1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 ffmpeg_4,
6 future,
7 pytest-mock,
8 pytestCheckHook,
9 pythonAtLeast,
10 pythonOlder,
11 substituteAll,
12}:
13
14buildPythonPackage rec {
15 pname = "ffmpeg-python";
16 version = "0.2.0";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "kkroening";
23 repo = "ffmpeg-python";
24 rev = version;
25 hash = "sha256-Dk3nHuYVlIiFF6nORZ5TVFkBXdoZUxLfoiz68V1tvlY=";
26 };
27
28 propagatedBuildInputs = [ future ];
29
30 nativeCheckInputs = [
31 pytestCheckHook
32 pytest-mock
33 ];
34
35 patches = [
36 (substituteAll {
37 src = ./ffmpeg-location.patch;
38 ffmpeg = ffmpeg_4;
39 })
40 ];
41
42 postPatch = ''
43 substituteInPlace setup.py \
44 --replace "'pytest-runner'" ""
45 '';
46
47 pythonImportsCheck = [ "ffmpeg" ];
48
49 disabledTests = lib.optionals (pythonAtLeast "3.10") [ "test__output__video_size" ];
50
51 meta = with lib; {
52 description = "Python bindings for FFmpeg - with complex filtering support";
53 homepage = "https://github.com/kkroening/ffmpeg-python";
54 license = licenses.asl20;
55 maintainers = with maintainers; [ AluisioASG ];
56 };
57}