fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version }:
2
3stdenv.mkDerivation rec {
4 name = "libc++-${version}";
5
6 src = fetch "libcxx" "1672aaf95fgy4xsfra8pw24f6r93zwzpan1033hkcm8p2glqipvf";
7
8 postUnpack = ''
9 unpackFile ${libcxxabi.src}
10 export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
11 '';
12
13 # on next rebuild, this can be replaced with optionals; for now set to null to avoid
14 # patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [
15 patches = if stdenv.hostPlatform.isMusl then [
16 ../../libcxx-0001-musl-hacks.patch
17 ] else null;
18
19 prePatch = ''
20 substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
21 '';
22
23 preConfigure = ''
24 # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
25 cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
26 '' + lib.optionalString stdenv.hostPlatform.isMusl ''
27 patchShebangs utils/cat_files.py
28 '';
29 nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python;
30
31 buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
32
33 cmakeFlags = [
34 "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
35 "-DLIBCXX_LIBCPPABI_VERSION=2"
36 "-DLIBCXX_CXX_ABI=libcxxabi"
37 ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
38
39 enableParallelBuilding = true;
40
41 linkCxxAbi = stdenv.isLinux;
42
43 setupHooks = [
44 ../../../../../build-support/setup-hooks/role.bash
45 ./setup-hook.sh
46 ];
47
48 meta = {
49 homepage = http://libcxx.llvm.org/;
50 description = "A new implementation of the C++ standard library, targeting C++11";
51 license = with stdenv.lib.licenses; [ ncsa mit ];
52 platforms = stdenv.lib.platforms.unix;
53 };
54}