2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPy3k
|
2021-05-20 23:08:51 +00:00
|
|
|
, fetchPypi
|
|
|
|
, substituteAll
|
2022-02-10 20:34:41 +00:00
|
|
|
, ffmpeg_4
|
2021-05-20 23:08:51 +00:00
|
|
|
, python
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "imageio-ffmpeg";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.4.5";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "f2ea4245a2adad25dedf98d343159579167e549ac8c4691cef5eff980e20c139";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-path.patch;
|
2022-02-10 20:34:41 +00:00
|
|
|
ffmpeg = "${ffmpeg_4}/bin/ffmpeg";
|
2021-05-20 23:08:51 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
${python.interpreter} << EOF
|
|
|
|
from imageio_ffmpeg import get_ffmpeg_version
|
2022-02-10 20:34:41 +00:00
|
|
|
assert get_ffmpeg_version() == '${ffmpeg_4.version}'
|
2021-05-20 23:08:51 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
pythonImportsCheck = [ "imageio_ffmpeg" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "FFMPEG wrapper for Python";
|
|
|
|
homepage = "https://github.com/imageio/imageio-ffmpeg";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = [ maintainers.pmiddend ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|