2009-11-27 11:56:07 +01:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
2012-02-17 20:33:12 +01:00
|
|
|
, langCC ? true, langObjC ? true, langF77 ? false
|
2009-11-27 11:56:07 +01:00
|
|
|
, profiledCompiler ? false
|
|
|
|
, gmp ? null, mpfr ? null, bison ? null, flex ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert stdenv.isDarwin;
|
|
|
|
assert langF77 -> gmp != null;
|
|
|
|
|
2011-08-30 15:08:33 +02:00
|
|
|
let
|
|
|
|
version = "4.2.1"; # Upstream GCC version, from `gcc/BASE-VER'.
|
|
|
|
revision = "5666.3"; # Apple's fork revision number.
|
|
|
|
in
|
2012-02-17 20:33:12 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2011-08-30 15:08:33 +02:00
|
|
|
name = "gcc-apple-${version}.${revision}";
|
|
|
|
|
2009-11-27 11:56:07 +01:00
|
|
|
builder = ./builder.sh;
|
2011-08-30 15:08:33 +02:00
|
|
|
|
|
|
|
src =
|
2012-02-17 20:33:12 +01:00
|
|
|
stdenv.lib.optional true (fetchurl {
|
2011-08-30 15:08:33 +02:00
|
|
|
url = "http://www.opensource.apple.com/tarballs/gcc/gcc-${revision}.tar.gz";
|
|
|
|
sha256 = "0nq1szgqx9ryh1qsn5n6yd55gpvf56wr8f7w1jzabb8idlvz8ikc";
|
2009-11-27 11:56:07 +01:00
|
|
|
}) ++
|
|
|
|
stdenv.lib.optional langCC (fetchurl {
|
2012-02-17 20:33:12 +01:00
|
|
|
url = http://www.opensource.apple.com/tarballs/libstdcxx/libstdcxx-39.tar.gz;
|
2011-08-30 15:08:33 +02:00
|
|
|
sha256 = "ccf4cf432c142778c766affbbf66b61001b6c4f1107bc2b2c77ce45598786b6d";
|
2012-02-17 20:33:12 +01:00
|
|
|
});
|
2009-11-27 11:56:07 +01:00
|
|
|
|
Enable parallel building of gcc, glibc, gmp, mpfr, ncurses, coreutils, perl, python, git, and qt4.
If a build expressions has set "enableParallelBuilding = true", then the
generic builder may utilize more than one CPU core to build that particular
expression. This feature works out of the box for GNU Make. Expressions that
use other build drivers like Boost.Jam or SCons have to specify appropriate
flags such as "-j${NIX_BUILD_CORES}" themselves.
svn path=/nixpkgs/trunk/; revision=23042
2010-08-08 20:51:42 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2009-11-27 11:56:07 +01:00
|
|
|
libstdcxx = "libstdcxx-39";
|
2012-02-17 20:33:12 +01:00
|
|
|
|
2011-08-30 15:08:33 +02:00
|
|
|
sourceRoot = "gcc-${revision}/";
|
2012-02-17 20:33:12 +01:00
|
|
|
|
2009-11-27 11:56:07 +01:00
|
|
|
patches =
|
2012-04-13 14:41:36 +02:00
|
|
|
[ ./pass-cxxcpp.patch ]
|
|
|
|
++ stdenv.lib.optional noSysDirs ./no-sys-dirs.patch
|
|
|
|
++ stdenv.lib.optional langCC ./fix-libstdc++-link.patch;
|
2012-02-17 20:33:12 +01:00
|
|
|
|
|
|
|
inherit noSysDirs langCC langF77 langObjC;
|
|
|
|
langC = true;
|
|
|
|
|
|
|
|
buildInputs = stdenv.lib.optionals langF77 [ gmp mpfr bison flex ];
|
|
|
|
}
|