fzf: remove perl dependency

Since fzf 0.43.0, the history command only uses Perl if it's installed
otherwise uses Awk [1].

[1] 9f7684f6fe
This commit is contained in:
Mario Rodas 2024-04-07 04:20:00 +00:00
parent 1035a9efdf
commit 41d1adec69

View File

@ -1,26 +1,13 @@
{ stdenv { lib
, lib
, buildGoModule , buildGoModule
, fetchFromGitHub , fetchFromGitHub
, writeShellScriptBin
, installShellFiles , installShellFiles
, bc , bc
, ncurses , ncurses
, perl
, testers , testers
, fzf , fzf
}: }:
let
# on Linux, wrap perl in the bash completion scripts with the glibc locales,
# so that using the shell completion (ctrl+r, etc) doesn't result in ugly
# warnings on non-nixos machines
ourPerl = if !stdenv.isLinux then perl else (
writeShellScriptBin "perl" ''
export PERL_BADLANG=0
exec ${perl}/bin/perl "$@"
'');
in
buildGoModule rec { buildGoModule rec {
pname = "fzf"; pname = "fzf";
version = "0.49.0"; version = "0.49.0";
@ -55,14 +42,9 @@ buildGoModule rec {
exit 1 exit 1
fi fi
# Has a sneaky dependency on perl
# Include first args to make sure we're patching the right thing
substituteInPlace shell/key-bindings.bash \
--replace "command -v perl" "command -v ${ourPerl}/bin/perl" \
--replace " perl -n " " ${ourPerl}/bin/perl -n "
# fzf-tmux depends on bc # fzf-tmux depends on bc
substituteInPlace bin/fzf-tmux \ substituteInPlace bin/fzf-tmux \
--replace "bc" "${bc}/bin/bc" --replace "bc" "${bc}/bin/bc"
''; '';
postInstall = '' postInstall = ''