1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 replaceVars,
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.6.0";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "imageio";
24 repo = "imageio-ffmpeg";
25 tag = "v${version}";
26 hash = "sha256-Yy2PTNBGPP/BAR7CZck/9qr2g/s4ntiuydqXz77hR7E=";
27 };
28
29 patches = [
30 (replaceVars ./ffmpeg-path.patch {
31 ffmpeg = lib.getExe ffmpeg;
32 })
33 ];
34
35 build-system = [ setuptools ];
36
37 nativeCheckInputs = [
38 psutil
39 pytestCheckHook
40 ];
41
42 disabledTestPaths = [
43 # network access
44 "tests/test_io.py"
45 "tests/test_special.py"
46 "tests/test_terminate.py"
47 ];
48
49 postCheck = ''
50 ${python.interpreter} << EOF
51 from imageio_ffmpeg import get_ffmpeg_version
52 assert get_ffmpeg_version() == '${ffmpeg.version}'
53 EOF
54 '';
55
56 pythonImportsCheck = [ "imageio_ffmpeg" ];
57
58 meta = with lib; {
59 changelog = "https://github.com/imageio/imageio-ffmpeg/releases/tag/${src.tag}";
60 description = "FFMPEG wrapper for Python";
61 homepage = "https://github.com/imageio/imageio-ffmpeg";
62 license = licenses.bsd2;
63 maintainers = [ maintainers.pmiddend ];
64 };
65}