2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, libsndfile, ApplicationServices, Carbon, CoreServices }:
|
2007-10-22 00:51:40 +00:00
|
|
|
|
2016-08-07 16:20:06 +00:00
|
|
|
let
|
2021-01-21 17:00:13 +00:00
|
|
|
inherit (lib) optionals optionalString;
|
2016-08-07 16:20:06 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2021-06-20 14:15:21 +00:00
|
|
|
pname = "libsamplerate";
|
2024-03-26 22:29:37 +00:00
|
|
|
version = "0.2.2";
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2010-07-28 11:55:54 +00:00
|
|
|
src = fetchurl {
|
2024-03-26 22:29:37 +00:00
|
|
|
url = "https://github.com/libsndfile/libsamplerate/releases/download/${version}/libsamplerate-${version}.tar.xz";
|
|
|
|
hash = "sha256-MljaKAUR0ktJ1rCGFbvoJNDKzJhCsOTK8RxSzysEOJM=";
|
2008-12-20 01:20:35 +00:00
|
|
|
};
|
2007-10-22 00:51:40 +00:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2016-08-07 16:20:06 +00:00
|
|
|
buildInputs = [ libsndfile ]
|
|
|
|
++ optionals stdenv.hostPlatform.isDarwin [ ApplicationServices CoreServices ];
|
2010-07-30 20:17:37 +00:00
|
|
|
|
2016-10-13 01:12:33 +00:00
|
|
|
configureFlags = [ "--disable-fftw" ];
|
2007-10-22 00:51:40 +00:00
|
|
|
|
2024-03-26 22:29:37 +00:00
|
|
|
outputs = [ "dev" "out" ];
|
2012-08-23 20:21:45 +00:00
|
|
|
|
2016-08-07 16:20:06 +00:00
|
|
|
postConfigure = optionalString stdenv.hostPlatform.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"
|
|
|
|
'';
|
2013-07-04 04:59:41 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2008-12-20 01:20:35 +00:00
|
|
|
description = "Sample Rate Converter for audio";
|
2024-03-26 22:29:37 +00:00
|
|
|
homepage = "https://libsndfile.github.io/libsamplerate/";
|
2017-04-29 10:34:11 +00:00
|
|
|
license = licenses.bsd2;
|
2019-01-26 10:01:09 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
2013-07-04 04:59:41 +00:00
|
|
|
platforms = platforms.all;
|
2024-08-04 12:54:04 +00:00
|
|
|
# Linker is unhappy with the `.def` file.
|
|
|
|
broken = stdenv.hostPlatform.isMinGW;
|
2007-10-22 00:51:40 +00:00
|
|
|
};
|
2008-12-20 01:20:35 +00:00
|
|
|
}
|