at 23.05-pre 61 lines 2.3 kB view raw
1{ lib, stdenv, fetchFromGitHub, autoreconfHook, autogen, flac, libogg, libopus, libvorbis, pkg-config, python3 2, Carbon, AudioToolbox 3}: 4 5stdenv.mkDerivation rec { 6 pname = "libsndfile"; 7 version = "1.1.0"; 8 9 src = fetchFromGitHub { 10 owner = pname; 11 repo = pname; 12 rev = version; 13 sha256 = "sha256-bhIXVSKuUnUzs5aaLDHt21RcnqekEpLU414sFtl2Lro="; 14 }; 15 16 nativeBuildInputs = [ autoreconfHook autogen pkg-config python3 ]; 17 buildInputs = [ flac libogg libopus libvorbis ] 18 ++ lib.optionals stdenv.isDarwin [ Carbon AudioToolbox ]; 19 20 enableParallelBuilding = true; 21 22 outputs = [ "bin" "dev" "out" "man" "doc" ]; 23 24 # need headers from the Carbon.framework in /System/Library/Frameworks to 25 # compile this on darwin -- not sure how to handle 26 preConfigure = lib.optionalString stdenv.isDarwin 27 '' 28 NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers" 29 ''; 30 31 # Needed on Darwin. 32 NIX_CFLAGS_LINK = "-logg -lvorbis"; 33 34 meta = with lib; { 35 description = "A C library for reading and writing files containing sampled sound"; 36 homepage = "https://libsndfile.github.io/libsndfile/"; 37 license = licenses.lgpl2Plus; 38 maintainers = with maintainers; [ lovek323 ]; 39 platforms = platforms.unix; 40 41 longDescription = '' 42 Libsndfile is a C library for reading and writing files containing 43 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) 44 through one standard library interface. It is released in source 45 code format under the GNU Lesser General Public License. 46 47 The library was written to compile and run on a Linux system but 48 should compile and run on just about any Unix (including macOS). 49 There are also pre-compiled binaries available for 32 and 64 bit 50 windows. 51 52 It was designed to handle both little-endian (such as WAV) and 53 big-endian (such as AIFF) data, and to compile and run correctly on 54 little-endian (such as Intel and DEC/Compaq Alpha) processor systems 55 as well as big-endian processor systems such as Motorola 68k, Power 56 PC, MIPS and SPARC. Hopefully the design of the library will also 57 make it easy to extend for reading and writing new sound file 58 formats. 59 ''; 60 }; 61}