···1{ lib, stdenv, llvm_meta, version
2, monorepoSrc, runCommand
3-, cmake, python3, libllvm, libcxxabi
4}:
56let
···26 inherit src;
27 sourceRoot = "${src.name}/${baseName}";
2829- nativeBuildInputs = [ cmake python3 libllvm.dev ];
030 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
3132 NIX_CFLAGS_COMPILE = [
···73 # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
74 # extra `/`.
75 ./normalize-var.patch
76- ] # Prevent a compilation error on darwin
77- ++ lib.optional stdenv.hostPlatform.isDarwin ./darwin-targetconditionals.patch
78- ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
007980 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
81 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
···86 substituteInPlace cmake/builtin-config-ix.cmake \
87 --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
88 '' + lib.optionalString stdenv.isDarwin ''
89- substituteInPlace cmake/builtin-config-ix.cmake \
90- --replace 'set(ARM64 arm64 arm64e)' 'set(ARM64)'
91 substituteInPlace cmake/config-ix.cmake \
92 --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
93 '' + lib.optionalString (useLLVM) ''
···1{ lib, stdenv, llvm_meta, version
2, monorepoSrc, runCommand
3+, cmake, python3, xcbuild, libllvm, libcxxabi
4}:
56let
···26 inherit src;
27 sourceRoot = "${src.name}/${baseName}";
2829+ nativeBuildInputs = [ cmake python3 libllvm.dev ]
30+ ++ lib.optional stdenv.isDarwin xcbuild.xcrun;
31 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
3233 NIX_CFLAGS_COMPILE = [
···74 # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
75 # extra `/`.
76 ./normalize-var.patch
77+ # Prevent a compilation error on darwin
78+ ./darwin-targetconditionals.patch
79+ ../../common/compiler-rt/darwin-plistbuddy-workaround.patch
80+ ./armv7l.patch
81+ ];
8283 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
84 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
···89 substituteInPlace cmake/builtin-config-ix.cmake \
90 --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
91 '' + lib.optionalString stdenv.isDarwin ''
0092 substituteInPlace cmake/config-ix.cmake \
93 --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
94 '' + lib.optionalString (useLLVM) ''
···1+CMake tries to read a list field from SDKSettings.plist, but the output of
2+xcbuild PlistBuddy is incompatible with Apple's. (Plus we don't want it in our
3+dependencies.)
4+5+Simply assume ARM64 is supported by the SDK. We already limit the actual archs
6+we build for by setting DARWIN_osx_BUILTIN_ARCHS explicitely.
7+8+--- a/cmake/builtin-config-ix.cmake
9++++ b/cmake/builtin-config-ix.cmake
10+@@ -97,14 +97,7 @@ if(APPLE)
11+ set(DARWIN_osx_BUILTIN_MIN_VER 10.5)
12+ set(DARWIN_osx_BUILTIN_MIN_VER_FLAG
13+ -mmacosx-version-min=${DARWIN_osx_BUILTIN_MIN_VER})
14+- set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64})
15+- # Add support for arm64 macOS if available in SDK.
16+- foreach(arch ${ARM64})
17+- sdk_has_arch_support(${DARWIN_osx_SYSROOT} macosx ${arch} MACOS_ARM_SUPPORT)
18+- if (MACOS_ARM_SUPPORT)
19+- list(APPEND DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${arch})
20+- endif()
21+- endforeach(arch)
22++ set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64} ${ARM64})
23+24+ if(COMPILER_RT_ENABLE_IOS)
25+ list(APPEND DARWIN_EMBEDDED_PLATFORMS ios)
···1{ lib, stdenv, llvm_meta, version
2, monorepoSrc, runCommand
3-, cmake, python3, libllvm, libcxxabi
4}:
56let
···26 inherit src;
27 sourceRoot = "${src.name}/${baseName}";
2829- nativeBuildInputs = [ cmake python3 libllvm.dev ];
030 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
3132 NIX_CFLAGS_COMPILE = [
···71 # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
72 # extra `/`.
73 ./normalize-var.patch
74- ] # Prevent a compilation error on darwin
75- ++ lib.optional stdenv.hostPlatform.isDarwin ./darwin-targetconditionals.patch
76- ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
007778 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
79 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
···84 substituteInPlace cmake/builtin-config-ix.cmake \
85 --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
86 '' + lib.optionalString stdenv.isDarwin ''
87- substituteInPlace cmake/builtin-config-ix.cmake \
88- --replace 'set(ARM64 arm64 arm64e)' 'set(ARM64)'
89 substituteInPlace cmake/config-ix.cmake \
90 --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
91 '' + lib.optionalString (useLLVM) ''
···1{ lib, stdenv, llvm_meta, version
2, monorepoSrc, runCommand
3+, cmake, python3, xcbuild, libllvm, libcxxabi
4}:
56let
···26 inherit src;
27 sourceRoot = "${src.name}/${baseName}";
2829+ nativeBuildInputs = [ cmake python3 libllvm.dev ]
30+ ++ lib.optional stdenv.isDarwin xcbuild.xcrun;
31 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
3233 NIX_CFLAGS_COMPILE = [
···72 # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the
73 # extra `/`.
74 ./normalize-var.patch
75+ # Prevent a compilation error on darwin
76+ ./darwin-targetconditionals.patch
77+ ../../common/compiler-rt/darwin-plistbuddy-workaround.patch
78+ ./armv7l.patch
79+ ];
8081 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
82 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
···87 substituteInPlace cmake/builtin-config-ix.cmake \
88 --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
89 '' + lib.optionalString stdenv.isDarwin ''
0090 substituteInPlace cmake/config-ix.cmake \
91 --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
92 '' + lib.optionalString (useLLVM) ''