summary refs log tree commit diff
path: root/pkgs/shells/bash
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-01-03 00:47:16 -0600
committerWill Dietz <w@wdtz.org>2018-02-13 09:44:36 -0600
commitb42c8af907f66127119ff47eeff8e63a9b5615d7 (patch)
tree905b8c59b8ad3e9ce51f41b9bb78f1fa562744c0 /pkgs/shells/bash
parent5dcf3cdf37c6892f32a71294cfa980f943309302 (diff)
downloadnixpkgs-b42c8af907f66127119ff47eeff8e63a9b5615d7.tar
nixpkgs-b42c8af907f66127119ff47eeff8e63a9b5615d7.tar.gz
nixpkgs-b42c8af907f66127119ff47eeff8e63a9b5615d7.tar.bz2
nixpkgs-b42c8af907f66127119ff47eeff8e63a9b5615d7.tar.lz
nixpkgs-b42c8af907f66127119ff47eeff8e63a9b5615d7.tar.xz
nixpkgs-b42c8af907f66127119ff47eeff8e63a9b5615d7.tar.zst
nixpkgs-b42c8af907f66127119ff47eeff8e63a9b5615d7.zip
bash: fix on musl
Diffstat (limited to 'pkgs/shells/bash')
-rw-r--r--pkgs/shells/bash/4.4.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/pkgs/shells/bash/4.4.nix b/pkgs/shells/bash/4.4.nix
index 5635c6a73be..63c7fbc7a0e 100644
--- a/pkgs/shells/bash/4.4.nix
+++ b/pkgs/shells/bash/4.4.nix
@@ -1,5 +1,5 @@
 { stdenv, buildPackages
-, fetchurl, readline70 ? null, texinfo ? null, binutils ? null, bison
+, fetchurl, readline70 ? null, texinfo ? null, binutils ? null, bison, autoconf
 , buildPlatform, hostPlatform
 , interactive ? false
 }:
@@ -51,7 +51,12 @@ stdenv.mkDerivation rec {
 
   patchFlags = "-p0";
 
-  patches = upstreamPatches;
+  patches = upstreamPatches
+    # https://lists.gnu.org/archive/html/bug-bash/2016-10/msg00006.html
+    ++ optional (hostPlatform.libc == "musl") (fetchurl {
+      url = "https://lists.gnu.org/archive/html/bug-bash/2016-10/patchJxugOXrY2y.patch";
+      sha256 = "1m4v9imidb1cc1h91f2na0b8y9kc5c5fgmpvy9apcyv2kbdcghg1";
+  });
 
   postPatch = optionalString hostPlatform.isCygwin "patch -p2 < ${./cygwin-bash-4.4.11-2.src.patch}";
 
@@ -65,13 +70,17 @@ stdenv.mkDerivation rec {
     "bash_cv_dev_stdin=present"
     "bash_cv_dev_fd=standard"
     "bash_cv_termcap_lib=libncurses"
+  ] ++ optionals (hostPlatform.libc == "musl") [
+    "--without-bash-malloc"
+    "--disable-nls"
   ];
 
   # Note: Bison is needed because the patches above modify parse.y.
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [bison]
     ++ optional (texinfo != null) texinfo
-    ++ optional hostPlatform.isDarwin binutils;
+    ++ optional hostPlatform.isDarwin binutils
+    ++ optional (hostPlatform.libc == "musl") autoconf;
 
   buildInputs = optional interactive readline70;
 
@@ -86,7 +95,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     ln -s bash "$out/bin/sh"
-    rm $out/lib/bash/Makefile.inc
+    rm -f $out/lib/bash/Makefile.inc
   '';
 
   postFixup = if interactive
@@ -96,7 +105,7 @@ stdenv.mkDerivation rec {
     ''
     # most space is taken by locale data
     else ''
-      rm -r "$out/share" "$out/bin/bashbug"
+      rm -rf "$out/share" "$out/bin/bashbug"
     '';
 
   meta = with stdenv.lib; {