ytfzf: 1.2.0 -> 2.0

https://github.com/pystardust/ytfzf/releases/tag/v2.0
This commit is contained in:
Robert Schütz 2021-12-30 08:22:09 +00:00 committed by Robert Schütz
parent 47e6b33a61
commit 4cd8e98f48
2 changed files with 10 additions and 39 deletions

View file

@ -2,6 +2,7 @@
, stdenv
, fetchFromGitHub
, makeWrapper
, chafa
, coreutils
, curl
, dmenu
@ -9,27 +10,21 @@
, gnused
, jq
, mpv
, ncurses
, ueberzug
, youtube-dl
, yt-dlp
}:
stdenv.mkDerivation rec {
pname = "ytfzf";
version = "1.2.0";
version = "2.0";
src = fetchFromGitHub {
owner = "pystardust";
repo = "ytfzf";
rev = "v${version}";
sha256 = "sha256-3wbjCtRmnd9tm8kqKaIF6VmMdKsWznhOvQkEsrAJpAE=";
sha256 = "sha256-JuLfFC3oz2FvCaD+XPuL1N8tGKmv4atyZIBeDKWYgT8=";
};
patches = [
# Updates have to be installed through Nix.
./no-update.patch
];
nativeBuildInputs = [ makeWrapper ];
makeFlags = [ "PREFIX=${placeholder "out"}/bin" ];
@ -38,8 +33,13 @@ stdenv.mkDerivation rec {
postInstall = ''
wrapProgram "$out/bin/ytfzf" --prefix PATH : ${lib.makeBinPath [
coreutils curl dmenu fzf gnused jq mpv ncurses ueberzug youtube-dl
chafa coreutils curl dmenu fzf gnused jq mpv ueberzug yt-dlp
]}
gzip -c docs/man/ytfzf.1 > docs/man/ytfzf.1.gz
gzip -c docs/man/ytfzf.5 > docs/man/ytfzf.5.gz
install -Dt "$out/share/man/man1" docs/man/ytfzf.1.gz
install -Dt "$out/share/man/man5" docs/man/ytfzf.5.gz
'';
meta = with lib; {

View file

@ -1,29 +0,0 @@
diff --git a/ytfzf b/ytfzf
index f4d2e0d..7a3b4b6 100755
--- a/ytfzf
+++ b/ytfzf
@@ -1260,22 +1260,8 @@ EOF
}
update_ytfzf () {
- branch="$1"
- updatefile="/tmp/ytfzf-update"
- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile"
-
- if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then
- chmod 755 "$updatefile"
- [ "$(uname)" = "Darwin" ] && prefix="/usr/local/bin" || prefix="/usr/bin"
- function_exists "sudo" && doasroot="sudo" || doasroot="doas"
- $doasroot cp "$updatefile" "$prefix/ytfzf"
- unset prefix doasroot
- else
- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset"
- fi
-
- rm "$updatefile"
- exit 0
+ printf "%bUpdates have to be installed through Nix.%b\n" "$c_red" "$c_reset"
+ exit 1
}
#gives a value to sort by (this will give the unix time the video was uploaded)