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