GNU bug report logs - #68052
[PATCH 0/4] Collected patches fixing builds of various Frescobaldi dependencies

Previous Next

Package: guix-patches;

Reported by: Marco Rimoldi <rimarko <at> libero.it>

Date: Tue, 26 Dec 2023 22:11:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68052 in the body.
You can then email your comments to 68052 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 26 Dec 2023 22:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marco Rimoldi <rimarko <at> libero.it>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 26 Dec 2023 22:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Marco Rimoldi <rimarko <at> libero.it>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/4] Collected patches fixing builds of various Frescobaldi
 dependencies
Date: Tue, 26 Dec 2023 23:10:42 +0100
I resubmit here the patches I've sent separately in the last couple of days, for your convenience. My apologies.

* Fixed builds for python-poppler-qt5, python-pyportmidi, frescobaldi.
* Added up-to-date variant definition for portmidi.

Marco Rimoldi (4):
  gnu: python-poppler-qt5: update to 21.3.0
  gnu : python-poppler-qt5: Remove no longer needed patch
  gnu: python-pyportmidi: Update to latest git revision, fixing build
    fail.
  gnu: portmidi: Add variant portmidi-2 updated to release 2.0.4

 gnu/packages/music.scm                        |  73 +++++++----
 .../python-poppler-qt5-fix-build.patch        | 116 ------------------
 gnu/packages/pdf.scm                          |  37 ++----
 3 files changed, 62 insertions(+), 164 deletions(-)
 delete mode 100644 gnu/packages/patches/python-poppler-qt5-fix-build.patch


base-commit: 103dc351111d7aff82b7b7883f79084faaa54abc
-- 
2.41.0




Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 26 Dec 2023 22:15:01 GMT) Full text and rfc822 format available.

Message #8 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Marco Rimoldi <rimarko <at> libero.it>
To: 68052 <at> debbugs.gnu.org
Subject: [PATCH 1/4] gnu: python-poppler-qt5: update to 21.3.0
Date: Tue, 26 Dec 2023 23:14:08 +0100
* gnu/packages/pdf.scm (python-poppler-qt5): Update tp 21.3.0
[build-system]: Change to pyproject, fix previous build failure.

Change-Id: I30d6e2a3180505091d8072ed452211b0bb3a0178
---
 gnu/packages/pdf.scm | 37 +++++++++++++------------------------
 1 file changed, 13 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 644a4617a6..787f5a2a6f 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -415,40 +415,29 @@ (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)
+          "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))))))
+     `(
+       ;; The 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
+       #:build-backend "sipbuild.api"
+       #:tests? #f))
     (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")
+     (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.")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 26 Dec 2023 22:15:02 GMT) Full text and rfc822 format available.

Message #11 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Marco Rimoldi <rimarko <at> libero.it>
To: 68052 <at> debbugs.gnu.org
Subject: [PATCH 2/4] gnu : python-poppler-qt5: Remove no longer needed patch
Date: Tue, 26 Dec 2023 23:14:41 +0100
Change-Id: Ie5f6039dcfd8e6d1315e969dc12dafb158a8cc10
---
 .../python-poppler-qt5-fix-build.patch        | 116 ------------------
 1 file changed, 116 deletions(-)
 delete mode 100644 gnu/packages/patches/python-poppler-qt5-fix-build.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 <code <at> bnavigator.de>
-Date: Thu, 4 Mar 2021 17:02:51 +0100
-Subject: [PATCH] map type QVector< QPair<TYPE, TYPE> > 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 <TYPE>
- };
- 
- 
-+/**
-+ * Convert QVector< QPair<TYPE, TYPE> >
-+ * from and to a Python list of a 2-item tuple
-+ */
-+
-+template<TYPE>
-+%MappedType QVector< QPair<TYPE, TYPE> >
-+{
-+%TypeHeaderCode
-+#include <qvector.h>
-+#include <qpair.h>
-+%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<TYPE, TYPE>* p = new QPair<TYPE, TYPE>(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<TYPE, TYPE>");
-+
-+  // 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<TYPE, TYPE> > *qv = new QVector< QPair<TYPE, TYPE> >;
-+
-+  for (int i = 0; i < PySequence_Size(sipPy); ++i)
-+  {
-+    int state;
-+    QPair<TYPE, TYPE> * p = reinterpret_cast< QPair<TYPE, TYPE> * >(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; */
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 26 Dec 2023 22:17:01 GMT) Full text and rfc822 format available.

Message #14 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Marco Rimoldi <rimarko <at> libero.it>
To: 68052 <at> debbugs.gnu.org
Subject: [PATCH 3/4] gnu: python-pyportmidi: Update to latest git revision,
 fixing build fail.
Date: Tue, 26 Dec 2023 23:15:54 +0100
Change-Id: Ibe02edca39731f3f3c9001818665d2da97df9465
---
 gnu/packages/music.scm | 52 ++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 77e952d383..6f1736a276 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3048,36 +3048,28 @@ (define-public portmidi
     (license license:expat)))
 
 (define-public python-pyportmidi
-  (package
-    (name "python-pyportmidi")
-    (version (package-version portmidi))
-    (source (package-source portmidi))
-    (build-system python-build-system)
-    (arguments
-     `(#:tests? #f ; no tests included
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'enter-dir
-           (lambda _ (chdir "pm_python") #t))
-         (add-after 'enter-dir 'fix-setup.py
-           (lambda _
-             (substitute* "setup.py"
-               ;; Use Python 3 syntax
-               (("print (\".*\")" _ text)
-                (string-append "print(" text ")\n"))
-               ;; TODO.txt and CHANGES.txt don't exist
-               (("CHANGES =.*") "CHANGES = \"\"\n")
-               (("TODO =.*") "TODO = \"\"\n"))
-             #t)))))
-    (inputs
-     (list portmidi alsa-lib))
-    (native-inputs
-     (list python-cython unzip))
-    (home-page "https://portmedia.sourceforge.net/portmidi/")
-    (synopsis "Python bindings to PortMidi")
-    (description
-     "This package provides Python bindings to the PortMidi library.")
-    (license license:expat)))
+  (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
+        (revision "0"))
+    (package
+      (name "python-pyportmidi")
+      (version (git-version "0.0.7" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/PortMidi/pm_python.git")
+                      (commit commit)))
+                (sha256 (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
+                (file-name (git-file-name name version))))
+      (build-system python-build-system)
+      (inputs
+        (list portmidi alsa-lib))
+      (native-inputs
+        (list python-cython))
+      (home-page "https://github.com/PortMidi")
+      (synopsis "Python bindings to PortMidi")
+      (description
+        "This package provides Python bindings to the PortMidi library.")
+      (license license:expat))))
 
 (define-public frescobaldi
   (package
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 26 Dec 2023 22:17:02 GMT) Full text and rfc822 format available.

Message #17 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Marco Rimoldi <rimarko <at> libero.it>
To: 68052 <at> debbugs.gnu.org
Subject: [PATCH 4/4] gnu: portmidi: Add variant portmidi-2 updated to
 release 2.0.4
Date: Tue, 26 Dec 2023 23:16:09 +0100
Tested with package Frescobaldi. Other packages dependent on the old 217 version still need to be tested and updated so that it can be phased out.

Change-Id: I2530d206e19e885082a95f1aac65348e7a51d4ca
---
 gnu/packages/music.scm | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 6f1736a276..c485bf1620 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3047,6 +3047,39 @@ (define-public portmidi
 using a system-independent interface.")
     (license license:expat)))
 
