summary refs log tree commit diff
path: root/pkgs/development/libraries/libc++abi/default.nix
blob: 141802d1616b2e79949fe4ef37b74c59eb56ae5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ stdenv, fetchsvn, libcxx, libunwind, gnused }:
let
  rev = "199626";
in stdenv.mkDerivation {
  name = "libcxxabi-pre-${rev}";

  src = fetchsvn {
    url = http://llvm.org/svn/llvm-project/libcxxabi/trunk;
    rev = "199626";
    sha256 = "0h1x1s40x5r65ar53rv34lmgcfil3zxaknqr64dka1mz29xhhrxy";
  };

  NIX_CFLAGS_LINK="-L${libunwind}/lib -lunwind";

  postUnpack = ''
    unpackFile ${libcxx.src}
    export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include -I$(readlink -f libcxx-*)/include"
    export TRIPLE=x86_64-apple-darwin
  '';

  installPhase = ''
    install -d -m 755 $out/include $out/lib
    install -m 644 lib/libc++abi.dylib $out/lib
    install -m 644 include/cxxabi.h $out/include
  '';

  patchPhase = "${gnused}/bin/sed -e s,-lstdc++,, -i lib/buildit";

  buildPhase = "(cd lib; ./buildit)";

  meta = {
    homepage = http://libcxxabi.llvm.org/;
    description = "A new implementation of low level support for a standard C++ library";
    license = "BSD";
    maintainers = stdenv.lib.maintainers.shlevy;
    platforms = stdenv.lib.platforms.unix;
  };
}