at 17.09-beta 47 lines 1.7 kB view raw
1{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }: 2 3stdenv.mkDerivation { 4 name = "libc++abi-${version}"; 5 6 src = fetch "libcxxabi" "0cqvzallxh0nwiijsf6i4d5ds9m5ijfzywg7376ncv50i64if24g"; 7 8 nativeBuildInputs = [ cmake ]; 9 buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind; 10 11 postUnpack = '' 12 unpackFile ${libcxx.src} 13 unpackFile ${llvm.src} 14 export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)" 15 '' + stdenv.lib.optionalString stdenv.isDarwin '' 16 export TRIPLE=x86_64-apple-darwin 17 ''; 18 19 installPhase = if stdenv.isDarwin 20 then '' 21 for file in lib/*.dylib; do 22 # this should be done in CMake, but having trouble figuring out 23 # the magic combination of necessary CMake variables 24 # if you fancy a try, take a look at 25 # http://www.cmake.org/Wiki/CMake_RPATH_handling 26 install_name_tool -id $out/$file $file 27 done 28 make install 29 install -d 755 $out/include 30 install -m 644 ../include/*.h $out/include 31 '' 32 else '' 33 install -d -m 755 $out/include $out/lib 34 install -m 644 lib/libc++abi.so.1.0 $out/lib 35 install -m 644 ../include/cxxabi.h $out/include 36 ln -s libc++abi.so.1.0 $out/lib/libc++abi.so 37 ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1 38 ''; 39 40 meta = { 41 homepage = http://libcxxabi.llvm.org/; 42 description = "A new implementation of low level support for a standard C++ library"; 43 license = with stdenv.lib.licenses; [ ncsa mit ]; 44 maintainers = with stdenv.lib.maintainers; [ vlstill ]; 45 platforms = stdenv.lib.platforms.unix; 46 }; 47}