2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
ffmpeg-full,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2024-06-20 14:57:18 +00:00
|
|
|
substituteAll,
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pydub";
|
2021-04-26 19:14:03 +00:00
|
|
|
version = "0.25.1";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jiaaro";
|
2024-02-29 20:09:43 +00:00
|
|
|
repo = "pydub";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-FTEMT47wPXK5i4ZGjTVAhI/NjJio3F2dbBZzYzClU3c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
patches = [
|
|
|
|
# Fix test assertions, https://github.com/jiaaro/pydub/pull/769
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-assertions.patch";
|
|
|
|
url = "https://github.com/jiaaro/pydub/commit/66c1bf7813ae8621a71484fdcdf609734c0d8efd.patch";
|
|
|
|
hash = "sha256-3OIzvTgGK3r4/s5y7izHvouB4uJEmjO6cgKvegtTf7A=";
|
|
|
|
})
|
2024-06-20 14:57:18 +00:00
|
|
|
# Fix paths to ffmpeg, ffplay and ffprobe
|
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-fix-path.patch;
|
|
|
|
ffmpeg = lib.getExe ffmpeg-full;
|
|
|
|
ffplay = lib.getExe' ffmpeg-full "ffplay";
|
|
|
|
ffprobe = lib.getExe' ffmpeg-full "ffprobe";
|
|
|
|
})
|
2024-02-29 20:09:43 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pydub"
|
|
|
|
"pydub.audio_segment"
|
|
|
|
"pydub.playback"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "test/test.py" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-01-13 20:06:32 +00:00
|
|
|
description = "Manipulate audio with a simple and easy high level interface";
|
|
|
|
homepage = "http://pydub.com";
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/jiaaro/pydub/blob/v${version}/CHANGELOG.md";
|
2022-01-13 20:06:32 +00:00
|
|
|
license = licenses.mit;
|
2024-01-13 08:15:51 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|