2014-01-26 19:16:50 +01:00
|
|
|
{ stdenv, fetchurl, perl, groff, llvm, cmake }:
|
|
|
|
|
2014-01-26 22:51:58 +01:00
|
|
|
let
|
|
|
|
version = "3.1";
|
|
|
|
gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
|
|
|
|
in
|
2014-01-26 19:16:50 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "clang-${version}";
|
|
|
|
|
|
|
|
buildInputs = [ perl llvm groff cmake ];
|
|
|
|
|
|
|
|
patches = stdenv.lib.optionals (stdenv.gcc.libc != null)
|
|
|
|
[ ./clang-include-paths.patch ./clang-ld-flags.patch ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DLLVM_TARGETS_TO_BUILD=all"
|
2014-01-26 22:51:58 +01:00
|
|
|
"-DGCC_INSTALL_PREFIX=${gccReal}"
|
2014-01-26 19:16:50 +01:00
|
|
|
] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
|
|
|
|
"-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
|
|
|
|
sha256 = "11m7sm9f8qcrayckfg3z91zb3fimilpm0f7azn7q7qnkvhay4qzz";
|
|
|
|
};
|
|
|
|
|
|
|
|
passthru = { gcc = stdenv.gcc.gcc; };
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://clang.llvm.org/;
|
|
|
|
description = "A C language family frontend for LLVM";
|
|
|
|
license = "BSD";
|
2014-01-27 03:01:13 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [viric vlstill];
|
2014-01-26 19:16:50 +01:00
|
|
|
platforms = with stdenv.lib.platforms; all;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|