From cadc02cb2b101437dac600aeb1243d4671ef778d Mon Sep 17 00:00:00 2001 From: Marco Maggesi Date: Wed, 6 Jun 2012 20:44:11 +0000 Subject: [PATCH] Fix build of ocaml 3.12.1 on darwin svn path=/nixpkgs/trunk/; revision=34373 --- .../ocaml/3.12.1-darwin-fix-configure.patch | 32 +++++++++++++++++++ pkgs/development/compilers/ocaml/3.12.1.nix | 3 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch diff --git a/pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch b/pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch new file mode 100644 index 000000000000..4b867bbb1e6f --- /dev/null +++ b/pkgs/development/compilers/ocaml/3.12.1-darwin-fix-configure.patch @@ -0,0 +1,32 @@ +diff -Nuar ocaml-3.12.1/configure ocaml-3.12.1-fix-configure/configure +--- ocaml-3.12.1/configure 2011-07-04 23:15:01.000000000 +0200 ++++ ocaml-3.12.1-fix-configure/configure 2012-06-06 22:20:40.000000000 +0200 +@@ -259,7 +259,7 @@ + bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC" + mathlib="";; + *,*-*-darwin*) +- bytecccompopts="-fno-defer-pop -no-cpp-precomp $gcc_warnings" ++ bytecccompopts="-fno-defer-pop $gcc_warnings" + mathlib="" + # Tell gcc that we can use 32-bit code addresses for threaded code + # unless we are compiled for a shared library (-fPIC option) +@@ -739,7 +739,7 @@ + *,*,rhapsody,*) nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs" + if $arch64; then partialld="ld -r -arch ppc64"; fi;; + *,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";; +- amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";; ++ amd64,gcc*,macosx,*) partialld="ld -r";; + amd64,gcc*,solaris,*) partialld="ld -r -m elf_x86_64";; + *,gcc*,*,*) nativecccompopts="$gcc_warnings";; + esac +@@ -752,8 +752,8 @@ + asppprofflags='-pg -DPROFILING';; + alpha,*,*) as='as' + aspp='gcc -c';; +- amd64,*,macosx) as='as -arch x86_64' +- aspp='gcc -arch x86_64 -c';; ++ amd64,*,macosx) as='as' ++ aspp='gcc -c';; + amd64,*,solaris) as='as --64' + aspp='gcc -m64 -c';; + amd64,*,*) as='as' diff --git a/pkgs/development/compilers/ocaml/3.12.1.nix b/pkgs/development/compilers/ocaml/3.12.1.nix index 44fe2d139d8b..66075d4a9669 100644 --- a/pkgs/development/compilers/ocaml/3.12.1.nix +++ b/pkgs/development/compilers/ocaml/3.12.1.nix @@ -20,7 +20,8 @@ stdenv.mkDerivation rec { buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt"; buildInputs = [ncurses] ++ optionals useX11 [ x11 ]; installTargets = "install" + optionalString useNativeCompilers " installopt"; - patchPhase = '' + patches = optionals stdenv.isDarwin [ ./3.12.1-darwin-fix-configure.patch ]; + preConfigure = '' CAT=$(type -tp cat) sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang '';