Merge pull request #116342 from dotlambda/ytfzf-1.1.0

ytfzf: 1.0.1 -> 1.1.0
This commit is contained in:
Sandro 2021-03-15 09:37:03 +01:00 committed by GitHub
commit 266dc8c3d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 3 deletions

View File

@ -2,25 +2,34 @@
, stdenv
, fetchFromGitHub
, makeWrapper
, coreutils
, curl
, dmenu
, fzf
, gnused
, jq
, mpv
, ncurses
, ueberzug
, youtube-dl
}:
stdenv.mkDerivation rec {
pname = "ytfzf";
version = "1.0.1";
version = "1.1.0";
src = fetchFromGitHub {
owner = "pystardust";
repo = "ytfzf";
rev = "v${version}";
sha256 = "1i9ya38zcaj1vkfgy1n4gp5vqb59zlrd609pdmz4jqinrb0c5fgv";
sha256 = "sha256-ATQRXYaIp1MKCO/EAPsopzFEZeNJzdk73/OcgjsMdkg=";
};
patches = [
# Updates have to be installed through Nix.
./no-update.patch
];
nativeBuildInputs = [ makeWrapper ];
makeFlags = [ "PREFIX=${placeholder "out"}/bin" ];
@ -29,7 +38,7 @@ stdenv.mkDerivation rec {
postInstall = ''
wrapProgram "$out/bin/ytfzf" --prefix PATH : ${lib.makeBinPath [
curl dmenu fzf jq mpv youtube-dl
coreutils curl dmenu fzf gnused jq mpv ncurses ueberzug youtube-dl
]}
'';

View File

@ -0,0 +1,30 @@
diff --git a/ytfzf b/ytfzf
index 5238682..c5c3a1a 100755
--- a/ytfzf
+++ b/ytfzf
@@ -757,23 +757,8 @@ clear_history () {
}
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"
- if [ "$(uname)" = "Darwin" ]; then
- sudo cp "$updatefile" "/usr/local/bin/ytfzf"
- else
- sudo cp "$updatefile" "/usr/bin/ytfzf"
- fi
- else
- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset"
- fi
-
- rm "$updatefile"
- exit
+ printf "%bUpdates have to be installed through Nix.%b\n" "$c_red" "$c_reset"
+ exit 1
}