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

105 lines
2.2 KiB
Nix
Raw Normal View History

2021-03-10 13:36:44 +01:00
{ lib
, buildPythonApplication
, copyDesktopItems
, fetchPypi
, makeDesktopItem
, flask
, jellyfin-apiclient-python
, jinja2
, mpv
, pillow
2021-03-10 13:40:13 +01:00
, pydantic
2021-03-10 13:36:44 +01:00
, pyqtwebengine
, pystray
, python-mpv-jsonipc
, pywebview
, qt5
, tkinter
, werkzeug
}:
2020-03-05 10:26:01 +01:00
buildPythonApplication rec {
pname = "jellyfin-mpv-shim";
2021-03-10 13:40:13 +01:00
version = "1.8.1";
2020-03-05 10:26:01 +01:00
src = fetchPypi {
inherit pname version;
2021-03-10 13:40:13 +01:00
sha256 = "sha256-X7UL5uUegdtHc8PGucLc8OQpWnw0fxV88z4k5FgmIE0=";
2020-03-05 10:26:01 +01:00
};
2021-03-10 13:36:44 +01:00
propagatedBuildInputs = [
jellyfin-apiclient-python
mpv
pillow
2021-03-10 13:40:13 +01:00
pydantic
2021-03-10 13:36:44 +01:00
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 MPV Shim Desktop";
exec = "jellyfin-mpv-desktop";
icon = "jellyfin-mpv-desktop";
desktopName = "jellyfin-mpv-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-04 12:41:13 +02:00
];
2020-03-05 10:26:01 +01: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 13:36:44 +01:00
postInstall = ''
mkdir -p $out/share/pixmaps
cp jellyfin_mpv_shim/integration/jellyfin-256.png $out/share/pixmaps/jellyfin-mpv-desktop.png
'';
2020-03-05 10:26:01 +01:00
2021-03-10 13:36:44 +01:00
postFixup = ''
wrapQtApp $out/bin/jellyfin-mpv-desktop
'';
2020-03-05 10:26:01 +01:00
2021-01-04 03:27:23 +01:00
# no tests
doCheck = false;
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
meta = with lib; {
2020-03-05 10:26:01 +01:00
homepage = "https://github.com/iwalton3/jellyfin-mpv-shim";
2020-07-01 13:12:56 +02:00
description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
2020-03-05 10:26:01 +01:00
license = licenses.gpl3;
maintainers = with maintainers; [ jojosch ];
};
}