nixpkgs/pkgs/development/python-modules/mpv/default.nix
Adam Joseph c7e0f6b905 treewide: s_targetPlatform_hostPlatform_ in non-compiler packages
stdenv.targetPlatform really shouldn't be used by software that
doesn't generate or manipulate binaries.  I reviewed all uses of
targetPlatform outside of pkgs/development/compilers and pkgs/stdenv
and replaced those which weren't involved in something which fits
these criteria.
2023-11-17 08:07:34 +00:00

43 lines
951 B
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, mpv
, setuptools
}:
buildPythonPackage rec {
pname = "mpv";
version = "1.0.4";
format = "pyproject";
src = fetchFromGitHub {
owner = "jaseg";
repo = "python-mpv";
rev = "v${version}";
hash = "sha256-qP5Biw4sTLioAhmMZX+Pemue2PWc3N7afAe38dwJv3U=";
};
nativeBuildInputs = [
setuptools
];
buildInputs = [ mpv ];
postPatch = ''
substituteInPlace mpv.py \
--replace "sofile = ctypes.util.find_library('mpv')" \
'sofile = "${mpv}/lib/libmpv${stdenv.hostPlatform.extensions.sharedLibrary}"'
'';
# tests impure, will error if it can't load libmpv.so
doCheck = false;
pythonImportsCheck = [ "mpv" ];
meta = with lib; {
description = "A python interface to the mpv media player";
homepage = "https://github.com/jaseg/python-mpv";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ onny ];
};
}