3
0
Fork 0
forked from mirrors/nixpkgs

libcxx: Update to 190100 and build with libc++abi.

This commit is contained in:
Petr Rockai 2013-09-07 11:03:26 +02:00
parent 2c9f0e059a
commit e3f2e2e10b

View file

@ -1,19 +1,43 @@
{ stdenv, fetchsvn, cmake }: { stdenv, fetchsvn, cmake, libunwind }:
let rev = "165151"; in let rev = "190100"; in
stdenv.mkDerivation { stdenv.mkDerivation rec {
name = "libc++-pre${rev}"; name = "libc++-pre${rev}";
src = fetchsvn { src = fetchsvn {
url = "http://llvm.org/svn/llvm-project/libcxx/trunk"; url = "http://llvm.org/svn/llvm-project/libcxx/trunk";
inherit rev; inherit rev;
sha256 = "00l8xx5nc3cjlmln7c1sy1i4v844has9kbfxrsziwkalzbgwaslz"; sha256 = "0hnfvzzrkj797kp9sk2yncvbmiyx0d72k8bys3z7l6i47d37xv03";
};
cxxabi = fetchsvn {
url = "http://llvm.org/svn/llvm-project/libcxxabi/trunk";
inherit rev;
sha256 = "1kdyvngwd229cgmcqpawaf0qizas8bqc0g8s08fmbgwsrh1qrryp";
}; };
buildInputs = [ cmake ]; buildInputs = [ cmake ];
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]; preConfigure = ''
sed -i 's/;cxa_demangle.h//' CMakeLists.txt
cp -R ${cxxabi} cxxabi
chmod u+w -R cxxabi # umm
(export NIX_CFLAGS_COMPILE="-I${libunwind}/include -I$PWD/include";
export NIX_CFLAGS_LINK="-L${libunwind}/lib -lunwind";
cd cxxabi/lib
sed -e s,-lstdc++,, -i buildit # do not link to libstdc++!
./buildit
mkdir -p $out/lib && cp libc++abi.so.1.0 $out/lib
cd $out/lib
ln -s libc++abi.so.1.0 libc++abi.so
ln -s libc++abi.so.1.0 libc++abi.so.1)
'';
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release"
"-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${cxxabi}/include"
"-DLIBCXX_CXX_ABI=libcxxabi" ];
buildPhase = ''NIX_CFLAGS_LINK="-L$out/lib -lc++abi" make'';
enableParallelBuilding = true; enableParallelBuilding = true;