Get mlton a little closer to working on darwin+clang (thanks to gridaphobe). Still impure, and needs more work.

+9 -3
+9 -3
pkgs/development/compilers/mlton/default.nix
··· 38 38 39 39 sourceRoot = name; 40 40 41 - buildInputs = [ patchelf gmp ]; 41 + buildInputs = [ gmp ] ++ stdenv.lib.optional stdenv.isLinux patchelf; 42 42 43 43 makeFlags = [ "all-no-docs" ]; 44 44 ··· 47 47 find . -type f | grep -v -e '\.tgz''$' | xargs sed -i "s@/usr/bin/env bash@$(type -p bash)@" 48 48 49 49 substituteInPlace $(pwd)/Makefile --replace '/bin/cp' $(type -p cp) 50 + substituteInPlace bin/mlton-script --replace gcc cc 51 + substituteInPlace bin/regression --replace gcc cc 52 + substituteInPlace lib/mlnlffi-lib/Makefile --replace gcc cc 53 + substituteInPlace mlnlffigen/gen-cppcmd --replace gcc cc 54 + substituteInPlace runtime/Makefile --replace gcc cc 55 + substituteInPlace ../${usr_prefix}/bin/mlton --replace gcc cc 50 56 51 57 # Fix paths in the binary distribution. 52 58 BIN_DIST_DIR="$(pwd)/../${usr_prefix}" ··· 91 97 # Path to gmp.h. 92 98 substituteInPlace $(pwd)/install/${usr_prefix}/bin/mlton --replace "-cc-opt '-O1 -fno-common'" "-cc-opt '-O1 -fno-common -I${gmp}/include'" 93 99 94 - # Path to the same gcc used in the build; needed at runtime. 95 - substituteInPlace $(pwd)/install/${usr_prefix}/bin/mlton --replace "gcc='gcc'" "gcc='"$(type -p gcc)"'" 100 + # Path to the same cc used in the build; needed at runtime. 101 + substituteInPlace $(pwd)/install/${usr_prefix}/bin/mlton --replace "gcc='gcc'" "gcc='"$(type -p cc)"'" 96 102 97 103 # Copy files to final positions. 98 104 cp -r $(pwd)/install/${usr_prefix}/bin $out