2021-03-20 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, copyDesktopItems
|
|
|
|
, fetchPypi
|
|
|
|
, makeDesktopItem
|
|
|
|
, flask
|
|
|
|
, jellyfin-apiclient-python
|
|
|
|
, jinja2
|
|
|
|
, mpv
|
|
|
|
, pillow
|
|
|
|
, pydantic
|
|
|
|
, pyqtwebengine
|
|
|
|
, pystray
|
|
|
|
, python-mpv-jsonipc
|
|
|
|
, pywebview
|
|
|
|
, qt5
|
|
|
|
, tkinter
|
|
|
|
, werkzeug
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "jellyfin-mpv-shim";
|
2021-03-20 04:20:00 +00:00
|
|
|
version = "1.10.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "sha256-Tl7P8SJ/ZuwIi8RxDWkhfd7LUd63xv5Ehg1UqaYHb1g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jellyfin-apiclient-python
|
|
|
|
mpv
|
|
|
|
pillow
|
|
|
|
pydantic
|
|
|
|
python-mpv-jsonipc
|
|
|
|
|
|
|
|
# gui dependencies
|
|
|
|
pystray
|
|
|
|
tkinter
|
|
|
|
|
|
|
|
# display_mirror dependencies
|
|
|
|
jinja2
|
|
|
|
pywebview
|
|
|
|
|
|
|
|
# desktop dependencies
|
|
|
|
flask
|
|
|
|
pyqtwebengine
|
|
|
|
werkzeug
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
copyDesktopItems
|
|
|
|
qt5.wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "Jellyfin Desktop";
|
|
|
|
exec = "jellyfin-desktop";
|
|
|
|
icon = "jellyfin-desktop";
|
|
|
|
desktopName = "jellyfin-desktop";
|
|
|
|
comment = "MPV-based desktop and cast client for Jellyfin";
|
|
|
|
genericName = "MPV-based desktop and cast client for Jellyfin";
|
|
|
|
categories = "Video;AudioVideo;TV;Player";
|
|
|
|
})
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +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-08-20 17:08:02 +00:00
|
|
|
postPatch = ''
|
2021-03-20 04:20:00 +00:00
|
|
|
substituteInPlace jellyfin_mpv_shim/conf.py \
|
|
|
|
--replace "check_updates: bool = True" "check_updates: bool = False" \
|
|
|
|
--replace "notify_updates: bool = True" "notify_updates: bool = False"
|
2020-08-20 17:08:02 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
cp jellyfin_mpv_shim/integration/jellyfin-256.png $out/share/pixmaps/jellyfin-desktop.png
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
postFixup = ''
|
|
|
|
wrapQtApp $out/bin/jellyfin-desktop
|
|
|
|
wrapQtApp $out/bin/jellyfin-mpv-desktop
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-03-20 04:20:00 +00:00
|
|
|
homepage = "https://github.com/jellyfin/jellyfin-desktop";
|
2020-08-20 17:08:02 +00:00
|
|
|
description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ jojosch ];
|
|
|
|
};
|
|
|
|
}
|