nixpkgs/pkgs/development/compilers/gcc-4.2/default.nix
Eelco Dolstra 45a2c87402 * Support for mirror:// URLs a la Gentoo (NIXPKGS-70). Instead of
fetchurl {
      url = http://heanet.dl.sourceforge.net/sourceforge/zapping/zapping-0.9.6.tar.bz2;
      md5 = "8306775c6a11de4d72345b5eee970ea6";
    };

  you can write

    fetchurl {
      url = mirror://sourceforge/zapping/zapping-0.9.6.tar.bz2;
      md5 = "8306775c6a11de4d72345b5eee970ea6";
    };

  which causes fetchurl to try the SourceForge mirrors listed in the
  `sourceforge' attribute in build-support/fetchurl/mirrors.nix.
  (They're currently tried in sequence, and the lists of mirrors are
  not configurable yet.)

  The syntax for mirror URLs is mirror://site/path/to/file, where
  `site' is currently one of `sourceforge', `gnu' (mirrors of
  ftp://ftp.gnu.org/pub/gnu) and `kernel' (mirrors of
  http://www.all.kernel.org/pub/).

svn path=/nixpkgs/trunk/; revision=9197
2007-08-27 12:44:01 +00:00

60 lines
1.5 KiB
Nix

{ stdenv, fetchurl, noSysDirs
, langC ? true, langCC ? true, langF77 ? false
, profiledCompiler ? false
, staticCompiler ? false
}:
assert langC;
with import ../../../lib;
stdenv.mkDerivation {
name = "gcc-4.2.0";
builder = ./builder.sh;
src =
optional /*langC*/ true (fetchurl {
url = mirror://gnu/gcc/gcc-4.2.0/gcc-core-4.2.0.tar.bz2;
sha256 = "0ykhzxhr8857dr97z0j9wyybfz1kjr71xk457cfapfw5fjas4ny1";
}) ++
optional /*langCC*/ true (fetchurl {
url = mirror://gnu/gcc/gcc-4.2.0/gcc-g++-4.2.0.tar.bz2;
sha256 = "0k5ribrfdp9vmljxrglcgx2j2r7xnycd1rvd8sny2y5cj0l8ps12";
}) ++
optional langF77 (fetchurl {
url = mirror://gnu/gcc/gcc-4.2.0/gcc-fortran-4.2.0.tar.bz2;
sha256 = "0vw07qv6qpa5cgxc0qxraq6li2ibh8zrp65jrg92v4j63ivvi3hh";
});
patches =
[./pass-cxxcpp.patch]
++ optional noSysDirs [./no-sys-dirs.patch];
inherit noSysDirs profiledCompiler staticCompiler;
configureFlags = "
--disable-multilib
--disable-libstdcxx-pch
--with-system-zlib
--enable-languages=${
concatStrings (intersperse ","
( optional langC "c"
++ optional langCC "c++"
++ optional langF77 "f77"
)
)
}
${if stdenv.isi686 then "--with-arch=i686" else ""}
";
makeFlags = if staticCompiler then "LDFLAGS=-static" else "";
passthru = { inherit langC langCC langF77; };
meta = {
homepage = "http://gcc.gnu.org/";
license = "GPL/LGPL";
description = "GNU Compiler Collection, 4.2.x";
};
}