[Nix-dev] fix for mlton

Marc Weber marco-oweber at gmx.de
Tue Mar 13 02:34:34 CET 2012


diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix
index c7217f8..8b42e70 100644
--- a/pkgs/development/compilers/mlton/default.nix
+++ b/pkgs/development/compilers/mlton/default.nix
@@ -30,9 +30,7 @@ stdenv.mkDerivation rec {
 
   configurePhase = ''
     # Fix paths in the source.
-    for f in $(find $(pwd) -type f ) ; do
-      substituteInPlace $f --replace '/usr/bin/env bash' $(type -p bash)
-    done
+    find . -type f | grep -v -e '\.tgz''$' | xargs sed -i "s@/usr/bin/env bash@$(type -p bash)@"
 
     substituteInPlace $(pwd)/Makefile --replace '/bin/cp' $(type -p cp)
 
replacing the for each execute loop by sed also makes it a lot faster.
The probblem was  substituteInPlace modifying the .tgz file. Don't ask
me why it didn't happen in the past?

Either find or substituteInPlace changed behaviour !?

Marc Weber


More information about the nix-dev mailing list