2015-11-11 21:55:44 +00:00
|
|
|
{ stdenv, fetchurl, flac, libogg, libvorbis, pkgconfig
|
2016-05-05 23:39:58 +01:00
|
|
|
, Carbon, AudioToolbox
|
2015-11-11 21:55:44 +00:00
|
|
|
}:
|
2005-10-26 16:58:09 +01:00
|
|
|
|
2012-08-25 01:43:48 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2017-04-06 11:30:53 +01:00
|
|
|
name = "libsndfile-1.0.28";
|
2009-12-13 20:19:03 +00:00
|
|
|
|
2005-10-26 16:58:09 +01:00
|
|
|
src = fetchurl {
|
2009-12-13 20:19:03 +00:00
|
|
|
url = "http://www.mega-nerd.com/libsndfile/files/${name}.tar.gz";
|
2017-04-06 11:30:53 +01:00
|
|
|
sha256 = "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz";
|
2009-12-13 20:19:03 +00:00
|
|
|
};
|
|
|
|
|
2017-08-17 17:31:29 +01:00
|
|
|
patches = [
|
|
|
|
(fetchurl {
|
2017-11-19 17:51:22 +00:00
|
|
|
name = "CVE-2017-12562.patch";
|
|
|
|
url = "https://github.com/erikd/libsndfile/commit/cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8.patch";
|
|
|
|
sha256 = "1jg3wq30wdn9nv52mcyv6jyi4d80h4r1h9p96czcria7l91yh4sy";
|
2017-08-17 17:31:29 +01:00
|
|
|
})
|
|
|
|
(fetchurl {
|
2017-11-19 17:51:22 +00:00
|
|
|
name = "CVE-2017-6892.patch";
|
|
|
|
url = "https://github.com/erikd/libsndfile/commit/f833c53cb596e9e1792949f762e0b33661822748.patch";
|
|
|
|
sha256 = "05xkmz2ihc1zcj73sbmj1ikrv9qlcym2bkp1v6ak7w53ky619mwq";
|
2017-08-17 17:31:29 +01:00
|
|
|
})
|
|
|
|
(fetchurl {
|
2017-11-19 17:51:22 +00:00
|
|
|
name = "CVE-2017-8361+CVE-2017-8363+CVE-2017-8365.patch";
|
|
|
|
url = "https://github.com/erikd/libsndfile/commit/fd0484aba8e51d16af1e3a880f9b8b857b385eb3.patch";
|
|
|
|
sha256 = "0ccndnvjzx5fw18zvy03vnb29rr81h5vsh1m16msqbxk8ibndln2";
|
2017-08-17 17:31:29 +01:00
|
|
|
})
|
|
|
|
(fetchurl {
|
2017-11-19 17:51:22 +00:00
|
|
|
name = "CVE-2017-8362.patch";
|
|
|
|
url = "https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808.patch";
|
|
|
|
sha256 = "1xyv30ga71cpy4wx5f76sc4dma91la2lcc6s9f3pk9rndyi7gj9x";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
name = "CVE-2017-14634.patch";
|
|
|
|
url = "https://github.com/erikd/libsndfile/commit/85c877d5072866aadbe8ed0c3e0590fbb5e16788.patch";
|
|
|
|
sha256 = "0kc7vp22qsxidhvmlc6nfamw7k92n0hcfpmwhb3gaksjamwhb2df";
|
2017-08-17 17:31:29 +01:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ flac libogg libvorbis ]
|
2016-05-05 23:39:58 +01:00
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin [ Carbon AudioToolbox ];
|
2010-10-28 15:00:41 +01:00
|
|
|
|
2012-08-23 20:01:00 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-07-11 10:14:14 +01:00
|
|
|
outputs = [ "bin" "dev" "out" "man" "doc" ];
|
2012-08-23 20:01:00 +01:00
|
|
|
|
2013-07-04 06:02:09 +01:00
|
|
|
# need headers from the Carbon.framework in /System/Library/Frameworks to
|
|
|
|
# compile this on darwin -- not sure how to handle
|
2014-07-23 10:00:41 +01:00
|
|
|
preConfigure = stdenv.lib.optionalString stdenv.isDarwin
|
|
|
|
''
|
2014-07-24 20:53:46 +01:00
|
|
|
NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
|
2014-07-23 10:00:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Needed on Darwin.
|
|
|
|
NIX_CFLAGS_LINK = "-logg -lvorbis";
|
2013-07-04 06:02:09 +01:00
|
|
|
|
|
|
|
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;
|
2013-08-16 22:44:33 +01:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
2015-04-26 04:39:49 +01:00
|
|
|
platforms = platforms.unix;
|
2013-07-04 06:02:09 +01:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
The library was written to compile and run on a Linux system but
|
2017-08-06 23:05:18 +01:00
|
|
|
should compile and run on just about any Unix (including macOS).
|
2013-07-04 06:02:09 +01:00
|
|
|
There are also pre-compiled binaries available for 32 and 64 bit
|
|
|
|
windows.
|
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
2005-10-26 16:58:09 +01:00
|
|
|
};
|
|
|
|
}
|