>From 8cd2b22517e04030970bb33abd980577c15c3f01 Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Sat, 9 Dec 2017 13:05:21 +0000 Subject: [PATCH 1/2] gnu: libid3tag: Create a pkg-config file. Cleanup packages depending on libid3tag by allowing pkg-config to find it automatically. * gnu/package/mp3.scm (libid3tag)[arguments]: Add a create-pkg-config-file phase. * gnu/package/audio.scm (audacity)[arguments]: Do not ID3TAG_CFLAGS and ID3TAG_LIBS environment variables. * gnu/package/libusb.scm (gmtp)[arguments]: Remove. --- gnu/packages/audio.scm | 10 ++++------ gnu/packages/libusb.scm | 8 +------- gnu/packages/mp3.scm | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 4f6e4a409..2273f4606 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2016 ng0 ;;; Copyright © 2016 Lukas Gradl ;;; Copyright © 2016 Tobias Geerinckx-Rice +;;; Copyright © 2017 Pierre Langlois ;;; ;;; This file is part of GNU Guix. ;;; @@ -345,8 +346,7 @@ engineers, musicians, soundtrack editors and composers.") ("which" ,which))) (arguments `(#:configure-flags - (let ((libid3tag (assoc-ref %build-inputs "libid3tag")) - (libmad (assoc-ref %build-inputs "libmad")) + (let ((libmad (assoc-ref %build-inputs "libmad")) (portmidi (assoc-ref %build-inputs "portmidi"))) (list ;; Loading FFmpeg dynamically is problematic. @@ -357,10 +357,8 @@ engineers, musicians, soundtrack editors and composers.") '("x64_64" "i686")) '() '("--enable-sse=no")) - ;; portmidi, libid3tag and libmad provide no .pc files, so - ;; pkg-config fails to find them. Force their inclusion. - (string-append "ID3TAG_CFLAGS=-I" libid3tag "/include") - (string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz") + ;; portmidi and libmad provide no .pc files, so pkg-config fails to + ;; find them. Force their inclusion. (string-append "LIBMAD_CFLAGS=-I" libmad "/include") (string-append "LIBMAD_LIBS=-L" libmad "/lib -lmad") (string-append "PORTMIDI_CFLAGS=-I" portmidi "/include") diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 31c7dfa44..94c611b2f 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 Theodoros Foradis ;;; Copyright © 2017 Jonathan Brielmaier +;;; Copyright © 2017 Pierre Langlois ;;; ;;; This file is part of GNU Guix. ;;; @@ -295,13 +296,6 @@ proposed for standardization.") (base32 "0fyi3pdl2g57vr0p46ip2wwzyap3l0by7iqaqygv0yxfcs79l6xj")))) (build-system glib-or-gtk-build-system) - (arguments - '(#:configure-flags - (let ((libid3tag (assoc-ref %build-inputs "libid3tag"))) - (list - ;; libid3tag provides no .pc file, so pkg-config fails to find them. - (string-append "ID3TAG_CFLAGS=-I" libid3tag "/include") - (string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz"))))) (inputs `(("gtk+" ,gtk+) ("flac" ,flac) diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm index fbb924ba5..dd40fc59f 100644 --- a/gnu/packages/mp3.scm +++ b/gnu/packages/mp3.scm @@ -99,6 +99,28 @@ This package contains the library.") "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3")))) (build-system gnu-build-system) (inputs `(("zlib" ,zlib))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'create-pkg-config-file + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (pkgconfig-path (string-append out "/lib/pkgconfig"))) + (mkdir-p pkgconfig-path) + (with-output-to-file + (string-append pkgconfig-path "/id3tag.pc") + (lambda _ + (format #t + "address@hidden@ + exec_prefix=${prefix}/bin~@ + libdir=${prefix}/lib~@ + includedir=${prefix}/include~@ + Name: ID3TAG~@ + Description: libid3tag - ID3 tag manipulation library~@ + Version: address@hidden@ + Libs: -L${libdir} -lid3tag -lz~@ + Cflags: -I${includedir}~%" + out ,version))))))))) (synopsis "Library for reading ID3 tags") (description "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various -- 2.15.1