summaryrefslogtreecommitdiff
path: root/media-gfx/krita
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2025-02-13 22:17:16 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2025-02-13 23:16:51 +0100
commitded992d8cc03bd42a5ecb1c495d44153c6416ecc (patch)
tree1049d49cbbee9e224479b044da5c53594a0fac1b /media-gfx/krita
parent7cd82aa5f9949f2eac55c981232d2f0ee909e8c4 (diff)
downloadkde-ded992d8cc03bd42a5ecb1c495d44153c6416ecc.tar.gz
kde-ded992d8cc03bd42a5ecb1c495d44153c6416ecc.tar.bz2
kde-ded992d8cc03bd42a5ecb1c495d44153c6416ecc.zip
media-gfx/krita: Port to KF6
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-gfx/krita')
-rw-r--r--media-gfx/krita/files/krita-5.2.6-py3.13.patch120
-rw-r--r--media-gfx/krita/files/krita-5.3.0-tests-optional.patch (renamed from media-gfx/krita/files/krita-5.2.3-tests-optional.patch)6
-rw-r--r--media-gfx/krita/krita-9999.ebuild75
3 files changed, 35 insertions, 166 deletions
diff --git a/media-gfx/krita/files/krita-5.2.6-py3.13.patch b/media-gfx/krita/files/krita-5.2.6-py3.13.patch
deleted file mode 100644
index 6714059895d..00000000000
--- a/media-gfx/krita/files/krita-5.2.6-py3.13.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From 0f43ec3158225092f6a02422eb90c56421326570 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
-Date: Tue, 18 Jun 2024 22:05:34 +0200
-Subject: [PATCH] Changes to build pykrita with Python 3.13
-
-Python 3.11 deprecated Py_SetPath() in 2022 and Python 3.13 removed it.
-Instead one needs to use the new PyConfig API (PEP 587) added to Python
-3.8.
-
-Fix: #488680
----
- .../extensions/pykrita/plugin/utilities.cpp | 61 +++++++++++++++++--
- plugins/extensions/pykrita/plugin/utilities.h | 4 +-
- 2 files changed, 57 insertions(+), 8 deletions(-)
-
-diff --git a/plugins/extensions/pykrita/plugin/utilities.cpp b/plugins/extensions/pykrita/plugin/utilities.cpp
-index 4f58183238..1e497b2681 100644
---- a/plugins/extensions/pykrita/plugin/utilities.cpp
-+++ b/plugins/extensions/pykrita/plugin/utilities.cpp
-@@ -19,8 +19,10 @@
- #include <cmath>
- #include <Python.h>
-
-+#include <QDebug>
- #include <QDir>
- #include <QLibrary>
-+#include <QProcessEnvironment>
- #include <QString>
- #include <QStringList>
- #include <QVector>
-@@ -412,18 +414,65 @@ bool Python::setPath(const QStringList& scriptPaths)
- joinedPaths = joinedPaths + pathSeparator + originalPath;
- }
- dbgScript << "Setting python paths:" << joinedPaths;
-+
- #ifdef Q_OS_WIN
-- QVector<wchar_t> joinedPathsWChars(joinedPaths.size() + 1, 0);
-- joinedPaths.toWCharArray(joinedPathsWChars.data());
-- Py_SetPath(joinedPathsWChars.data());
-+ PyStatus status;
-+ PyConfig config;
-+ PyConfig_InitPythonConfig(&config);
-+
-+ for (const QString& path : joinedPaths.split(pathSeparator)) {
-+ status = PyWideStringList_Append(&config.module_search_paths, path.toStdWString().c_str());
-+ if (PyStatus_Exception(status)) {
-+ qDebug() << "Error appending to PyWideStringList:" << status.err_msg;
-+ dbgScript << "Error appending to PyWideStringList";
-+ return false;
-+ }
-+ }
-+
-+ config.module_search_paths_set = true;
-+ qDebug() << "Set module_search_paths";
-+
-+ status = Py_InitializeFromConfig(&config);
-+ if (PyStatus_Exception(status)) {
-+ qDebug() << "Cannot initialize Py_InitializeFromConfig:" << status.err_msg;
-+ Py_ExitStatusException(status);
-+ PyConfig_Clear(&config);
-+ dbgScript << "Cannot initialize Py_InitializeFromConfig config";
-+ return false;
-+ }
-+
-+ PyConfig_Clear(&config);
- #else
- if (runningInBundle) {
-- QVector<wchar_t> joinedPathsWChars(joinedPaths.size() + 1, 0);
-- joinedPaths.toWCharArray(joinedPathsWChars.data());
-- Py_SetPath(joinedPathsWChars.data());
-+ PyStatus status;
-+ PyConfig config;
-+ PyConfig_InitPythonConfig(&config);
-+
-+ for (const QString& path : joinedPaths.split(pathSeparator)) {
-+ status = PyWideStringList_Append(&config.module_search_paths, path.toStdWString().c_str());
-+ if (PyStatus_Exception(status)) {
-+ qDebug() << "Error appending to PyWideStringList:" << status.err_msg;
-+ dbgScript << "Error appending to PyWideStringList";
-+ return false;
-+ }
-+ }
-+
-+ config.module_search_paths_set = true;
-+
-+ status = Py_InitializeFromConfig(&config);
-+ if (PyStatus_Exception(status)) {
-+ Py_ExitStatusException(status);
-+ qDebug() << "Cannot initialize Py_InitializeFromConfig 2:" << status.err_msg;
-+ PyConfig_Clear(&config);
-+ dbgScript << "Cannot initialize Py_InitializeFromConfig config";
-+ return false;
-+ }
-+
-+ PyConfig_Clear(&config);
- }
- else {
- qputenv("PYTHONPATH", joinedPaths.toLocal8Bit());
-+ qDebug() << "Set PYTHONPATH environment variable";
- }
- #endif
- isPythonPathSet = true;
-diff --git a/plugins/extensions/pykrita/plugin/utilities.h b/plugins/extensions/pykrita/plugin/utilities.h
-index fb309bd0b8..aec47da239 100644
---- a/plugins/extensions/pykrita/plugin/utilities.h
-+++ b/plugins/extensions/pykrita/plugin/utilities.h
-@@ -81,8 +81,8 @@ public:
- static bool libraryLoad();
-
- /**
-- * Set the Python paths by calling Py_SetPath. This should be called before
-- * initialization to ensure the proper libraries get loaded.
-+ * Set the Python paths by calling Py_InitializeFromConfig. This should be
-+ * called before initialization to ensure the proper libraries get loaded.
- */
- static bool setPath(const QStringList& scriptPaths);
-
---
-2.45.2
-
diff --git a/media-gfx/krita/files/krita-5.2.3-tests-optional.patch b/media-gfx/krita/files/krita-5.3.0-tests-optional.patch
index 48d9e314a29..c21b9127b77 100644
--- a/media-gfx/krita/files/krita-5.2.3-tests-optional.patch
+++ b/media-gfx/krita/files/krita-5.3.0-tests-optional.patch
@@ -2,7 +2,7 @@ From 2e9369281d44a2701ac7364568d381cca0d92ec5 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sun, 12 Jul 2020 18:55:31 +0200
Subject: [PATCH] KritaAddBrokenUnitTest.cmake, MacroKritaAddBenchmark.cmake:
- Skip ecm_add_test early if Qt5::Test is not available
+ Skip ecm_add_test early if Qt${QT_MAJOR_VERSION}Test is not available
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
@@ -18,7 +18,7 @@ index b7d0e8d852..901a0a1f99 100644
message(FATAL_ERROR "ecm_add_test() called with multiple source files but without setting \"TEST_NAME\"")
endif()
-+ if(NOT TARGET Qt5::Test)
++ if(NOT TARGET Qt${QT_MAJOR_VERSION}Test)
+ return()
+ endif()
+
@@ -33,7 +33,7 @@ index c748d8e319..f804d9b8f4 100644
set(_nogui "NOGUI")
endif()
-+ if(NOT TARGET Qt5::Test)
++ if(NOT TARGET Qt${QT_MAJOR_VERSION}Test)
+ return()
+ endif()
+
diff --git a/media-gfx/krita/krita-9999.ebuild b/media-gfx/krita/krita-9999.ebuild
index 83a11fa3da2..ea3ca8f7338 100644
--- a/media-gfx/krita/krita-9999.ebuild
+++ b/media-gfx/krita/krita-9999.ebuild
@@ -5,9 +5,9 @@ EAPI=8
ECM_TEST="forceoptional"
PYTHON_COMPAT=( python3_{10..13} )
-KFMIN=5.115.0
-QTMIN=5.15.12
-inherit ecm kde.org python-single-r1
+KFMIN=6.9.0
+QTMIN=6.8.0
+inherit ecm kde.org python-single-r1 xdg
if [[ ${KDE_BUILD_TYPE} = release ]]; then
SRC_URI="mirror://kde/stable/${PN}/${PV}/${P}.tar.xz"
@@ -18,44 +18,37 @@ DESCRIPTION="Free digital painting application. Digital Painting, Creative Freed
HOMEPAGE="https://apps.kde.org/krita/ https://krita.org/en/"
LICENSE="GPL-3"
-SLOT="5"
+SLOT="0"
IUSE="color-management fftw gif +gsl heif jpeg2k jpegxl +mypaint-brush-engine openexr pdf media +raw +xsimd webp"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# bug 630508
RESTRICT="test"
-RDEPEND="${PYTHON_DEPS}
+COMMON_DEPEND="${PYTHON_DEPS}
dev-libs/boost:=
dev-libs/libunibreak:=
- >=dev-libs/quazip-1.3-r2:0=[qt5(-)]
+ >=dev-libs/quazip-1.3-r2:0=[qt6(+)]
$(python_gen_cond_dep '
- dev-python/pyqt5[declarative,gui,widgets,${PYTHON_USEDEP}]
+ dev-python/pyqt6[declarative,gui,widgets,${PYTHON_USEDEP}]
dev-python/sip:=[${PYTHON_USEDEP}]
')
- >=dev-qt/qtconcurrent-${QTMIN}:5
- >=dev-qt/qtdbus-${QTMIN}:5
- >=dev-qt/qtdeclarative-${QTMIN}:5
- >=dev-qt/qtgui-${QTMIN}:5=[-gles2-only]
- >=dev-qt/qtnetwork-${QTMIN}:5
- >=dev-qt/qtprintsupport-${QTMIN}:5
- >=dev-qt/qtsql-${QTMIN}:5
- >=dev-qt/qtsvg-${QTMIN}:5
- >=dev-qt/qtwidgets-${QTMIN}:5
- >=dev-qt/qtx11extras-${QTMIN}:5
- >=dev-qt/qtxml-${QTMIN}:5
- >=kde-frameworks/kcompletion-${KFMIN}:5
- >=kde-frameworks/kconfig-${KFMIN}:5
- >=kde-frameworks/kcoreaddons-${KFMIN}:5
- >=kde-frameworks/kcrash-${KFMIN}:5
- >=kde-frameworks/kguiaddons-${KFMIN}:5
- >=kde-frameworks/ki18n-${KFMIN}:5
- >=kde-frameworks/kiconthemes-${KFMIN}:5
- >=kde-frameworks/kitemmodels-${KFMIN}:5
- >=kde-frameworks/kitemviews-${KFMIN}:5
- >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
- >=kde-frameworks/kwindowsystem-${KFMIN}:5
- >=kde-frameworks/kxmlgui-${KFMIN}:5
+ >=dev-qt/qt5compat-${QTMIN}:6
+ >=dev-qt/qtbase-${QTMIN}:6=[concurrent,dbus,-gles2-only,gui,network,opengl,sql,widgets,X,xml]
+ >=dev-qt/qtdeclarative-${QTMIN}:6
+ >=dev-qt/qtsvg-${QTMIN}:6
+ >=kde-frameworks/kcompletion-${KFMIN}:6
+ >=kde-frameworks/kconfig-${KFMIN}:6
+ >=kde-frameworks/kcoreaddons-${KFMIN}:6
+ >=kde-frameworks/kcrash-${KFMIN}:6
+ >=kde-frameworks/kguiaddons-${KFMIN}:6
+ >=kde-frameworks/ki18n-${KFMIN}:6
+ >=kde-frameworks/kiconthemes-${KFMIN}:6
+ >=kde-frameworks/kitemmodels-${KFMIN}:6
+ >=kde-frameworks/kitemviews-${KFMIN}:6
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:6
+ >=kde-frameworks/kwindowsystem-${KFMIN}:6
+ >=kde-frameworks/kxmlgui-${KFMIN}:6
media-gfx/exiv2:=
media-libs/lcms
media-libs/libjpeg-turbo:=
@@ -75,13 +68,16 @@ RDEPEND="${PYTHON_DEPS}
media? ( media-libs/mlt:= )
mypaint-brush-engine? ( media-libs/libmypaint:= )
openexr? ( media-libs/openexr:= )
- pdf? ( app-text/poppler[qt5(-)] )
- raw? ( kde-apps/libkdcraw:5 )
+ pdf? ( app-text/poppler[qt6(-)] )
+ raw? ( kde-apps/libkdcraw:6 )
webp? ( >=media-libs/libwebp-1.2.0:= )
xsimd? ( >=dev-cpp/xsimd-13.0.0 )
"
-DEPEND="${RDEPEND}
+RDEPEND="${COMMON_DEPEND}
+ !${CATEGORY}/${PN}:5
+"
+DEPEND="${COMMON_DEPEND}
dev-libs/immer
dev-libs/lager
dev-libs/zug
@@ -94,23 +90,17 @@ BDEPEND="
PATCHES=(
# downstream
- "${FILESDIR}"/${PN}-5.2.3-tests-optional.patch
+ "${FILESDIR}"/${PN}-5.3.0-tests-optional.patch
"${FILESDIR}"/${PN}-5.2.2-fftw.patch # bug 913518
- # Fedora, non-upstreamed:
- "${FILESDIR}"/${P}-py3.13.patch # bug 943149
)
-pkg_setup() {
- python-single-r1_pkg_setup
- ecm_pkg_setup
-}
-
src_configure() {
# Prevent sandbox violation from FindPyQt5.py module
# See Gentoo-bug 655918
addpredict /dev/dri
local mycmakeargs=(
+ -DBUILD_WITH_QT6=ON
-DENABLE_UPDATERS=OFF
-DKRITA_ENABLE_PCH=OFF # big mess.
-DCMAKE_DISABLE_FIND_PACKAGE_KSeExpr=ON # not packaged
@@ -125,10 +115,9 @@ src_configure() {
$(cmake_use_find_package mypaint-brush-engine LibMyPaint)
$(cmake_use_find_package openexr OpenEXR)
$(cmake_use_find_package pdf Poppler)
- $(cmake_use_find_package raw KF5KDcraw)
+ $(cmake_use_find_package raw KDcrawQt6)
$(cmake_use_find_package webp WebP)
$(cmake_use_find_package xsimd xsimd)
)
-
ecm_src_configure
}