From 64249d43725eb967e9f8ca8fc614c416c3e490cb Mon Sep 17 00:00:00 2001 From: Alexander Tsamutali Date: Sun, 18 Apr 2010 18:07:03 +0000 Subject: [PATCH] libmad: Added patch to install mad.pc, stolen from Arch Linux. svn path=/nixpkgs/trunk/; revision=21144 --- pkgs/development/libraries/libmad/default.nix | 5 +- .../libraries/libmad/pkgconfig.patch | 117 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/libmad/pkgconfig.patch diff --git a/pkgs/development/libraries/libmad/default.nix b/pkgs/development/libraries/libmad/default.nix index aa5c3526e857..83070b92ac64 100644 --- a/pkgs/development/libraries/libmad/default.nix +++ b/pkgs/development/libraries/libmad/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, autoconf}: stdenv.mkDerivation { name = "libmad-0.15.1b"; @@ -8,8 +8,11 @@ stdenv.mkDerivation { sha256 = "bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690"; }; + patches = [ ./pkgconfig.patch ]; + # The -fforce-mem flag has been removed in GCC 4.3. preConfigure = '' + ${autoconf}/bin/autoconf substituteInPlace configure --replace "-fforce-mem" "" ''; diff --git a/pkgs/development/libraries/libmad/pkgconfig.patch b/pkgs/development/libraries/libmad/pkgconfig.patch new file mode 100644 index 000000000000..0ac88acb8415 --- /dev/null +++ b/pkgs/development/libraries/libmad/pkgconfig.patch @@ -0,0 +1,117 @@ +diff -ruN libmad-0.15.1b.orig/Makefile.am libmad-0.15.1b/Makefile.am +--- libmad-0.15.1b.orig/Makefile.am 2004-02-17 02:02:03.000000000 +0000 ++++ libmad-0.15.1b/Makefile.am 2005-08-25 12:08:04.000000000 +0000 +@@ -33,9 +33,12 @@ + minimad_INCLUDES = + minimad_LDADD = libmad.la + +-EXTRA_DIST = mad.h.sed \ ++EXTRA_DIST = mad.h.sed mad.pc.in \ + CHANGES COPYRIGHT CREDITS README TODO VERSION + ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA= mad.pc ++ + exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h \ + synth.h decoder.h + +diff -ruN libmad-0.15.1b.orig/Makefile.in libmad-0.15.1b/Makefile.in +--- libmad-0.15.1b.orig/Makefile.in 2004-02-17 02:33:23.000000000 +0000 ++++ libmad-0.15.1b/Makefile.in 2005-08-25 12:09:34.000000000 +0000 +@@ -14,6 +14,8 @@ + + @SET_MAKE@ + ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = mad.pc + + SOURCES = $(libmad_la_SOURCES) $(EXTRA_libmad_la_SOURCES) $(minimad_SOURCES) + +@@ -43,7 +45,7 @@ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(srcdir)/libmad.list.in \ + $(top_srcdir)/configure COPYING INSTALL TODO config.guess \ +- config.sub depcomp install-sh ltmain.sh missing mkinstalldirs ++ config.sub depcomp install-sh ltmain.sh missing mkinstalldirs mad.pc.in + subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/configure.ac +@@ -53,7 +55,7 @@ + configure.lineno configure.status.lineno + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = config.h +-CONFIG_CLEAN_FILES = libmad.list ++CONFIG_CLEAN_FILES = libmad.list mad.pc + am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) + libLTLIBRARIES_INSTALL = $(INSTALL) + LTLIBRARIES = $(lib_LTLIBRARIES) +@@ -218,7 +220,7 @@ + minimad_SOURCES = minimad.c + minimad_INCLUDES = + minimad_LDADD = libmad.la +-EXTRA_DIST = mad.h.sed \ ++EXTRA_DIST = mad.h.sed mad.pc.in \ + CHANGES COPYRIGHT CREDITS README TODO VERSION + + exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h \ +@@ -298,6 +300,28 @@ + rm -f stamp-h1 + touch $@ + ++mad.pc: $(top_builddir)/config.status mad.pc.in ++ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status ++ ++install-pkgconfigDATA: $(pkgconfig_DATA) ++ @$(NORMAL_INSTALL) ++ $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) ++ @list='$(pkgconfig_DATA)'; for p in $$list; do \ ++ if test -f $(srcdir)/$$p; then \ ++ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ ++ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \ ++ else if test -f $$p; then \ ++ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ ++ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \ ++ fi; fi; \ ++ done ++ ++uninstall-pkgconfigDATA: ++ @$(NORMAL_UNINSTALL) ++ list='$(pkgconfig_DATA)'; for p in $$list; do \ ++ rm -f $(DESTDIR)$(pkgconfigdir)/$$p; \ ++ done ++ + distclean-hdr: + -rm -f config.h stamp-h1 + libmad.list: $(top_builddir)/config.status $(srcdir)/libmad.list.in +@@ -726,7 +750,7 @@ + + info-am: + +-install-data-am: install-includeHEADERS ++install-data-am: install-includeHEADERS install-pkgconfigDATA + + install-exec-am: install-libLTLIBRARIES + +@@ -757,7 +781,7 @@ + ps-am: + + uninstall-am: uninstall-includeHEADERS uninstall-info-am \ +- uninstall-libLTLIBRARIES ++ uninstall-libLTLIBRARIES install-pkgconfigDATA + + uninstall-info: uninstall-info-recursive + +diff -ruN libmad-0.15.1b.orig/mad.pc.in libmad-0.15.1b/mad.pc.in +--- libmad-0.15.1b.orig/mad.pc.in 1970-01-01 00:00:00.000000000 +0000 ++++ libmad-0.15.1b/mad.pc.in 2005-08-25 12:08:04.000000000 +0000 +@@ -0,0 +1,10 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: MAD ++Description: libmad - MPEG audio decoder library ++Version: @VERSION@ ++Libs: -L${libdir} -lmad ++Cflags: diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2b7358b824ba..377a42731898 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4354,7 +4354,7 @@ let }; libmad = import ../development/libraries/libmad { - inherit fetchurl stdenv; + inherit fetchurl stdenv autoconf; }; libmatthew_java = import ../development/libraries/java/libmatthew-java {