1 { lib, stdenv, fetchFromGitHub, autoreconfHook, autogen, flac, libogg, libopus, libvorbis, pkg-config, python3
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
13 sha256 = "sha256-bhIXVSKuUnUzs5aaLDHt21RcnqekEpLU414sFtl2Lro=";
16 nativeBuildInputs = [ autoreconfHook autogen pkg-config python3 ];
17 buildInputs = [ flac libogg libopus libvorbis ]
18 ++ lib.optionals stdenv.isDarwin [ Carbon AudioToolbox ];
20 enableParallelBuilding = true;
22 outputs = [ "bin" "dev" "out" "man" "doc" ];
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
28 NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
32 NIX_CFLAGS_LINK = "-logg -lvorbis";
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;
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.
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
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