1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 substituteAll,
6 ffmpeg,
7
8 # build-system
9 setuptools,
10
11 # checks
12 psutil,
13 pytestCheckHook,
14 python,
15}:
16
17buildPythonPackage rec {
18 pname = "imageio-ffmpeg";
19 version = "0.5.1";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "imageio";
24 repo = "imageio-ffmpeg";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-i9DBEhRyW5shgnhpaqpPLTI50q+SATJnxur8PAauYX4=";
27 };
28
29 patches = [
30 (substituteAll {
31 src = ./ffmpeg-path.patch;
32 ffmpeg = "${ffmpeg}/bin/ffmpeg";
33 })
34 ];
35
36 # https://github.com/imageio/imageio-ffmpeg/issues/59
37 postPatch = ''
38 sed -i '/setup_requires=\["pip>19"\]/d' setup.py
39 '';
40
41 build-system = [ setuptools ];
42
43 nativeCheckInputs = [
44 psutil
45 pytestCheckHook
46 ];
47
48 disabledTestPaths = [
49 # network access
50 "tests/test_io.py"
51 "tests/test_special.py"
52 "tests/test_terminate.py"
53 ];
54
55 postCheck = ''
56 ${python.interpreter} << EOF
57 from imageio_ffmpeg import get_ffmpeg_version
58 assert get_ffmpeg_version() == '${ffmpeg.version}'
59 EOF
60 '';
61
62 pythonImportsCheck = [ "imageio_ffmpeg" ];
63
64 meta = with lib; {
65 changelog = "https://github.com/imageio/imageio-ffmpeg/releases/tag/v${version}";
66 description = "FFMPEG wrapper for Python";
67 homepage = "https://github.com/imageio/imageio-ffmpeg";
68 license = licenses.bsd2;
69 maintainers = [ maintainers.pmiddend ];
70 };
71}