+(define-public portmidi-2
+  (package
+    (name "portmidi")
+    (version "2.0.4")
+    (source (origin
+	      (method url-fetch)
+	      (uri (string-append
+		    "https://github.com/PortMidi/portmidi/archive/refs/tags/v"
+		    version ".zip"))
+	      (sha256
+	       (base32
+		"00xdlxd470zpbvvjb8km516y3mbpkv3487y1irn0qs1d38b18mys"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f              ; tests are interactive and can be found in the
+       #:configure-flags        ; pm_tests/ directory of the build tree
+       (list "-DBUILD_PORTMIDI_TESTS=On")
+       #:phases
+       (modify-phases %standard-phases
+	 (add-after 'unpack 'fix-version
+	   (lambda _ (substitute* "CMakeLists.txt"
+                       (("2.0.3") (version))))))))
+    (inputs
+     (list alsa-lib))
+    (native-inputs
+     (list unzip))
+    (home-page "https://github.com/PortMidi/")
+    (synopsis "Library for MIDI I/O")
+    (description
+     "PortMidi is a library supporting real-time input and output of MIDI data
+using a system-independent interface.")
+    (license license:expat)))
+
 (define-public python-pyportmidi
   (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
         (revision "0"))
@@ -3062,7 +3095,7 @@ (define-public python-pyportmidi
                 (file-name (git-file-name name version))))
       (build-system python-build-system)
       (inputs
-        (list portmidi alsa-lib))
+        (list portmidi-2 alsa-lib))
       (native-inputs
         (list python-cython))
       (home-page "https://github.com/PortMidi")
@@ -3098,7 +3131,7 @@ (define-public frescobaldi
     (inputs
      (list lilypond
            poppler
-           portmidi
+           portmidi-2
            python-ly
            python-poppler-qt5
            python-pyportmidi
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Thu, 04 Jan 2024 18:02:02 GMT) Full text and rfc822 format available.

Message #20 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Marco Rimoldi <rimarko <at> libero.it>
Cc: 68052 <at> debbugs.gnu.org
Subject: Re: [bug#68052] [PATCH 1/4] gnu: python-poppler-qt5: update to 21.3.0
Date: Thu, 04 Jan 2024 13:00:52 -0500
Hello,

Marco Rimoldi <rimarko <at> libero.it> writes:

> * gnu/packages/pdf.scm (python-poppler-qt5): Update tp 21.3.0

Please end complete sentences by a final period (also in the commit
summary).

> [build-system]: Change to pyproject, fix previous build failure.

The changelog should ideally detail each change, such as specifying the
'sipbuild.api' backend.

> Change-Id: I30d6e2a3180505091d8072ed452211b0bb3a0178
> ---
>  gnu/packages/pdf.scm | 37 +++++++++++++------------------------
>  1 file changed, 13 insertions(+), 24 deletions(-)
>
> diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
> index 644a4617a6..787f5a2a6f 100644
> --- a/gnu/packages/pdf.scm
> +++ b/gnu/packages/pdf.scm
> @@ -415,40 +415,29 @@ (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"))))

Patches are also registered in the build system in gnu/local.mk, and
need to be de-registered there.

> -    (build-system python-build-system)
> +          "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))))))
> +     `(
> +       ;; The 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.

Please use double space after period (that's an Emacs/Texinfo/Scheme
convention that allows navigating between sentences in Emacs).

> +       #:configure-flags '#nil
> +       #:build-backend "sipbuild.api"
> +       #:tests? #f))
>      (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")
> +     (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.")

The rest LGTM.

-- 
Thanks,
Maxim




Added tag(s) moreinfo. Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 04 Jan 2024 18:02:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Thu, 04 Jan 2024 18:03:02 GMT) Full text and rfc822 format available.

Message #25 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Marco Rimoldi <rimarko <at> libero.it>
Cc: 68052 <at> debbugs.gnu.org
Subject: Re: [bug#68052] [PATCH 2/4] gnu : python-poppler-qt5: Remove no
 longer needed patch
Date: Thu, 04 Jan 2024 13:02:19 -0500
Hi,

Marco Rimoldi <rimarko <at> libero.it> writes:

Missing GNU changelog message, e.g.:

--8<---------------cut here---------------start------------->8---
* gnu/packages/patches/python-poppler-qt5-fix-build.patch: Delete file.
--8<---------------cut here---------------end--------------->8---

This change should be squashed in the previous commit, as they belong
together.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Thu, 04 Jan 2024 18:06:02 GMT) Full text and rfc822 format available.

Message #28 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Marco Rimoldi <rimarko <at> libero.it>
Cc: 68052 <at> debbugs.gnu.org
Subject: Re: [bug#68052] [PATCH 3/4] gnu: python-pyportmidi: Update to
 latest git revision, fixing build fail.
Date: Thu, 04 Jan 2024 13:04:48 -0500
Hello,

Marco Rimoldi <rimarko <at> libero.it> writes:

Please write GNU ChangeLog commit messages, as mentioned in info '(guix)
Submitting Patches'.  This makes it easy to review the changes and match
if the actual changes match the author's intent.

> Change-Id: Ibe02edca39731f3f3c9001818665d2da97df9465
> ---
>  gnu/packages/music.scm | 52 ++++++++++++++++++------------------------
>  1 file changed, 22 insertions(+), 30 deletions(-)
>
> diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
> index 77e952d383..6f1736a276 100644
> --- a/gnu/packages/music.scm
> +++ b/gnu/packages/music.scm
> @@ -3048,36 +3048,28 @@ (define-public portmidi
>      (license license:expat)))
>  
>  (define-public python-pyportmidi
> -  (package
> -    (name "python-pyportmidi")
> -    (version (package-version portmidi))
> -    (source (package-source portmidi))
> -    (build-system python-build-system)
> -    (arguments
> -     `(#:tests? #f ; no tests included
> -       #:phases
> -       (modify-phases %standard-phases
> -         (add-after 'unpack 'enter-dir
> -           (lambda _ (chdir "pm_python") #t))
> -         (add-after 'enter-dir 'fix-setup.py
> -           (lambda _
> -             (substitute* "setup.py"
> -               ;; Use Python 3 syntax
> -               (("print (\".*\")" _ text)
> -                (string-append "print(" text ")\n"))
> -               ;; TODO.txt and CHANGES.txt don't exist
> -               (("CHANGES =.*") "CHANGES = \"\"\n")
> -               (("TODO =.*") "TODO = \"\"\n"))
> -             #t)))))
> -    (inputs
> -     (list portmidi alsa-lib))
> -    (native-inputs
> -     (list python-cython unzip))
> -    (home-page "https://portmedia.sourceforge.net/portmidi/")
> -    (synopsis "Python bindings to PortMidi")
> -    (description
> -     "This package provides Python bindings to the PortMidi library.")
> -    (license license:expat)))
> +  (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
> +        (revision "0"))
> +    (package
> +      (name "python-pyportmidi")
> +      (version (git-version "0.0.7" revision commit))
> +      (source (origin
> +                (method git-fetch)
> +                (uri (git-reference
> +                      (url "https://github.com/PortMidi/pm_python.git")
> +                      (commit commit)))
> +                (sha256 (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
> +                (file-name (git-file-name name version))))
> +      (build-system python-build-system)
> +      (inputs
> +        (list portmidi alsa-lib))
> +      (native-inputs
> +        (list python-cython))
> +      (home-page "https://github.com/PortMidi")
> +      (synopsis "Python bindings to PortMidi")
> +      (description
> +        "This package provides Python bindings to the PortMidi library.")
> +      (license license:expat))))

Otherwise LGTM.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Thu, 04 Jan 2024 18:07:02 GMT) Full text and rfc822 format available.

Message #31 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Marco Rimoldi <rimarko <at> libero.it>
Cc: 68052 <at> debbugs.gnu.org
Subject: Re: [bug#68052] [PATCH 3/4] gnu: python-pyportmidi: Update to
 latest git revision, fixing build fail.
Date: Thu, 04 Jan 2024 13:06:02 -0500
Hi again,

Marco Rimoldi <rimarko <at> libero.it> writes:

[...]

> +  (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
> +        (revision "0"))

Actually, why do we need this latest git version?  A explanatory comment
is needed in these case, as we normally ship stable/tagged releases.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Thu, 04 Jan 2024 18:09:01 GMT) Full text and rfc822 format available.

Message #34 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Marco Rimoldi <rimarko <at> libero.it>
Cc: 68052 <at> debbugs.gnu.org
Subject: Re: [bug#68052] [PATCH 4/4] gnu: portmidi: Add variant portmidi-2
 updated to release 2.0.4
Date: Thu, 04 Jan 2024 13:07:52 -0500
Hello Marco,

Marco Rimoldi <rimarko <at> libero.it> writes:

> Tested with package Frescobaldi. Other packages dependent on the old
> 217 version still need to be tested and updated so that it can be
> phased out.

Thank you!

[...]

Here also, we'll want a GNU ChangeLog commit message, but otherwise,
LGTM.

Could you send a v2 taking care of my review comments, for this commit
and the earlier ones?

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 00:36:02 GMT) Full text and rfc822 format available.

Message #37 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v1 0/3] Collected patches fixing builds of various Frescobaldi
 dependencies
Date: Tue, 16 Jan 2024 01:34:11 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

I applied your suggestions as best as I could Maxim. Looking forward to refine these further if needed.

Thanks for your feedback!

Marco

Marco Rimoldi (3):
  gnu: python-poppler-qt5: Update to 21.3.0.
  gnu: python-pyportmidi: Update to first working git revision since
    project restarted development, fixing build.
  gnu: portmidi: Add variant portmidi-2 updated to release 2.0.4.

 gnu/local.mk                                  |   1 -
 gnu/packages/music.scm                        |  81 +++++++-----
 .../python-poppler-qt5-fix-build.patch        | 116 ------------------
 gnu/packages/pdf.scm                          |  50 +++-----
 4 files changed, 71 insertions(+), 177 deletions(-)
 delete mode 100644 gnu/packages/patches/python-poppler-qt5-fix-build.patch


base-commit: f6afaf58b0a0b04e5023141c8f56c204f9779e19
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 00:36:02 GMT) Full text and rfc822 format available.

Message #40 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v1 2/3] gnu: python-pyportmidi: Update to first working git
 revision since project restarted development, fixing build.
Date: Tue, 16 Jan 2024 01:34:13 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

When the PortMidi project moved to GitHub in 2021, changing version numbering scheme, the Python bindings were moved to a separate repository and marked as needing a new maintainer.  The chosen revision, dated June 2023, is the first to allow the package to build successfully in the temporary lack of an official new release.

* gnu/packages/music.scm (python-pyportmidi): Source moved, fix build.
[version]: Change to new scheme, jumping from 217 to 0.0.7.
[source]: Change origin from Sourceforge to GitHub.

Change-Id: Ibe02edca39731f3f3c9001818665d2da97df9465
---
 gnu/packages/music.scm | 52 ++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 77e952d383..28141c11a5 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3048,36 +3048,28 @@ (define-public portmidi
     (license license:expat)))
 
 (define-public python-pyportmidi
-  (package
-    (name "python-pyportmidi")
-    (version (package-version portmidi))
-    (source (package-source portmidi))
-    (build-system python-build-system)
-    (arguments
-     `(#:tests? #f ; no tests included
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'enter-dir
-           (lambda _ (chdir "pm_python") #t))
-         (add-after 'enter-dir 'fix-setup.py
-           (lambda _
-             (substitute* "setup.py"
-               ;; Use Python 3 syntax
-               (("print (\".*\")" _ text)
-                (string-append "print(" text ")\n"))
-               ;; TODO.txt and CHANGES.txt don't exist
-               (("CHANGES =.*") "CHANGES = \"\"\n")
-               (("TODO =.*") "TODO = \"\"\n"))
-             #t)))))
-    (inputs
-     (list portmidi alsa-lib))
-    (native-inputs
-     (list python-cython unzip))
-    (home-page "https://portmedia.sourceforge.net/portmidi/")
-    (synopsis "Python bindings to PortMidi")
-    (description
-     "This package provides Python bindings to the PortMidi library.")
-    (license license:expat)))
+  (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
+        (revision "0"))
+    (package
+      (name "python-pyportmidi")
+      (version (git-version "0.0.7" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/PortMidi/pm_python")
+               (commit commit)))
+         (sha256
+          (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
+         (file-name (git-file-name name version))))
+      (build-system python-build-system)
+      (inputs (list portmidi alsa-lib))
+      (native-inputs (list python-cython))
+      (home-page "https://github.com/PortMidi")
+      (synopsis "Python bindings to PortMidi")
+      (description
+       "This package provides Python bindings to the PortMidi library.")
+      (license license:expat))))
 
 (define-public frescobaldi
   (package
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 00:36:02 GMT) Full text and rfc822 format available.

Message #43 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v1 3/3] gnu: portmidi: Add variant portmidi-2 updated to
 release 2.0.4.
Date: Tue, 16 Jan 2024 01:34:14 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

Tested with package Frescobaldi.  Other packages dependent on the old 217 version still need to be tested and updated so that it can be phased out.

* gnu/packages/music.scm (portmidi): Add variant portmidi-2.
[version]: Change to new scheme, jumping from 217 to 2.0.4.
[source]: Change origin from Sourceforge to GitHub.
* gnu/packages/music.scm (python-pyportmidi) [inputs]: Change portmidi to portmidi-2.
* gnu/packages/music.scm (python-pyportmidi) [inputs]: Change portmidi to portmidi-2.

Change-Id: I2530d206e19e885082a95f1aac65348e7a51d4ca
---
 gnu/packages/music.scm | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 28141c11a5..2d7d3fdd0a 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3047,6 +3047,39 @@ (define-public portmidi
 using a system-independent interface.")
     (license license:expat)))
 
+(define-public portmidi-2
+  (package
+    (name "portmidi")
+    (version "2.0.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/PortMidi/portmidi")
+             (commit "b808babecdc5d05205467dab5c1006c5ac0fdfd4")))
+       (sha256
+        (base32 "05a3dfpgbpcg08p8a3acjrrd1qy5hvvray2kz2asygy1vf3mx85s"))
+       (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f       ;Tests are interactive and can be found in the
+       #:configure-flags ;pm_tests/ directory of the build tree.
+       (list "-DBUILD_PORTMIDI_TESTS=On")
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'fix-version
+                    (lambda _
+                      (substitute* "CMakeLists.txt"
+                        (("2.0.3")
+                         (version))))))))
+    (inputs (list alsa-lib))
+    (native-inputs (list unzip))
+    (home-page "https://github.com/PortMidi/")
+    (synopsis "Library for MIDI I/O")
+    (description
+     "PortMidi is a library supporting real-time input and output of MIDI data
+using a system-independent interface.")
+    (license license:expat)))
+
 (define-public python-pyportmidi
   (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
         (revision "0"))
@@ -3063,7 +3096,7 @@ (define-public python-pyportmidi
           (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
          (file-name (git-file-name name version))))
       (build-system python-build-system)
-      (inputs (list portmidi alsa-lib))
+      (inputs (list portmidi-2 alsa-lib))
       (native-inputs (list python-cython))
       (home-page "https://github.com/PortMidi")
       (synopsis "Python bindings to PortMidi")
@@ -3098,7 +3131,7 @@ (define-public frescobaldi
     (inputs
      (list lilypond
            poppler
-           portmidi
+           portmidi-2
            python-ly
            python-poppler-qt5
            python-pyportmidi
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 00:36:03 GMT) Full text and rfc822 format available.

Message #46 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v1 1/3] gnu: python-poppler-qt5: Update to 21.3.0.
Date: Tue, 16 Jan 2024 01:34:12 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

* gnu/packages/pdf.scm (python-poppler-qt5): Update to 21.3.0.
[build-system]: Change to pyproject.
[inputs]: Change sip to sip-4.
* 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 <code <at> bnavigator.de>
-Date: Thu, 4 Mar 2021 17:02:51 +0100
-Subject: [PATCH] map type QVector< QPair<TYPE, TYPE> > 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 <TYPE>
- };
- 
- 
-+/**
-+ * Convert QVector< QPair<TYPE, TYPE> >
-+ * from and to a Python list of a 2-item tuple
-+ */
-+
-+template<TYPE>
-+%MappedType QVector< QPair<TYPE, TYPE> >
-+{
-+%TypeHeaderCode
-+#include <qvector.h>
-+#include <qpair.h>
-+%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<TYPE, TYPE>* p = new QPair<TYPE, TYPE>(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<TYPE, TYPE>");
-+
-+  // 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<TYPE, TYPE> > *qv = new QVector< QPair<TYPE, TYPE> >;
-+
-+  for (int i = 0; i < PySequence_Size(sipPy); ++i)
-+  {
-+    int state;
-+    QPair<TYPE, TYPE> * p = reinterpret_cast< QPair<TYPE, TYPE> * >(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.")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 17:44:02 GMT) Full text and rfc822 format available.

Message #49 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v2 0/3] Collected patches fixing builds of various Frescobaldi
 dependencies
Date: Tue, 16 Jan 2024 18:37:36 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

Just a correction to the commit description re: python-poppler-qt5. The python-sip-4 package was replaced with python-sip to allow build, not the other way around. 

Marco

Marco Rimoldi (3):
  gnu: python-poppler-qt5: Update to 21.3.0.
  gnu: python-pyportmidi: Update to first working git revision since
    project restarted development, fixing build.
  gnu: portmidi: Add variant portmidi-2 updated to release 2.0.4.

 gnu/local.mk                                  |   1 -
 gnu/packages/music.scm                        |  81 +++++++-----
 .../python-poppler-qt5-fix-build.patch        | 116 ------------------
 gnu/packages/pdf.scm                          |  50 +++-----
 4 files changed, 71 insertions(+), 177 deletions(-)
 delete mode 100644 gnu/packages/patches/python-poppler-qt5-fix-build.patch


base-commit: f6afaf58b0a0b04e5023141c8f56c204f9779e19
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 17:44:02 GMT) Full text and rfc822 format available.

Message #52 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v2 1/3] gnu: python-poppler-qt5: Update to 21.3.0.
Date: Tue, 16 Jan 2024 18:37:37 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

* 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 <code <at> bnavigator.de>
-Date: Thu, 4 Mar 2021 17:02:51 +0100
-Subject: [PATCH] map type QVector< QPair<TYPE, TYPE> > 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 <TYPE>
- };
- 
- 
-+/**
-+ * Convert QVector< QPair<TYPE, TYPE> >
-+ * from and to a Python list of a 2-item tuple
-+ */
-+
-+template<TYPE>
-+%MappedType QVector< QPair<TYPE, TYPE> >
-+{
-+%TypeHeaderCode
-+#include <qvector.h>
-+#include <qpair.h>
-+%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<TYPE, TYPE>* p = new QPair<TYPE, TYPE>(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<TYPE, TYPE>");
-+
-+  // 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<TYPE, TYPE> > *qv = new QVector< QPair<TYPE, TYPE> >;
-+
-+  for (int i = 0; i < PySequence_Size(sipPy); ++i)
-+  {
-+    int state;
-+    QPair<TYPE, TYPE> * p = reinterpret_cast< QPair<TYPE, TYPE> * >(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.")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 17:44:03 GMT) Full text and rfc822 format available.

Message #55 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v2 2/3] gnu: python-pyportmidi: Update to first working git
 revision since project restarted development, fixing build.
Date: Tue, 16 Jan 2024 18:37:38 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

When the PortMidi project moved to GitHub in 2021, changing version numbering scheme, the Python bindings were moved to a separate repository and marked as needing a new maintainer.  The chosen revision, dated June 2023, is the first to allow the package to build successfully in the temporary lack of an official new release.

* gnu/packages/music.scm (python-pyportmidi): Source moved, fix build.
[version]: Change to new scheme, jumping from 217 to 0.0.7.
[source]: Change origin from Sourceforge to GitHub.

Change-Id: Ibe02edca39731f3f3c9001818665d2da97df9465
---
 gnu/packages/music.scm | 52 ++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 77e952d383..28141c11a5 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3048,36 +3048,28 @@ (define-public portmidi
     (license license:expat)))
 
 (define-public python-pyportmidi
-  (package
-    (name "python-pyportmidi")
-    (version (package-version portmidi))
-    (source (package-source portmidi))
-    (build-system python-build-system)
-    (arguments
-     `(#:tests? #f ; no tests included
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'enter-dir
-           (lambda _ (chdir "pm_python") #t))
-         (add-after 'enter-dir 'fix-setup.py
-           (lambda _
-             (substitute* "setup.py"
-               ;; Use Python 3 syntax
-               (("print (\".*\")" _ text)
-                (string-append "print(" text ")\n"))
-               ;; TODO.txt and CHANGES.txt don't exist
-               (("CHANGES =.*") "CHANGES = \"\"\n")
-               (("TODO =.*") "TODO = \"\"\n"))
-             #t)))))
-    (inputs
-     (list portmidi alsa-lib))
-    (native-inputs
-     (list python-cython unzip))
-    (home-page "https://portmedia.sourceforge.net/portmidi/")
-    (synopsis "Python bindings to PortMidi")
-    (description
-     "This package provides Python bindings to the PortMidi library.")
-    (license license:expat)))
+  (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
+        (revision "0"))
+    (package
+      (name "python-pyportmidi")
+      (version (git-version "0.0.7" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/PortMidi/pm_python")
+               (commit commit)))
+         (sha256
+          (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
+         (file-name (git-file-name name version))))
+      (build-system python-build-system)
+      (inputs (list portmidi alsa-lib))
+      (native-inputs (list python-cython))
+      (home-page "https://github.com/PortMidi")
+      (synopsis "Python bindings to PortMidi")
+      (description
+       "This package provides Python bindings to the PortMidi library.")
+      (license license:expat))))
 
 (define-public frescobaldi
   (package
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Tue, 16 Jan 2024 17:44:03 GMT) Full text and rfc822 format available.

Message #58 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v2 3/3] gnu: portmidi: Add variant portmidi-2 updated to
 release 2.0.4.
Date: Tue, 16 Jan 2024 18:37:39 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

Tested with package Frescobaldi.  Other packages dependent on the old 217 version still need to be tested and updated so that it can be phased out.

* gnu/packages/music.scm (portmidi): Add variant portmidi-2.
[version]: Change to new scheme, jumping from 217 to 2.0.4.
[source]: Change origin from Sourceforge to GitHub.
* gnu/packages/music.scm (python-pyportmidi) [inputs]: Change portmidi to portmidi-2.
* gnu/packages/music.scm (python-pyportmidi) [inputs]: Change portmidi to portmidi-2.

Change-Id: I2530d206e19e885082a95f1aac65348e7a51d4ca
---
 gnu/packages/music.scm | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 28141c11a5..2d7d3fdd0a 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3047,6 +3047,39 @@ (define-public portmidi
 using a system-independent interface.")
     (license license:expat)))
 
+(define-public portmidi-2
+  (package
+    (name "portmidi")
+    (version "2.0.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/PortMidi/portmidi")
+             (commit "b808babecdc5d05205467dab5c1006c5ac0fdfd4")))
+       (sha256
+        (base32 "05a3dfpgbpcg08p8a3acjrrd1qy5hvvray2kz2asygy1vf3mx85s"))
+       (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f       ;Tests are interactive and can be found in the
+       #:configure-flags ;pm_tests/ directory of the build tree.
+       (list "-DBUILD_PORTMIDI_TESTS=On")
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'fix-version
+                    (lambda _
+                      (substitute* "CMakeLists.txt"
+                        (("2.0.3")
+                         (version))))))))
+    (inputs (list alsa-lib))
+    (native-inputs (list unzip))
+    (home-page "https://github.com/PortMidi/")
+    (synopsis "Library for MIDI I/O")
+    (description
+     "PortMidi is a library supporting real-time input and output of MIDI data
+using a system-independent interface.")
+    (license license:expat)))
+
 (define-public python-pyportmidi
   (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
         (revision "0"))
@@ -3063,7 +3096,7 @@ (define-public python-pyportmidi
           (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
          (file-name (git-file-name name version))))
       (build-system python-build-system)
-      (inputs (list portmidi alsa-lib))
+      (inputs (list portmidi-2 alsa-lib))
       (native-inputs (list python-cython))
       (home-page "https://github.com/PortMidi")
       (synopsis "Python bindings to PortMidi")
@@ -3098,7 +3131,7 @@ (define-public frescobaldi
     (inputs
      (list lilypond
            poppler
-           portmidi
+           portmidi-2
            python-ly
            python-poppler-qt5
            python-pyportmidi
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Wed, 21 Feb 2024 19:32:02 GMT) Full text and rfc822 format available.

Message #61 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v3 2/4] gnu: python-pyportmidi: Update to first working git
 revision since project restarted development, fixing build.
Date: Wed, 21 Feb 2024 20:30:33 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

When the PortMidi project moved to GitHub in 2021, changing version numbering scheme, the Python bindings were moved to a separate repository and marked as needing a new maintainer.  The chosen revision, dated June 2023, is the first to allow the package to build successfully in the temporary lack of an official new release.

* gnu/packages/music.scm (python-pyportmidi): Source moved, fix build.
[version]: Change to new scheme, jumping from 217 to 0.0.7.
[source]: Change origin from Sourceforge to GitHub.

Change-Id: Ibe02edca39731f3f3c9001818665d2da97df9465
---
 gnu/packages/music.scm | 52 ++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 6b218376b7..8926f93ac8 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3034,36 +3034,28 @@ (define-public portmidi
     (license license:expat)))
 
 (define-public python-pyportmidi
-  (package
-    (name "python-pyportmidi")
-    (version (package-version portmidi))
-    (source (package-source portmidi))
-    (build-system python-build-system)
-    (arguments
-     `(#:tests? #f ; no tests included
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'enter-dir
-           (lambda _ (chdir "pm_python") #t))
-         (add-after 'enter-dir 'fix-setup.py
-           (lambda _
-             (substitute* "setup.py"
-               ;; Use Python 3 syntax
-               (("print (\".*\")" _ text)
-                (string-append "print(" text ")\n"))
-               ;; TODO.txt and CHANGES.txt don't exist
-               (("CHANGES =.*") "CHANGES = \"\"\n")
-               (("TODO =.*") "TODO = \"\"\n"))
-             #t)))))
-    (inputs
-     (list portmidi alsa-lib))
-    (native-inputs
-     (list python-cython unzip))
-    (home-page "https://portmedia.sourceforge.net/portmidi/")
-    (synopsis "Python bindings to PortMidi")
-    (description
-     "This package provides Python bindings to the PortMidi library.")
-    (license license:expat)))
+  (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
+        (revision "0"))
+    (package
+      (name "python-pyportmidi")
+      (version (git-version "0.0.7" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/PortMidi/pm_python")
+               (commit commit)))
+         (sha256
+          (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
+         (file-name (git-file-name name version))))
+      (build-system python-build-system)
+      (inputs (list portmidi alsa-lib))
+      (native-inputs (list python-cython))
+      (home-page "https://github.com/PortMidi")
+      (synopsis "Python bindings to PortMidi")
+      (description
+       "This package provides Python bindings to the PortMidi library.")
+      (license license:expat))))
 
 (define-public frescobaldi
   (package
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Wed, 21 Feb 2024 19:32:02 GMT) Full text and rfc822 format available.

Message #64 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v3 4/4] gnu: frescobaldi: Make it display icons with qtsvg-5.
Date: Wed, 21 Feb 2024 20:30:35 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

* gnu/packages/music.scm (frescobaldi)
[origin] <uri> Updated to avoid automatic redirect.
[arguments] <phases> Add 'wrap-executable to export QT_PLUGIN_PATH.
[inputs] Add qtsvg-5, bash-minimal.

Change-Id: I55b3c56d41bd60e4ba4c938109ff41631e211ad2
---
 gnu/packages/music.scm | 47 ++++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index a0be16a44e..63d545e68b 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3098,32 +3098,39 @@ (define-public frescobaldi
      (origin
        (method url-fetch)
        (uri (string-append
-             "https://github.com/wbsoft/frescobaldi/releases/download/v"
+             "https://github.com/frescobaldi/frescobaldi/releases/download/v"
              version "/frescobaldi-" version ".tar.gz"))
        (sha256
         (base32 "1n60gfnf6x0l1bac088g9adzx0lskbl9knd4y1ynr3y0zcs0kfcz"))))
     (build-system python-build-system)
     (arguments
      (list
-      #:tests? #f                       ;no tests included
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-before 'build 'generate-translations
-            (lambda _
-              (invoke "make" "-C" "i18n")))
-          (add-before 'build 'generate-metadata
-            (lambda _
-              (invoke "make" "-C" "linux"))))))
-    (inputs
-     (list lilypond
-           poppler
-           portmidi-2
-           python-ly
-           python-poppler-qt5
-           python-pyportmidi
-           python-pyqt
-           python-sip
-           qpageview))
+      #:tests? #f ;no tests included
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'build 'generate-translations
+                     (lambda _
+                       (invoke "make" "-C" "i18n")))
+                   (add-before 'build 'generate-metadata
+                     (lambda _
+                       (invoke "make" "-C" "linux")))
+                   (add-after 'install 'wrap-executable
+                     (lambda _
+                       ;; Ensure that icons are found at runtime.
+                       (wrap-program (string-append #$output
+                                                    "/bin/frescobaldi")
+                         `("QT_PLUGIN_PATH" prefix
+                           ,(list (getenv "QT_PLUGIN_PATH")))))))))
+    (inputs (list bash-minimal
+                  lilypond
+                  poppler
+                  portmidi-2
+                  python-ly
+                  python-poppler-qt5
+                  python-pyportmidi
+                  python-pyqt
+                  python-sip
+                  qpageview
+                  qtsvg-5))
     (home-page "https://www.frescobaldi.org/")
     (synopsis "LilyPond sheet music text editor")
     (description
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Wed, 21 Feb 2024 19:33:02 GMT) Full text and rfc822 format available.

Message #67 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v3 3/4] gnu: portmidi: Add variant portmidi-2 updated to
 release 2.0.4.
Date: Wed, 21 Feb 2024 20:30:34 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

Tested with package Frescobaldi.  Other packages dependent on the old 217 version still need to be tested and updated so that it can be phased out.

* gnu/packages/music.scm (portmidi): Add variant portmidi-2.
[version]: Change to new scheme, jumping from 217 to 2.0.4.
[source]: Change origin from Sourceforge to GitHub.
* gnu/packages/music.scm (python-pyportmidi) [inputs]: Change portmidi to portmidi-2.
* gnu/packages/music.scm (frescobaldi) [inputs]: Change portmidi to portmidi-2.

Change-Id: I2530d206e19e885082a95f1aac65348e7a51d4ca
---
 gnu/packages/music.scm | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 8926f93ac8..a0be16a44e 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3033,6 +3033,39 @@ (define-public portmidi
 using a system-independent interface.")
     (license license:expat)))
 
+(define-public portmidi-2
+  (package
+    (name "portmidi")
+    (version "2.0.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/PortMidi/portmidi")
+             (commit "b808babecdc5d05205467dab5c1006c5ac0fdfd4")))
+       (sha256
+        (base32 "05a3dfpgbpcg08p8a3acjrrd1qy5hvvray2kz2asygy1vf3mx85s"))
+       (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f       ;Tests are interactive and can be found in the
+       #:configure-flags ;pm_tests/ directory of the build tree.
+       (list "-DBUILD_PORTMIDI_TESTS=On")
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'fix-version
+                    (lambda _
+                      (substitute* "CMakeLists.txt"
+                        (("2.0.3")
+                         (version))))))))
+    (inputs (list alsa-lib))
+    (native-inputs (list unzip))
+    (home-page "https://github.com/PortMidi/")
+    (synopsis "Library for MIDI I/O")
+    (description
+     "PortMidi is a library supporting real-time input and output of MIDI data
+using a system-independent interface.")
+    (license license:expat)))
+
 (define-public python-pyportmidi
   (let ((commit "d9e5ee00b208b09618fa0d4a5bbce3c9c077b386")
         (revision "0"))
@@ -3049,7 +3082,7 @@ (define-public python-pyportmidi
           (base32 "1jvp9na8d1hw46w9ybhkimbavfb3ysw7hp30cbk6dj40k5y5vgvz"))
          (file-name (git-file-name name version))))
       (build-system python-build-system)
