2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
mpv,
|
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mpv";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.0.6";
|
2023-08-10 07:59:29 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jaseg";
|
|
|
|
repo = "python-mpv";
|
|
|
|
rev = "v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-1axVJ8XXs0ZPgsVux3+6YUm1KttLceZyyHOuUEHIFl4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ mpv ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace mpv.py \
|
|
|
|
--replace "sofile = ctypes.util.find_library('mpv')" \
|
2024-01-02 11:29:13 +00:00
|
|
|
'sofile = "${mpv}/lib/libmpv${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# tests impure, will error if it can't load libmpv.so
|
2023-03-15 16:39:30 +00:00
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "mpv" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python interface to the mpv media player";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/jaseg/python-mpv";
|
2021-03-19 17:17:44 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2023-08-10 07:59:29 +00:00
|
|
|
maintainers = with maintainers; [ onny ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|