2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, python, isPy27
|
2020-04-24 23:36:52 +00:00
|
|
|
, mpv
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mpv";
|
2021-03-19 17:17:44 +00:00
|
|
|
version = "0.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jaseg";
|
|
|
|
repo = "python-mpv";
|
|
|
|
rev = "v${version}";
|
2021-03-19 17:17:44 +00:00
|
|
|
sha256 = "0ffskpynhl1252h6a05087lvpjgn1cn2z3caiv3i666dn1n79fjd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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'";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A python interface to the mpv media player";
|
|
|
|
homepage = "https://github.com/jaseg/python-mpv";
|
2021-03-19 17:17:44 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|