2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, libsndfile, ApplicationServices, Carbon, CoreServices }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
inherit (lib) optionals optionalString;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "libsamplerate";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
url = "https://github.com/libsndfile/libsamplerate/releases/download/${version}/libsamplerate-${version}.tar.xz";
|
|
|
|
hash = "sha256-MljaKAUR0ktJ1rCGFbvoJNDKzJhCsOTK8RxSzysEOJM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libsndfile ]
|
|
|
|
++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
|
|
|
|
|
|
|
|
configureFlags = [ "--disable-fftw" ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
outputs = [ "dev" "out" ];
|
2020-04-24 23:36:52 +00: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"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Sample Rate Converter for audio";
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://libsndfile.github.io/libsamplerate/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|