2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, libsndfile, ApplicationServices, Carbon, CoreServices }:
|
2007-10-22 02:51:40 +02:00
|
|
|
|
2016-08-07 18:20:06 +02:00
|
|
|
let
|
2021-01-21 18:00:13 +01:00
|
|
|
inherit (lib) optionals optionalString;
|
2016-08-07 18:20:06 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2021-06-20 16:15:21 +02:00
|
|
|
pname = "libsamplerate";
|
|
|
|
version = "0.1.9";
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
src = fetchurl {
|
2021-06-20 16:15:21 +02:00
|
|
|
url = "http://www.mega-nerd.com/SRC/${pname}-${version}.tar.gz";
|
2016-10-13 03:12:33 +02:00
|
|
|
sha256 = "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha";
|
2008-12-20 02:20:35 +01:00
|
|
|
};
|
2007-10-22 02:51:40 +02:00
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2016-08-07 18:20:06 +02:00
|
|
|
buildInputs = [ libsndfile ]
|
|
|
|
++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
|
2010-07-30 22:17:37 +02:00
|
|
|
|
2016-10-13 03:12:33 +02:00
|
|
|
configureFlags = [ "--disable-fftw" ];
|
2007-10-22 02:51:40 +02:00
|
|
|
|
2016-08-29 02:30:01 +02:00
|
|
|
outputs = [ "bin" "dev" "out" ];
|
2012-08-23 22:21:45 +02:00
|
|
|
|
2016-08-07 18:20:06 +02:00
|
|
|
postConfigure = optionalString stdenv.isDarwin ''
|
|
|
|
# need headers from the Carbon.framework in /System/Library/Frameworks to
|
|
|
|
# compile this on darwin -- not sure how to handle
|
|
|
|
NIX_CFLAGS_COMPILE+=" -I${Carbon}/Library/Frameworks/Carbon.framework/Headers"
|
2014-07-23 11:45:44 +02:00
|
|
|
|
2016-08-07 18:20:06 +02:00
|
|
|
substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
|
|
|
|
'';
|
2013-07-04 06:59:41 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2008-12-20 02:20:35 +01:00
|
|
|
description = "Sample Rate Converter for audio";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.mega-nerd.com/SRC/index.html";
|
2017-04-29 12:34:11 +02:00
|
|
|
license = licenses.bsd2;
|
2019-01-26 11:01:09 +01:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
2013-07-04 06:59:41 +02:00
|
|
|
platforms = platforms.all;
|
2007-10-22 02:51:40 +02:00
|
|
|
};
|
2008-12-20 02:20:35 +01:00
|
|
|
}
|