diff --git a/pkgs/tools/misc/lesspipe/default.nix b/pkgs/tools/misc/lesspipe/default.nix index 5c8a13e3c20..8977f901395 100644 --- a/pkgs/tools/misc/lesspipe/default.nix +++ b/pkgs/tools/misc/lesspipe/default.nix @@ -1,11 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, substituteAll, perl, file, ncurses }: +{ lib, stdenv, fetchFromGitHub, substituteAll, perl, file, ncurses, bash }: stdenv.mkDerivation rec { pname = "lesspipe"; version = "1.85"; - buildInputs = [ perl ]; - preConfigure = "patchShebangs ."; + nativeBuildInputs = [ perl ]; + buildInputs = [ perl bash ]; + strictDeps = true; + preConfigure = '' + patchShebangs --build configure + ''; + configureFlags = [ "--shell=${bash}/bin/bash" "--yes" ]; + configurePlatforms = []; + dontBuild = true; src = fetchFromGitHub { owner = "wofr06"; @@ -20,6 +27,7 @@ stdenv.mkDerivation rec { file = "${file}/bin/file"; tput = "${ncurses}/bin/tput"; }) + ./override-shell-detection.patch ]; meta = with lib; { diff --git a/pkgs/tools/misc/lesspipe/override-shell-detection.patch b/pkgs/tools/misc/lesspipe/override-shell-detection.patch new file mode 100644 index 00000000000..08ef7e07b7c --- /dev/null +++ b/pkgs/tools/misc/lesspipe/override-shell-detection.patch @@ -0,0 +1,12 @@ +--- a/configure ++++ b/configure +@@ -101,7 +101,8 @@ + open OUT, ">lesspipe.sh.tmp"; + my $in = 1; + my $anyin; +-my $shell = check_shell_vers(); ++my $shell = $opt_shell; ++print OUT "#!$shell\n"; + # ask if syntax highlighting should be included + $ifsyntax = ''; + if ($opt_yes) {