From daa7574361bd0b3a4b17cfa618924d16ce562cfa Mon Sep 17 00:00:00 2001 From: Johannes Schleifenbaum Date: Tue, 4 Aug 2020 12:41:13 +0200 Subject: [PATCH] jellyfin-mpv-shim: 1.5.11 -> 1.7.1 --- .../video/jellyfin-mpv-shim/default.nix | 19 +++++++++----- .../disable-desktop-client.patch | 12 +++++++++ .../disable-update-check.patch | 15 +++++++++++ .../video/jellyfin-mpv-shim/shader-pack.nix | 25 +++++++++++++++++++ 4 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 pkgs/applications/video/jellyfin-mpv-shim/disable-desktop-client.patch create mode 100644 pkgs/applications/video/jellyfin-mpv-shim/disable-update-check.patch create mode 100644 pkgs/applications/video/jellyfin-mpv-shim/shader-pack.nix diff --git a/pkgs/applications/video/jellyfin-mpv-shim/default.nix b/pkgs/applications/video/jellyfin-mpv-shim/default.nix index 4021fda68b9..825aac4dad2 100644 --- a/pkgs/applications/video/jellyfin-mpv-shim/default.nix +++ b/pkgs/applications/video/jellyfin-mpv-shim/default.nix @@ -1,19 +1,27 @@ -{ stdenv, buildPythonApplication, fetchFromGitHub, fetchurl +{ stdenv, buildPythonApplication, fetchFromGitHub, callPackage , mpv, python-mpv-jsonipc, jellyfin-apiclient-python , pillow, tkinter, pystray, jinja2, pywebview }: +let + shaderPack = callPackage ./shader-pack.nix {}; +in buildPythonApplication rec { pname = "jellyfin-mpv-shim"; - version = "1.5.11"; + version = "1.7.1"; src = fetchFromGitHub { owner = "iwalton3"; repo = pname; rev = "v${version}"; - sha256 = "14hm8yccdp7w1vdnvdzafk1byhaq1qsr33i4962s1nvm9lafxkr7"; + sha256 = "0alrh5h3f8pq9mrq09jmpqa0yslxsjqwij6kwn24ggbwc10zkq75"; fetchSubmodules = true; # needed for display_mirror css file }; + patches = [ + ./disable-desktop-client.patch + ./disable-update-check.patch + ]; + # override $HOME directory: # error: [Errno 13] Permission denied: '/homeless-shelter' # @@ -25,10 +33,9 @@ buildPythonApplication rec { rm jellyfin_mpv_shim/win_utils.py ''; - # disable the desktop client for now postPatch = '' - substituteInPlace setup.py \ - --replace "'jellyfin-mpv-desktop=jellyfin_mpv_shim.mpv_shim:main_desktop'," "" + # link the default shader pack + ln -s ${shaderPack} jellyfin_mpv_shim/default_shader_pack ''; propagatedBuildInputs = [ diff --git a/pkgs/applications/video/jellyfin-mpv-shim/disable-desktop-client.patch b/pkgs/applications/video/jellyfin-mpv-shim/disable-desktop-client.patch new file mode 100644 index 00000000000..996225efb3a --- /dev/null +++ b/pkgs/applications/video/jellyfin-mpv-shim/disable-desktop-client.patch @@ -0,0 +1,12 @@ +diff --git a/setup.py b/setup.py +index a831959..2206e6e 100644 +--- a/setup.py ++++ b/setup.py +@@ -25,7 +25,6 @@ setup( + entry_points={ + 'console_scripts': [ + 'jellyfin-mpv-shim=jellyfin_mpv_shim.mpv_shim:main', +- 'jellyfin-mpv-desktop=jellyfin_mpv_shim.mpv_shim:main_desktop', + ] + }, + classifiers=[ diff --git a/pkgs/applications/video/jellyfin-mpv-shim/disable-update-check.patch b/pkgs/applications/video/jellyfin-mpv-shim/disable-update-check.patch new file mode 100644 index 00000000000..6941b956e85 --- /dev/null +++ b/pkgs/applications/video/jellyfin-mpv-shim/disable-update-check.patch @@ -0,0 +1,15 @@ +diff --git a/jellyfin_mpv_shim/conf.py b/jellyfin_mpv_shim/conf.py +index 0ab9326..ccedc17 100644 +--- a/jellyfin_mpv_shim/conf.py ++++ b/jellyfin_mpv_shim/conf.py +@@ -88,8 +88,8 @@ class Settings(object): + "sync_revert_seek": True, + "sync_osd_message": True, + "screenshot_menu": True, +- "check_updates": True, +- "notify_updates": True, ++ "check_updates": False, ++ "notify_updates": False, + "lang": None, + "desktop_scale": 1.0, + } diff --git a/pkgs/applications/video/jellyfin-mpv-shim/shader-pack.nix b/pkgs/applications/video/jellyfin-mpv-shim/shader-pack.nix new file mode 100644 index 00000000000..fd33e8c90b5 --- /dev/null +++ b/pkgs/applications/video/jellyfin-mpv-shim/shader-pack.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "jellyfin-mpv-shim-shader-pack"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "iwalton3"; + repo = "default-shader-pack"; + rev = "v${version}"; + sha256 = "04y8gvjy4v3773b1kyan4dxqcf86b56x7v33m2k246jbn0rl2pgr"; + }; + + installPhase = '' + mkdir -p $out + cp -a . $out + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/iwalton3/default-shader-pack"; + description = "Preconfigured set of MPV shaders and configurations for MPV Shim media clients"; + license = with licenses; [ mit lgpl3Plus unlicense ]; + maintainers = with maintainers; [ jojosch ]; + }; +}