depot/third_party/nixpkgs/pkgs/development/python-modules/mpv/default.nix
Default email 5083ee08a2 Project import generated by Copybara.
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
2022-09-30 06:47:45 -05:00

33 lines
864 B
Nix

{ lib, stdenv, buildPythonPackage, fetchFromGitHub, python, isPy27
, mpv
}:
buildPythonPackage rec {
pname = "mpv";
version = "1.0.1";
disabled = isPy27;
src = fetchFromGitHub {
owner = "jaseg";
repo = "python-mpv";
rev = "v${version}";
sha256 = "sha256-UCJ1PknnWQiFciTEMxTUqDzz0Z8HEWycLuQqYeyQhoM=";
};
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;
};
}