2013-06-22 00:50:56 +01:00
|
|
|
{ stdenv, fetchurl, perl, groff, llvm, cmake, libxml2, python }:
|
2011-10-19 21:57:18 +01:00
|
|
|
|
2013-05-04 22:29:51 +01:00
|
|
|
let
|
2013-06-22 00:50:56 +01:00
|
|
|
version = "3.3";
|
2013-05-04 22:29:51 +01:00
|
|
|
gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
|
|
|
|
in
|
2011-10-19 21:57:18 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "clang-${version}";
|
|
|
|
|
2013-06-22 00:50:56 +01:00
|
|
|
buildInputs = [ perl llvm groff cmake libxml2 python ];
|
2011-10-20 00:49:22 +01:00
|
|
|
|
2013-01-22 19:33:55 +00:00
|
|
|
patches = stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
|
2011-10-19 21:57:18 +01:00
|
|
|
|
2012-10-08 06:57:39 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DLLVM_TARGETS_TO_BUILD=all"
|
2013-05-04 22:29:51 +01:00
|
|
|
"-DGCC_INSTALL_PREFIX=${gccReal}"
|
2012-10-08 06:57:39 +01:00
|
|
|
] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
|
|
|
|
"-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
|
|
|
|
];
|
2011-10-19 21:57:18 +01:00
|
|
|
|
2011-12-19 12:48:09 +00:00
|
|
|
enableParallelBuilding = true;
|
2011-10-19 22:47:28 +01:00
|
|
|
|
2011-12-19 12:48:09 +00:00
|
|
|
src = fetchurl {
|
2013-06-22 00:50:56 +01:00
|
|
|
url = "http://llvm.org/releases/${version}/cfe-${version}.src.tar.gz";
|
|
|
|
sha256 = "15mrvw43s4frk1j49qr4v5viq68h8qlf10qs6ghd6mrsmgj5vddi";
|
2011-12-19 12:48:09 +00:00
|
|
|
};
|
2011-10-19 21:57:18 +01:00
|
|
|
|
|
|
|
passthru = { gcc = stdenv.gcc.gcc; };
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://clang.llvm.org/;
|
|
|
|
description = "A C language family frontend for LLVM";
|
|
|
|
license = "BSD";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [viric shlevy];
|
2011-12-19 23:58:57 +00:00
|
|
|
platforms = with stdenv.lib.platforms; all;
|
2011-10-19 21:57:18 +01:00
|
|
|
};
|
|
|
|
}
|