2012-04-23 17:47:31 +02:00
|
|
|
{ stdenv, fetchurl, perl, groff, llvm, cmake }:
|
2011-10-19 22:57:18 +02:00
|
|
|
|
2012-10-08 07:57:39 +02:00
|
|
|
let version = "3.1"; in
|
2011-10-19 22:57:18 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "clang-${version}";
|
|
|
|
|
2012-04-23 17:47:31 +02:00
|
|
|
buildInputs = [ perl llvm groff cmake ];
|
2011-10-20 01:49:22 +02:00
|
|
|
|
2011-12-19 14:40:33 +01:00
|
|
|
patches = stdenv.lib.optionals (stdenv.gcc.libc != null)
|
2011-12-19 13:48:09 +01:00
|
|
|
[ ./clang-include-paths.patch ./clang-ld-flags.patch ];
|
2011-10-19 22:57:18 +02:00
|
|
|
|
2012-10-08 07:57:39 +02:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DLLVM_TARGETS_TO_BUILD=all"
|
|
|
|
] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
|
|
|
|
"-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
|
|
|
|
];
|
2011-10-19 22:57:18 +02:00
|
|
|
|
2011-12-19 13:48:09 +01:00
|
|
|
enableParallelBuilding = true;
|
2011-10-19 23:47:28 +02:00
|
|
|
|
2011-12-19 13:48:09 +01:00
|
|
|
src = fetchurl {
|
2012-10-08 07:57:39 +02:00
|
|
|
url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
|
|
|
|
sha256 = "11m7sm9f8qcrayckfg3z91zb3fimilpm0f7azn7q7qnkvhay4qzz";
|
2011-12-19 13:48:09 +01:00
|
|
|
};
|
2011-10-19 22:57:18 +02: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-20 00:58:57 +01:00
|
|
|
platforms = with stdenv.lib.platforms; all;
|
2011-10-19 22:57:18 +02:00
|
|
|
};
|
|
|
|
}
|
2011-12-19 13:48:09 +01:00
|
|
|
|