Sigil OS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
sigil/overlay/llvm-11/libc++/default.nix

47 lines
1.4 KiB

{ lib, stdenv, fetch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames
, version, enableShared ? true }:
stdenv.mkDerivation {
pname = "libc++";
inherit version;
src = fetch "libcxx" "0ylbkcd38zrrz9xmkq9na3d9s8d96hc286dwfwd73wi205lyc7kc";
postUnpack = ''
unpackFile ${libcxxabi.src}
mv libcxxabi-* libcxxabi
unpackFile ${llvm.src}
mv llvm-* llvm
'';
preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake python3 ]
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ];
cmakeFlags = [ "-DLIBCXX_CXX_ABI=libcxxabi" ]
++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi)
"-DLIBCXX_HAS_MUSL_LIBC=1"
++ lib.optional (stdenv.hostPlatform.useLLVM or false)
"-DLIBCXX_USE_COMPILER_RT=ON" ++ lib.optional stdenv.hostPlatform.isWasm [
"-DLIBCXX_ENABLE_THREADS=OFF"
"-DLIBCXX_ENABLE_FILESYSTEM=OFF"
"-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
enableParallelBuilding = true;
passthru = { isLLVM = true; };
meta = {
homepage = "https://libcxx.llvm.org/";
description =
"A new implementation of the C++ standard library, targeting C++11";
license = with lib.licenses; [ ncsa mit ];
platforms = lib.platforms.all;
};
}