commit fe8869197b194aa578a1974e3b45091f7b034ed0
parent 0e2095fdbf0fa5fe4f7956c0eff5751f28b1699a
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Tue, 18 Feb 2020 22:46:32 +0300
Fix libshell
Diffstat:
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/pkgs/development/libraries/libshell/default.nix b/pkgs/development/libraries/libshell/default.nix
@@ -1,23 +1,28 @@
-{ stdenv, dash, help2man, ncurses, scdoc, sources }:
+{ stdenv, bash, dash, help2man, ncurses, sources
+, withDoc ? false, scdoc }:
stdenv.mkDerivation rec {
pname = "libshell";
version = stdenv.lib.substring 0 7 src.rev;
src = sources.libshell;
- nativeBuildInputs = [ help2man scdoc ];
- buildInputs = [ dash ncurses ];
+ nativeBuildInputs = [ help2man ];
postPatch = ''
- substituteInPlace Makefile \
- --replace "/usr" ""
- substituteInPlace utils/Makefile \
- --replace "/usr" ""
- substituteInPlace utils/cgrep.in \
- --replace "/bin/ash" "${dash}/bin/dash"
+ substituteInPlace Makefile --replace "/usr" ""
+ substituteInPlace utils/Makefile --replace "/usr" ""
+ substituteInPlace utils/cgrep.in --replace "/bin/ash" "${dash}/bin/dash"
+ substituteInPlace shell-terminfo --replace "tput" "${ncurses}/bin/tput"
+ for f in shell-* ; do
+ substituteInPlace $f --replace "/bin/sh" "${bash}/bin/sh"
+ done
'';
- makeFlags = [ "DESTDIR=$(out)" ];
+ makeFlags = with stdenv.lib; [
+ "DESTDIR=$(out)"
+ (optional withDoc "SCDOC=${scdoc}/bin/scdoc")
+ (optional (!withDoc) "SCDOC=")
+ ];
doCheck = false;