uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
19
pkgs/applications/video/mpv/scripts/autocrop.nix
Normal file
19
pkgs/applications/video/mpv/scripts/autocrop.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ stdenvNoCC, mpv-unwrapped, lib }:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "mpv-autocrop";
|
||||
version = mpv-unwrapped.version;
|
||||
src = "${mpv-unwrapped.src.outPath}/TOOLS/lua/autocrop.lua";
|
||||
dontBuild = true;
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
install -Dm644 ${src} $out/share/mpv/scripts/autocrop.lua
|
||||
'';
|
||||
passthru.scriptName = "autocrop.lua";
|
||||
|
||||
meta = {
|
||||
description = "This script uses the lavfi cropdetect filter to automatically insert a crop filter with appropriate parameters for the currently playing video.";
|
||||
homepage = "https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autocrop.lua";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
};
|
||||
}
|
||||
19
pkgs/applications/video/mpv/scripts/autodeint.nix
Normal file
19
pkgs/applications/video/mpv/scripts/autodeint.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ stdenvNoCC, mpv-unwrapped, lib }:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "mpv-autodeint";
|
||||
version = mpv-unwrapped.version;
|
||||
src = "${mpv-unwrapped.src.outPath}/TOOLS/lua/autodeint.lua";
|
||||
dontBuild = true;
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
install -Dm644 ${src} $out/share/mpv/scripts/autodeint.lua
|
||||
'';
|
||||
passthru.scriptName = "autodeint.lua";
|
||||
|
||||
meta = {
|
||||
description = "This script uses the lavfi idet filter to automatically insert the appropriate deinterlacing filter based on a short section of the currently playing video.";
|
||||
homepage = "https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autodeint.lua";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
};
|
||||
}
|
||||
20
pkgs/applications/video/mpv/scripts/autoload.nix
Normal file
20
pkgs/applications/video/mpv/scripts/autoload.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ stdenvNoCC, mpv-unwrapped, lib }:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "mpv-autoload";
|
||||
version = mpv-unwrapped.version;
|
||||
src = "${mpv-unwrapped.src.outPath}/TOOLS/lua/autoload.lua";
|
||||
dontBuild = true;
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
install -Dm644 ${src} $out/share/mpv/scripts/autoload.lua
|
||||
'';
|
||||
passthru.scriptName = "autoload.lua";
|
||||
|
||||
meta = {
|
||||
description = "This script automatically loads playlist entries before and after the the currently played file";
|
||||
homepage = "https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua";
|
||||
maintainers = [ lib.maintainers.dawidsowa ];
|
||||
license = lib.licenses.gpl2Plus;
|
||||
};
|
||||
}
|
||||
46
pkgs/applications/video/mpv/scripts/convert.nix
Normal file
46
pkgs/applications/video/mpv/scripts/convert.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ stdenvNoCC, fetchgit, lib
|
||||
, yad, mkvtoolnix-cli, libnotify }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "mpv-convert-script";
|
||||
version = "2016-03-18";
|
||||
src = fetchgit {
|
||||
url = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
|
||||
rev = "f95cee43e390e843a47e8ec9d1711a12a8cd343d";
|
||||
sha256 = "13m7l4sy2r8jv2sfrb3vvqvnim4a9ilnv28q5drlg09v298z3mck";
|
||||
};
|
||||
|
||||
patches = [ ./convert.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace convert_script.lua \
|
||||
--replace 'mkvpropedit_exe = "mkvpropedit"' \
|
||||
'mkvpropedit_exe = "${mkvtoolnix-cli}/bin/mkvpropedit"' \
|
||||
--replace 'mkvmerge_exe = "mkvmerge"' \
|
||||
'mkvmerge_exe = "${mkvtoolnix-cli}/bin/mkvmerge"' \
|
||||
--replace 'yad_exe = "yad"' \
|
||||
'yad_exe = "${yad}/bin/yad"' \
|
||||
--replace 'notify_send_exe = "notify-send"' \
|
||||
'notify_send_exe = "${libnotify}/bin/notify-send"' \
|
||||
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/mpv/scripts
|
||||
cp convert_script.lua $out/share/mpv/scripts
|
||||
'';
|
||||
passthru.scriptName = "convert_script.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Convert parts of a video while you are watching it in mpv";
|
||||
homepage = "https://gist.github.com/Zehkul/25ea7ae77b30af959be0";
|
||||
maintainers = [ maintainers.Profpatsch ];
|
||||
longDescription = ''
|
||||
When this script is loaded into mpv, you can hit Alt+W to mark the beginning
|
||||
and Alt+W again to mark the end of the clip. Then a settings window opens.
|
||||
'';
|
||||
# author was asked to add a license https://gist.github.com/Zehkul/25ea7ae77b30af959be0#gistcomment-3715700
|
||||
license = licenses.unfree;
|
||||
};
|
||||
}
|
||||
102
pkgs/applications/video/mpv/scripts/convert.patch
Normal file
102
pkgs/applications/video/mpv/scripts/convert.patch
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
diff --git "a/Convert Script \342\200\223 README.md" "b/Convert Script \342\200\223 README.md"
|
||||
index 8e062c1..6e0d798 100644
|
||||
--- "a/Convert Script \342\200\223 README.md"
|
||||
+++ "b/Convert Script \342\200\223 README.md"
|
||||
@@ -68,7 +68,7 @@ and set some options in ``mpv/lua-settings/convert_script.conf`` or with ``--scr
|
||||
If you don’t want to upgrade your yad. Features like appending segments won’t be available.
|
||||
|
||||
libvpx_fps
|
||||
- Default: --oautofps
|
||||
+ Default: ""
|
||||
FPS settings (or any other settings really) for libvpx encoding. Set it to --ofps=24000/1001 for example.
|
||||
|
||||
-Warning: Some of these options aren’t very robust and setting them to bogus values will break the script.
|
||||
\ No newline at end of file
|
||||
+Warning: Some of these options aren’t very robust and setting them to bogus values will break the script.
|
||||
diff --git a/convert_script.lua b/convert_script.lua
|
||||
index 17d3100..90f88ec 100644
|
||||
--- a/convert_script.lua
|
||||
+++ b/convert_script.lua
|
||||
@@ -3,6 +3,12 @@ local msg = require 'mp.msg'
|
||||
local opt = require 'mp.options'
|
||||
local utils = require 'mp.utils'
|
||||
|
||||
+-- executables
|
||||
+local mkvpropedit_exe = "mkvpropedit"
|
||||
+local mkvmerge_exe = "mkvmerge"
|
||||
+local yad_exe = "yad"
|
||||
+local notify_send_exe = "notify-send"
|
||||
+
|
||||
-- default options, convert_script.conf is read
|
||||
local options = {
|
||||
bitrate_multiplier = 0.975, -- to make sure the file won’t go over the target file size, set it to 1 if you don’t care
|
||||
@@ -14,7 +20,7 @@ local options = {
|
||||
libvpx_options = "--ovcopts-add=cpu-used=0,auto-alt-ref=1,lag-in-frames=25,quality=good",
|
||||
libvpx_vp9_options = "",
|
||||
legacy_yad = false, -- if you don’t want to upgrade to at least yad 0.18
|
||||
- libvpx_fps = "--oautofps", -- --ofps=24000/1001 for example
|
||||
+ libvpx_fps = "", -- --ofps=24000/1001 for example
|
||||
audio_bitrate = 112, -- mpv default, in kbps
|
||||
}
|
||||
|
||||
@@ -247,12 +253,12 @@ function encode(enc)
|
||||
if string.len(vf) > 0 then
|
||||
vf = vf .. ","
|
||||
end
|
||||
- local sub_file_table = mp.get_property_native("options/sub-file")
|
||||
+ local sub_file_table = mp.get_property_native("options/sub-files")
|
||||
local sub_file = ""
|
||||
for index, param in pairs(sub_file_table) do
|
||||
sub_file = sub_file .. " --sub-file='" .. string.gsub(tostring(param), "'", "'\\''") .. "'"
|
||||
end
|
||||
- local audio_file_table = mp.get_property_native("options/audio-file")
|
||||
+ local audio_file_table = mp.get_property_native("options/audio-files")
|
||||
local audio_file = ""
|
||||
for index, param in pairs(audio_file_table) do
|
||||
audio_file = audio_file .. " --audio-file='" .. string.gsub(tostring(param), "'", "'\\''") .. "'"
|
||||
@@ -354,9 +360,9 @@ function encode(enc)
|
||||
if ovc == "gif" then
|
||||
full_command = full_command .. ' --vf-add=lavfi=graph=\\"framestep=' .. framestep .. '\\" && convert '
|
||||
.. tmpfolder .. '/*.png -set delay ' .. delay .. ' -loop 0 -fuzz ' .. fuzz .. '% ' .. dither .. ' -layers optimize '
|
||||
- .. full_output_path .. ' && rm -rf ' .. tmpfolder .. ' && notify-send "Gif done") & disown'
|
||||
+ .. full_output_path .. ' && rm -rf ' .. tmpfolder .. ' && ' .. notify_send_exe .. ' "Gif done") & disown'
|
||||
else
|
||||
- full_command = full_command .. ' && notify-send "Encoding done"; mkvpropedit '
|
||||
+ full_command = full_command .. ' && ' .. notify_send_exe .. ' "Encoding done"; ' .. mkvpropedit_exe .. ' '
|
||||
.. full_output_path .. ' -s title="' .. metadata_title .. '") & disown'
|
||||
end
|
||||
|
||||
@@ -409,7 +415,7 @@ function encode_copy(enc)
|
||||
sep = ",+"
|
||||
|
||||
if enc then
|
||||
- local command = "mkvmerge '" .. video .. "' " .. mkvmerge_parts .. " -o " .. full_output_path
|
||||
+ local command = mkvmerge_exe .. " '" .. video .. "' " .. mkvmerge_parts .. " -o " .. full_output_path
|
||||
msg.info(command)
|
||||
os.execute(command)
|
||||
clear()
|
||||
@@ -508,7 +514,7 @@ function call_gui ()
|
||||
end
|
||||
|
||||
|
||||
- local yad_command = [[LC_NUMERIC=C yad --title="Convert Script" --center --form --fixed --always-print-result \
|
||||
+ local yad_command = [[LC_NUMERIC=C ]] .. yad_exe .. [[ --title="Convert Script" --center --form --fixed --always-print-result \
|
||||
--name "convert script" --class "Convert Script" --field="Resize to height:NUM" "]] .. scale_sav --yad_table 1
|
||||
.. [[" --field="Resize to width instead:CHK" ]] .. resize_to_width_instead .. " " --yad_table 2
|
||||
if options.legacy_yad then
|
||||
@@ -524,7 +530,7 @@ function call_gui ()
|
||||
yad_command = yad_command
|
||||
.. [[--field="2pass:CHK" "false" ]] --yad_table 5
|
||||
.. [[--field="Encode options::CBE" '! --ovcopts=b=2000,cpu-used=0,auto-alt-ref=1,lag-in-frames=25,quality=good,threads=4' ]] --yad_table 6
|
||||
- .. [[--field="Output format::CBE" ' --ovc=libx264! --oautofps --of=webm --ovc=libvpx' ]]
|
||||
+ .. [[--field="Output format::CBE" ' --ovc=libx264! --of=webm --ovc=libvpx' ]]
|
||||
.. [[--field="Simple:FBTN" 'bash -c "echo \"simple\" && kill -s SIGUSR1 \"$YAD_PID\""' ]]
|
||||
advanced = true
|
||||
else
|
||||
@@ -734,4 +740,4 @@ mp.set_key_bindings({
|
||||
|
||||
mp.add_key_binding("alt+w", "convert_script", convert_script_hotkey_call)
|
||||
|
||||
-mp.register_event("tick", tick)
|
||||
\ No newline at end of file
|
||||
+mp.register_event("tick", tick)
|
||||
47
pkgs/applications/video/mpv/scripts/cutter.nix
Normal file
47
pkgs/applications/video/mpv/scripts/cutter.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ lib, stdenvNoCC, fetchFromGitHub, makeWrapper }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "video-cutter";
|
||||
version = "unstable-2021-02-03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rushmj";
|
||||
repo = "mpv-video-cutter";
|
||||
rev = "718d6ce9356e63fdd47208ec44f575a212b9068a";
|
||||
sha256 = "sha256-ramID1DPl0UqEzevpqdYKb9aaW3CAy3Dy9CPb/oJ4eY=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
dontCheck = true;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace cutter.lua \
|
||||
--replace '~/.config/mpv/scripts/c_concat.sh' '${placeholder "out"}/share/mpv/scripts/c_concat.sh'
|
||||
|
||||
# needs to be ran separately so that we can replace everything, and not every single mention explicitly
|
||||
# original script places them in the scripts folder, just spawning unnecessary errors
|
||||
# i know that hardcoding .config and especially the .mpv directory isn't best practice, but I didn't want to deviate too much from upstream
|
||||
substituteInPlace cutter.lua \
|
||||
--replace '~/.config/mpv/scripts' "''${XDG_CONFIG_HOME:-~/.config}/mpv/cutter"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 c_concat.sh $out/share/mpv/scripts/c_concat.sh
|
||||
install cutter.lua $out/share/mpv/scripts/cutter.lua
|
||||
|
||||
wrapProgram $out/share/mpv/scripts/c_concat.sh \
|
||||
--run "mkdir -p ~/.config/mpv/cutter/"
|
||||
'';
|
||||
|
||||
passthru.scriptName = "cutter.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Cut videos and concat them automatically";
|
||||
homepage = "https://github.com/rushmj/mpv-video-cutter";
|
||||
# repo doesn't have a license
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ lom ];
|
||||
};
|
||||
}
|
||||
39
pkgs/applications/video/mpv/scripts/mpris.nix
Normal file
39
pkgs/applications/video/mpv/scripts/mpris.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, stdenv, fetchpatch, fetchFromGitHub, pkg-config, glib, mpv-unwrapped }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mpv-mpris";
|
||||
version = "0.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hoyon";
|
||||
repo = "mpv-mpris";
|
||||
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 = [ pkg-config ];
|
||||
|
||||
buildInputs = [ glib mpv-unwrapped ];
|
||||
|
||||
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 lib; {
|
||||
description = "MPRIS plugin for mpv";
|
||||
homepage = "https://github.com/hoyon/mpv-mpris";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ jfrankenau ];
|
||||
};
|
||||
}
|
||||
37
pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
Normal file
37
pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, stdenvNoCC, fetchFromGitHub, youtube-dl }:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "mpv-playlistmanager";
|
||||
version = "unstable-2021-09-27";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jonniek";
|
||||
repo = "mpv-playlistmanager";
|
||||
rev = "9a759b300c92b55e82be5824fe058e263975741a";
|
||||
sha256 = "qMzDJlouBptwyNdw2ag4VKEtmkQNUlos0USPerBAV/s=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace playlistmanager.lua \
|
||||
--replace "'youtube-dl'" "'${youtube-dl}/bin/youtube-dl'" \
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/share/mpv/scripts
|
||||
cp playlistmanager.lua $out/share/mpv/scripts
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.scriptName = "playlistmanager.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Mpv lua script to create and manage playlists";
|
||||
homepage = "https://github.com/jonniek/mpv-playlistmanager";
|
||||
license = licenses.unlicense;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ lunik1 ];
|
||||
};
|
||||
}
|
||||
48
pkgs/applications/video/mpv/scripts/mpvacious.nix
Normal file
48
pkgs/applications/video/mpv/scripts/mpvacious.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ lib
|
||||
, stdenvNoCC
|
||||
, fetchFromGitHub
|
||||
, curl
|
||||
, wl-clipboard
|
||||
, xclip
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "mpvacious";
|
||||
version = "0.15";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Ajatt-Tools";
|
||||
repo = "mpvacious";
|
||||
rev = "v${version}";
|
||||
sha256 = "1lxlgbjk4x3skg5s7kkr9llcdlmpmabfrcslwhhz5f4j3bq7498w";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# 'require' replaced with 'dofile' to work around
|
||||
# https://github.com/mpv-player/mpv/issues/7399 until fixed in mpvacious
|
||||
substituteInPlace subs2srs.lua \
|
||||
--replace "require('osd_styler')" "dofile('"$out/share/mpv/scripts/mpvacious/osd_styler.lua"')" \
|
||||
--replace "'curl'" "'${curl}/bin/curl'" \
|
||||
--replace "'wl-copy'" "'${wl-clipboard}/bin/wl-copy'" \
|
||||
--replace "xclip" "${xclip}/bin/xclip"
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/share/mpv/scripts/mpvacious
|
||||
cp *.lua $out/share/mpv/scripts/mpvacious
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.scriptName = "mpvacious/subs2srs.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Adds mpv keybindings to create Anki cards from movies and TV shows";
|
||||
homepage = "https://github.com/Ajatt-Tools/mpvacious";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ kmicklas ];
|
||||
};
|
||||
}
|
||||
33
pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
Normal file
33
pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ lib, stdenvNoCC
|
||||
, fetchFromGitHub }:
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "simple-mpv-ui";
|
||||
version = "2.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "open-dynaMIX";
|
||||
repo = "simple-mpv-webui";
|
||||
rev = "v${version}";
|
||||
sha256 = "1z0y8sdv5mbxznxqh43w5592ym688vkvqg7w26p8cinrhf09pbw8";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/mpv/scripts
|
||||
cp -r webui.lua webui-page $out/share/mpv/scripts/
|
||||
'';
|
||||
passthru.scriptName = "webui.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A web based user interface with controls for the mpv mediaplayer";
|
||||
homepage = "https://github.com/open-dynaMIX/simple-mpv-webui";
|
||||
maintainers = with maintainers; [ cript0nauta zopieux ];
|
||||
longDescription = ''
|
||||
You can access the webui when accessing http://127.0.0.1:8080 or
|
||||
http://[::1]:8080 in your webbrowser. By default it listens on
|
||||
0.0.0.0:8080 and [::0]:8080
|
||||
'';
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
|
||||
54
pkgs/applications/video/mpv/scripts/sponsorblock.nix
Normal file
54
pkgs/applications/video/mpv/scripts/sponsorblock.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ lib, stdenvNoCC, fetchFromGitHub, fetchpatch, python3 }:
|
||||
|
||||
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.sponsorblock ]; }`
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "mpv_sponsorblock";
|
||||
version = "unstable-2021-12-23";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "po5";
|
||||
repo = "mpv_sponsorblock";
|
||||
rev = "6743bd47d4cfce3ae3d5dd4f587f3193bd4fb9b2";
|
||||
sha256 = "06c37f33cdpz1w1jacjf1wnbh4f9b1xpipxzkg5ixf46cbwssmsj";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
patches = [
|
||||
# Use XDG_DATA_HOME and XDG_CACHE_HOME if defined for UID and DB
|
||||
# Necessary to avoid sponsorblock to write in the nix store at runtime.
|
||||
# https://github.com/po5/mpv_sponsorblock/pull/17
|
||||
(fetchpatch {
|
||||
url = "https://github.com/po5/mpv_sponsorblock/pull/17/commits/e65b360a7d03a3430b4829e457a6670b2f617b09.patch";
|
||||
sha256 = "00wv0pvbz0dz2ibka66zhl2jk0pil4pyv6ipjfz37i81q6szyhs5";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/po5/mpv_sponsorblock/pull/17/commits/3832304d959205e99120a14c0560ed3c37104b08.patch";
|
||||
sha256 = "149ffvn714n2m3mqs8mgrbs24bcr74kqfkx7wyql36ndhm88xd2z";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace sponsorblock.lua \
|
||||
--replace "python3" "${python3}/bin/python3" \
|
||||
--replace 'mp.find_config_file("scripts")' "\"$out/share/mpv/scripts\""
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/mpv/scripts
|
||||
cp -r sponsorblock.lua sponsorblock_shared $out/share/mpv/scripts/
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
scriptName = "sponsorblock.lua";
|
||||
updateScript = ./update-sponsorblock.sh;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Script for mpv to skip sponsored segments of YouTube videos";
|
||||
homepage = "https://github.com/po5/mpv_sponsorblock";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ pacien ];
|
||||
};
|
||||
}
|
||||
36
pkgs/applications/video/mpv/scripts/thumbnail.nix
Normal file
36
pkgs/applications/video/mpv/scripts/thumbnail.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ fetchFromGitHub, lib, python3, stdenvNoCC }:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "mpv_thumbnail_script";
|
||||
version = "unstable-2020-01-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "theamm";
|
||||
repo = pname;
|
||||
rev = "682becf5b5115c2a206b4f0bdee413d4be8b5bef";
|
||||
sha256 = "0dgfrb8ypc5vlq35kzn423fm6l6348ivl85vb6j3ccc9a51xprw3";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ python3 ];
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs concat_files.py
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/share/mpv/scripts
|
||||
cp mpv_thumbnail_script_{client_osc,server}.lua $out/share/mpv/scripts
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.scriptName = "mpv_thumbnail_script_{client_osc,server}.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A lua script to show preview thumbnails in mpv's OSC seekbar";
|
||||
homepage = "https://github.com/theamm/mpv_thumbnail_script";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ figsoda ];
|
||||
};
|
||||
}
|
||||
49
pkgs/applications/video/mpv/scripts/update-sponsorblock.sh
Executable file
49
pkgs/applications/video/mpv/scripts/update-sponsorblock.sh
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p common-updater-scripts git jq nix nix-prefetch-git
|
||||
git_url='https://github.com/po5/mpv_sponsorblock.git'
|
||||
git_branch='master'
|
||||
git_dir='/var/tmp/mpv_sponsorblock.git'
|
||||
nix_file="$(dirname "${BASH_SOURCE[0]}")/sponsorblock.nix"
|
||||
pkg='mpvScripts.sponsorblock'
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
info() {
|
||||
if [ -t 2 ]; then
|
||||
set -- '\033[32m%s\033[39m\n' "$@"
|
||||
else
|
||||
set -- '%s\n' "$@"
|
||||
fi
|
||||
printf "$@" >&2
|
||||
}
|
||||
|
||||
old_rev=$(nix-instantiate --eval --strict --json -A "$pkg.src.rev" | jq -r)
|
||||
old_version=$(nix-instantiate --eval --strict --json -A "$pkg.version" | jq -r)
|
||||
today=$(LANG=C date -u +'%Y-%m-%d')
|
||||
|
||||
info "fetching $git_url..."
|
||||
if [ ! -d "$git_dir" ]; then
|
||||
git init --initial-branch="$git_branch" "$git_dir"
|
||||
git -C "$git_dir" remote add origin "$git_url"
|
||||
fi
|
||||
git -C "$git_dir" fetch origin "$git_branch"
|
||||
|
||||
# use latest commit before today, we should not call the version *today*
|
||||
# because there might still be commits coming
|
||||
# use the day of the latest commit we picked as version
|
||||
new_rev=$(git -C "$git_dir" log -n 1 --format='format:%H' --before="${today}T00:00:00Z" "origin/$git_branch")
|
||||
new_version="unstable-$(git -C "$git_dir" log -n 1 --format='format:%cs' "$new_rev")"
|
||||
info "latest commit before $today: $new_rev"
|
||||
|
||||
if [ "$new_rev" = "$old_rev" ]; then
|
||||
info "$pkg is up-to-date."
|
||||
exit
|
||||
fi
|
||||
|
||||
new_sha256=$(nix-prefetch-git --rev "$new_rev" "$git_dir" | jq -r .sha256)
|
||||
update-source-version "$pkg" \
|
||||
"$new_version" \
|
||||
"$new_sha256" \
|
||||
--rev="$new_rev"
|
||||
git add "$nix_file"
|
||||
git commit --verbose --message "$pkg: $old_version -> $new_version"
|
||||
35
pkgs/applications/video/mpv/scripts/vr-reversal.nix
Normal file
35
pkgs/applications/video/mpv/scripts/vr-reversal.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, stdenvNoCC, fetchFromGitHub, ffmpeg }:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "vr-reversal";
|
||||
version = "1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dfaker";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1wn2ngcvn7wcsl3kmj782x5q9130qw951lj6ilrkafp6q6zscpqr";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
# reset_rot is only available in ffmpeg 5.0, see 5bcc61ce87922ecccaaa0bd303a7e195929859a8
|
||||
postPatch = lib.optionalString (lib.versionOlder ffmpeg.version "5.0") ''
|
||||
substituteInPlace 360plugin.lua --replace ":reset_rot=1:" ":"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/mpv/scripts
|
||||
cp -r 360plugin.lua $out/share/mpv/scripts/
|
||||
'';
|
||||
|
||||
passthru.scriptName = "360plugin.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Script for mpv to play VR video with optional saving of head tracking data.";
|
||||
homepage = "https://github.com/dfaker/VR-reversal";
|
||||
license = licenses.unlicense;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ schnusch ];
|
||||
};
|
||||
}
|
||||
39
pkgs/applications/video/mpv/scripts/youtube-quality.nix
Normal file
39
pkgs/applications/video/mpv/scripts/youtube-quality.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib
|
||||
, stdenvNoCC
|
||||
, fetchFromGitHub
|
||||
, oscSupport ? false
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "mpv-youtube-quality";
|
||||
version = "unstable-2020-02-11";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jgreco";
|
||||
repo = "mpv-youtube-quality";
|
||||
rev = "1f8c31457459ffc28cd1c3f3c2235a53efad7148";
|
||||
sha256 = "voNP8tCwCv8QnAZOPC9gqHRV/7jgCAE63VKBd/1s5ic=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/share/mpv/scripts
|
||||
cp youtube-quality.lua $out/share/mpv/scripts
|
||||
'' + lib.optionalString oscSupport ''
|
||||
cp youtube-quality-osc.lua $out/share/mpv/scripts
|
||||
'' + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.scriptName = "youtube-quality.lua";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A userscript for MPV that allows you to change youtube video quality (ytdl-format) on the fly";
|
||||
homepage = "https://github.com/jgreco/mpv-youtube-quality";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ lunik1 ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue