2019-08-09 00:00:24 +01:00
|
|
|
{ stdenv, buildPythonPackage, fetchFromGitHub, python, isPy27
|
|
|
|
, mpv
|
2018-10-16 23:30:45 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mpv";
|
2019-12-24 09:58:13 +00:00
|
|
|
version = "0.4.5";
|
2019-08-09 00:00:24 +01:00
|
|
|
disabled = isPy27;
|
2018-10-16 23:30:45 +01:00
|
|
|
|
2019-08-09 00:00:24 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jaseg";
|
|
|
|
repo = "python-mpv";
|
|
|
|
rev = "v${version}";
|
2019-12-24 09:58:13 +00:00
|
|
|
sha256 = "1y80c2k4s42lzvm5dz8wi186i7rsn1vs1wn30hp6v6vs62fb91fi";
|
2018-10-16 23:30:45 +01:00
|
|
|
};
|
|
|
|
|
2019-08-09 00:00:24 +01: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'";
|
2018-10-16 23:30:45 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A python interface to the mpv media player";
|
|
|
|
homepage = "https://github.com/jaseg/python-mpv";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
};
|
|
|
|
}
|