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";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "1.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jaseg";
|
|
|
|
repo = "python-mpv";
|
|
|
|
rev = "v${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
sha256 = "sha256-UCJ1PknnWQiFciTEMxTUqDzz0Z8HEWycLuQqYeyQhoM=";
|
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
|
|
|
};
|
|
|
|
}
|