Files
nixpkgs/pkgs/development/python-modules/mpv/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

53 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
pythonOlder,
mpv,
setuptools,
}:
buildPythonPackage rec {
pname = "mpv";
version = "1.0.7";
format = "pyproject";
src = fetchFromGitHub {
owner = "jaseg";
repo = "python-mpv";
rev = "v${version}";
hash = "sha256-2sYWTzj7+ozezNX0uFdJW+A0K6bwAmiVvqo/lr9UToA=";
};
patches = [
# https://github.com/jellyfin/jellyfin-mpv-shim/issues/448
(fetchpatch {
url = "https://github.com/jaseg/python-mpv/commit/12850b34bd3b64704f8abd30341a647a73719267.patch";
hash = "sha256-2O7w8PeWinCzrigGX3IV+9PVCtU9KCM2UJ32Y1kE6m0=";
})
];
disabled = pythonOlder "3.9";
nativeBuildInputs = [ setuptools ];
buildInputs = [ mpv ];
postPatch = ''
substituteInPlace mpv.py \
--replace-fail "sofile = ctypes.util.find_library('mpv')" \
'sofile = "${mpv}/lib/libmpv${stdenv.hostPlatform.extensions.sharedLibrary}"'
'';
pythonImportsCheck = [ "mpv" ];
meta = {
description = "Python interface to the mpv media player";
homepage = "https://github.com/jaseg/python-mpv";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ onny ];
};
}