Subject: [bug#68181] [PATCH v2] gnu: extempore: Add rtmidi@4 to package inputs.

From: Giacomo Leidi <[email-masked]>
Date: Mon, 21 Oct 2024 00:52:24 +0200

Some extempore code (libs/contrib/rtmidi.xtm specifically) depend on
rtmidi, this patch adds it to package inputs and hardcodes the soname
path.

* gnu/packages/music.scm (extempore)[inputs]: Add rtmidi-4.0;
[arguments]<hardcode-contrib-lib-paths>: new phase.

Change-Id: I16e055a68d48c813fb54dd55f686be102a0850af
---
 gnu/packages/music.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 9c1a617ca1..102f3143f4 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1212,6 +1212,12 @@ (define-public extempore
                 ("gl/glcore-directbind"   "libGL.so" "mesa")
                 ("gl/glcompat-directbind" "libGL.so" "mesa")))
              #t))
+         (add-after 'hardcode-external-lib-paths 'hardcode-contrib-lib-paths
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "libs/contrib/rtmidi.xtm"
+                  (("librtmidic.so")
+                   (string-append (assoc-ref inputs "rtmidi")
+                                  "/lib/librtmidi.so")))))
          (add-after 'unpack 'use-own-llvm
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "EXT_LLVM_DIR" (assoc-ref inputs "llvm"))
@@ -1264,6 +1270,7 @@ (define-public extempore
        ("libffi" ,libffi)
        ("jack" ,jack-1)
        ("libsndfile" ,libsndfile)
+       ("rtmidi" ,rtmidi-4.0)
        ("glfw" ,glfw)
        ("apr" ,apr)
        ("stb-image"

base-commit: 5ab3c4c1e43ebb637551223791db0ea3519986e1
-- 
2.46.0