From 29bc53265d1a51c77320f9f327434c75a4040fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 23 Apr 2012 15:47:37 +0000 Subject: [PATCH] Darwin: Use GCC 4.6 in `stdenvNix'. svn path=/nixpkgs/trunk/; revision=33894 --- .../development/compilers/gcc/4.6/default.nix | 5 ++++ .../development/libraries/ncurses/default.nix | 6 ++++- pkgs/stdenv/nix/default.nix | 2 +- pkgs/top-level/all-packages.nix | 24 ++++++++++++++++--- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix index bceaf2b44266..f1e4991f6c18 100644 --- a/pkgs/development/compilers/gcc/4.6/default.nix +++ b/pkgs/development/compilers/gcc/4.6/default.nix @@ -28,6 +28,7 @@ , gnat ? null , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , stripped ? true +, gnused }: assert langJava -> zip != null && unzip != null @@ -226,6 +227,10 @@ stdenv.mkDerivation ({ ++ (optionals (cross != null) [binutilsCross]) ++ (optionals langAda [gnatboot]) ++ (optionals langVhdl [gnat]) + + # The builder relies on GNU sed (for instance, Darwin's `sed' fails with + # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. + ++ (optional stdenv.isDarwin gnused) ; configureFlagsArray = stdenv.lib.optionals diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 0278f62f65d8..a6b9a69e6e1f 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -27,7 +27,11 @@ stdenv.mkDerivation (rec { enableParallelBuilding = true; - preBuild = ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile''; + preBuild = + # On Darwin, we end up using the native `sed' during bootstrap, and it + # fails to run this command, which isn't needed anyway. + stdenv.lib.optionalString (!stdenv.isDarwin) + ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile''; # When building a wide-character (Unicode) build, create backward # compatibility links from the the "normal" libraries to the diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix index 473bb5af0afd..5e242b6e3a1c 100644 --- a/pkgs/stdenv/nix/default.nix +++ b/pkgs/stdenv/nix/default.nix @@ -28,7 +28,7 @@ import ../generic rec { import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;} else pkgs.binutils; - gcc = if stdenv.isDarwin then pkgs.gccApple.gcc else pkgs.gcc.gcc; + gcc = pkgs.gcc.gcc; coreutils = pkgs.coreutils; shell = pkgs.bash + "/bin/sh"; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c0cdaa5e0abd..bf03cb252fc7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1962,8 +1962,12 @@ let (if stdenv.system == "i686-darwin" then import ../development/compilers/gcc/4.2-apple32 else import ../development/compilers/gcc/4.2-apple64) { - inherit fetchurl stdenv noSysDirs; + inherit fetchurl noSysDirs; profiledCompiler = true; + + # Since it fails to build with GCC 4.6, build it with the "native" + # Apple-GCC. + stdenv = allStdenvs.stdenvNative; }); gccupc40 = wrapGCCUPC (import ../development/compilers/gcc-upc-4.0 { @@ -3199,7 +3203,14 @@ let target = crossSystem; }; - valgrind = callPackage ../development/tools/analysis/valgrind { }; + valgrind = callPackage ../development/tools/analysis/valgrind { + stdenv = + # On Darwin, Valgrind 3.7.0 expects Apple's GCC (for + # `__private_extern'.) + if stdenv.isDarwin + then overrideGCC stdenv gccApple + else stdenv; + }; valkyrie = callPackage ../development/tools/analysis/valkyrie { }; @@ -4429,8 +4440,15 @@ let mysocketw = callPackage ../development/libraries/mysocketw { }; ncurses = makeOverridable (import ../development/libraries/ncurses) { - inherit fetchurl stdenv; + inherit fetchurl; unicode = system != "i686-cygwin"; + stdenv = + # On Darwin, NCurses uses `-no-cpp-precomp', which is specific to + # Apple-GCC. Since NCurses is part of stdenv, always use + # `stdenvNative' to build it. + if stdenv.isDarwin + then allStdenvs.stdenvNative + else stdenv; }; neon = neon029;