2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildPythonApplication, fetchFromGitHub, callPackage
|
2020-03-05 09:26:01 +00:00
|
|
|
, mpv, python-mpv-jsonipc, jellyfin-apiclient-python
|
|
|
|
, pillow, tkinter, pystray, jinja2, pywebview }:
|
|
|
|
|
2020-08-04 11:41:13 +01:00
|
|
|
let
|
|
|
|
shaderPack = callPackage ./shader-pack.nix {};
|
|
|
|
in
|
2020-03-05 09:26:01 +00:00
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "jellyfin-mpv-shim";
|
2020-08-04 11:41:13 +01:00
|
|
|
version = "1.7.1";
|
2020-03-05 09:26:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iwalton3";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-08-04 11:41:13 +01:00
|
|
|
sha256 = "0alrh5h3f8pq9mrq09jmpqa0yslxsjqwij6kwn24ggbwc10zkq75";
|
2020-03-05 09:26:01 +00:00
|
|
|
fetchSubmodules = true; # needed for display_mirror css file
|
|
|
|
};
|
|
|
|
|
2020-08-04 11:41:13 +01:00
|
|
|
patches = [
|
|
|
|
./disable-desktop-client.patch
|
|
|
|
./disable-update-check.patch
|
|
|
|
];
|
|
|
|
|
2020-03-05 09:26:01 +00:00
|
|
|
# override $HOME directory:
|
|
|
|
# error: [Errno 13] Permission denied: '/homeless-shelter'
|
|
|
|
#
|
|
|
|
# remove jellyfin_mpv_shim/win_utils.py:
|
|
|
|
# ModuleNotFoundError: No module named 'win32gui'
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
|
|
|
|
rm jellyfin_mpv_shim/win_utils.py
|
|
|
|
'';
|
|
|
|
|
2020-07-01 12:12:56 +01:00
|
|
|
postPatch = ''
|
2020-08-04 11:41:13 +01:00
|
|
|
# link the default shader pack
|
|
|
|
ln -s ${shaderPack} jellyfin_mpv_shim/default_shader_pack
|
2020-07-01 12:12:56 +01:00
|
|
|
'';
|
|
|
|
|
2020-03-05 09:26:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jellyfin-apiclient-python
|
|
|
|
mpv
|
|
|
|
pillow
|
|
|
|
python-mpv-jsonipc
|
|
|
|
|
|
|
|
# gui dependencies
|
|
|
|
pystray
|
|
|
|
tkinter
|
|
|
|
|
|
|
|
# display_mirror dependencies
|
|
|
|
jinja2
|
|
|
|
pywebview
|
|
|
|
];
|
|
|
|
|
2021-01-04 02:27:23 +00:00
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-03-05 09:26:01 +00:00
|
|
|
homepage = "https://github.com/iwalton3/jellyfin-mpv-shim";
|
2020-07-01 12:12:56 +01:00
|
|
|
description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
|
2020-03-05 09:26:01 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ jojosch ];
|
|
|
|
};
|
|
|
|
}
|