about summary refs log tree commit diff
path: root/pkgs/development/python-modules/imageio-ffmpeg/default.nix
blob: 250f5ea64b188880a4fdb04e9698ecd3ca751c67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  substituteAll,
  ffmpeg,

  # build-system
  setuptools,

  # checks
  psutil,
  pytestCheckHook,
  python,
}:

buildPythonPackage rec {
  pname = "imageio-ffmpeg";
  version = "0.5.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "imageio";
    repo = "imageio-ffmpeg";
    rev = "refs/tags/v${version}";
    hash = "sha256-i9DBEhRyW5shgnhpaqpPLTI50q+SATJnxur8PAauYX4=";
  };

  patches = [
    (substituteAll {
      src = ./ffmpeg-path.patch;
      ffmpeg = "${ffmpeg}/bin/ffmpeg";
    })
  ];

  # https://github.com/imageio/imageio-ffmpeg/issues/59
  postPatch = ''
    sed -i '/setup_requires=\["pip>19"\]/d' setup.py
  '';

  build-system = [ setuptools ];

  nativeCheckInputs = [
    psutil
    pytestCheckHook
  ];

  disabledTestPaths = [
    # network access
    "tests/test_io.py"
    "tests/test_special.py"
    "tests/test_terminate.py"
  ];

  postCheck = ''
    ${python.interpreter} << EOF
    from imageio_ffmpeg import get_ffmpeg_version
    assert get_ffmpeg_version() == '${ffmpeg.version}'
    EOF
  '';

  pythonImportsCheck = [ "imageio_ffmpeg" ];

  meta = with lib; {
    changelog = "https://github.com/imageio/imageio-ffmpeg/releases/tag/v${version}";
    description = "FFMPEG wrapper for Python";
    homepage = "https://github.com/imageio/imageio-ffmpeg";
    license = licenses.bsd2;
    maintainers = [ maintainers.pmiddend ];
  };
}