2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
ffmpeg_4,
|
|
|
|
future,
|
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
substituteAll,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ffmpeg-python";
|
|
|
|
version = "0.2.0";
|
2022-03-05 16:20:37 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kkroening";
|
|
|
|
repo = "ffmpeg-python";
|
|
|
|
rev = version;
|
2022-03-05 16:20:37 +00:00
|
|
|
hash = "sha256-Dk3nHuYVlIiFF6nORZ5TVFkBXdoZUxLfoiz68V1tvlY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ future ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-03-05 16:20:37 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
2021-05-03 20:48:10 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-location.patch;
|
2023-03-27 19:17:25 +00:00
|
|
|
ffmpeg = ffmpeg_4;
|
2021-05-03 20:48:10 +00:00
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'pytest-runner'" ""
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ffmpeg" ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.10") [ "test__output__video_size" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for FFmpeg - with complex filtering support";
|
|
|
|
homepage = "https://github.com/kkroening/ffmpeg-python";
|
|
|
|
license = licenses.asl20;
|
2022-03-05 16:20:37 +00:00
|
|
|
maintainers = with maintainers; [ AluisioASG ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|