GNU bug report logs - #72142
[PATCH] add python-rtmidi

Previous Next

Package: guix-patches;

Reported by: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>

Date: Tue, 16 Jul 2024 15:23:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 72142 AT debbugs.gnu.org.

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#72142; Package guix-patches. (Tue, 16 Jul 2024 15:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rick Huijzer <ikbenrickhuyzer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 16 Jul 2024 15:23:02 GMT) Full text and rfc822 format available.

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

From: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>
Subject: [PATCH] add python-rtmidi
Date: Tue, 16 Jul 2024 17:23:06 +0200
---
I've run guix lint and should be fine. I'm having a bit of a hard time with formatting so I will probaby have to recreate the perfect setup from the documentation.
Packaging python-rtmidi in an effort to bring a complete DMX workflow to guix.

 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4d7ddeb9d7..8f8cf4a1a8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24710,6 +24710,32 @@ (define-public python-sacn
      a network.")
     (license license:expat)))
 
+(define-public python-rtmidi
+  (package
+    (name "python-rtmidi")
+    (version "1.5.8")
+    (source 
+      (origin
+       (method url-fetch)
+       (uri (pypi-uri "python_rtmidi" version))
+       (sha256
+        (base32 "1yh4s124awzwhfg49m8s6qsa58qxabljlmnb1q00kbk8n1ldx6kz"))))
+    (build-system meson-build-system)
+    (inputs
+      (list glibc
+            python-cffi
+            jack-2
+            boost
+            rtmidi))
+    (native-inputs (list python python-pytest pkg-config python-setuptools))
+    (home-page "https://pypi.org/project/python-rtmidi/")
+    (synopsis "Python bindings for RtMidi")
+    (description
+    "Python-rtmidi is a Python binding for RtMidi, a set of C++ classes that provides
+    a common API for real-time MIDI input/output across Linux (ALSA & JACK), macOS,
+    and Windows (Multimedia Library).")
+    (license license:expat)))
+
 (define-public python-bagit
   (package
     (name "python-bagit")

base-commit: 3c58b759a51072aabd7eaaca680674a0c2b36c23
-- 
2.45.2





Information forwarded to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, tanguy <at> bioneland.org, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#72142; Package guix-patches. (Thu, 18 Jul 2024 15:14:02 GMT) Full text and rfc822 format available.

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

From: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>
To: 72142 <at> debbugs.gnu.org
Cc: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>
Subject: [PATCH v1] Fix formatting, boost not needed in python-rtmidi
Date: Thu, 18 Jul 2024 17:10:31 +0200
Change-Id: I96127532b959bec2995180d8c0838595c0943a62
---
Sorry; this is a fixed patch. Still trying to use pytest, but haven't found a nice way to add the add-installed-pythonpath logic, which is not present in the meson-build system
 gnu/packages/python-xyz.scm | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4ac585c8d9..a46d36790b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24765,24 +24765,19 @@ (define-public python-rtmidi
   (package
     (name "python-rtmidi")
     (version "1.5.8")
-    (source 
-      (origin
+    (source
+     (origin
        (method url-fetch)
        (uri (pypi-uri "python_rtmidi" version))
        (sha256
         (base32 "1yh4s124awzwhfg49m8s6qsa58qxabljlmnb1q00kbk8n1ldx6kz"))))
     (build-system meson-build-system)
-    (inputs
-      (list glibc
-            python-cffi
-            jack-2
-            boost
-            rtmidi))
+    (inputs (list glibc python-cffi jack-2 rtmidi))
     (native-inputs (list python python-pytest pkg-config python-setuptools))
     (home-page "https://pypi.org/project/python-rtmidi/")
     (synopsis "Python bindings for RtMidi")
     (description
-    "Python-rtmidi is a Python binding for RtMidi, a set of C++ classes that provides
+     "Python-rtmidi is a Python binding for RtMidi, a set of C++ classes that provides
     a common API for real-time MIDI input/output across Linux (ALSA & JACK), macOS,
     and Windows (Multimedia Library).")
     (license license:expat)))

base-commit: c3cdb2b4057a2c2e8e7be1e320784431f0f671ae
prerequisite-patch-id: f1cc8a724ee8010966de580066164220f481deff
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72142; Package guix-patches. (Thu, 18 Jul 2024 16:40:01 GMT) Full text and rfc822 format available.

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

From: "jgart" <jgart <at> dismail.de>
To: "Rick Huijzer" <ikbenrickhuyzer <at> gmail.com>, 72142 <at> debbugs.gnu.org
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 Rick Huijzer <ikbenrickhuyzer <at> gmail.com>,
 Munyoki Kilyungi <me <at> bonfacemunyoki.com>, Lars-Dominik Braun <lars <at> 6xq.net>,
 Marius Bakke <marius <at> gnu.org>, Tanguy Le Carrour <tanguy <at> bioneland.org>
Subject: Re: [bug#72142] [PATCH v1] Fix formatting, boost not needed in
 python-rtmidi
Date: Thu, 18 Jul 2024 16:38:54 +0000
> + (inputs (list glibc python-cffi jack-2 rtmidi))

Hi, since this is a Python library, do we want to make the Python inputs propagated?

Were you able to test in a shell that the following works fine when run from a script or repl?

If not, can you test that and report back on the results. I'll give it a try after.

Or, how have you gone about testing that this package works in a Guix environment with all the system audio requirements?


```python
import time
import rtmidi

midiout = rtmidi.MidiOut()
available_ports = midiout.get_ports()

if available_ports:
    midiout.open_port(0)
else:
    midiout.open_virtual_port("My virtual output")

with midiout:
    note_on = [0x90, 60, 112] # channel 1, middle C, velocity 112
    note_off = [0x80, 60, 0]
    midiout.send_message(note_on)
    time.sleep(0.5)
    midiout.send_message(note_off)
    time.sleep(0.1)

del midiout
```

all best,

jgart




Information forwarded to guix-patches <at> gnu.org:
bug#72142; Package guix-patches. (Thu, 18 Jul 2024 20:56:01 GMT) Full text and rfc822 format available.

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

From: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>
To: 72142 <at> debbugs.gnu.org
Subject: [PATCH] add python-rtmidi
Date: Thu, 18 Jul 2024 22:54:36 +0200
[Message part 1 (text/plain, inline)]
Hi,

I will look into the propagated inputs question. Indeed looking at the
documentation python does not belong there.

Your example works at a foreign distro using guix (Fedora) with jack, which
is where I've tested the declaration. On Guix system it seems to work when
using the PipeWire Home Service, but I can't get it to work with the
standalone jack2 just yet.  So that's something I've got to look into as
well.

It wasn't my intention to submit a poorly working patch, sorry. Somewhere
next week probably I will compose a new patch revision.

-- 
Kind regards,

Rick Huijzer
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#72142; Package guix-patches. (Tue, 06 Aug 2024 13:28:02 GMT) Full text and rfc822 format available.

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

From: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>
To: 72142 <at> debbugs.gnu.org
Subject: [PATCH] add python-rtmidi
Date: Tue, 6 Aug 2024 15:28:14 +0200
[Message part 1 (text/plain, inline)]
Hi,

I've installed guix-system and did some further testing:

The package seems to work just fine when properly installing jack2,
pipewire (pw-jack) or jack on guix-system (and Fedora). It's possible to
put jack (v1) in the propagated inputs, but that's not that elegant I
suppose. Furthermore all the audio packages I could find in guix include
jack in the same way, at build time and not as a propagated input.

I cannot test this with actual midi hardware, only with the
midiout.open_virtual_port method. But for my use case (using the OLA
suite), the library works fine, even when using real DMX controller
hardware.

So after testing and configuring my system properly, I have found no reason
for a revised patch. If you or someone else wants to take a look at this
patch, please do.

Thanks.

-- 
Kind regards,

Rick Huijzer
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#72142; Package guix-patches. (Mon, 02 Sep 2024 20:11:02 GMT) Full text and rfc822 format available.

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

From: Rick Huijzer <ikbenrickhuyzer <at> gmail.com>
To: 72142 <at> debbugs.gnu.org
Subject: [PATCH] add python-rtmidi
Date: Mon, 2 Sep 2024 22:07:00 +0200
[Message part 1 (text/plain, inline)]
Hi,

Could someone have a look at this? It builds and works. Feedback is much
appreciated.

-- 
Met vriendelijke groet,

Rick Huijzer
[Message part 2 (text/html, inline)]

This bug report was last modified 45 days ago.

Previous Next


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