From patchwork Tue Jan 16 17:37:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Rimoldi X-Patchwork-Id: 58947 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 87BB227BBEA; Tue, 16 Jan 2024 17:44:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BC1CF27BBE2 for ; Tue, 16 Jan 2024 17:44:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPnTo-0004eM-1T; Tue, 16 Jan 2024 12:44:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPnTm-0004dr-Mx for guix-patches@gnu.org; Tue, 16 Jan 2024 12:44:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rPnTm-0008GF-Ek for guix-patches@gnu.org; Tue, 16 Jan 2024 12:44:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPnTm-0004bi-Tt for guix-patches@gnu.org; Tue, 16 Jan 2024 12:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68052] [PATCH v2 1/3] gnu: python-poppler-qt5: Update to 21.3.0. Resent-From: rimarko@libero.it Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Jan 2024 17:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68052 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 68052@debbugs.gnu.org Cc: Marco Rimoldi Received: via spool by 68052-submit@debbugs.gnu.org id=B68052.170542698917612 (code B ref 68052); Tue, 16 Jan 2024 17:44:02 +0000 Received: (at 68052) by debbugs.gnu.org; 16 Jan 2024 17:43:09 +0000 Received: from localhost ([127.0.0.1]:49686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPnSu-0004a0-9g for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:43:08 -0500 Received: from smtp-32.italiaonline.it ([213.209.10.32]:48465 helo=libero.it) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPnSr-0004ZC-5Q for 68052@debbugs.gnu.org; Tue, 16 Jan 2024 12:43:06 -0500 Received: from localhost ([93.38.119.137]) by smtp-32.iol.local with ESMTPA id PnSarqOMwQSiOPnSkr44eD; Tue, 16 Jan 2024 18:42:58 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1705426978; bh=5oVRH3/6UlKRC0WVcf3vEF/IpG01WEoX00g1OXYASQ8=; h=From; b=B5sslsnGyWKVa7OSBo/pSmtP8LkzGReO+gQNh5nEx0eOeB1+r0s998TRWnoSZCiIy OCqANbmVXdJF9yx6qt+WBLD5xr2rALIZHiGtmNfNwZhA9z/P7IH9FMRuCvnkNchxZi zhA8IiBPeykzWWW9lqyo8e4kPSXNPhYT/cDO3qJbTJAwC9kQy3TReKtFhJTrl2Zvmz BnjJ+xbZ12XQtoPm+8XzCzht9ayVG77BIzfU5+ve8RD5QNanLLLEa81D5pxGEbUz5M Io3yPG0oz0blayXrwVpUFotje3wj33KmbNI5yrNivZH6p22EJ1L52YWhY/ik7dU7Q7 XLqVwSmEROQ6g== X-CNFS-Analysis: v=2.4 cv=M6buKDws c=1 sm=1 tr=0 ts=65a6c022 cx=a_exe a=zr5aN+YwjWvrDHBFAPbA8Q==:117 a=zr5aN+YwjWvrDHBFAPbA8Q==:17 a=NEAV23lmAAAA:8 a=CckQENj0AAAA:8 a=8AHkEIZyAAAA:8 a=Mx0scFzx4O3nQM9Q7SsA:9 a=-XWihg8NfbdYC9mmq4w4:22 Date: Tue, 16 Jan 2024 18:37:37 +0100 Message-ID: <785256562197b2f1fdbd67ca21b0ee9e2464b611.1705426659.git.rimarko@libero.it> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-CMAE-Envelope: MS4xfMcLBGeMLkhBAWYLHgjZda0hPor2kfuSiD1RKqXjCeaZMop1mh4X2x9fJ6T5k2773MfkOW2s0UWF7HYYMdL0jmP/8dGWwnm4UpKGFZ2BeBrexN7+yIEL SO6+ogqPKakQaebYkIQvf5FwV3MSeS2M8Y6Np7VED3SHFRiLF+gPf3FkqpQUeIYQncGuyhavL1CsqEFSAoyJk0dYBpuazK8U2yg= 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: , Reply-to: rimarko@libero.it X-ACL-Warn: , Marco Rimoldi via Guix-patches X-Patchwork-Original-From: Marco Rimoldi via Guix-patches via From: Marco Rimoldi Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Marco Rimoldi * gnu/packages/pdf.scm (python-poppler-qt5): Update to 21.3.0. [build-system]: Change to pyproject. [inputs]: Change SIP to current version variant. * gnu/packages/patches/python-poppler-qt5-fix-build.patch: Delete file. * gnu/local.mk (dist_patch_DATA): De-register said patch. Change-Id: I30d6e2a3180505091d8072ed452211b0bb3a0178 --- gnu/local.mk | 1 - .../python-poppler-qt5-fix-build.patch | 116 ------------------ gnu/packages/pdf.scm | 50 +++----- 3 files changed, 18 insertions(+), 149 deletions(-) delete mode 100644 gnu/packages/patches/python-poppler-qt5-fix-build.patch diff --git a/gnu/local.mk b/gnu/local.mk index d2e2843372..bd0d9b75ce 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1794,7 +1794,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-feedparser-missing-import.patch \ %D%/packages/patches/python-louvain-fix-test.patch \ %D%/packages/patches/python-random2-getrandbits-test.patch \ - %D%/packages/patches/python-poppler-qt5-fix-build.patch \ %D%/packages/patches/python-pyreadstat-link-libiconv.patch \ %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch \ %D%/packages/patches/python-pytorch2-system-libraries.patch \ diff --git a/gnu/packages/patches/python-poppler-qt5-fix-build.patch b/gnu/packages/patches/python-poppler-qt5-fix-build.patch deleted file mode 100644 index 099bb86d2f..0000000000 --- a/gnu/packages/patches/python-poppler-qt5-fix-build.patch +++ /dev/null @@ -1,116 +0,0 @@ -Patch taken from the upstream repository -https://github.com/frescobaldi/python-poppler-qt5/issues/43 - -From 92e5962ec3751ab051d0b655fd61afc7a1cf709e Mon Sep 17 00:00:00 2001 -From: Ben Greiner -Date: Thu, 4 Mar 2021 17:02:51 +0100 -Subject: [PATCH] map type QVector< QPair > for - FormFieldChoice::choicesWithExportValues() (#45) - ---- - types.sip | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 93 insertions(+) - -diff --git a/types.sip b/types.sip -index 239b8c9..81cb283 100644 ---- a/types.sip -+++ b/types.sip -@@ -331,5 +331,98 @@ template - }; - - -+/** -+ * Convert QVector< QPair > -+ * from and to a Python list of a 2-item tuple -+ */ -+ -+template -+%MappedType QVector< QPair > -+{ -+%TypeHeaderCode -+#include -+#include -+%End -+ -+%ConvertFromTypeCode -+ // Create the list. -+ PyObject *l; -+ -+ if ((l = PyList_New(sipCpp->size())) == NULL) -+ return NULL; -+ -+ // Set the list elements. -+ for (int i = 0; i < sipCpp->size(); ++i) -+ { -+ QPair* p = new QPair(sipCpp->at(i)); -+ PyObject *ptuple = PyTuple_New(2); -+ PyObject *pfirst; -+ PyObject *psecond; -+ -+ TYPE *sfirst = new TYPE(p->first); -+ if ((pfirst = sipConvertFromType(sfirst, sipType_TYPE, sipTransferObj)) == NULL) -+ { -+ Py_DECREF(l); -+ Py_DECREF(ptuple); -+ return NULL; -+ } -+ PyTuple_SET_ITEM(ptuple, 0, pfirst); -+ -+ TYPE *ssecond = new TYPE(p->second); -+ if ((psecond = sipConvertFromType(ssecond, sipType_TYPE, sipTransferObj)) == NULL) -+ { -+ Py_DECREF(l); -+ Py_DECREF(ptuple); -+ Py_DECREF(pfirst); -+ return NULL; -+ } -+ PyTuple_SET_ITEM(ptuple, 1, psecond); -+ -+ PyList_SET_ITEM(l, i, ptuple); -+ } -+ -+ return l; -+%End -+ -+%ConvertToTypeCode -+ const sipTypeDef* qpair_type = sipFindType("QPair"); -+ -+ // Check the type if that is all that is required. -+ if (sipIsErr == NULL) -+ { -+ if (!PySequence_Check(sipPy)) -+ return 0; -+ -+ for (int i = 0; i < PySequence_Size(sipPy); ++i) -+ if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qpair_type, SIP_NOT_NONE)) -+ return 0; -+ -+ return 1; -+ } -+ -+ -+ QVector< QPair > *qv = new QVector< QPair >; -+ -+ for (int i = 0; i < PySequence_Size(sipPy); ++i) -+ { -+ int state; -+ QPair * p = reinterpret_cast< QPair * >(sipConvertToType(PySequence_ITEM(sipPy, i), qpair_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); -+ -+ if (*sipIsErr) -+ { -+ sipReleaseType(p, qpair_type, state); -+ delete qv; -+ return 0; -+ } -+ qv->append(*p); -+ sipReleaseType(p, qpair_type, state); -+ } -+ -+ *sipCppPtr = qv; -+ return sipGetState(sipTransferObj); -+%End -+ -+}; -+ - - /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index e07f0441e2..c7a08cafa3 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -431,40 +431,26 @@ (define-public poppler-qt5 (define-public python-poppler-qt5 (package (name "python-poppler-qt5") - (version "21.1.0") + (version "21.3.0") (source - (origin - (method url-fetch) - (uri (pypi-uri "python-poppler-qt5" version)) - (sha256 - (base32 - "0b82gm4i75q5v19kfbq0h4y0b2vcwr2213zkhxh6l0h45kdndmxd")) - (patches (search-patches "python-poppler-qt5-fix-build.patch")))) - (build-system python-build-system) + (origin + (method url-fetch) + (uri (pypi-uri "python-poppler-qt5" version)) + (sha256 + (base32 "1q3gvmsmsq3llf9mcbhlkryrgprqrw2z7wmnvagy180f3y2fhxxl")))) + (build-system pyproject-build-system) (arguments - `(;; There are no tests. The check phase just causes a rebuild. - #:tests? #f - #:phases - (modify-phases %standard-phases - (replace 'build - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "setup.py" - ;; This check always fails, so disable it. - (("if not check_qtxml\\(\\)") - "if True")) - ;; We need to pass an extra flag here. This cannot be in - ;; configure-flags because it should not be passed for the - ;; installation phase. - ((@@ (guix build python-build-system) call-setuppy) - "build_ext" (list (string-append "--pyqt-sip-dir=" - (assoc-ref inputs "python-pyqt") - "/share/sip")) #t)))))) - (native-inputs - (list pkg-config)) - (inputs - (list python-sip-4 python-pyqt poppler-qt5 qtbase-5)) - (home-page "https://pypi.org/project/python-poppler-qt5/") - (synopsis "Python bindings for Poppler-Qt5") + `(;; The sipbuild.api backend builder expects a Python dictionary as per + + ;; https://peps.python.org/pep-0517/#config-settings, but we + ;; give it lists and it fails. The next line is a workaround. + #:configure-flags '#nil + #:tests? #f)) + (native-inputs (list pkg-config)) + (inputs (list python-sip python-pyqt-builder python-pyqt poppler-qt5 + qtbase-5)) + (home-page "https://github.com/frescobaldi/python-poppler-qt5") + (synopsis "Python binding to Poppler-Qt5") (description "This package provides Python bindings for the Qt5 interface of the Poppler PDF rendering library.")