diff --git a/pkgs/development/python-modules/ffpyplayer/default.nix b/pkgs/development/python-modules/ffpyplayer/default.nix new file mode 100644 index 000000000000..0661ecb99681 --- /dev/null +++ b/pkgs/development/python-modules/ffpyplayer/default.nix @@ -0,0 +1,75 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pkg-config, + + # build-system + cython, + setuptools, + + # buildInputs + SDL2, + # ffpyplayer is not compatible with ffmpeg 7 + # https://github.com/matham/ffpyplayer/issues/166 + ffmpeg_6, +}: + +buildPythonPackage (finalAttrs: { + pname = "ffpyplayer"; + version = "4.5.3"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "matham"; + repo = "ffpyplayer"; + tag = "v${finalAttrs.version}"; + hash = "sha256-dzSORPNXQ82d9fmfuQa8RcxDu5WbUBJEDG/SWQLJ6i0="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail \ + "cython~=3.0.11" \ + "cython" + substituteInPlace setup.py \ + --replace-fail \ + "cython~=3.0.11" \ + "cython" + ''; + + build-system = [ + cython + setuptools + ]; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + (lib.getDev SDL2) + (lib.getDev ffmpeg_6) + ]; + + env = { + NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=implicit-function-declaration" + "-Wno-error=incompatible-pointer-types" + ]; + }; + + pythonImportsCheck = [ "ffpyplayer" ]; + + # No proper test suite + doCheck = false; + + meta = { + changelog = "https://github.com/matham/ffpyplayer/releases/tag/v${finalAttrs.version}"; + description = "A cython implementation of an ffmpeg based player"; + homepage = "https://github.com/matham/ffpyplayer"; + license = lib.licenses.lgpl3Only; + maintainers = with lib.maintainers; [ drupol ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ec2e4389352c..be1cb5078a7a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5571,6 +5571,8 @@ self: super: with self; { ffmpy = callPackage ../development/python-modules/ffmpy { }; + ffpyplayer = callPackage ../development/python-modules/ffpyplayer { }; + fhir-py = callPackage ../development/python-modules/fhir-py { }; fiblary3-fork = callPackage ../development/python-modules/fiblary3-fork { };