From b5720518828a0d64f1c2a52aed893fa7b4369315 Mon Sep 17 00:00:00 2001 From: Karn Kallio 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 47c4404a818e..4bd05301ecff 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;