public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/kde:master commit in: media-gfx/krita/, media-gfx/krita/files/
Date: Thu, 13 Feb 2025 22:17:17 +0000 (UTC)	[thread overview]
Message-ID: <1739485011.ded992d8cc03bd42a5ecb1c495d44153c6416ecc.asturm@gentoo> (raw)

commit:     ded992d8cc03bd42a5ecb1c495d44153c6416ecc
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 13 21:17:16 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Feb 13 22:16:51 2025 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=ded992d8

media-gfx/krita: Port to KF6

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 media-gfx/krita/files/krita-5.2.6-py3.13.patch     | 120 ---------------------
 ...onal.patch => krita-5.3.0-tests-optional.patch} |   6 +-
 media-gfx/krita/krita-9999.ebuild                  |  75 ++++++-------
 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 6714059895..0000000000
--- 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
similarity index 94%
rename from media-gfx/krita/files/krita-5.2.3-tests-optional.patch
rename to media-gfx/krita/files/krita-5.3.0-tests-optional.patch
index 48d9e314a2..c21b9127b7 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 83a11fa3da..ea3ca8f733 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
 }


             reply	other threads:[~2025-02-13 22:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13 22:17 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-25 22:52 [gentoo-commits] proj/kde:master commit in: media-gfx/krita/, media-gfx/krita/files/ Andreas Sturmlechner
2021-03-26 21:18 Andreas Sturmlechner
2020-07-12 22:55 Andreas Sturmlechner
2020-07-12 22:55 Andreas Sturmlechner
2016-10-27 19:42 Michael Palimaka
2016-09-22 11:38 Michael Palimaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1739485011.ded992d8cc03bd42a5ecb1c495d44153c6416ecc.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox