python310Packages.samplerate: init at 0.1.0
Packaged as a dependency for librosa.
This commit is contained in:
parent
8e4af8054b
commit
470651e0e8
56
pkgs/development/python-modules/samplerate/default.nix
Normal file
56
pkgs/development/python-modules/samplerate/default.nix
Normal file
@ -0,0 +1,56 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, cffi
|
||||
, numpy
|
||||
, libsamplerate
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "samplerate";
|
||||
version = "0.1.0";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tuxu";
|
||||
repo = "python-samplerate";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-lHZ9SVnKcsEsnKYXR/QocGbKPEoA7yCZxXvrNPeH1rA=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace ", 'pytest-runner'" ""
|
||||
|
||||
substituteInPlace samplerate/lowlevel.py --replace \
|
||||
"lib_filename = _find_library('samplerate')" \
|
||||
'lib_filename = "${libsamplerate.out}/lib/libsamplerate${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [
|
||||
cffi
|
||||
numpy
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"samplerate"
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
rm -rf samplerate
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python bindings for libsamplerate based on CFFI and NumPy";
|
||||
homepage = "https://github.com/tuxu/python-samplerate";
|
||||
changelog = "https://github.com/tuxu/python-samplerate/releases/tag/${version}";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
@ -10357,6 +10357,10 @@ self: super: with self; {
|
||||
|
||||
sampledata = callPackage ../development/python-modules/sampledata { };
|
||||
|
||||
samplerate = callPackage ../development/python-modules/samplerate {
|
||||
inherit (pkgs) libsamplerate;
|
||||
};
|
||||
|
||||
samsungctl = callPackage ../development/python-modules/samsungctl { };
|
||||
|
||||
samsungtvws = callPackage ../development/python-modules/samsungtvws { };
|
||||
|
Loading…
Reference in New Issue
Block a user