From dcc4ffdb7f49ade1bafa947a4e602df3ca87432e Mon Sep 17 00:00:00 2001 From: "Jason \\\"Don\\\" O'Conal" Date: Thu, 4 Jul 2013 15:02:09 +1000 Subject: [PATCH] libsndfile: fix build on darwin * build with gccApple * add Carbon headers to include path --- .../libraries/libsndfile/default.nix | 55 ++++++++++--------- pkgs/top-level/all-packages.nix | 6 +- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/pkgs/development/libraries/libsndfile/default.nix b/pkgs/development/libraries/libsndfile/default.nix index d9b4afbf0ff..7cf9cbca51f 100644 --- a/pkgs/development/libraries/libsndfile/default.nix +++ b/pkgs/development/libraries/libsndfile/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, flac, libogg, libvorbis, pkgconfig }: +{ stdenv, fetchurl, flac, libogg, libvorbis, pkgconfig }: stdenv.mkDerivation rec { name = "libsndfile-1.0.23"; @@ -8,35 +8,38 @@ stdenv.mkDerivation rec { sha256 = "0k9x4804gfh9d9zd4rm1v2izm8l716rzk4d6jlrjcf45b5sw7jal"; }; - buildInputs = [pkgconfig flac libogg libvorbis]; + buildInputs = [ pkgconfig flac libogg libvorbis ]; - meta = { - description = "Libsndfile, a C library for reading and writing files containing sampled sound"; + # need headers from the Carbon.framework in /System/Library/Frameworks to + # compile this on darwin -- not sure how to handle + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin + "-I/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"; - longDescription = - '' Libsndfile is a C library for reading and writing files containing - sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) - through one standard library interface. It is released in source - code format under the GNU Lesser General Public License. + meta = with stdenv.lib; { + description = "A C library for reading and writing files containing sampled sound"; + homepage = http://www.mega-nerd.com/libsndfile/; + license = licenses.lgpl2Plus; + maintainers = with maintainers; [ lovek323 ludo ]; + platfomrs = platforms.unix; - The library was written to compile and run on a Linux system but - should compile and run on just about any Unix (including MacOS X). - There are also pre-compiled binaries available for 32 and 64 bit - windows. + longDescription = '' + Libsndfile is a C library for reading and writing files containing + sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) + through one standard library interface. It is released in source + code format under the GNU Lesser General Public License. - It was designed to handle both little-endian (such as WAV) and - big-endian (such as AIFF) data, and to compile and run correctly on - little-endian (such as Intel and DEC/Compaq Alpha) processor systems - as well as big-endian processor systems such as Motorola 68k, Power - PC, MIPS and SPARC. Hopefully the design of the library will also - make it easy to extend for reading and writing new sound file - formats. - ''; + The library was written to compile and run on a Linux system but + should compile and run on just about any Unix (including MacOS X). + There are also pre-compiled binaries available for 32 and 64 bit + windows. - homepage = http://www.mega-nerd.com/libsndfile/; - - license = "LGPLv2+"; - - maintainers = [ stdenv.lib.maintainers.ludo ]; + It was designed to handle both little-endian (such as WAV) and + big-endian (such as AIFF) data, and to compile and run correctly on + little-endian (such as Intel and DEC/Compaq Alpha) processor systems + as well as big-endian processor systems such as Motorola 68k, Power + PC, MIPS and SPARC. Hopefully the design of the library will also + make it easy to extend for reading and writing new sound file + formats. + ''; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ba18fd850e4..22623abb046 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4781,7 +4781,11 @@ let # To bootstrap SBCL, I need CLisp 2.44.1; it needs libsigsegv 2.5 libsigsegv_25 = callPackage ../development/libraries/libsigsegv/2.5.nix { }; - libsndfile = callPackage ../development/libraries/libsndfile { }; + libsndfile = callPackage ../development/libraries/libsndfile { + stdenv = if stdenv.isDarwin + then overrideGCC stdenv gccApple + else stdenv; + }; libsoup = callPackage ../development/libraries/libsoup { };