From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oG7IHtkLB2MbYAAAbAwnHQ (envelope-from ) for ; Thu, 25 Aug 2022 07:42:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gLnzHdkLB2MscwEAG6o9tA (envelope-from ) for ; Thu, 25 Aug 2022 07:42:49 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E1EDC19206 for ; Thu, 25 Aug 2022 07:42:48 +0200 (CEST) Received: from localhost ([::1]:40700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR5df-0003vY-Bf for larch@yhetil.org; Thu, 25 Aug 2022 01:42:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR5cw-0003sD-OR for guix-patches@gnu.org; Thu, 25 Aug 2022 01:42:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oR5cw-0000Iz-Gd for guix-patches@gnu.org; Thu, 25 Aug 2022 01:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oR5cw-0005iX-5B for guix-patches@gnu.org; Thu, 25 Aug 2022 01:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57398] [PATCH]: Add PySide 6. Resent-From: Zhu Zihao Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Aug 2022 05:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57398 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57398@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.166140611521962 (code B ref -1); Thu, 25 Aug 2022 05:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Aug 2022 05:41:55 +0000 Received: from localhost ([127.0.0.1]:48607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR5co-0005i7-1B for submit@debbugs.gnu.org; Thu, 25 Aug 2022 01:41:55 -0400 Received: from lists.gnu.org ([209.51.188.17]:56990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR5ci-0005hu-3o for submit@debbugs.gnu.org; Thu, 25 Aug 2022 01:41:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR5ch-0003nC-PX for guix-patches@gnu.org; Thu, 25 Aug 2022 01:41:47 -0400 Received: from mail-m971.mail.163.com ([123.126.97.1]:59183) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR5cY-0000GQ-K0 for guix-patches@gnu.org; Thu, 25 Aug 2022 01:41:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=OIbqN lUdiYCKu+v4tP44nF7oSBNLx1TxjCRD4NLfQ1M=; b=nXPVtG2bOxRp1vEd6fFXB 0yUolLm655WbzODDEUZt4e4GFbekC3iFvLVedll12kcHpco/Ktf0Rg/TQQCkNu/V yKDHZXcXWCxcocGqLRAavEF0fThrU22kayHJlrZJtDxalxORp5db6JB/xyWa/hjH 2Ey0QxIS6QSCTtUifATSC0= Received: from asus-laptop (unknown [163.125.249.44]) by smtp1 (Coremail) with SMTP id GdxpCgCX6LmECwdjf4i9XA--.25871S2; Thu, 25 Aug 2022 13:41:25 +0800 (CST) User-agent: mu4e 1.8.9; emacs 29.0.50 From: Zhu Zihao Date: Thu, 25 Aug 2022 13:38:07 +0800 Message-ID: <86czcoribi.fsf@163.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-CM-TRANSID: GdxpCgCX6LmECwdjf4i9XA--.25871S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvj4RZMaeDUUUU X-Originating-IP: [163.125.249.44] X-CM-SenderInfo: pdoosuxxwbztlvw6il2tof0z/xtbBPQZor2AZCBazxgAAsu Received-SPF: pass client-ip=123.126.97.1; envelope-from=all_but_last@163.com; helo=mail-m971.mail.163.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661406169; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=OIbqNlUdiYCKu+v4tP44nF7oSBNLx1TxjCRD4NLfQ1M=; b=tfFSfN9w7T1X5uex8+OuriXd4JVKhtjLRL+vzzmjMuxgy5lN6MTOaZJn9DcqVGZfW1zQb1 KCn1ubr5deKLzzfeRHc46ytzetUB01qveY6TTNcs66nL16BqkVDmQ5gTs6BVZZoQJiCSOt ohS+KJjlVyATuaDXaGu/CRQv07dCtN3ww+g/qy95cqAyFlODI7JmZ5HyIQuEdYf/rkX/jM d/Id5VIqI1bjDpr32Fe2tNI7oEvFNbUX38QYsy7FD+E9cMnhmRqNxuJiSW96/xI+N7ly27 rxQuEKk28PGP2nAlPUUgnbRU86L7C2IkcykDoHnuyu5E2SbnIfnExQ++aIMH6g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661406169; a=rsa-sha256; cv=none; b=WK6Rdda7LKhv3nfNIYVby1IGbQ5EUcJHqo5prBwus5JLT7MfrhghKIOADW7eL5Sf+EiN96 S+cAQPNVAQiGf/vo0xQUPb12REmElI0yPK6z01WZGmcSzs0W4zD4v+vL4QUvaByQolt0V8 3Apyy6w7KlCYub7bXq39iWMb0VhNflYkTFmy8tgEs+8SGVgmi0gJ/LbtEs68JSe/9BUyCL ymzKQpZn2JgJQ2cth8V67nrt3q+CGF/fpNs+h95mBjRG+hNYR41Nz14uwOLrrJQOwT5ryJ 1+CZp5iKvSjHleG9xxGxMQf4PeZLfC2HO8RICAfR7jl1PcWqE6TPLx3hqSUXWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=163.com header.s=s110527 header.b=nXPVtG2b; dmarc=fail reason="SPF not aligned (relaxed)" header.from=163.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=163.com header.s=s110527 header.b=nXPVtG2b; dmarc=fail reason="SPF not aligned (relaxed)" header.from=163.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E1EDC19206 X-Spam-Score: 5.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: +uhkJg7+1X+z --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-python-shiboken-2-Use-G-expressions.patch Content-Transfer-Encoding: quoted-printable >From bbfc717a19c272d1f2698bca44e72109cbe1d3cf Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Wed, 24 Aug 2022 16:50:14 +0800 Subject: [PATCH 1/9] gnu: python-shiboken-2: Use G-expressions. * gnu/packages/qt.scm (python-shiboken-2)[arguments]: Use G-expressions. <#:phases>: In phase "set-build-env", Replace (assoc-ref inputs ...) with (this-package-input ...). --- gnu/packages/qt.scm | 53 +++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index d9d796f551..fe9c9213e5 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -24,6 +24,7 @@ ;;; Copyright =C2=A9 2021, 2022 Guillaume Le Vaillant ;;; Copyright =C2=A9 2021 Nicol=C3=B2 Balzarotti ;;; Copyright =C2=A9 2022 Foo Chuan Wei +;;; Copyright =C2=A9 2022 Zhu Zihao ;;; ;;; This file is part of GNU Guix. ;;; @@ -3746,6 +3747,9 @@ (define-public qcustomplot "QCustomPlot is a Qt C++ widget providing 2D plots, graphs and charts= .") (license license:gpl3+))) =20 +;; TODO: Split shiboken2 binding generator into a dedicated output. +;; This executable requires libxml2, libxslt, clang-toolchain at runtime. +;; The libshiboken library only requires Qt and Python at runtime. (define-public python-shiboken-2 (package (name "python-shiboken-2") @@ -3768,30 +3772,31 @@ (define-public python-shiboken-2 qtbase-5 qtxmlpatterns)) (arguments - `(#:tests? #f - ;; FIXME: Building tests fails - #:configure-flags '("-DBUILD_TESTS=3Doff") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'use-shiboken-dir-only - (lambda _ (chdir "sources/shiboken2") #t)) - (add-before 'configure 'make-files-writable-and-update-timestamps - (lambda _ - ;; The build scripts need to modify some files in - ;; the read-only source directory, and also attempts - ;; to create Zip files which fails because the Zip - ;; format does not support timestamps before 1980. - (let ((circa-1980 (* 10 366 24 60 60))) - (for-each (lambda (file) - (make-file-writable file) - (utime file circa-1980 circa-1980)) - (find-files "."))) - #t)) - (add-before 'configure 'set-build-env - (lambda* (#:key inputs #:allow-other-keys) - (let ((llvm (assoc-ref inputs "clang-toolchain"))) - (setenv "CLANG_INSTALL_DIR" llvm) - #t)))))) + (list + #:tests? #f + ;; FIXME: Building tests fails + #:configure-flags #~(list "-DBUILD_TESTS=3Doff") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-shiboken-dir-only + (lambda _ (chdir "sources/shiboken2") #t)) + (add-before 'configure 'make-files-writable-and-update-timestamps + (lambda _ + ;; The build scripts need to modify some files in + ;; the read-only source directory, and also attempts + ;; to create Zip files which fails because the Zip + ;; format does not support timestamps before 1980. + (let ((circa-1980 (* 10 366 24 60 60))) + (for-each (lambda (file) + (make-file-writable file) + (utime file circa-1980 circa-1980)) + (find-files "."))) + #t)) + (add-before 'configure 'set-build-env + (lambda _ + (let ((llvm #$(this-package-input "clang-toolchain"))) + (setenv "CLANG_INSTALL_DIR" llvm) + #t)))))) (home-page "https://wiki.qt.io/Qt_for_Python") (synopsis "Shiboken generates bindings for C++ libraries using CPython source c= ode") --=20 2.37.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-gnu-Add-python-shiboken-6.patch >From 1f1e9b864581544be3fb2e5281a5182826538807 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Wed, 24 Aug 2022 19:23:31 +0800 Subject: [PATCH 2/9] gnu: Add python-shiboken-6 * gnu/packages/qt.scm (python-shiboken-6): New variable. --- gnu/packages/qt.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index fe9c9213e5..7e303a929c 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -3810,6 +3810,40 @@ (define-public python-shiboken-2 license:lgpl3 license:bsd-3)))) +(define-public python-shiboken-6 + (package + (inherit python-shiboken-2) + (name "python-shiboken-6") + (version "6.3.1") + (source (origin + (method url-fetch) + (uri (string-append "https://download.qt.io/official_releases" + "/QtForPython/pyside6/PySide6-" version + "-src/pyside-setup-opensource-src-" + version ".tar.xz")) + (sha256 + (base32 + "0xwri69nnbhn6fajm7l045r0s0qv8nlq6qj8wcj87srli3b5xa75")))) + (build-system cmake-build-system) + (inputs + (modify-inputs (package-inputs python-shiboken-2) + (replace "qtbase" qtbase) + (delete "qtxmlpatterns"))) + (arguments + (substitute-keyword-arguments (package-arguments python-shiboken-2) + ((#:phases p) + #~(modify-phases #$p + (replace 'use-shiboken-dir-only + (lambda _ (chdir "sources/shiboken6") #t)))) + ((#:configure-flags flags) + #~(cons* + ;; The RUNPATH of shibokenmodule contains the entry in build + ;; directory instead of install directory. + "-DCMAKE_SKIP_RPATH=TRUE" + (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath=" + #$output "/lib") + #$flags)))))) + (define-public python-pyside-2 (package (name "python-pyside-2") -- 2.37.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-gnu-python-pyside-2-Use-G-expressions.patch >From a4d31ffc721fa3b459e2f168cb4af65147b82248 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Wed, 24 Aug 2022 19:25:26 +0800 Subject: [PATCH 3/9] gnu: python-pyside-2: Use G-expressions. * gnu/packages/qt.scm (python-pyside-2)[native-inputs]: Use label-less input style. [arguments]: Use G-expressions. --- gnu/packages/qt.scm | 116 ++++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 7e303a929c..3f53f22363 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -3874,68 +3874,66 @@ (define-public python-pyside-2 (propagated-inputs (list python-shiboken-2)) (native-inputs - `(("cmake" ,cmake-minimal) - ("python" ,python-wrapper) - ("qttools-5" ,qttools-5) - ("which" ,which))) + (list cmake-minimal python-wrapper qttools-5 which)) (arguments - `(#:tests? #f - ;; FIXME: Building tests fail. - #:configure-flags - (list "-DBUILD_TESTS=FALSE" - (string-append "-DPYTHON_EXECUTABLE=" - (assoc-ref %build-inputs "python") - "/bin/python")) - #:modules ((guix build cmake-build-system) + (list + #:tests? #f + ;; FIXME: Building tests fail. + #:configure-flags + #~(list "-DBUILD_TESTS=FALSE" + (string-append "-DPYTHON_EXECUTABLE=" + (assoc-ref %build-inputs "python") + "/bin/python")) + #:modules '((guix build cmake-build-system) (guix build utils) (srfi srfi-1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'go-to-source-dir - (lambda _ (chdir "sources/pyside2") #t)) - (add-after 'go-to-source-dir 'fix-qt-module-detection - (lambda* (#:key inputs #:allow-other-keys) - ;; Activate qt module support even if it not in the same - ;; directory as qtbase. - (substitute* "../cmake_helpers/helpers.cmake" - (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)") - "true")) - ;; Add include directories for qt modules. - (let ((dirs (map (lambda (name) - (string-append (assoc-ref inputs name) - "/include/qt5")) - '("qtdatavis3d" - "qtdeclarative" - "qtlocation" - "qtmultimedia" - "qtquickcontrols" - "qtquickcontrols2" - "qtscript" - "qtscxml" - "qtsensors" - "qtspeech" - "qtsvg" - "qttools-5" - "qtwebchannel" - "qtwebengine" - "qtwebsockets" - "qtx11extras" - "qtxmlpatterns")))) - (substitute* "cmake/Macros/PySideModules.cmake" - (("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all) - (fold (lambda (dir paths) - (string-append paths "${PATH_SEP}" dir)) - all - dirs))) - (setenv "CXXFLAGS" (fold (lambda (dir paths) - (string-append paths " -I" dir)) - "" - dirs))))) - (add-before 'configure 'set-clang-dir - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "clang-toolchain"))) - (setenv "CLANG_INSTALL_DIR" clang) - #t)))))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'go-to-source-dir + (lambda _ (chdir "sources/pyside2") #t)) + (add-after 'go-to-source-dir 'fix-qt-module-detection + (lambda* (#:key inputs #:allow-other-keys) + ;; Activate qt module support even if it not in the same + ;; directory as qtbase. + (substitute* "../cmake_helpers/helpers.cmake" + (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)") + "true")) + ;; Add include directories for qt modules. + (let ((dirs (map (lambda (name) + (string-append (assoc-ref inputs name) + "/include/qt5")) + '("qtdatavis3d" + "qtdeclarative" + "qtlocation" + "qtmultimedia" + "qtquickcontrols" + "qtquickcontrols2" + "qtscript" + "qtscxml" + "qtsensors" + "qtspeech" + "qtsvg" + "qttools-5" + "qtwebchannel" + "qtwebengine" + "qtwebsockets" + "qtx11extras" + "qtxmlpatterns")))) + (substitute* "cmake/Macros/PySideModules.cmake" + (("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all) + (fold (lambda (dir paths) + (string-append paths "${PATH_SEP}" dir)) + all + dirs))) + (setenv "CXXFLAGS" (fold (lambda (dir paths) + (string-append paths " -I" dir)) + "" + dirs))))) + (add-before 'configure 'set-clang-dir + (lambda* (#:key inputs #:allow-other-keys) + (let ((clang (assoc-ref inputs "clang-toolchain"))) + (setenv "CLANG_INSTALL_DIR" clang) + #t)))))) (home-page "https://wiki.qt.io/Qt_for_Python") (synopsis "The Qt for Python product enables the use of Qt5 APIs in Python applications") -- 2.37.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0004-gnu-python-pyside-2-Clarify-the-package-inputs.patch >From 3d1db3ee35d31414e2d4ef40ad5fcffa60a1e7b4 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Wed, 24 Aug 2022 22:54:46 +0800 Subject: [PATCH 4/9] gnu: python-pyside-2: Clarify the package inputs. The module "PySide.PyQtUiTools" depends on "qttools-5", it should be an input, not a native input. libxml2, libxslt, clang-toolchain is only used by python-shiboken-2. cmake-minimal is not used. * gnu/packages/qt.scm (python-pyside-2): [inputs]: Remove libxml2, libxslt, clang-toolchain. Add qttools-5. [native-inputs]: Remove cmake-minimal, qttools-5. [arguments]<#:phases>: Remove phase "set-clang-dir". --- gnu/packages/qt.scm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 3f53f22363..dd1e2d4640 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -3851,10 +3851,7 @@ (define-public python-pyside-2 (source (package-source python-shiboken-2)) (build-system cmake-build-system) (inputs - (list libxml2 - libxslt - clang-toolchain - qtbase-5 + (list qtbase-5 qtdatavis3d qtdeclarative-5 qtlocation @@ -3866,6 +3863,7 @@ (define-public python-pyside-2 qtsensors qtspeech qtsvg-5 + qttools-5 qtwebchannel-5 qtwebengine-5 qtwebsockets-5 @@ -3874,7 +3872,7 @@ (define-public python-pyside-2 (propagated-inputs (list python-shiboken-2)) (native-inputs - (list cmake-minimal python-wrapper qttools-5 which)) + (list python-wrapper)) (arguments (list #:tests? #f @@ -3928,12 +3926,7 @@ (define-public python-pyside-2 (setenv "CXXFLAGS" (fold (lambda (dir paths) (string-append paths " -I" dir)) "" - dirs))))) - (add-before 'configure 'set-clang-dir - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "clang-toolchain"))) - (setenv "CLANG_INSTALL_DIR" clang) - #t)))))) + dirs)))))))) (home-page "https://wiki.qt.io/Qt_for_Python") (synopsis "The Qt for Python product enables the use of Qt5 APIs in Python applications") -- 2.37.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0005-gnu-python-pyside-2-Use-this-package-input-instead-o.patch >From 801e4315b1ef24fc18cf61169b42443eb221e924 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Wed, 24 Aug 2022 22:57:44 +0800 Subject: [PATCH 5/9] gnu: python-pyside-2: Use "this-package-input" instead of "assoc-ref". * gnu/packages/qt.scm (python-pyside-2)[arguments]<#:configure-flags>: Use "this-package-input" <#:phases>: In phase "fix-qt-module-detection", use "this-package-input". --- gnu/packages/qt.scm | 46 +++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index dd1e2d4640..bc16f69e60 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -3880,7 +3880,7 @@ (define-public python-pyside-2 #:configure-flags #~(list "-DBUILD_TESTS=FALSE" (string-append "-DPYTHON_EXECUTABLE=" - (assoc-ref %build-inputs "python") + #$(this-package-native-input "python-wrapper") "/bin/python")) #:modules '((guix build cmake-build-system) (guix build utils) @@ -3890,33 +3890,35 @@ (define-public python-pyside-2 (add-after 'unpack 'go-to-source-dir (lambda _ (chdir "sources/pyside2") #t)) (add-after 'go-to-source-dir 'fix-qt-module-detection - (lambda* (#:key inputs #:allow-other-keys) + (lambda _ ;; Activate qt module support even if it not in the same ;; directory as qtbase. (substitute* "../cmake_helpers/helpers.cmake" (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)") "true")) ;; Add include directories for qt modules. - (let ((dirs (map (lambda (name) - (string-append (assoc-ref inputs name) - "/include/qt5")) - '("qtdatavis3d" - "qtdeclarative" - "qtlocation" - "qtmultimedia" - "qtquickcontrols" - "qtquickcontrols2" - "qtscript" - "qtscxml" - "qtsensors" - "qtspeech" - "qtsvg" - "qttools-5" - "qtwebchannel" - "qtwebengine" - "qtwebsockets" - "qtx11extras" - "qtxmlpatterns")))) + (let ((dirs (map (lambda (path) + (string-append path "/include/qt5")) + (list + #$@(map (lambda (name) + (this-package-input name)) + '("qtdatavis3d" + "qtdeclarative" + "qtlocation" + "qtmultimedia" + "qtquickcontrols" + "qtquickcontrols2" + "qtscript" + "qtscxml" + "qtsensors" + "qtspeech" + "qtsvg" + "qttools" + "qtwebchannel" + "qtwebengine" + "qtwebsockets" + "qtx11extras" + "qtxmlpatterns")))))) (substitute* "cmake/Macros/PySideModules.cmake" (("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all) (fold (lambda (dir paths) -- 2.37.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0006-gnu-Add-python-pyside-6.patch >From 1b1d4b2a22638aca688a9f35572b82c9dc649d1f Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Thu, 25 Aug 2022 12:42:54 +0800 Subject: [PATCH 6/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 bc16f69e60..0d1d6124d4 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -3950,6 +3950,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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0007-gnu-python-pyside-2-tools-Use-G-expressions.patch >From f3fffdcfd6635399418073e4bb6bf884a685d5d7 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Thu, 25 Aug 2022 13:02:46 +0800 Subject: [PATCH 7/9] gnu: python-pyside-2-tools: Use G-expressions. * gnu/packages/qt.scm (python-pyside2-tools)[native-inputs]: Use label-less style. [arguments]: Use G-expressions. <#:configure-flags>: Use "this-package-native-input". --- gnu/packages/qt.scm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 0d1d6124d4..e1bda580ad 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -4031,17 +4031,19 @@ (define-public python-pyside-2-tools (inputs (list python-pyside-2 python-shiboken-2 qtbase-5)) (native-inputs - `(("python" ,python-wrapper))) + (list python-wrapper)) (arguments - `(#:tests? #f - #:configure-flags - (list "-DBUILD_TESTS=off" - (string-append "-DPYTHON_EXECUTABLE=" - (assoc-ref %build-inputs "python") - "/bin/python")) - #:phases (modify-phases %standard-phases - (add-after 'unpack 'go-to-source-dir - (lambda _ (chdir "sources/pyside2-tools") #t))))) + (list + #:tests? #f + #:configure-flags + #~(list "-DBUILD_TESTS=off" + (string-append "-DPYTHON_EXECUTABLE=" + #$(this-package-native-inputs "python-wrapper") + "/bin/python")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'go-to-source-dir + (lambda _ (chdir "sources/pyside2-tools") #t))))) (home-page "https://wiki.qt.io/Qt_for_Python") (synopsis "Contains command line tools for PySide2") -- 2.37.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0008-gnu-python-pyside-2-tools-Fix-synopsis-and-descripti.patch >From 2669f1f0dd7a2688f0dcaf913649a24640a68f7c Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Thu, 25 Aug 2022 13:04:45 +0800 Subject: [PATCH 8/9] gnu: python-pyside-2-tools: Fix synopsis and description. * gnu/packages/qt.scm (python-pyside2-tools)[synopsis]: Use more descriptive words. [description]: Ditto. --- gnu/packages/qt.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index e1bda580ad..84550872b1 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -4046,9 +4046,9 @@ (define-public python-pyside-2-tools (lambda _ (chdir "sources/pyside2-tools") #t))))) (home-page "https://wiki.qt.io/Qt_for_Python") (synopsis - "Contains command line tools for PySide2") + "Command line tools for PySide2") (description - "Contains lupdate, rcc and uic tools for PySide2") + "Python-pyside-2-tools contains lupdate, rcc and uic tools for PySide2") (license license:gpl2))) (define-public libqglviewer -- 2.37.2 --=-=-= Content-Type: text/plain -- Retrieve my PGP public key: gpg --recv-keys 481F5EEEBA425ADC13247C76A6E672D981B8E744 Zihao --=-=-=--