summary refs log tree commit diff
diff options
context:
space:
mode:
authorKei Kebreau <kkebreau@posteo.net>2020-12-09 14:34:43 -0500
committerKei Kebreau <kkebreau@posteo.net>2020-12-27 16:42:02 -0500
commit64af916d6f08ae5c59ee76c15fdd9cff343595a4 (patch)
tree812599e21fe60d608d163d3532bfd6735ec06f95
parent83afa4e9a6aa4dc69f86651d795007dc96a31e64 (diff)
downloadguix-64af916d6f08ae5c59ee76c15fdd9cff343595a4.tar.gz
gnu: portmidi: Install pkg-config file.
* gnu/packages/music.scm (portmidi)[arguments]: Add 'install-pkg-config phase.
-rw-r--r--gnu/packages/music.scm21
1 files changed, 19 insertions, 2 deletions
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 8fcc22f26d..3c8d3c5881 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -2411,8 +2411,25 @@ main purpose is to liberate raw audio rendering from audio and MIDI drivers.")
              (let* ((out (assoc-ref outputs "out"))
                     (lib (string-append out "/lib")))
                (with-directory-excursion lib
-                 (symlink "libportmidi.so" "libporttime.so")))
-             #t)))))
+                 (symlink "libportmidi.so" "libporttime.so")))))
+         (add-after 'install 'install-pkg-config
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (pkg-config-dir (string-append out "/lib/pkgconfig")))
+               (mkdir-p pkg-config-dir)
+               (with-output-to-file (string-append pkg-config-dir "/portmidi.pc")
+                 (lambda _
+                   (format #t
+                           "prefix=~@*~a~@
+                           libdir=${prefix}/lib~@
+                           includedir=${prefix}/include~@
+
+                           Name: portmidi~@
+                           Description:~@
+                           Version: ~a~@
+                           Libs: -L${libdir} -lportmidi~@
+                           Cflags: -I${includedir}~%"
+                           out ,version)))))))))
     (inputs
      `(("alsa-lib" ,alsa-lib)))
     (native-inputs