[PATCH]: Add PyQt 6.

  • Done
  • quality assurance status badge
Details
5 participants
  • Zhu Zihao
  • chris
  • Herman Rimm
  • Ludovic Courtès
  • ROCKTAKEY
Owner
unassigned
Submitted by
Zhu Zihao
Severity
normal

Debbugs page

Zhu Zihao wrote 3 years ago
(name . guix-patches)(address . guix-patches@gnu.org)
865yifjbu2.fsf@163.com
From f14e4b2e32240ef169514127d61da775b641f97d Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Thu, 25 Aug 2022 14:58:57 +0800
Subject: [PATCH 1/9] gnu: Add python-pyqt6-sip.

* gnu/packages/qt.scm (python-pyqt6-sip): New variable.
---
gnu/packages/qt.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Toggle diff (28 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 25d56acdc3..1f8e51c667 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3088,6 +3088,21 @@ (define-public python-pyqt5-sip
(description "Sip module support for PyQt5")
(license license:lgpl2.1+)))
+(define-public python-pyqt6-sip
+ (package
+ (inherit python-pyqt5-sip)
+ (name "python-pyqt6-sip")
+ (version "13.4.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_sip" version))
+ (sha256
+ (base32
+ "0yfra2rk4072kqfs0hks7fpjqd8946inhzcmfqdm3mvjb3pa71vd"))))
+ (synopsis "Sip module support for PyQt6")
+ (description "Sip module support for PyQt6")))
+
(define-public python-pyqtwebengine
(package
(name "python-pyqtwebengine")
--
2.37.2
From 5949dc9870560a474d79337b8cfe3abdde7792f3 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Thu, 25 Aug 2022 19:25:45 +0800
Subject: [PATCH 5/9] gnu: python-pyqt+qscintilla: Rename to
python-pyqt-5+qscintilla.

* gnu/packages/qt.scm (python-pyqt+qscintilla): Rename to
python-pyqt-5+qscintilla.
* gnu/packages/geo.scm (qgjs)[inputs]: Ditto.
* gnu/packages/medical.scm (openmolar-1)[inputs]: Ditto.
* gnu/packages/python-xyz.scm (autokey)[inputs]: Ditto.
---
gnu/packages/geo.scm | 2 +-
gnu/packages/medical.scm | 2 +-
gnu/packages/python-xyz.scm | 2 +-
gnu/packages/qt.scm | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

Toggle diff (54 lines)
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 66c97d3d6a..2678c08a02 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -2607,7 +2607,7 @@ (define-public qgis
python-owslib
python-psycopg2
python-pygments
- python-pyqt+qscintilla
+ python-pyqt-5+qscintilla
python-pytz
python-pyyaml
python-requests
diff --git a/gnu/packages/medical.scm b/gnu/packages/medical.scm
index 6c9cc757eb..60fb8c6091 100644
--- a/gnu/packages/medical.scm
+++ b/gnu/packages/medical.scm
@@ -49,7 +49,7 @@ (define-public openmolar-1
(("/usr") (assoc-ref outputs "out")))
#t)))))
(inputs
- (list python-pyqt+qscintilla python-mysqlclient qscintilla))
+ (list python-pyqt-5+qscintilla python-mysqlclient qscintilla))
(home-page "https://openmolar.com/om1")
(synopsis "Dental practice management software")
(description "Openmolar is a dental practice management suite. Its
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 67d1128b88..82eaeec90f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4357,7 +4357,7 @@ (define-public autokey
python-ipython
python-pygobject
python-pyinotify
- python-pyqt+qscintilla
+ python-pyqt-5+qscintilla
python-xlib
wmctrl
zenity))
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 25bc0a1dad..d9b32749cc 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3333,7 +3333,7 @@ (define-public python-qscintilla
;; PyQt only looks for modules in its own directory. It ignores environment
;; variables such as PYTHONPATH, so we need to build a union package to make
;; it work.
-(define-public python-pyqt+qscintilla
+(define-public python-pyqt-5+qscintilla
(package/inherit python-pyqt-5
(name "python-pyqt+qscintilla")
(source #f)
--
2.37.2
From 5e054770ff6f50478be9860f0c75ffc706e980ec Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Thu, 25 Aug 2022 20:06:14 +0800
Subject: [PATCH 6/9] gnu: python-sip: Update to 6.6.2.

* gnu/packages/qt.scm (python-sip): Update to 6.6.2
[propagated-inputs]: Add missing input python-ply.
---
gnu/packages/qt.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (30 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d9b32749cc..c7ea6e6713 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2904,7 +2904,7 @@ (define-public single-application-qt5
(define-public python-sip
(package
(name "python-sip")
- (version "5.5.0")
+ (version "6.6.2")
(source
(origin
(method url-fetch)
@@ -2914,12 +2914,12 @@ (define-public python-sip
"/sip-" version ".tar.gz")))
(sha256
(base32
- "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"))))
+ "03frpw2l2krigibx32cbyl9kx696vwkhj52pmqjybn6zqp0zlghf"))))
(build-system python-build-system)
(native-inputs
(list python-wrapper))
(propagated-inputs
- (list python-toml python-packaging))
+ (list python-toml python-packaging python-ply))
(home-page "https://www.riverbankcomputing.com/software/sip/intro")
(synopsis "Python binding creator for C and C++ libraries")
(description
--
2.37.2
From 750cd9f80a3a02b64c933b8308fa1e0ef0ab8333 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Thu, 25 Aug 2022 22:41:25 +0800
Subject: [PATCH 7/9] gnu: python-pyqt-builder: Update to 1.13.0.

* gnu/packages/qt.scm (python-pyqt-builder): Update to 1.13.0.
---
gnu/packages/qt.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index c7ea6e6713..b89cf989ec 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3200,14 +3200,14 @@ (define-public python-pyqt-5-without-qtwebkit
(define-public python-pyqt-builder
(package
(name "python-pyqt-builder")
- (version "1.9.0")
+ (version "1.13.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "PyQt-builder" version))
(sha256
(base32
- "0nh0054c54ji3sm6d268fccf0y5f613spswwgwqd3rnn816hnljl"))))
+ "1vwyd2hs13zh0ybvkn36h73031ha7c41sf4v28735dff7065hxs8"))))
(build-system python-build-system)
(inputs
(list python-sip))
--
2.37.2
From 18831a399f1be3748c55d25c3c1bb80036c2cbcb Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Fri, 26 Aug 2022 17:50:36 +0800
Subject: [PATCH 8/9] gnu: Add python-pyqt, version 6.3.1.

* gnu/packages/qt.scm (python-pyqt): New variable.
---
gnu/packages/qt.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)

Toggle diff (72 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index b89cf989ec..ac575c9828 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2978,6 +2978,65 @@ (define-public python-sip-4
"--incdir" include)))))))
(license license:gpl3)))
+(define-public python-pyqt
+ (package
+ (name "python-pyqt")
+ (version "6.3.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6" version))
+ (file-name (string-append "PyQt6-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0mwp5iyh21jzsvd66rcpxzr142kiv769dqwpr0gps17pp8fy5ilc"))))
+ (inputs
+ (list python-wrapper
+ qtbase
+ qtdeclarative
+ qtmultimedia
+ qtpositioning
+ qtsvg
+ qttools
+ qtwebchannel
+ qtwebsockets))
+ (propagated-inputs
+ (list python-pyqt6-sip))
+ (native-inputs
+ (list python-pyqt-builder
+ python-sip
+ python-wrapper
+ qtbase)) ;qmake
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:imported-modules `((guix build python-build-system)
+ ,@%gnu-build-system-modules)
+ #:modules `(((guix build python-build-system) #:select (site-packages))
+ ,@%gnu-build-system-modules)
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "sip-build"
+ "--verbose"
+ "--confirm-license"
+ "--no-make"
+ "--qmake" (search-input-file inputs "/bin/qmake")
+ "--target-dir" (site-packages inputs outputs)
+ "--scripts-dir" (string-append #$output "/bin"))))
+ (add-before 'build 'enter-build-directory
+ (lambda _ (chdir "build") #t))
+ (add-after 'install 'leave-build-directory
+ (lambda _ (chdir "..") #t)))))
+ (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
+ (synopsis "Python bindings for Qt6")
+ (description
+ "PyQt is a set of Python v3 bindings for the Qt6 application framework.
+The bindings are implemented as a set of Python modules and contain over
+620 classes.")
+ (license license:gpl3)))
+
(define-public python-pyqt-5
(package
(name "python-pyqt")
--
2.37.2
From 0856c6efcd09be2a5326af457b01f994c954d959 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Fri, 26 Aug 2022 22:32:24 +0800
Subject: [PATCH 9/9] gnu: Add python-pyqtwebengine, version 6.3.1.

* gnu/packages/qt.scm (python-pyqtwebengine): New variable.
---
gnu/packages/qt.scm | 104 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)

Toggle diff (117 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index ac575c9828..821e824e36 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3162,6 +3162,110 @@ (define-public python-pyqt6-sip
(synopsis "Sip module support for PyQt6")
(description "Sip module support for PyQt6")))
+(define-public python-pyqtwebengine
+ (package
+ (name "python-pyqtwebengine")
+ (version "6.3.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_WebEngine" version))
+ (sha256
+ (base32
+ "01zhx1yz8ggi6n9rwqi1z18aznbl3ndwa5yn090z85abgd9gblf3"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ (list python
+ python-sip
+ python-pyqt-builder
+ ;; qtbase is required for qmake
+ qtbase))
+ (inputs
+ (list python-pyqt
+ qtbase
+ qtdeclarative
+ qtwebchannel
+ qtwebengine))
+ (arguments
+ (list
+ #:imported-modules `((guix build python-build-system)
+ ,@%gnu-build-system-modules)
+ #:modules
+ `((ice-9 regex)
+ ((guix build python-build-system)
+ #:select (site-packages python-version))
+ ,@%gnu-build-system-modules)
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'fix-pyqt-sip-dirs
+ (lambda _
+ (define sip-dir
+ (string-append
+ #$(this-package-input "python-pyqt")
+ "/lib/python"
+ (python-version #$(this-package-native-input "python"))
+ "/site-packages/PyQt6/bindings"))
+
+ (substitute* "pyproject.toml"
+ (("tool\\.sip\\.project.+$" all)
+ (format #f "~asip-include-dirs = [\"~a\"]~%"
+ all sip-dir)))))
+ (replace 'configure
+ (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
+ (invoke "sip-build"
+ "--verbose"
+ "--no-make"
+ "--target-dir" (site-packages inputs outputs))))
+ ;; XXX: qmake generates Makefile that tries to link with
+ ;; <path-to-qtbase>/lib/libQt6Qml.so. This phase deletes these
+ ;; bad references.
+ (add-after 'configure 'delete-bad-references
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("build/QtWebEngineCore/Makefile"
+ "build/QtWebEngineQuick/Makefile"
+ "build/QtWebEngineWidgets/Makefile")
+ (((string-append
+ (regexp-quote #$(this-package-input "qtbase"))
+ "/lib/libQt6(Qml|QmlModels|WebEngineCore)\\.so"))
+ ""))))
+ (add-after 'configure 'absolutize-qprinter.h
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((qtprinter.h
+ (string-append
+ "\""
+ (search-input-file
+ inputs
+ "include/qt6/QtPrintSupport/qprinter.h")
+ "\"")))
+ (substitute* (find-files "build/QtWebEngineWidgets"
+ "\\.(cpp|h)$")
+ (("<qprinter.h>")
+ qtprinter.h))
+ #t)))
+ (add-before 'build 'enter-build-directory
+ (lambda _ (chdir "build") #t))
+ (add-after 'install 'leave-build-directory
+ (lambda _ (chdir "..") #t))
+ (add-after 'install 'make-namespace
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((init (string-append
+ (site-packages inputs outputs)
+ "/PyQt6/__init__.py")))
+ (with-output-to-file init
+ (lambda _
+ (display "\
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
+")))
+ #t))))))
+ (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
+ (synopsis "Python bindings for QtWebEngine6")
+ (description
+ "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
+WebEngine libraries. The bindings sit on top of PyQt6 and are implemented as a
+set of three modules.")
+ (license license:gpl3)))
+
(define-public python-pyqtwebengine-5
(package
(name "python-pyqtwebengine")
--
2.37.2
--
Retrieve my PGP public key:

gpg --recv-keys 481F5EEEBA425ADC13247C76A6E672D981B8E744

Zihao
ROCKTAKEY wrote 2 years ago
bde9acc8-4783-e92d-46a5-4350dadc34f7@gmail.com
Hi, it looks great. I would like to use PyQt 6.

Is there any progress? I want help if there is some problem.

ROCKTAKEY
Zhu Zihao wrote 2 years ago
(name . ROCKTAKEY)(address . rocktakey@gmail.com)(address . 57431@debbugs.gnu.org)
86r0sktvco.fsf@163.com
ROCKTAKEY <rocktakey@gmail.com> writes:

Toggle quote (2 lines)
> Hi, it looks great. I would like to use PyQt 6.

If you just wanna programming with Python and Qt, you can use qtpy and
pyside-6 :)

Toggle quote (3 lines)
>
> Is there any progress? I want help if there is some problem.

The problem is, the sip of PyQt 6 prefer the qmake way rather than CMake
way like PySide6. but the qmake definition file of Qt6 is broken.(Ok,
plz see the XXX comment of pyqt-webengine in previos patch...)


--
Retrieve my PGP public key:

gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQT4UAIrVkIEZilSHr2K2nJqP6LM8gUCZDtdBxUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQitpyaj+izPIpRgD+JvpKvLmFP/psJK48YQ0rUE74ITfZ
QSMWIQdmY3gcVX4BAPd3g/xqMdSL+rAZbVxTnkmTT5FryuHw0FUCx+kxYv0F
=jlwR
-----END PGP SIGNATURE-----

Herman Rimm wrote 1 years ago
Update packages to compatible versions.
(address . 57431@debbugs.gnu.org)
foagb7ejnfi2pba3iwa63rdfqhasftcsobrzzeic7pr23msccp@v2vfle2oz3jx
Hello, only patch 1 can be applied sucessfully: python-sip and
python-pyqt-builder are already updated, so patch 6 and 7 don't apply;
patches 2, 3, 4 and 5 do renames and touch a lot of code, which has
changed since patch creation; patch 8 and 9 can't be applied without the
renames.

I have modified patch 8 and 9 and made a patch series from patches 1, 8
and 9. It should easier to apply than the longer patch series. I have
not tested or cross-compiled any of the packages, only built them
natively. Probably some (native-)inputs can be removed or need to be
added.

As for the renames, there are many Qt5 package symbols without a '-5'
suffix. Some rename patches touch a lot of files and get outdated
quickly. Can they be contributed some other way? For example:

1. run the rename scripts;
2. write a commit message for the changes;
3. send the commit as a patch to a maintainer via IRC/Matrix;
4. the maintainer applies the patch and pushes to remote;
5. repeat steps 1-4 until it is pushed sucessfully.

Cheers,
Herman Rimm
Herman Rimm wrote 1 years ago
[PATCH v1 1/3] gnu: Add python-pyqt6-sip.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
f30ee2f3a623d80c04ff73e14789ed7b8d34120e.1700407095.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqt6-sip): New variable.
---
gnu/packages/qt.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Toggle diff (30 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 12785c811f..242a5da172 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3675,6 +3675,21 @@ (define-public python-pyqt5-sip
(description "Sip module support for PyQt5")
(license license:lgpl2.1+)))
+(define-public python-pyqt6-sip
+ (package
+ (inherit python-pyqt5-sip)
+ (name "python-pyqt6-sip")
+ (version "13.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_sip" version))
+ (sha256
+ (base32
+ "0y2pgc1kzskq3q230b5d48izvzy9dl4hkfjpcr7kv53ih1cf31i4"))))
+ (synopsis "Sip module support for PyQt6")
+ (description "Sip module support for PyQt6")))
+
(define-public python-pyqtwebengine
(package
(name "python-pyqtwebengine")

base-commit: b7abea0fd6a146563830db1dc4ddd0cceb6fcf1c
--
2.41.0
Herman Rimm wrote 1 years ago
[PATCH v1 2/3] gnu: Add python-pyqt, version 6.5.2.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
817ca09b733ed2163ec3147a1f131844fa0080e1.1700407095.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqt-6): New variable.
---
gnu/packages/qt.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

Toggle diff (69 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 242a5da172..eea13d1ea2 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -29,6 +29,7 @@
;;; Copyright © 2022 Yash Tiwari <yasht@mailbox.org>
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3656,6 +3657,54 @@ (define-public python-pyqt
contain over 620 classes.")
(license license:gpl3)))
+(define-public python-pyqt-6
+ (package
+ (inherit python-pyqt)
+ (version "6.5.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6" version))
+ (file-name (string-append "PyQt6-" version ".tar.gz"))
+ (sha256
+ (base32
+ "100jh1iiz5gx821qzgicfrqv7hjjj98pchdbc1nvdzzra1ryx1ql"))))
+ (inputs ; Qt5 dependencies only in python-pyqt:
+ ; (qt)connectivity, location, sensors, serialport, x11extras, xmlpatterns.
+ `(("python" ,python-wrapper)
+ ("qtbase" ,qtbase)
+ ("qtdeclarative" ,qtdeclarative)
+ ("qtmultimedia" ,qtmultimedia)
+ ("qtpositioning" ,qtpositioning)
+ ("qtsvg" ,qtsvg)
+ ("qttools" ,qttools)
+ ("qtwebchannel" ,qtwebchannel)
+ ("qtwebsockets" ,qtwebsockets)))
+ (propagated-inputs
+ (list python-sip python-pyqt6-sip))
+ (native-inputs
+ (list python-pyqt-builder
+ qtbase)) ;for qmake
+ (arguments
+ (list
+ #:tests? #f ; No tests.
+ #:configure-flags
+ #~`(@ ("--verbose" . "") ; Print commands run.
+ ("--confirm-license" . "")
+ ("--jobs" . ,(number->string (parallel-job-count))))
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; When building python-pyqtwebengine, <qprinter.h> can not be
+ ;; included. Here we substitute the full path to the header in the
+ ;; store.
+ (add-after 'unpack 'substitute-source
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((qtbase (assoc-ref inputs "qtbase"))
+ (qtprinter.h (string-append "\"" qtbase "/include/qt6/QtPrintSupport/qprinter.h\"")))
+ (substitute* (list "sip/QtPrintSupport/qprinter.sip"
+ "sip/QtPrintSupport/qpyprintsupport_qlist.sip")
+ (("<qprinter.h>") qtprinter.h))))))))))
+
(define-public python-pyqt5-sip
(package
(name "python-pyqt5-sip")
--
2.41.0
Herman Rimm wrote 1 years ago
[PATCH v1 3/3] gnu: Add python-pyqtwebengine, version 6.6.0.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
c7845be649cf23fb064ee7152623d7feaea90fdf.1700407095.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqtwebengine-6): New variable.
---
gnu/packages/qt.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (57 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index eea13d1ea2..3418900d16 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3796,6 +3796,50 @@ (define-public python-pyqtwebengine
itself.")
(license license:gpl3)))
+(define-public python-pyqtwebengine-6
+ (package
+ (inherit python-pyqtwebengine)
+ (version "6.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_WebEngine" version))
+ (sha256
+ (base32
+ "11wlnggs5vi7z465xhmnz664wbaj44ki6mmijbk0kr457x69h2ym"))))
+ (native-inputs
+ (list python python-sip
+ python-pyqt-builder
+ ;; qtbase is required for qmake
+ qtbase))
+ (inputs
+ `(("python-pyqt" ,python-pyqt-6)
+ ("qtbase" ,qtbase)
+ ("qtdeclarative" ,qtdeclarative)
+ ("qtwebchannel" ,qtwebchannel)
+ ("qtwebengine" ,qtwebengine)))
+ (arguments
+ (list
+ #:tests? #f ; No tests.
+ #:configure-flags
+ #~`(@ ("--verbose" . "") ; Print commands run.
+ ("--jobs" . ,(number->string (parallel-job-count))))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'set-include-dirs
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((python (assoc-ref inputs "python"))
+ (python-pyqt (assoc-ref inputs "python-pyqt"))
+ (sip-include-dirs (string-append
+ python-pyqt "/lib/python"
+ (python-version python)
+ "/site-packages/PyQt6/bindings")))
+ (setenv "SIP_INCLUDE_DIRS" sip-include-dirs)))))))
+ (description
+ "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
+WebEngine libraries. The bindings sit on top of PyQt6 and are implemented as a
+set of three modules.")))
+
(define-public python-pyqt-builder
(package
(name "python-pyqt-builder")
--
2.41.0
Ludovic Courtès wrote 1 years ago
Re: [bug#57431] [PATCH v1 1/3] gnu: Add python-pyqt6-sip.
(name . Herman Rimm)(address . herman@rimm.ee)
87ttpdkd44.fsf@gnu.org
Hi,

Herman Rimm <herman@rimm.ee> skribis:

Toggle quote (4 lines)
> From: Zhu Zihao <all_but_last@163.com>
>
> * gnu/packages/qt.scm (python-pyqt6-sip): New variable.

[...]

Toggle quote (13 lines)
> + (inherit python-pyqt5-sip)
> + (name "python-pyqt6-sip")
> + (version "13.6.0")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "PyQt6_sip" version))
> + (sha256
> + (base32
> + "0y2pgc1kzskq3q230b5d48izvzy9dl4hkfjpcr7kv53ih1cf31i4"))))
> + (synopsis "Sip module support for PyQt6")
> + (description "Sip module support for PyQt6")))