-      (inputs (list portmidi alsa-lib))
+      (inputs (list portmidi-2 alsa-lib))
       (native-inputs (list python-cython))
       (home-page "https://github.com/PortMidi")
       (synopsis "Python bindings to PortMidi")
@@ -3084,7 +3117,7 @@ (define-public frescobaldi
     (inputs
      (list lilypond
            poppler
-           portmidi
+           portmidi-2
            python-ly
            python-poppler-qt5
            python-pyportmidi
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Wed, 21 Feb 2024 20:11:01 GMT) Full text and rfc822 format available.

Message #70 received at 68052 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 68052 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH v3 1/4] gnu: python-poppler-qt5: Update to 21.3.0.
Date: Wed, 21 Feb 2024 20:30:32 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

* 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 c08b27f94d..631addcb29 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1800,7 +1800,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-pyls-black-41.patch		\
   %D%/packages/patches/python-pypdf-annotate-tests-appropriately.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 <code <at> bnavigator.de>
-Date: Thu, 4 Mar 2021 17:02:51 +0100
-Subject: [PATCH] map type QVector< QPair<TYPE, TYPE> > 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 <TYPE>
- };
- 
- 
-+/**
-+ * Convert QVector< QPair<TYPE, TYPE> >
-+ * from and to a Python list of a 2-item tuple
-+ */
-+
-+template<TYPE>
-+%MappedType QVector< QPair<TYPE, TYPE> >
-+{
-+%TypeHeaderCode
-+#include <qvector.h>
-+#include <qpair.h>
-+%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<TYPE, TYPE>* p = new QPair<TYPE, TYPE>(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<TYPE, TYPE>");
-+
-+  // 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<TYPE, TYPE> > *qv = new QVector< QPair<TYPE, TYPE> >;
-+
-+  for (int i = 0; i < PySequence_Size(sipPy); ++i)
-+  {
-+    int state;
-+    QPair<TYPE, TYPE> * p = reinterpret_cast< QPair<TYPE, TYPE> * >(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 0d796f65bb..9076407740 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.")

base-commit: fdbf4192f5eaa7fdb5e6e2e98ada0726c8104824
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68052; Package guix-patches. (Sat, 16 Mar 2024 10:15:01 GMT) Full text and rfc822 format available.

Message #73 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: rimarko <at> libero.it
Cc: 68052-done <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#68052] [PATCH v3 1/4] gnu: python-poppler-qt5: Update to
 21.3.0.
Date: Sat, 16 Mar 2024 10:12:58 +0000
[Message part 1 (text/plain, inline)]
Marco Rimoldi via Guix-patches via <guix-patches <at> gnu.org> writes:

> From: Marco Rimoldi <rimarko <at> libero.it>
>
> * 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

These patches look good to me, obviously hopefully the situation around
this software will improve but I've pushed this latest series to master
as 00bf07ecccee86da4ced281bd28948c96db284e6 (after tweaking a few of the
commit messages).

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Sat, 16 Mar 2024 10:15:02 GMT) Full text and rfc822 format available.

Notification sent to Marco Rimoldi <rimarko <at> libero.it>:
bug acknowledged by developer. (Sat, 16 Mar 2024 10:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 13 Apr 2024 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.