Attached patch adjusts the mlton expression to build with the 20130715 
version.
>From 2e1cdf1726cfc4e3e6251030bbd33af299dc17af Mon Sep 17 00:00:00 2001
From: Karn Kallio <[email protected]>
Date: Mon, 3 Feb 2014 13:42:30 -0430
Subject: [PATCH] mlton: fix build with latest version.

---
 pkgs/development/compilers/mlton/default.nix | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix
index 47c4404..4bd0530 100644
--- a/pkgs/development/compilers/mlton/default.nix
+++ b/pkgs/development/compilers/mlton/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ stdenv, fetchurl, patchelf, gmp }:
 
 let
   version = "20130715";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   sourceRoot = name;
 
-  buildInputs = [ gmp ];
+  buildInputs = [ patchelf gmp ];
 
   makeFlags = [ "all-no-docs" ];
 
@@ -54,6 +54,15 @@ stdenv.mkDerivation rec {
     chmod u+x $(pwd)/../usr/bin/mllex
     chmod u+x $(pwd)/../usr/bin/mlyacc
     chmod u+x $(pwd)/../usr/bin/mlton
+
+    # So the builder runs the binary compiler with gmp.
+    export LD_LIBRARY_PATH=${gmp}/lib:$LD_LIBRARY_PATH
+
+    # Patch ELF interpreter.
+    patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $(pwd)/../usr/lib/mlton/mlton-compile
+    for e in mllex mlyacc ; do
+      patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $(pwd)/../usr/bin/$e
+    done
   '';
 
   doCheck = true;
-- 
1.8.5.2

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to