nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 audioop-lts,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch,
7 ffmpeg-full,
8 pytestCheckHook,
9 setuptools,
10 replaceVars,
11}:
12
13buildPythonPackage rec {
14 pname = "pydub";
15 version = "0.25.1";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "jiaaro";
20 repo = "pydub";
21 tag = "v${version}";
22 hash = "sha256-FTEMT47wPXK5i4ZGjTVAhI/NjJio3F2dbBZzYzClU3c=";
23 };
24
25 patches = [
26 # Fix test assertions, https://github.com/jiaaro/pydub/pull/769
27 (fetchpatch {
28 name = "fix-assertions.patch";
29 url = "https://github.com/jiaaro/pydub/commit/66c1bf7813ae8621a71484fdcdf609734c0d8efd.patch";
30 hash = "sha256-3OIzvTgGK3r4/s5y7izHvouB4uJEmjO6cgKvegtTf7A=";
31 })
32 # Fix paths to ffmpeg, ffplay and ffprobe
33 (replaceVars ./ffmpeg-fix-path.patch {
34 ffmpeg = lib.getExe ffmpeg-full;
35 ffplay = lib.getExe' ffmpeg-full "ffplay";
36 ffprobe = lib.getExe' ffmpeg-full "ffprobe";
37 })
38 ];
39
40 nativeBuildInputs = [ setuptools ];
41
42 dependencies = [ audioop-lts ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 ];
47
48 pythonImportsCheck = [
49 "pydub"
50 "pydub.audio_segment"
51 "pydub.playback"
52 ];
53
54 enabledTestPaths = [ "test/test.py" ];
55
56 meta = {
57 description = "Manipulate audio with a simple and easy high level interface";
58 homepage = "http://pydub.com";
59 changelog = "https://github.com/jiaaro/pydub/blob/v${version}/CHANGELOG.md";
60 license = lib.licenses.mit;
61 maintainers = [ ];
62 };
63}