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";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "0.4.7";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-egiDj5fzY+N8pBghuGT9P9yZqx/iQhBAx4619Wqecj4=";
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|