From d6aee89fd73e59fc661e351a3829ef05401cc461 Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 15 Apr 2014 15:59:01 +0200 Subject: [PATCH] Fix build of MLton on Linux i686 --- pkgs/development/compilers/mlton/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix index 44cbb5951f2a..2fa986375ff8 100644 --- a/pkgs/development/compilers/mlton/default.nix +++ b/pkgs/development/compilers/mlton/default.nix @@ -4,7 +4,12 @@ let version = "20130715"; usr_prefix = if stdenv.isDarwin then "usr/local" else "usr"; + + dynamic_linker = + if stdenv.isx86_64 then "${stdenv.glibc}/lib/ld-linux-x86-64.so.2" + else "${stdenv.glibc}/lib/ld-linux.so.2"; in + stdenv.mkDerivation rec { name = "mlton-${version}"; @@ -66,9 +71,9 @@ stdenv.mkDerivation rec { '' + stdenv.lib.optionalString stdenv.isLinux '' # Patch ELF interpreter. - patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $(pwd)/../${usr_prefix}/lib/mlton/mlton-compile + patchelf --set-interpreter ${dynamic_linker} $(pwd)/../${usr_prefix}/lib/mlton/mlton-compile for e in mllex mlyacc ; do - patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $(pwd)/../${usr_prefix}/bin/$e + patchelf --set-interpreter ${dynamic_linker} $(pwd)/../${usr_prefix}/bin/$e done '';