3
0
Fork 0
forked from mirrors/nixpkgs

python3Packages.mpv: 0.1 -> 0.3.9

This commit is contained in:
Jonathan Ringer 2019-08-08 16:00:24 -07:00
parent 63fa75e34c
commit 0f85491892
2 changed files with 20 additions and 12 deletions

View file

@ -1,25 +1,33 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, pkgs
{ stdenv, buildPythonPackage, fetchFromGitHub, python, isPy27
, mpv
}:
buildPythonPackage rec {
pname = "mpv";
version = "0.1";
version = "0.3.9";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "0b9kd70mshdr713f3l1lbnz1q0vlg2y76h5d8liy1bzqm7hjcgfw";
src = fetchFromGitHub {
owner = "jaseg";
repo = "python-mpv";
rev = "v${version}";
sha256 = "112kr9wppcyy3shsb7v7kq0s1pdw6vw3v2fvqicm7qb2f49y2p4q";
};
buildInputs = [ pkgs.mpv ];
patchPhase = "substituteInPlace mpv.py --replace libmpv.so ${pkgs.mpv}/lib/libmpv.so";
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 stdenv.lib; {
description = "A python interface to the mpv media player";
homepage = "https://github.com/jaseg/python-mpv";
license = licenses.agpl3;
};
}

View file

@ -3712,7 +3712,7 @@ in {
mpd2 = callPackage ../development/python-modules/mpd2 { };
mpv = callPackage ../development/python-modules/mpv { };
mpv = callPackage ../development/python-modules/mpv { mpv = pkgs.mpv; };
mrbob = callPackage ../development/python-modules/mrbob {};