depot/third_party/nixpkgs/pkgs/development/python-modules/soxr/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

60 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
cython,
numpy,
oldest-supported-numpy,
setuptools,
setuptools-scm,
gnutar,
# native
libsoxr,
# tests
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "soxr";
version = "0.3.7";
format = "pyproject";
src = fetchFromGitHub {
owner = "dofuuz";
repo = "python-soxr";
rev = "refs/tags/v${version}";
fetchSubmodules = true;
hash = "sha256-HGtoMfMQ5/2iEIFtik7mCrSxFnLXkSSx2W8wBul0+jk=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "SYS_LIBSOXR = False" "SYS_LIBSOXR = True"
'';
nativeBuildInputs = [
cython
gnutar
numpy
oldest-supported-numpy
setuptools
setuptools-scm
];
buildInputs = [ libsoxr ];
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 ];
};
}