I know the issue was already present, but it would be great if you could
provide a description that follows our conventions, possible in
‘python-pyqt5-sip’ proper:


Ludo’.
Ludovic Courtès wrote 1 years ago
Re: [bug#57431] [PATCH v1 2/3] gnu: Add python-pyqt, version 6.5.2.
(name . Herman Rimm)(address . herman@rimm.ee)
87pm01kcwt.fsf@gnu.org
Herman Rimm <herman@rimm.ee> skribis:

Toggle quote (4 lines)
> From: Zhu Zihao <all_but_last@163.com>
>
> * gnu/packages/qt.scm (python-pyqt-6): New variable.

[...]

Toggle quote (12 lines)
> + (inputs ; Qt5 dependencies only in python-pyqt:
> + ; (qt)connectivity, location, sensors, serialport, x11extras, xmlpatterns.
> + `(("python" ,python-wrapper)
> + ("qtbase" ,qtbase)
> + ("qtdeclarative" ,qtdeclarative)
> + ("qtmultimedia" ,qtmultimedia)
> + ("qtpositioning" ,qtpositioning)
> + ("qtsvg" ,qtsvg)
> + ("qttools" ,qttools)
> + ("qtwebchannel" ,qtwebchannel)
> + ("qtwebsockets" ,qtwebsockets)))

Could you run ‘guix style -f inputs --input-simplification=always python-pyqt-6’?

Toggle quote (10 lines)
> + #:phases
> + #~(modify-phases %standard-phases
> + ;; When building python-pyqtwebengine, <qprinter.h> can not be
> + ;; included. Here we substitute the full path to the header in the
> + ;; store.
> + (add-after 'unpack 'substitute-source
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let* ((qtbase (assoc-ref inputs "qtbase"))
> + (qtprinter.h (string-append "\"" qtbase "/include/qt6/QtPrintSupport/qprinter.h\"")))

I understand it’s copied from ‘python-pyqt’ but IWBN to write it along
these lines:

(let ((qtprinter.h
(search-input-file inputs
"/include/qt6/QtPrintSupport/qprinter.h")))
…)

(We could make the same changes in ‘python-pyqt’ in a separate patch.)

Thanks,
Ludo’.
Ludovic Courtès wrote 1 years ago
Re: [bug#57431] [PATCH v1 3/3] gnu: Add python-pyqtwebengine, version 6.6.0.
(name . Herman Rimm)(address . herman@rimm.ee)
87leapkcul.fsf@gnu.org
Herman Rimm <herman@rimm.ee> skribis:

Toggle quote (4 lines)
> From: Zhu Zihao <all_but_last@163.com>
>
> * gnu/packages/qt.scm (python-pyqtwebengine-6): New variable.

[...]

Toggle quote (7 lines)
> + (inputs
> + `(("python-pyqt" ,python-pyqt-6)
> + ("qtbase" ,qtbase)
> + ("qtdeclarative" ,qtdeclarative)
> + ("qtwebchannel" ,qtwebchannel)
> + ("qtwebengine" ,qtwebengine)))

[...]

Toggle quote (5 lines)
> + (sip-include-dirs (string-append
> + python-pyqt "/lib/python"
> + (python-version python)
> + "/site-packages/PyQt6/bindings")))

