From 73991a4c298292cc1358eb41dc6fb704ff9ca737 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Thu, 25 Aug 2022 12:42:54 +0800 Subject: [PATCH 5/9] gnu: Add python-pyside-6. * gnu/packages/qt.scm (python-pyside-6): New variable. --- gnu/packages/qt.scm | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index ce56efd0d8..8612e3b536 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -3955,6 +3955,78 @@ (define-public python-pyside-2 license:gpl3 license:gpl2)))) +(define-public python-pyside-6 + (package + (inherit python-pyside-2) + (name "python-pyside-6") + (version (package-version python-shiboken-6)) + (source (package-source python-shiboken-6)) + ;; TODO: Add more Qt components if available. + (inputs + (list qtbase + qtdeclarative + qtmultimedia + qtnetworkauth + qtpositioning + qtsvg + qttools + qtwebchannel + qtwebengine + qtwebsockets)) + (propagated-inputs + (list python-shiboken-6)) + (native-inputs + (list python-wrapper)) + (arguments + (list + #:tests? #f + #:configure-flags + #~(list "-DBUILD_TESTS=FALSE" + (string-append "-DPYTHON_EXECUTABLE=" + #$(this-package-native-input "python-wrapper") + "/bin/python")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'go-to-source-dir + (lambda _ (chdir "sources/pyside6") #t)) + (add-after 'go-to-source-dir 'fix-qt-module-detection + (lambda _ + (substitute* "cmake/PySideHelpers.cmake" + (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)") + "true")) + (let ((dirs (map (lambda (path) + (string-append path "/include/qt6")) + (list + #$@(map (lambda (name) + (this-package-input name)) + '("qtdeclarative" + "qtmultimedia" + "qtnetworkauth" + "qtpositioning" + "qtsvg" + "qttools" + "qtwebchannel" + "qtwebengine" + "qtwebsockets")))))) + (substitute* "cmake/Macros/PySideModules.cmake" + (("set\\(shiboken_include_dir_list " all) + (string-append all (string-join dirs ";") " "))) + (setenv "CXXFLAGS" + (string-join + (map (lambda (dir) + (string-append "-I" dir)) + dirs) + " ")))))))) + (synopsis + "The Qt for Python product enables the use of Qt6 APIs in Python applications") + (description + "The Qt for Python product enables the use of Qt6 APIs in Python +applications. It lets Python developers utilize the full potential of Qt, +using the PySide6 module. The PySide6 module provides access to the +individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also +comes with the Shiboken6 CPython binding code generator, which can be used to +generate Python bindings for your C or C++ code."))) + (define-public python-pyside-2-tools (package (name "python-pyside-2-tools") -- 2.37.2