2021-03-20 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
2022-12-17 10:02:37 +00:00
|
|
|
, copyDesktopItems
|
2021-03-20 04:20:00 +00:00
|
|
|
, fetchPypi
|
2022-11-27 09:42:12 +00:00
|
|
|
, gobject-introspection
|
2021-03-20 04:20:00 +00:00
|
|
|
, jellyfin-apiclient-python
|
|
|
|
, jinja2
|
2022-12-17 10:02:37 +00:00
|
|
|
, makeDesktopItem
|
2021-03-20 04:20:00 +00:00
|
|
|
, mpv
|
|
|
|
, pillow
|
|
|
|
, pystray
|
2022-12-17 10:02:37 +00:00
|
|
|
, python
|
2021-03-20 04:20:00 +00:00
|
|
|
, python-mpv-jsonipc
|
|
|
|
, pywebview
|
|
|
|
, tkinter
|
2022-11-27 09:42:12 +00:00
|
|
|
, wrapGAppsHook
|
2021-03-20 04:20:00 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "jellyfin-mpv-shim";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "2.6.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-90Z2vgYT/9hBQZgfXeY7l6sGwT5KEY8X4rZMgrbTwrM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
nativeBuildInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
copyDesktopItems
|
2022-11-27 09:42:12 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
gobject-introspection
|
|
|
|
];
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jellyfin-apiclient-python
|
|
|
|
mpv
|
|
|
|
pillow
|
|
|
|
python-mpv-jsonipc
|
|
|
|
|
|
|
|
# gui dependencies
|
|
|
|
pystray
|
|
|
|
tkinter
|
|
|
|
|
|
|
|
# display_mirror dependencies
|
|
|
|
jinja2
|
|
|
|
pywebview
|
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"
|
2023-08-22 20:05:09 +00:00
|
|
|
# python-mpv renamed to mpv with 1.0.4
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "python-mpv" "mpv" \
|
|
|
|
--replace "mpv-jsonipc" "python_mpv_jsonipc"
|
2020-08-20 17:08:02 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
# Install all the icons for the desktop item
|
|
|
|
postInstall = ''
|
|
|
|
for s in 16 32 48 64 128 256; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/''${s}x''${s}/apps
|
|
|
|
ln -s $out/${python.sitePackages}/jellyfin_mpv_shim/integration/jellyfin-''${s}.png \
|
|
|
|
$out/share/icons/hicolor/''${s}x''${s}/apps/${pname}.png
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
# needed for pystray to access appindicator using GI
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = pname;
|
|
|
|
icon = pname;
|
|
|
|
desktopName = "Jellyfin MPV Shim";
|
|
|
|
categories = [ "Video" "AudioVideo" "TV" "Player" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-04-25 03:57:28 +00:00
|
|
|
homepage = "https://github.com/jellyfin/jellyfin-mpv-shim";
|
2020-08-20 17:08:02 +00:00
|
|
|
description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
|
2021-04-25 03:57:28 +00:00
|
|
|
longDescription = ''
|
|
|
|
Jellyfin MPV Shim is a client for the Jellyfin media server which plays media in the
|
|
|
|
MPV media player. The application runs in the background and opens MPV only
|
|
|
|
when media is cast to the player. The player supports most file formats, allowing you
|
|
|
|
to prevent needless transcoding of your media files on the server. The player also has
|
|
|
|
advanced features, such as bulk subtitle updates and launching commands on events.
|
|
|
|
'';
|
|
|
|
license = with licenses; [
|
|
|
|
# jellyfin-mpv-shim
|
|
|
|
gpl3Only
|
|
|
|
mit
|
|
|
|
|
|
|
|
# shader-pack licenses (github:iwalton3/default-shader-pack)
|
|
|
|
# KrigBilateral, SSimDownscaler, NNEDI3
|
|
|
|
gpl3Plus
|
|
|
|
# Anime4K, FSRCNNX
|
|
|
|
mit
|
|
|
|
# Static Grain
|
|
|
|
unlicense
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ jojosch ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "jellyfin-mpv-shim";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|