about summary refs log tree commit diff
path: root/pkgs/development/compilers/mono/llvm.nix
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2014-03-08 11:04:01 -0600
committerAustin Seipp <aseipp@pobox.com>2014-03-08 14:57:49 -0600
commit6eb7a3078cc877d91fad01e1662e8a430eab68eb (patch)
treeec26ae809133274ae6462a5aa1e322d7b9c21447 /pkgs/development/compilers/mono/llvm.nix
parent3b69f4b109c384573b8107f7cf8518f1d4e19874 (diff)
downloadnixlib-6eb7a3078cc877d91fad01e1662e8a430eab68eb.tar
nixlib-6eb7a3078cc877d91fad01e1662e8a430eab68eb.tar.gz
nixlib-6eb7a3078cc877d91fad01e1662e8a430eab68eb.tar.bz2
nixlib-6eb7a3078cc877d91fad01e1662e8a430eab68eb.tar.lz
nixlib-6eb7a3078cc877d91fad01e1662e8a430eab68eb.tar.xz
nixlib-6eb7a3078cc877d91fad01e1662e8a430eab68eb.tar.zst
nixlib-6eb7a3078cc877d91fad01e1662e8a430eab68eb.zip
mono: add LLVM support (3.4svn build)
This adds LLVM support in Mono using their custom fork, based on LLVM
3.4svn upstream. Somehow, it's gone for a while without a patch to fix
the CMakeLists.txt in the fork...

The upstream commit is based on the mono3 branch.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/development/compilers/mono/llvm.nix')
-rw-r--r--pkgs/development/compilers/mono/llvm.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/development/compilers/mono/llvm.nix b/pkgs/development/compilers/mono/llvm.nix
new file mode 100644
index 000000000000..74f85b1519c6
--- /dev/null
+++ b/pkgs/development/compilers/mono/llvm.nix
@@ -0,0 +1,59 @@
+{ stdenv
+, fetchurl
+, perl
+, groff
+, cmake
+, python
+, libffi
+, binutils
+, libxml2
+, valgrind
+, ncurses
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  name    = "llvm-${version}";
+  version = "3.4svn-mono-f9b1a74368";
+  src = fetchurl {
+    # from the HEAD of the 'mono3' branch
+    url = "https://github.com/mono/llvm/archive/f9b1a74368ec299fc04c4cfef4b5aa0992b7b806.tar.gz";
+    name = "${name}.tar.gz";
+    sha256 = "1bbkx4p5zdnk3nbdd5jxvbwqx8cdq8z1n1nhf639i98mggs0zhdg";
+  };
+
+  patches = [ ./build-fix-llvm.patch ];
+  unpackPhase = ''
+    unpackFile ${src}
+    mv llvm-* llvm
+    sourceRoot=$PWD/llvm
+  '';
+
+  buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind;
+
+  propagatedBuildInputs = [ ncurses zlib ];
+
+  # hacky fix: created binaries need to be run before installation
+  preBuild = ''
+    mkdir -p $out/
+    ln -sv $PWD/lib $out
+  '';
+  postBuild = "rm -fR $out";
+
+  cmakeFlags = with stdenv; [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DLLVM_ENABLE_FFI=ON"
+    "-DLLVM_BINUTILS_INCDIR=${binutils}/include"
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+  ] ++ stdenv.lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Collection of modular and reusable compiler and toolchain technologies - Mono build";
+    homepage    = http://llvm.org/;
+    license     = stdenv.lib.licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
+    platforms   = stdenv.lib.platforms.all;
+  };
+}