mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-07 04:57:26 +03:00
Merge pull request #270927 from nbraud/mpvScripts/sponsorblock
mpvScripts.sponsorblock: Simplify with `buildLua`
This commit is contained in:
commit
2b97055f53
@ -36,6 +36,9 @@ lib.makeOverridable (args: stdenvNoCC.mkDerivation (extendedBy
|
||||
dontBuild = true;
|
||||
preferLocalBuild = true;
|
||||
|
||||
# Prevent `patch` from emitting `.orig` files (that end up in the output)
|
||||
patchFlags = [ "--no-backup-if-mismatch" "-p1" ];
|
||||
|
||||
outputHashMode = "recursive";
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ lib, stdenvNoCC, fetchFromGitHub, fetchpatch, python3, nix-update-script }:
|
||||
{ lib, buildLua, fetchFromGitHub, fetchpatch, python3, nix-update-script }:
|
||||
|
||||
# Usage: `pkgs.mpv.override { scripts = [ pkgs.mpvScripts.sponsorblock ]; }`
|
||||
stdenvNoCC.mkDerivation {
|
||||
buildLua {
|
||||
pname = "mpv_sponsorblock";
|
||||
version = "unstable-2023-01-30";
|
||||
|
||||
@ -12,8 +12,6 @@ stdenvNoCC.mkDerivation {
|
||||
sha256 = "sha256-iUXaTWWFEdxhxClu2NYbQcThlvYty3A2dEYGooeAVAQ=";
|
||||
};
|
||||
|
||||
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.
|
||||
@ -34,23 +32,16 @@ stdenvNoCC.mkDerivation {
|
||||
--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/
|
||||
'';
|
||||
postInstall = "cp -a sponsorblock_shared $out/share/mpv/scripts/";
|
||||
|
||||
passthru = {
|
||||
scriptName = "sponsorblock.lua";
|
||||
updateScript = nix-update-script {
|
||||
extraArgs = [ "--version=branch" ];
|
||||
};
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [ "--version=branch" ];
|
||||
};
|
||||
|
||||
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 ];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user