diff options
author | Doron Behar <doron.behar@gmail.com> | 2020-05-03 21:05:15 +0300 |
---|---|---|
committer | Doron Behar <doron.behar@gmail.com> | 2020-05-06 10:30:20 +0300 |
commit | b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a (patch) | |
tree | de9b9f9b55b561a2fac1472e90247e74d2b59d9f /pkgs/applications | |
parent | f388ca8ac842a757fc4223aa3ef6743f84a82e41 (diff) | |
download | nixlib-b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a.tar nixlib-b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a.tar.gz nixlib-b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a.tar.bz2 nixlib-b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a.tar.lz nixlib-b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a.tar.xz nixlib-b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a.tar.zst nixlib-b0ac6a009b5e8e121178a5e4eaf6cc964c38f61a.zip |
mpvScripts.mpris: use patch sent upstream for make DESTDIR=
Make sure mpris.so is stripped. mpv-with-scripts: use a standard location for scripts in $out. mpvScripts.convert: install to the new location of mpv scripts. Replaced gobject-introspection dependency with glib.
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/video/mpv/scripts/convert.nix | 7 | ||||
-rw-r--r-- | pkgs/applications/video/mpv/scripts/mpris.nix | 22 | ||||
-rw-r--r-- | pkgs/applications/video/mpv/wrapper.nix | 2 |
3 files changed, 22 insertions, 9 deletions
diff --git a/pkgs/applications/video/mpv/scripts/convert.nix b/pkgs/applications/video/mpv/scripts/convert.nix index a89b4ec0889a..ce0695203328 100644 --- a/pkgs/applications/video/mpv/scripts/convert.nix +++ b/pkgs/applications/video/mpv/scripts/convert.nix @@ -2,7 +2,8 @@ , yad, mkvtoolnix-cli, libnotify }: stdenv.mkDerivation { - name = "mpv-convert-script-2016-03-18.lua"; + pname = "mpv-convert-script"; + version = "2016-03-18"; src = fetchgit { url = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0"; rev = "f95cee43e390e843a47e8ec9d1711a12a8cd343d"; @@ -24,8 +25,10 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' - cp convert_script.lua $out + mkdir -p $out/share/mpv/scripts + cp convert_script.lua $out/share/mpv/scripts ''; + passthru.scriptName = "convert_script.lua"; meta = { description = "Convert parts of a video while you are watching it in mpv"; diff --git a/pkgs/applications/video/mpv/scripts/mpris.nix b/pkgs/applications/video/mpv/scripts/mpris.nix index 06d8e0c22222..f19db554d045 100644 --- a/pkgs/applications/video/mpv/scripts/mpris.nix +++ b/pkgs/applications/video/mpv/scripts/mpris.nix @@ -1,7 +1,7 @@ -{ stdenv, fetchFromGitHub, pkgconfig, gobject-introspection, mpv }: +{ stdenv, fetchpatch, fetchFromGitHub, pkgconfig, glib, mpv }: stdenv.mkDerivation rec { - name = "mpv-mpris-${version}.so"; + pname = "mpv-mpris"; version = "0.5"; src = fetchFromGitHub { @@ -10,14 +10,24 @@ stdenv.mkDerivation rec { rev = version; sha256 = "07p6li5z38pkfd40029ag2jqx917vyl3ng5p2i4v5a0af14slcnk"; }; + patches = [ + # Enables to "make SCRIPTS_DIR=... install" https://github.com/hoyon/mpv-mpris/pull/38 + (fetchpatch { + url = "https://github.com/hoyon/mpv-mpris/commit/f1482350868bf20e4575f923943ec998469b255e.patch"; + sha256 = "1lqy867wpmj6hv3zgi6g679a7x3dv5skpw24hwd05b28galnyd4l"; + }) + ]; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ gobject-introspection mpv ]; + buildInputs = [ glib mpv ]; - installPhase = '' - cp mpris.so $out - ''; + installFlags = [ "SCRIPTS_DIR=$(out)/share/mpv/scripts" ]; + + # Otherwise, the shared object isn't `strip`ped. See: + # https://discourse.nixos.org/t/debug-why-a-derivation-has-a-reference-to-gcc/7009 + stripDebugList = [ "share/mpv/scripts" ]; + passthru.scriptName = "mpris.so"; meta = with stdenv.lib; { description = "MPRIS plugin for mpv"; diff --git a/pkgs/applications/video/mpv/wrapper.nix b/pkgs/applications/video/mpv/wrapper.nix index 624c06414fd3..53def80e7dab 100644 --- a/pkgs/applications/video/mpv/wrapper.nix +++ b/pkgs/applications/video/mpv/wrapper.nix @@ -9,6 +9,6 @@ symlinkJoin { postBuild = '' wrapProgram $out/bin/mpv \ - --add-flags "${stdenv.lib.concatMapStringsSep " " (x: "--script=" + x) scripts}" + --add-flags "${stdenv.lib.concatMapStringsSep " " (x: "--script=${x}/share/mpv/scripts/${x.scriptName}") scripts}" ''; } |