summary refs log tree commit diff
path: root/pkgs/shells/bash
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-04-18 13:00:40 +0000
committerRobin Gloster <mail@glob.in>2016-04-18 13:49:22 +0000
commitd020caa5b2eca90ea051403fbb4c52b99ee071b9 (patch)
treeba44ef1e784bca89e0df6b249956fd035b1d86e3 /pkgs/shells/bash
parent3e68106afd95df012ddb548575f0133681687a90 (diff)
parent0729f606973870c03d21bb2f21b70d91216943ca (diff)
downloadnixlib-d020caa5b2eca90ea051403fbb4c52b99ee071b9.tar
nixlib-d020caa5b2eca90ea051403fbb4c52b99ee071b9.tar.gz
nixlib-d020caa5b2eca90ea051403fbb4c52b99ee071b9.tar.bz2
nixlib-d020caa5b2eca90ea051403fbb4c52b99ee071b9.tar.lz
nixlib-d020caa5b2eca90ea051403fbb4c52b99ee071b9.tar.xz
nixlib-d020caa5b2eca90ea051403fbb4c52b99ee071b9.tar.zst
nixlib-d020caa5b2eca90ea051403fbb4c52b99ee071b9.zip
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/shells/bash')
-rw-r--r--pkgs/shells/bash/default.nix40
1 files changed, 28 insertions, 12 deletions
diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix
index c9eee56b9050..815b7bde73aa 100644
--- a/pkgs/shells/bash/default.nix
+++ b/pkgs/shells/bash/default.nix
@@ -9,6 +9,8 @@ let
   shortName = "bash43";
   baseConfigureFlags = if interactive then "--with-installed-readline" else "--disable-readline";
   sha256 = "1m14s1f61mf6bijfibcjm9y6pkyvz6gibyl8p4hxq90fisi8gimg";
+
+  inherit (stdenv.lib) optional optionalString;
 in
 
 stdenv.mkDerivation rec {
@@ -21,7 +23,12 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  outputs = [ "out" "doc" ];
+  outputs = if (!interactive) # conditional to avoid mass rebuild ATM
+    then [ "out" "doc" ]
+    else [ "out" "doc" "info" ];
+
+  # the man pages are small and useful enough
+  outputMan = if interactive then "out" else null;
 
   NIX_CFLAGS_COMPILE = ''
     -DSYS_BASHRC="/etc/bashrc"
@@ -43,17 +50,17 @@ stdenv.mkDerivation rec {
         };
     in
       import ./bash-4.3-patches.nix patch) 
-      ++ stdenv.lib.optional stdenv.isCygwin ./cygwin-bash-4.3.33-1.src.patch;
+      ++ optional stdenv.isCygwin ./cygwin-bash-4.3.33-1.src.patch;
 
   crossAttrs = {
     configureFlags = baseConfigureFlags +
       " bash_cv_job_control_missing=nomissing bash_cv_sys_named_pipes=nomissing" +
-      stdenv.lib.optionalString stdenv.isCygwin ''
+      optionalString stdenv.isCygwin ''
         --without-libintl-prefix --without-libiconv-prefix
         --with-installed-readline
         bash_cv_dev_stdin=present
         bash_cv_dev_fd=standard
-        bash_cv_termcap_lib=libncurses 
+        bash_cv_termcap_lib=libncurses
       '';
   };
 
@@ -61,20 +68,29 @@ stdenv.mkDerivation rec {
 
   # Note: Bison is needed because the patches above modify parse.y.
   nativeBuildInputs = [bison]
-    ++ stdenv.lib.optional (texinfo != null) texinfo
-    ++ stdenv.lib.optional interactive readline
-    ++ stdenv.lib.optional stdenv.isDarwin binutils;
+    ++ optional (texinfo != null) texinfo
+    ++ optional interactive readline
+    ++ optional stdenv.isDarwin binutils;
 
   # Bash randomly fails to build because of a recursive invocation to
   # build `version.h'.
   enableParallelBuilding = false;
 
   postInstall = ''
-    # Add an `sh' -> `bash' symlink.
     ln -s bash "$out/bin/sh"
   '';
 
-  meta = {
+  postFixup = if interactive
+    then ''
+      substituteInPlace "$out/bin/bashbug" \
+        --replace '${stdenv.shell}' "$out/bin/bash"
+    ''
+    # most space is taken by locale data
+    else ''
+      rm -r "$out/share" "$out/bin/bashbug"
+    '';
+
+  meta = with stdenv.lib; {
     homepage = http://www.gnu.org/software/bash/;
     description =
       "GNU Bourne-Again Shell, the de facto standard shell on Linux" +
@@ -91,11 +107,11 @@ stdenv.mkDerivation rec {
       Bash without modification.
     '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = licenses.gpl3Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
 
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    maintainers = [ maintainers.simons ];
   };
 
   passthru = {