nixpkgs/pkgs/applications/video/jellyfin-mpv-shim/default.nix

106 lines
2.2 KiB
Nix
Raw Normal View History

2021-03-10 12:36:44 +00:00
{ lib
, buildPythonApplication
, copyDesktopItems
, fetchPypi
, makeDesktopItem
, flask
, jellyfin-apiclient-python
, jinja2
, mpv
, pillow
2021-03-10 12:40:13 +00:00
, pydantic
2021-03-10 12:36:44 +00:00
, pyqtwebengine
, pystray
, python-mpv-jsonipc
, pywebview
, qt5
, tkinter
, werkzeug
}:
2020-03-05 09:26:01 +00:00
buildPythonApplication rec {
pname = "jellyfin-mpv-shim";
2021-04-14 07:32:06 +01:00
version = "1.10.4";
2020-03-05 09:26:01 +00:00
src = fetchPypi {
inherit pname version;
2021-04-14 07:32:06 +01:00
sha256 = "sha256-QMyb69S8Ln4X0oUuLpL6vtgxJwq8f+Q4ReNckrN4E+E=";
2020-03-05 09:26:01 +00:00
};
2021-03-10 12:36:44 +00:00
propagatedBuildInputs = [
jellyfin-apiclient-python
mpv
pillow
2021-03-10 12:40:13 +00:00
pydantic
2021-03-10 12:36:44 +00:00
python-mpv-jsonipc
# gui dependencies
pystray
tkinter
# display_mirror dependencies
jinja2
pywebview
# desktop dependencies
flask
pyqtwebengine
werkzeug
];
nativeBuildInputs = [
copyDesktopItems
qt5.wrapQtAppsHook
];
desktopItems = [
(makeDesktopItem {
2021-03-18 07:27:50 +00:00
name = "Jellyfin Desktop";
exec = "jellyfin-desktop";
icon = "jellyfin-desktop";
desktopName = "jellyfin-desktop";
2021-03-10 12:36:44 +00:00
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-04 11:41:13 +01:00
];
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
'';
postPatch = ''
substituteInPlace jellyfin_mpv_shim/conf.py \
--replace "check_updates: bool = True" "check_updates: bool = False" \
--replace "notify_updates: bool = True" "notify_updates: bool = False"
'';
2021-03-10 12:36:44 +00:00
postInstall = ''
mkdir -p $out/share/pixmaps
2021-03-18 07:27:50 +00:00
cp jellyfin_mpv_shim/integration/jellyfin-256.png $out/share/pixmaps/jellyfin-desktop.png
2021-03-10 12:36:44 +00:00
'';
2020-03-05 09:26:01 +00:00
2021-03-10 12:36:44 +00:00
postFixup = ''
2021-03-18 07:27:50 +00:00
wrapQtApp $out/bin/jellyfin-desktop
2021-03-10 12:36:44 +00:00
wrapQtApp $out/bin/jellyfin-mpv-desktop
'';
2020-03-05 09:26:01 +00:00
2021-01-04 02:27:23 +00:00
# no tests
doCheck = false;
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
meta = with lib; {
2021-03-18 07:27:50 +00:00
homepage = "https://github.com/jellyfin/jellyfin-desktop";
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 ];
};
}