nixpkgs-suyu/pkgs/development/compilers/llvm/clang.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, perl, groff, llvm, cmake, libxml2 }:
let
version = "3.2";
gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
in
stdenv.mkDerivation {
name = "clang-${version}";
buildInputs = [ perl llvm groff cmake libxml2 ];
2013-01-22 20:33:55 +01:00
patches = stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
2012-10-08 07:57:39 +02:00
cmakeFlags = [
"-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_TARGETS_TO_BUILD=all"
"-DGCC_INSTALL_PREFIX=${gccReal}"
2012-10-08 07:57:39 +02:00
] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
"-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
];
enableParallelBuilding = true;
src = fetchurl {
2012-10-08 07:57:39 +02:00
url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
2013-01-22 20:33:55 +01:00
sha256 = "0n2nzw3pw2v7fk67f2k2qyzd9wibvi3i5j7cjzz1csqgghzz1aia";
};
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];
platforms = with stdenv.lib.platforms; all;
};
}