2023-03-15 16:39:30 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# build-system
|
2024-04-21 15:54:59 +00:00
|
|
|
, cython
|
2023-03-15 16:39:30 +00:00
|
|
|
, numpy
|
2023-10-09 19:29:22 +00:00
|
|
|
, oldest-supported-numpy
|
2023-03-15 16:39:30 +00:00
|
|
|
, setuptools
|
|
|
|
, setuptools-scm
|
|
|
|
, gnutar
|
|
|
|
|
|
|
|
# native
|
|
|
|
, libsoxr
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "soxr";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.3.7";
|
2023-03-15 16:39:30 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dofuuz";
|
|
|
|
repo = "python-soxr";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
fetchSubmodules = true;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-HGtoMfMQ5/2iEIFtik7mCrSxFnLXkSSx2W8wBul0+jk=";
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "SYS_LIBSOXR = False" "SYS_LIBSOXR = True"
|
|
|
|
'';
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
nativeBuildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
cython
|
2023-03-15 16:39:30 +00:00
|
|
|
gnutar
|
|
|
|
numpy
|
2023-10-09 19:29:22 +00:00
|
|
|
oldest-supported-numpy
|
2023-03-15 16:39:30 +00:00
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
buildInputs = [
|
|
|
|
libsoxr
|
|
|
|
];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"soxr"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "High quality, one-dimensional sample-rate conversion library";
|
|
|
|
homepage = "https://github.com/dofuuz/python-soxr/tree/main";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|