summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc-apple64/default.nix
blob: e2f70fbc1f568a01ecd2177fd34e846286df3b7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ stdenv, fetchurl, noSysDirs
, langC ? true, langCC ? true, langObjC ? true, langF77 ? false
, profiledCompiler ? false
, gmp ? null, mpfr ? null, bison ? null, flex ? null
}:

assert langC;
assert stdenv.isDarwin;
assert langF77 -> gmp != null;

let
  version  = "4.2.1";   # Upstream GCC version, from `gcc/BASE-VER'.
  revision = "5666.3";  # Apple's fork revision number.
in
stdenv.mkDerivation ({
  name = "gcc-apple-${version}.${revision}";

  builder = ./builder.sh;

  src =
    stdenv.lib.optional /*langC*/ true (fetchurl {
      url = "http://www.opensource.apple.com/tarballs/gcc/gcc-${revision}.tar.gz";
      sha256 = "0nq1szgqx9ryh1qsn5n6yd55gpvf56wr8f7w1jzabb8idlvz8ikc";
    }) ++
    stdenv.lib.optional langCC (fetchurl {
      url = http://www.opensource.apple.com/tarballs/libstdcxx/libstdcxx-39.tar.gz ;
      sha256 = "ccf4cf432c142778c766affbbf66b61001b6c4f1107bc2b2c77ce45598786b6d";
    }) ;

  enableParallelBuilding = true;

  libstdcxx = "libstdcxx-39";
  sourceRoot = "gcc-${revision}/";
  patches =
    [./pass-cxxcpp.patch ]
    ++ (if noSysDirs then [./no-sys-dirs.patch] else []);
  inherit noSysDirs langC langCC langF77 langObjC profiledCompiler;
} // (if langF77 then {buildInputs = [gmp mpfr bison flex];} else {}))