Similar comments as before regarding ‘guix style -S inputs’ and use of
‘search-input-directory’ above.

Could you send updated patches?

Thanks in advance!

Ludo’.
Herman Rimm wrote 1 years ago
[PATCH v2 1/3] gnu: Add python-pyqt6-sip.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
de6092437fd9c7afd7dbf6267399fa9a5f125e47.1700724016.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqt6-sip): New variable.
---
gnu/packages/qt.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Toggle diff (30 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 12785c811f..242a5da172 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3675,6 +3675,21 @@ (define-public python-pyqt5-sip
(description "Sip module support for PyQt5")
(license license:lgpl2.1+)))
+(define-public python-pyqt6-sip
+ (package
+ (inherit python-pyqt5-sip)
+ (name "python-pyqt6-sip")
+ (version "13.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_sip" version))
+ (sha256
+ (base32
+ "0y2pgc1kzskq3q230b5d48izvzy9dl4hkfjpcr7kv53ih1cf31i4"))))
+ (synopsis "Sip module support for PyQt6")
+ (description "Sip module support for PyQt6")))
+
(define-public python-pyqtwebengine
(package
(name "python-pyqtwebengine")

base-commit: 5283d24062be62f59ff9f14fa7095ebcfcb7a9a4
--
2.41.0
Herman Rimm wrote 1 years ago
[PATCH v2 2/3] gnu: Add python-pyqt, version 6.5.2.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
3f2ee183883ab4981f8529b26bca1cbb5205894e.1700724016.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqt-6): New variable.
---
gnu/packages/qt.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

Toggle diff (65 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 242a5da172..22569f5f75 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -29,6 +29,7 @@
;;; Copyright © 2022 Yash Tiwari <yasht@mailbox.org>
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3656,6 +3657,50 @@ (define-public python-pyqt
contain over 620 classes.")
(license license:gpl3)))
+(define-public python-pyqt-6
+ (package
+ (inherit python-pyqt)
+ (version "6.5.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6" version))
+ (file-name (string-append "PyQt6-" version ".tar.gz"))
+ (sha256
+ (base32 "100jh1iiz5gx821qzgicfrqv7hjjj98pchdbc1nvdzzra1ryx1ql"))))
+ (inputs ;Qt5 dependencies only in python-pyqt:
+ ;; (qt)connectivity, location, sensors, serialport, x11extras, xmlpatterns.
+ (list python-wrapper
+ qtbase
+ qtdeclarative
+ qtmultimedia
+ qtpositioning
+ qtsvg
+ qttools
+ qtwebchannel
+ qtwebsockets))
+ (propagated-inputs (list python-sip python-pyqt6-sip))
+ (native-inputs (list python-pyqt-builder qtbase)) ;qtbase is required for qmake.
+ (arguments
+ (list
+ #:tests? #f ;No tests.
+ #:configure-flags #~`(@ ("--verbose" . "") ;Print commands run.
+ ("--confirm-license" . "")
+ ("--jobs" unquote
+ (number->string (parallel-job-count))))
+ #:phases #~(modify-phases %standard-phases
+ ;; When building python-pyqtwebengine, <qprinter.h> cannot be
+ ;; included. Here we substitute the full path to the header in the
+ ;; store.
+ (add-after 'unpack 'substitute-source
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((qprinter.h (search-input-file inputs
+ "/include/qt6/QtPrintSupport/qprinter.h")))
+ (substitute* (list "sip/QtPrintSupport/qprinter.sip"
+ "sip/QtPrintSupport/qpyprintsupport_qlist.sip")
+ (("qprinter.h")
+ qprinter.h))))))))))
+
(define-public python-pyqt5-sip
(package
(name "python-pyqt5-sip")
--
2.41.0
Herman Rimm wrote 1 years ago
[PATCH v2 3/3] gnu: Add python-pyqtwebengine, version 6.6.0.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
ab036c068db5a317525fdc19989d44e00f110a14.1700724016.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqtwebengine-6): New variable.
---
gnu/packages/qt.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 22569f5f75..6ac6afba6e 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3792,6 +3792,39 @@ (define-public python-pyqtwebengine
itself.")
(license license:gpl3)))
+(define-public python-pyqtwebengine-6
+ (package
+ (inherit python-pyqtwebengine)
+ (version "6.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_WebEngine" version))
+ (sha256
+ (base32 "11wlnggs5vi7z465xhmnz664wbaj44ki6mmijbk0kr457x69h2ym"))))
+ (native-inputs (list python python-sip python-pyqt-builder
+ ;; qtbase is required for qmake
+ qtbase))
+ (inputs (list python-pyqt-6 qtbase qtdeclarative qtwebchannel qtwebengine))
+ (arguments
+ (list
+ #:tests? #f ;No tests.
+ #:configure-flags #~`(@ ("--verbose" . "") ;Print commands run.
+ ("--jobs" unquote
+ (number->string (parallel-job-count))))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'set-include-dirs
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((version (python-version (assoc-ref inputs "python")))
+ (sip-include-dirs (search-input-directory inputs
+ (string-append "/lib/python" version
+ "/site-packages/PyQt6/bindings"))))
+ (setenv "SIP_INCLUDE_DIRS" sip-include-dirs)))))))
+ (description
+ "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
+WebEngine libraries. The bindings sit on top of PyQt6 and are implemented as a
+set of three modules.")))
+
(define-public python-pyqt-builder
(package
(name "python-pyqt-builder")
--
2.41.0
Herman Rimm wrote 1 years ago
[PATCH v3 1/3] gnu: Add python-pyqt6-sip.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
b70ef9eb5371962c4f7338aa5914ebc8d5cf8e6f.1700740759.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqt6-sip): New variable.
---
gnu/packages/qt.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

Toggle diff (31 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 12785c811f..c703dbf4cc 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3675,6 +3675,22 @@ (define-public python-pyqt5-sip
(description "Sip module support for PyQt5")
(license license:lgpl2.1+)))
+(define-public python-pyqt6-sip
+ (package
+ (inherit python-pyqt5-sip)
+ (name "python-pyqt6-sip")
+ (version "13.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_sip" version))
+ (sha256
+ (base32 "0y2pgc1kzskq3q230b5d48izvzy9dl4hkfjpcr7kv53ih1cf31i4"))))
+ (synopsis "Sip module support for PyQt6")
+ (description
+ "SIP is used to write self contained extension modules, i.e. without a library
+to be wrapped. This SIP extension module provides support for the PyQt6 package.")))
+
(define-public python-pyqtwebengine
(package
(name "python-pyqtwebengine")

base-commit: 5283d24062be62f59ff9f14fa7095ebcfcb7a9a4
--
2.41.0
Herman Rimm wrote 1 years ago
[PATCH v3 2/3] gnu: Add python-pyqt, version 6.5.2.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
e197e98f4c1b8720b232c18f54b5ca5528a85479.1700740759.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqt-6): New variable.
---
gnu/packages/qt.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

Toggle diff (65 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index c703dbf4cc..1b8c56ef28 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -29,6 +29,7 @@
;;; Copyright © 2022 Yash Tiwari <yasht@mailbox.org>
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3656,6 +3657,50 @@ (define-public python-pyqt
contain over 620 classes.")
(license license:gpl3)))
+(define-public python-pyqt-6
+ (package
+ (inherit python-pyqt)
+ (version "6.5.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6" version))
+ (file-name (string-append "PyQt6-" version ".tar.gz"))
+ (sha256
+ (base32 "100jh1iiz5gx821qzgicfrqv7hjjj98pchdbc1nvdzzra1ryx1ql"))))
+ (inputs ;Qt5 dependencies only in python-pyqt:
+ ;; (qt)connectivity, location, sensors, serialport, x11extras, xmlpatterns.
+ (list python-wrapper
+ qtbase
+ qtdeclarative
+ qtmultimedia
+ qtpositioning
+ qtsvg
+ qttools
+ qtwebchannel
+ qtwebsockets))
+ (propagated-inputs (list python-sip python-pyqt6-sip))
+ (native-inputs (list python-pyqt-builder qtbase)) ;qtbase is required for qmake.
+ (arguments
+ (list
+ #:tests? #f ;No tests.
+ #:configure-flags #~`(@ ("--verbose" . "") ;Print commands run.
+ ("--confirm-license" . "")
+ ("--jobs" unquote
+ (number->string (parallel-job-count))))
+ #:phases #~(modify-phases %standard-phases
+ ;; When building python-pyqtwebengine, <qprinter.h> cannot be
+ ;; included. Here we substitute the full path to the header in the
+ ;; store.
+ (add-after 'unpack 'substitute-source
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((qprinter.h (search-input-file inputs
+ "/include/qt6/QtPrintSupport/qprinter.h")))
+ (substitute* (list "sip/QtPrintSupport/qprinter.sip"
+ "sip/QtPrintSupport/qpyprintsupport_qlist.sip")
+ (("qprinter.h")
+ qprinter.h))))))))))
+
(define-public python-pyqt5-sip
(package
(name "python-pyqt5-sip")
--
2.41.0
Herman Rimm wrote 1 years ago
[PATCH v3 3/3] gnu: Add python-pyqtwebengine, version 6.6.0.
(address . 57431@debbugs.gnu.org)(name . Zhu Zihao)(address . all_but_last@163.com)
e261fd2cfd67ebc4427db5765f30d8bcedd76cb3.1700740759.git.herman@rimm.ee
From: Zhu Zihao <all_but_last@163.com>

* gnu/packages/qt.scm (python-pyqtwebengine-6): New variable.
---
gnu/packages/qt.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 1b8c56ef28..ba944a3355 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3793,6 +3793,40 @@ (define-public python-pyqtwebengine
itself.")
(license license:gpl3)))
+(define-public python-pyqtwebengine-6
+ (package
+ (inherit python-pyqtwebengine)
+ (version "6.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQt6_WebEngine" version))
+ (sha256
+ (base32 "11wlnggs5vi7z465xhmnz664wbaj44ki6mmijbk0kr457x69h2ym"))))
+ (native-inputs (list python python-sip python-pyqt-builder
+ ;; qtbase is required for qmake
+ qtbase))
+ (inputs (list python-pyqt-6 qtbase qtdeclarative qtwebchannel qtwebengine))
+ (arguments
+ (list
+ #:tests? #f ;No tests.
+ #:configure-flags #~`(@ ("--verbose" . "") ;Print commands run.
+ ("--jobs" unquote
+ (number->string (parallel-job-count))))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'set-include-dirs
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((python (assoc-ref inputs "python"))
+ (sip-include-dirs (search-input-directory inputs
+ (string-append "/lib/python"
+ (python-version python)
+ "/site-packages/PyQt6/bindings"))))
+ (setenv "SIP_INCLUDE_DIRS" sip-include-dirs)))))))
+ (description
+ "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
+WebEngine libraries. The bindings sit on top of PyQt6 and are implemented as a
+set of three modules.")))
+
(define-public python-pyqt-builder
(package
(name "python-pyqt-builder")
--
2.41.0
chris wrote 1 years ago
[PATCH]: Add PyQt 6.
(address . 57431@debbugs.gnu.org)(address . chris@bumblehead.com)
ZWha0GvOrpvJlKNG@guix-xps
bumping this to please bring PyQt 6 and the latest version of qutebrowser!
Ludovic Courtès wrote 1 years ago
Re: [bug#57431] [PATCH v3 1/3] gnu: Add python-pyqt6-sip.
(name . Herman Rimm)(address . herman@rimm.ee)
87bkaib4ed.fsf@gnu.org
Hi Herman,

Herman Rimm <herman@rimm.ee> skribis:

Toggle quote (4 lines)
> From: Zhu Zihao <all_but_last@163.com>
>
> * gnu/packages/qt.scm (python-pyqt6-sip): New variable.

[...]

Toggle quote (4 lines)
> From: Zhu Zihao <all_but_last@163.com>
>
> * gnu/packages/qt.scm (python-pyqt-6): New variable.

[...]

Toggle quote (4 lines)
> From: Zhu Zihao <all_but_last@163.com>
>
> * gnu/packages/qt.scm (python-pyqtwebengine-6): New variable.

Finally applied, thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 57431@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 57431
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help