2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
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";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.4.9";
|
2023-08-22 20:05:09 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-ObzRZgEY7zYPpAR0VlAQcTZGYaqdkCHT0mxY8e4ggfU=";
|
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
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
# https://github.com/imageio/imageio-ffmpeg/issues/59
|
|
|
|
postPatch = ''
|
|
|
|
sed -i '/setup_requires=\["pip>19"\]/d' setup.py
|
|
|
|
'';
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|