Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 cython,
9 setuptools,
10
11 # nativeBuildInputs
12 pkg-config,
13
14 # buildInputs
15 ffmpeg-headless,
16
17 # dependencies
18
19 fetchurl,
20 linkFarm,
21 numpy,
22 pillow,
23 pytestCheckHook,
24}:
25
26buildPythonPackage rec {
27 pname = "av";
28 version = "16.1.0";
29 pyproject = true;
30
31 src = fetchFromGitHub {
32 owner = "PyAV-Org";
33 repo = "PyAV";
34 tag = "v${version}";
35 hash = "sha256-mz0VI72lqtur5HdCkPNxInk0pUWxji0boIZnfvdrxIs=";
36 };
37
38 build-system = [
39 cython
40 setuptools
41 ];
42
43 nativeBuildInputs = [ pkg-config ];
44
45 buildInputs = [ ffmpeg-headless ];
46
47 preCheck =
48 let
49 # Update with `./update-test-samples.bash` if necessary.
50 testSamples = linkFarm "pyav-test-samples" (
51 lib.mapAttrs (_: fetchurl) (lib.importTOML ./test-samples.toml)
52 );
53 in
54 ''
55 # ensure we import the built version
56 rm -r av
57 ln -s ${testSamples} tests/assets
58 '';
59
60 nativeCheckInputs = [
61 numpy
62 pillow
63 pytestCheckHook
64 ];
65
66 __darwinAllowLocalNetworking = true;
67
68 pythonImportsCheck = [
69 "av"
70 "av.audio"
71 "av.buffer"
72 "av.bytesource"
73 "av.codec"
74 "av.container"
75 "av._core"
76 "av.datasets"
77 "av.descriptor"
78 "av.dictionary"
79 "av.error"
80 "av.filter"
81 "av.format"
82 "av.frame"
83 "av.logging"
84 "av.option"
85 "av.packet"
86 "av.plane"
87 "av.stream"
88 "av.subtitles"
89 "av.utils"
90 "av.video"
91 ];
92
93 meta = {
94 description = "Pythonic bindings for FFmpeg";
95 mainProgram = "pyav";
96 homepage = "https://github.com/PyAV-Org/PyAV";
97 changelog = "https://github.com/PyAV-Org/PyAV/blob/${src.tag}/CHANGELOG.rst";
98 license = lib.licenses.bsd2;
99 maintainers = [ ];
100 };
101}