07d6a74cbb
GitOrigin-RevId: f5e8bdd07d1afaabf6b37afc5497b1e498b8046f
33 lines
865 B
Nix
33 lines
865 B
Nix
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, python, isPy27
|
|
, mpv
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "mpv";
|
|
version = "0.5.2";
|
|
disabled = isPy27;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jaseg";
|
|
repo = "python-mpv";
|
|
rev = "v${version}";
|
|
sha256 = "0ffskpynhl1252h6a05087lvpjgn1cn2z3caiv3i666dn1n79fjd";
|
|
};
|
|
|
|
buildInputs = [ mpv ];
|
|
|
|
postPatch = ''
|
|
substituteInPlace mpv.py \
|
|
--replace "sofile = ctypes.util.find_library('mpv')" \
|
|
'sofile = "${mpv}/lib/libmpv${stdenv.targetPlatform.extensions.sharedLibrary}"'
|
|
'';
|
|
|
|
# tests impure, will error if it can't load libmpv.so
|
|
checkPhase = "${python.interpreter} -c 'import mpv'";
|
|
|
|
meta = with lib; {
|
|
description = "A python interface to the mpv media player";
|
|
homepage = "https://github.com/jaseg/python-mpv";
|
|
license = licenses.agpl3Plus;
|
|
};
|
|
}
|