2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
librosa,
|
|
|
|
numpy,
|
|
|
|
torch,
|
2023-02-02 18:25:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "torchlibrosa";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.1.0";
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-Yqi+7fnJtBQaBiNN8/ECKfe6huZ2eMzuAkiexO8EQCg=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
librosa
|
|
|
|
numpy
|
|
|
|
torch
|
|
|
|
];
|
|
|
|
|
|
|
|
# Project has no tests.
|
|
|
|
# In order to make pythonImportsCheck work, NUMBA_CACHE_DIR env var need to
|
|
|
|
# be set to a writable dir (https://github.com/numba/numba/issues/4032#issuecomment-488102702).
|
|
|
|
# pythonImportsCheck has no pre* hook, use checkPhase to workaround that.
|
|
|
|
checkPhase = ''
|
|
|
|
export NUMBA_CACHE_DIR="$(mktemp -d)"
|
|
|
|
'';
|
|
|
|
pythonImportsCheck = [ "torchlibrosa" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "PyTorch implemention of part of librosa functions";
|
|
|
|
homepage = "https://github.com/qiuqiangkong/torchlibrosa";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ azuwis ];
|
|
|
|
};
|
|
|
|
}
|