summary refs log tree commit diff
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2016-05-01 22:10:18 +0000
committerAustin Seipp <aseipp@pobox.com>2016-05-01 22:15:42 +0000
commita1d61e736750159f6e860c7649d5f46dcade4d42 (patch)
treedf012555c617f60fdf3ebcc4b5d8700b3c365fdf
parent30240ccb9d62ade30e119448332e62112c00795c (diff)
downloadnixlib-a1d61e736750159f6e860c7649d5f46dcade4d42.tar
nixlib-a1d61e736750159f6e860c7649d5f46dcade4d42.tar.gz
nixlib-a1d61e736750159f6e860c7649d5f46dcade4d42.tar.bz2
nixlib-a1d61e736750159f6e860c7649d5f46dcade4d42.tar.lz
nixlib-a1d61e736750159f6e860c7649d5f46dcade4d42.tar.xz
nixlib-a1d61e736750159f6e860c7649d5f46dcade4d42.tar.zst
nixlib-a1d61e736750159f6e860c7649d5f46dcade4d42.zip
nixpkgs: fix chez build failures
The Chez build was failing, as usual, due to impurities. The build
system refers to absolute paths for tools like `ln` or `true`, which
was the real culprit here. Furthermore the build also 'helpfully'
suppresses errors in these cases by piping to /dev/null, so you never
see any errors at build time until it's too late (otherwise, you'd
see failures to call /bin/ln or at ./configure time).

This also re-enables parallel builds, as they should be safe from
all my testing, I believe.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
-rw-r--r--pkgs/development/compilers/chez/default.nix18
1 files changed, 15 insertions, 3 deletions
diff --git a/pkgs/development/compilers/chez/default.nix b/pkgs/development/compilers/chez/default.nix
index da60ffbb67a1..d9e7cc507305 100644
--- a/pkgs/development/compilers/chez/default.nix
+++ b/pkgs/development/compilers/chez/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, ncurses, libX11 }:
+{ stdenv, fetchgit, coreutils, ncurses, libX11 }:
 
 stdenv.mkDerivation rec {
   name    = "chez-scheme-${version}";
@@ -12,6 +12,7 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
+  enableParallelBuilding = true;
   buildInputs = [ ncurses libX11 ];
 
   /* Chez uses a strange default search path, which completely
@@ -19,14 +20,25 @@ stdenv.mkDerivation rec {
   ** defaults to {/usr,/usr/local,$HOME}/lib for finding the .boot
   ** file.
   **
-  ** Also, we patch out a very annoying 'feature' in ./configure, too.
+  ** Also, we patch out a very annoying 'feature' in ./configure, too,
+  ** which tries to use 'git' to update submodules.
+  **
+  ** Finally, we have to also fix a few occurrences to tools with
+  ** absolute paths in some helper scripts, otherwise the build will
+  ** fail on NixOS or in any chroot build.
   */
   patchPhase = ''
-    substituteInPlace c/scheme.c \
+    substituteInPlace ./c/scheme.c \
       --replace "/usr/lib/csv" "$out/lib/csv"
 
     substituteInPlace ./configure \
       --replace "git submodule init && git submodule update || exit 1" ""
+
+    substituteInPlace ./workarea \
+      --replace "/bin/ln" "${coreutils}/bin/ln"
+
+    substituteInPlace ./makefiles/installsh \
+      --replace "/usr/bin/true" "${coreutils}/bin/true"
   '';
 
   /* Don't use configureFlags, since that just implicitly appends