1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 substituteAll,
6 ffmpeg_4,
7 python,
8}:
9
10buildPythonPackage rec {
11 pname = "imageio-ffmpeg";
12 version = "0.4.9";
13 format = "setuptools";
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-ObzRZgEY7zYPpAR0VlAQcTZGYaqdkCHT0mxY8e4ggfU=";
18 };
19
20 patches = [
21 (substituteAll {
22 src = ./ffmpeg-path.patch;
23 ffmpeg = "${ffmpeg_4}/bin/ffmpeg";
24 })
25 ];
26
27 # https://github.com/imageio/imageio-ffmpeg/issues/59
28 postPatch = ''
29 sed -i '/setup_requires=\["pip>19"\]/d' setup.py
30 '';
31
32 checkPhase = ''
33 runHook preCheck
34
35 ${python.interpreter} << EOF
36 from imageio_ffmpeg import get_ffmpeg_version
37 assert get_ffmpeg_version() == '${ffmpeg_4.version}'
38 EOF
39
40 runHook postCheck
41 '';
42
43 pythonImportsCheck = [ "imageio_ffmpeg" ];
44
45 meta = with lib; {
46 description = "FFMPEG wrapper for Python";
47 homepage = "https://github.com/imageio/imageio-ffmpeg";
48 license = licenses.bsd2;
49 maintainers = [ maintainers.pmiddend ];
50 };
51}