mpv: use wrapper for scripts and add mpris script
This commit is contained in:
parent
1bec0a9ed4
commit
402ee4e9ea
@ -38,9 +38,6 @@
|
|||||||
, vapoursynthSupport ? false, vapoursynth ? null
|
, vapoursynthSupport ? false, vapoursynth ? null
|
||||||
, archiveSupport ? false, libarchive ? null
|
, archiveSupport ? false, libarchive ? null
|
||||||
, jackaudioSupport ? false, libjack2 ? null
|
, jackaudioSupport ? false, libjack2 ? null
|
||||||
|
|
||||||
# scripts you want to be loaded by default
|
|
||||||
, scripts ? []
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -180,7 +177,6 @@ in stdenv.mkDerivation rec {
|
|||||||
ln -s ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mpv/subfont.ttf
|
ln -s ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mpv/subfont.ttf
|
||||||
# Ensure youtube-dl is available in $PATH for MPV
|
# Ensure youtube-dl is available in $PATH for MPV
|
||||||
wrapProgram $out/bin/mpv \
|
wrapProgram $out/bin/mpv \
|
||||||
--add-flags "--scripts=${concatStringsSep "," scripts}" \
|
|
||||||
--prefix LUA_PATH : "${luaPath}" \
|
--prefix LUA_PATH : "${luaPath}" \
|
||||||
--prefix LUA_CPATH : "${luaCPath}" \
|
--prefix LUA_CPATH : "${luaCPath}" \
|
||||||
'' + optionalString youtubeSupport ''
|
'' + optionalString youtubeSupport ''
|
||||||
|
28
pkgs/applications/video/mpv/scripts/mpris.nix
Normal file
28
pkgs/applications/video/mpv/scripts/mpris.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{ stdenv, fetchFromGitHub, pkgconfig, gobjectIntrospection, mpv }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "mpv-mpris-${version}.so";
|
||||||
|
version = "0.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "hoyon";
|
||||||
|
repo = "mpv-mpris";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "0rsbrbv5q7vki59wdlx4cdkd0vvd79qgbjvdb3fn3li7aznvjwiy";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
|
|
||||||
|
buildInputs = [ gobjectIntrospection mpv ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
cp mpris.so $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "MPRIS plugin for mpv";
|
||||||
|
homepage = https://github.com/hoyon/mpv-mpris;
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ jfrankenau ];
|
||||||
|
};
|
||||||
|
}
|
14
pkgs/applications/video/mpv/wrapper.nix
Normal file
14
pkgs/applications/video/mpv/wrapper.nix
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{ stdenv, symlinkJoin, makeWrapper, mpv, scripts ? [] }:
|
||||||
|
|
||||||
|
symlinkJoin {
|
||||||
|
name = "mpv-with-scripts-${mpv.version}";
|
||||||
|
|
||||||
|
paths = [ mpv ];
|
||||||
|
|
||||||
|
buildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/mpv \
|
||||||
|
--add-flags "${stdenv.lib.concatMapStringsSep " " (x: "--script=" + x) scripts}"
|
||||||
|
'';
|
||||||
|
}
|
@ -17374,8 +17374,11 @@ with pkgs;
|
|||||||
xvSupport = !stdenv.isDarwin;
|
xvSupport = !stdenv.isDarwin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mpv-with-scripts = callPackage ../applications/video/mpv/wrapper.nix { };
|
||||||
|
|
||||||
mpvScripts = {
|
mpvScripts = {
|
||||||
convert = callPackage ../applications/video/mpv/scripts/convert.nix {};
|
convert = callPackage ../applications/video/mpv/scripts/convert.nix {};
|
||||||
|
mpris = callPackage ../applications/video/mpv/scripts/mpris.nix {};
|
||||||
};
|
};
|
||||||
|
|
||||||
mrpeach = callPackage ../applications/audio/pd-plugins/mrpeach { };
|
mrpeach = callPackage ../applications/audio/pd-plugins/mrpeach { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user