nixpkgs/pkgs/development/python-modules/mpv/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
864 B
Nix
Raw Normal View History

{ lib, stdenv, buildPythonPackage, fetchFromGitHub, python, isPy27
2019-08-08 23:00:24 +00:00
, mpv
}:
buildPythonPackage rec {
pname = "mpv";
2022-09-07 22:30:30 +00:00
version = "1.0.1";
2019-08-08 23:00:24 +00:00
disabled = isPy27;
2019-08-08 23:00:24 +00:00
src = fetchFromGitHub {
owner = "jaseg";
repo = "python-mpv";
rev = "v${version}";
2022-09-07 22:30:30 +00:00
sha256 = "sha256-UCJ1PknnWQiFciTEMxTUqDzz0Z8HEWycLuQqYeyQhoM=";
};
2019-08-08 23:00:24 +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'";
meta = with lib; {
description = "A python interface to the mpv media player";
homepage = "https://github.com/jaseg/python-mpv";
license = licenses.agpl3Plus;
};
}