2014-01-18 14:35:07 +01:00
|
|
|
{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils, version }:
|
2008-03-17 12:18:21 +01:00
|
|
|
|
2014-01-13 21:38:44 +01:00
|
|
|
with { inherit (stdenv.lib) optional; };
|
|
|
|
|
|
|
|
assert version == "3.4" || version == "3.3";
|
2011-10-18 18:37:28 +02:00
|
|
|
|
2013-05-02 20:14:24 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2011-10-18 18:37:28 +02:00
|
|
|
name = "llvm-${version}";
|
|
|
|
|
2008-03-17 12:18:21 +01:00
|
|
|
src = fetchurl {
|
2012-10-08 05:25:11 +02:00
|
|
|
url = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
|
2014-01-13 21:38:44 +01:00
|
|
|
sha256 =
|
|
|
|
if version == "3.4" then "0a169ba045r4apb9cv6ncrwl83l7yiajnzirkcdlhj1cd4nn3995"
|
|
|
|
else /*3.3*/ "0y3mfbb5qzcpw3v5qncn69x1hdrrrfirgs82ypi2annhf0g6nxk8";
|
2008-03-17 12:18:21 +01:00
|
|
|
};
|
|
|
|
|
2014-01-18 14:35:07 +01:00
|
|
|
patches =
|
|
|
|
# The default rlimits in 3.3 are too low for shared libraries.
|
|
|
|
optional (version == "3.3") ./more-memory-for-bugpoint.patch
|
|
|
|
++ [ ./no-rule-aarch64.patch ] # http://llvm.org/bugs/show_bug.cgi?id=16625
|
|
|
|
;
|
2013-05-16 17:16:02 +02:00
|
|
|
|
2013-06-22 01:18:52 +02:00
|
|
|
# libffi was propagated before, but it wasn't even being used, so
|
|
|
|
# unless something needs it just an input is fine.
|
|
|
|
buildInputs = [ perl groff cmake python libffi ]; # ToDo: polly, libc++; enable cxx11?
|
2013-06-01 23:36:38 +02:00
|
|
|
|
2013-08-02 18:28:29 +02:00
|
|
|
# hacky fix: created binaries need to be run before installation
|
|
|
|
preBuild = let LD = if stdenv.isDarwin then "DYLD" else "LD";
|
|
|
|
in "export ${LD}_LIBRARY_PATH='$$${LD}_LIBRARY_PATH:'`pwd`/lib";
|
2013-06-01 23:36:38 +02:00
|
|
|
|
2013-05-02 20:14:24 +02:00
|
|
|
cmakeFlags = with stdenv; [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DLLVM_ENABLE_FFI=ON"
|
2013-09-02 15:45:29 +02:00
|
|
|
"-DLLVM_BINUTILS_INCDIR=${binutils}/include"
|
2014-01-13 21:38:44 +01:00
|
|
|
]
|
|
|
|
++ optional (version == "3.3") "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=R600" # for mesa
|
|
|
|
++ optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
|
2010-06-12 23:52:39 +02:00
|
|
|
|
2011-12-04 00:47:59 +01:00
|
|
|
enableParallelBuilding = true;
|
2013-06-22 01:18:52 +02:00
|
|
|
|
|
|
|
doCheck = true;
|
2011-12-04 00:47:59 +01:00
|
|
|
|
2013-07-04 00:48:55 +02:00
|
|
|
meta = with stdenv.lib; {
|
2010-06-12 22:54:35 +02:00
|
|
|
description = "Collection of modular and reusable compiler and toolchain technologies";
|
2013-07-04 00:48:55 +02:00
|
|
|
homepage = http://llvm.org/;
|
2013-07-04 17:47:02 +02:00
|
|
|
license = licenses.bsd3;
|
2013-07-04 00:48:55 +02:00
|
|
|
maintainers = with maintainers; [ lovek323 raskin shlevy viric ];
|
|
|
|
platforms = platforms.all;
|
2010-06-12 22:54:35 +02:00
|
|
|
};
|
2008-03-17 12:18:21 +01:00
|
|
|
}
|