1{ lib
2, buildPythonPackage
3, isPy3k
4, fetchPypi
5, substituteAll
6, ffmpeg_4
7, python
8}:
9
10buildPythonPackage rec {
11 pname = "imageio-ffmpeg";
12 version = "0.4.7";
13
14 disabled = !isPy3k;
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "sha256-egiDj5fzY+N8pBghuGT9P9yZqx/iQhBAx4619Wqecj4=";
19 };
20
21 patches = [
22 (substituteAll {
23 src = ./ffmpeg-path.patch;
24 ffmpeg = "${ffmpeg_4}/bin/ffmpeg";
25 })
26 ];
27
28 checkPhase = ''
29 runHook preCheck
30
31 ${python.interpreter} << EOF
32 from imageio_ffmpeg import get_ffmpeg_version
33 assert get_ffmpeg_version() == '${ffmpeg_4.version}'
34 EOF
35
36 runHook postCheck
37 '';
38
39 pythonImportsCheck = [ "imageio_ffmpeg" ];
40
41 meta = with lib; {
42 description = "FFMPEG wrapper for Python";
43 homepage = "https://github.com/imageio/imageio-ffmpeg";
44 license = licenses.bsd2;
45 maintainers = [ maintainers.pmiddend ];
46 };
47
48}