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
, fetchFromGitHub
, writeShellScriptBin
, installShellFiles
, bc
, ncurses
, perl
, testers
, 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 {
pname = "fzf";
version = "0.49.0";
@ -55,14 +42,9 @@ buildGoModule rec {
exit 1
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
substituteInPlace bin/fzf-tmux \
--replace "bc" "${bc}/bin/bc"
substituteInPlace bin/fzf-tmux \
--replace "bc" "${bc}/bin/bc"
'';
postInstall = ''