about summary refs log tree commit diff
path: root/pkgs/applications/video/jellyfin-mpv-shim
diff options
context:
space:
mode:
authorJohannes Schleifenbaum <johannes@js-webcoding.de>2020-08-04 12:41:13 +0200
committerJohannes Schleifenbaum <johannes@js-webcoding.de>2020-08-13 08:19:24 +0200
commitdaa7574361bd0b3a4b17cfa618924d16ce562cfa (patch)
treef5aef469b16d82bd8ddd4364f8bea4af7742fb17 /pkgs/applications/video/jellyfin-mpv-shim
parenta2992d836c47fbdc2f949f996fcd41ec5cf0c407 (diff)
jellyfin-mpv-shim: 1.5.11 -> 1.7.1
Diffstat (limited to 'pkgs/applications/video/jellyfin-mpv-shim')
-rw-r--r--pkgs/applications/video/jellyfin-mpv-shim/default.nix19
-rw-r--r--pkgs/applications/video/jellyfin-mpv-shim/disable-desktop-client.patch12
-rw-r--r--pkgs/applications/video/jellyfin-mpv-shim/disable-update-check.patch15
-rw-r--r--pkgs/applications/video/jellyfin-mpv-shim/shader-pack.nix25
4 files changed, 65 insertions, 6 deletions
diff --git a/pkgs/applications/video/jellyfin-mpv-shim/default.nix b/pkgs/applications/video/jellyfin-mpv-shim/default.nix
index 4021fda68b9a0..825aac4dad290 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 0000000000000..996225efb3a51
--- /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 0000000000000..6941b956e854c
--- /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 0000000000000..fd33e8c90b52b
--- /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 ];
+  };
+}