about summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/kodi/addons/pvr-iptvsimple/default.nix4
-rw-r--r--pkgs/applications/video/mpv/scripts/buildLua.nix30
-rw-r--r--pkgs/applications/video/mpv/scripts/default.nix3
-rw-r--r--pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix32
-rw-r--r--pkgs/applications/video/mpv/scripts/uosc.nix50
-rw-r--r--pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix8
-rw-r--r--pkgs/applications/video/rtabmap/default.nix14
7 files changed, 97 insertions, 44 deletions
diff --git a/pkgs/applications/video/kodi/addons/pvr-iptvsimple/default.nix b/pkgs/applications/video/kodi/addons/pvr-iptvsimple/default.nix
index ba6470af873f..28dd626502e8 100644
--- a/pkgs/applications/video/kodi/addons/pvr-iptvsimple/default.nix
+++ b/pkgs/applications/video/kodi/addons/pvr-iptvsimple/default.nix
@@ -6,13 +6,13 @@
 buildKodiBinaryAddon rec {
   pname = "pvr-iptvsimple";
   namespace = "pvr.iptvsimple";
-  version = "20.11.1";
+  version = "20.13.0";
 
   src = fetchFromGitHub {
     owner = "kodi-pvr";
     repo = "pvr.iptvsimple";
     rev = "${version}-${rel}";
-    sha256 = "sha256-Dvnuy+2xW9hPjPVqN7X057B/1zWqIPbkS90kjexJvio=";
+    sha256 = "sha256-W/tFM/WpWdSvLEf0iwQoH2JVDjyfr1l8CRQkOG5q4hk=";
   };
 
   extraBuildInputs = [
diff --git a/pkgs/applications/video/mpv/scripts/buildLua.nix b/pkgs/applications/video/mpv/scripts/buildLua.nix
index 046b0fa2ea96..4c1e1957c097 100644
--- a/pkgs/applications/video/mpv/scripts/buildLua.nix
+++ b/pkgs/applications/video/mpv/scripts/buildLua.nix
@@ -5,31 +5,29 @@ let
   inherit (lib) hasPrefix hasSuffix removeSuffix;
   escapedList = with lib; concatMapStringsSep " " (s: "'${escape [ "'" ] s}'");
   fileName = pathStr: lib.last (lib.splitString "/" pathStr);
-  nameFromPath = pathStr:
-    let fN = fileName pathStr; in
-    if hasSuffix ".lua" fN then
-      fN
-    else if !(hasPrefix "." fN) then
-      "${fN}.lua"
-    else
-      null
-  ;
   scriptsDir = "$out/share/mpv/scripts";
+
+  # similar to `lib.extends`, but with inverted precedence and recursive update
+  extendedBy = args: orig: self:
+    let super = args self;
+    in lib.recursiveUpdate (orig super) super
+  ;
 in
-lib.makeOverridable (
+
+lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy
+  (if lib.isFunction args then args else (_: args)) (
   { pname
   , extraScripts ? []
   , ... }@args:
   let
     # either passthru.scriptName, inferred from scriptPath, or from pname
     scriptName = (args.passthru or {}).scriptName or (
-      if args ? scriptPath && nameFromPath args.scriptPath != null
-      then nameFromPath args.scriptPath
+      if args ? scriptPath
+      then fileName args.scriptPath
       else "${pname}.lua"
     );
     scriptPath = args.scriptPath or "./${scriptName}";
-  in
-  stdenvNoCC.mkDerivation (lib.attrsets.recursiveUpdate {
+  in {
     dontBuild = true;
     preferLocalBuild = true;
 
@@ -59,5 +57,5 @@ lib.makeOverridable (
 
     passthru = { inherit scriptName; };
     meta.platforms = lib.platforms.all;
-  } args)
-)
+  })
+))
diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix
index fb75464ab98e..4ca70c401fa8 100644
--- a/pkgs/applications/video/mpv/scripts/default.nix
+++ b/pkgs/applications/video/mpv/scripts/default.nix
@@ -20,9 +20,10 @@ in lib.recurseIntoAttrs
     quality-menu = callPackage ./quality-menu.nix { inherit buildLua; };
     simple-mpv-webui = callPackage ./simple-mpv-webui.nix { inherit buildLua; };
     sponsorblock = callPackage ./sponsorblock.nix { };
+    sponsorblock-minimal = callPackage ./sponsorblock-minimal.nix { inherit buildLua; };
     thumbfast = callPackage ./thumbfast.nix { inherit buildLua; };
     thumbnail = callPackage ./thumbnail.nix { inherit buildLua; };
-    uosc = callPackage ./uosc.nix { };
+    uosc = callPackage ./uosc.nix { inherit buildLua; };
     visualizer = callPackage ./visualizer.nix { };
     vr-reversal = callPackage ./vr-reversal.nix { };
     webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
diff --git a/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix b/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix
new file mode 100644
index 000000000000..f7f8049cbba3
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/sponsorblock-minimal.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildLua
+, fetchFromGitea
+, curl
+}:
+
+buildLua {
+  pname = "mpv_sponsorblock_minimal";
+  version = "unstable-2023-08-20";
+  scriptPath = "sponsorblock_minimal.lua";
+
+  src = fetchFromGitea {
+    domain = "codeberg.org";
+    owner = "jouni";
+    repo = "mpv_sponsorblock_minimal";
+    rev = "ca2844b8cf7674bfccd282d389a50427742251d3";
+    hash = "sha256-28HWZ6nOhKiE+5Ya1N3Vscd8aeH9OKS0t72e/xPfFQQ=";
+  };
+
+  preInstall = ''
+    substituteInPlace sponsorblock_minimal.lua \
+      --replace "curl" "${lib.getExe curl}"
+  '';
+
+  meta = with lib; {
+    description = "A minimal script to skip sponsored segments of YouTube videos";
+    homepage = "https://codeberg.org/jouni/mpv_sponsorblock_minimal";
+    license = licenses.gpl3Only;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ arthsmn ];
+  };
+}
diff --git a/pkgs/applications/video/mpv/scripts/uosc.nix b/pkgs/applications/video/mpv/scripts/uosc.nix
index b88cd2c5b968..4c434d49f368 100644
--- a/pkgs/applications/video/mpv/scripts/uosc.nix
+++ b/pkgs/applications/video/mpv/scripts/uosc.nix
@@ -1,42 +1,50 @@
-{ stdenvNoCC, lib, fetchFromGitHub, makeFontsConf }:
-
-stdenvNoCC.mkDerivation (finalAttrs: {
+{ lib
+, fetchFromGitHub
+, fetchpatch
+, makeFontsConf
+, buildLua
+, buildGoModule
+}:
+
+buildLua (finalAttrs: {
   pname = "uosc";
-  version = "4.7.0";
+  version = "5.1.1";
+  scriptPath = "src/uosc";
 
   src = fetchFromGitHub {
     owner = "tomasklaen";
     repo = "uosc";
     rev = finalAttrs.version;
-    hash = "sha256-JqlBjhwRgmXl6XfHYTwtNWZj656EDHjcdWOlCgihF5I=";
+    hash = "sha256-+4k8T1yX3IRXK3XkUShsuJSH9w1Zla7CaRENcIqX4iM=";
   };
 
-  postPatch = ''
-    substituteInPlace scripts/uosc.lua \
-      --replace "mp.find_config_file('scripts')" "\"$out/share/mpv/scripts\""
-  '';
-
-  dontBuild = true;
-
-  installPhase = ''
-    runHook preInstall
-
-    mkdir -p $out/share/mpv/
-    cp -r scripts $out/share/mpv
-    cp -r fonts $out/share
+  tools = buildGoModule {
+    pname = "uosc-bin";
+    inherit (finalAttrs) version src;
+    vendorHash = "sha256-nkY0z2GiDxfNs98dpe+wZNI3dAXcuHaD/nHiZ2XnZ1Y=";
+  };
 
-    runHook postInstall
-  '';
+  # Patch lua script to get the path to its `ziggy` binary form the environment
+  patches = [
+    # uosc#814: Support overriding `ziggy_path` via environment variable
+    (fetchpatch {
+      url = "https://github.com/tomasklaen/uosc/commit/4fdf68a1bcb510824d66f35ecc7672a6452a44b2.patch";
+      hash = "sha256-igUqFf8e7LVIIjGxACdIWAeZxjF/yqaCL4QRXrzNQXk=";
+    })
+  ];
 
-  passthru.scriptName = "uosc.lua";
   # the script uses custom "texture" fonts as the background for ui elements.
   # In order for mpv to find them, we need to adjust the fontconfig search path.
+  postInstall = "cp -r src/fonts $out/share";
   passthru.extraWrapperArgs = [
     "--set"
     "FONTCONFIG_FILE"
     (toString (makeFontsConf {
       fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
     }))
+    "--set"
+    "MPV_UOSC_ZIGGY"
+    (lib.getExe' finalAttrs.tools "ziggy")
   ];
 
   meta = with lib; {
diff --git a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix
index a1713e24375f..e870818fc64f 100644
--- a/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix
+++ b/pkgs/applications/video/mpv/scripts/webtorrent-mpv-hook.nix
@@ -2,23 +2,23 @@
 
 buildNpmPackage rec {
   pname = "webtorrent-mpv-hook";
-  version = "1.3.3";
+  version = "1.4.1";
 
   src = fetchFromGitHub {
     owner = "mrxdst";
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-AFKX31kriacXygZy0Mw+QwO+SwFEu13687mJ/WeAoKY=";
+    hash = "sha256-/dMtXcIyfAs++Zgz2CxRW0tkzn5QjS+WVGChlCyrU0U=";
   };
 
   postPatch = ''
     substituteInPlace src/webtorrent.ts --replace "node_path: 'node'" "node_path: '${nodejs}/bin/node'"
     # This executable is just for telling non-Nix users how to install
-    substituteInPlace package.json --replace '"bin": "build/bin.js",' ""
+    substituteInPlace package.json --replace '"bin": "build/bin.mjs",' ""
     rm -rf src/bin.ts
   '';
 
-  npmDepsHash = "sha256-GpNUJ5ZCgMjSYLqsIE/RwkTSFT3uAhxrHPe7XvGDRHE=";
+  npmDepsHash = "sha256-EqHPBoYyBuW9elxQH/XVTZoPkKHC6+7aksYo60t7WA4=";
   makeCacheWritable = true;
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/video/rtabmap/default.nix b/pkgs/applications/video/rtabmap/default.nix
index ecfd8a676bca..200fab274339 100644
--- a/pkgs/applications/video/rtabmap/default.nix
+++ b/pkgs/applications/video/rtabmap/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , pkg-config
 , cmake
 , opencv
@@ -35,6 +36,19 @@ stdenv.mkDerivation rec {
     hash = "sha256-1xb8O3VrErldid2OgAUMG28mSUO7QBUsPuSz8p03tSI";
   };
 
+  patches = [
+    # Fix build with g2o 20230806
+    (fetchpatch {
+      url = "https://github.com/introlab/rtabmap/commit/85cc6fe3c742855ad16c8442895e12dbb10b6e8b.patch";
+      hash = "sha256-P6GkYKCNwe9dgZdgF/oEhgjA3bJnwXFWJCPoyIknQCo=";
+    })
+    # Fix typo in previous patch
+    (fetchpatch {
+      url = "https://github.com/introlab/rtabmap/commit/c4e94bcdc31b859c1049724dbb7671e4597d86de.patch";
+      hash = "sha256-1btkV4/y+bnF3xEVqlUy/9F6BoANeTOEJjZLmRzG3iA=";
+    })
+  ];
+
   nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook wrapGAppsHook ];
   buildInputs = [
     ## Required