summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm/8/libc++abi.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-02-28 13:01:31 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-03-01 23:42:10 -0500
commit52cb07256284218db28c74953404cbc30e9c1868 (patch)
tree0f1e81038993c3c593505cb805c78bc4eac370fa /pkgs/development/compilers/llvm/8/libc++abi.nix
parentee35de1861fa37c968619b3868a6a0e5b8caa949 (diff)
downloadnixpkgs-52cb07256284218db28c74953404cbc30e9c1868.tar
nixpkgs-52cb07256284218db28c74953404cbc30e9c1868.tar.gz
nixpkgs-52cb07256284218db28c74953404cbc30e9c1868.tar.bz2
nixpkgs-52cb07256284218db28c74953404cbc30e9c1868.tar.lz
nixpkgs-52cb07256284218db28c74953404cbc30e9c1868.tar.xz
nixpkgs-52cb07256284218db28c74953404cbc30e9c1868.tar.zst
nixpkgs-52cb07256284218db28c74953404cbc30e9c1868.zip
llvm8: init
Diffstat (limited to 'pkgs/development/compilers/llvm/8/libc++abi.nix')
-rw-r--r--pkgs/development/compilers/llvm/8/libc++abi.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/development/compilers/llvm/8/libc++abi.nix b/pkgs/development/compilers/llvm/8/libc++abi.nix
new file mode 100644
index 00000000000..9c3bfe5e1ff
--- /dev/null
+++ b/pkgs/development/compilers/llvm/8/libc++abi.nix
@@ -0,0 +1,50 @@
+{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
+
+stdenv.mkDerivation {
+  name = "libc++abi-${version}";
+
+  src = fetch "libcxxabi" "0hdg7xw8vazw85i675qld7i6wqx502srny84cp0w6wi6pk44xiqr";
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
+
+  postUnpack = ''
+    unpackFile ${libcxx.src}
+    unpackFile ${llvm.src}
+    export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    export TRIPLE=x86_64-apple-darwin
+  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
+  '';
+
+  installPhase = if stdenv.isDarwin
+    then ''
+      for file in lib/*.dylib; do
+        # this should be done in CMake, but having trouble figuring out
+        # the magic combination of necessary CMake variables
+        # if you fancy a try, take a look at
+        # http://www.cmake.org/Wiki/CMake_RPATH_handling
+        install_name_tool -id $out/$file $file
+      done
+      make install
+      install -d 755 $out/include
+      install -m 644 ../include/*.h $out/include
+    ''
+    else ''
+      install -d -m 755 $out/include $out/lib
+      install -m 644 lib/libc++abi.a $out/lib
+      install -m 644 lib/libc++abi.so.1.0 $out/lib
+      install -m 644 ../include/cxxabi.h $out/include
+      ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
+      ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
+    '';
+
+  meta = {
+    homepage = http://libcxxabi.llvm.org/;
+    description = "A new implementation of low level support for a standard C++ library";
+    license = with stdenv.lib.licenses; [ ncsa mit ];
+    maintainers = with stdenv.lib.maintainers; [ vlstill ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}