bazel_6: Add sigtool and set up codesign allocate appropriately

This commit is contained in:
Claudio Bley 2024-01-29 10:04:42 +01:00
parent bb8574ddb8
commit a75d0a734f
2 changed files with 7 additions and 4 deletions

View File

@ -8,7 +8,7 @@
# updater # updater
, python3, writeScript , python3, writeScript
# Apple dependencies # Apple dependencies
, cctools, libcxx, CoreFoundation, CoreServices, Foundation , cctools, libcxx, CoreFoundation, CoreServices, Foundation, sigtool
# Allow to independently override the jdks used to build and run respectively # Allow to independently override the jdks used to build and run respectively
, buildJdk, runJdk , buildJdk, runJdk
, runtimeShell , runtimeShell
@ -424,7 +424,10 @@ stdenv.mkDerivation rec {
export NIX_CFLAGS_COMPILE+=" -Wno-deprecated-builtins -Wno-gnu-offsetof-extensions" export NIX_CFLAGS_COMPILE+=" -Wno-deprecated-builtins -Wno-gnu-offsetof-extensions"
# don't use system installed Xcode to run clang, use Nix clang instead # don't use system installed Xcode to run clang, use Nix clang instead
sed -i -E "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \ sed -i -E \
-e "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \
-e "s;/usr/bin/codesign;CODESIGN_ALLOCATE=${cctools}/bin/${cctools.targetPrefix}codesign_allocate ${sigtool}/bin/codesign;" \
-e "s;env -i codesign;env -i CODESIGN_ALLOCATE=${cctools}/bin/${cctools.targetPrefix}codesign_allocate ${sigtool}/bin/codesign;" \
scripts/bootstrap/compile.sh \ scripts/bootstrap/compile.sh \
tools/osx/BUILD tools/osx/BUILD
@ -578,7 +581,7 @@ stdenv.mkDerivation rec {
which which
zip zip
python3.pkgs.absl-py # Needed to build fish completion python3.pkgs.absl-py # Needed to build fish completion
] ++ lib.optionals (stdenv.isDarwin) [ cctools libcxx CoreFoundation CoreServices Foundation ]; ] ++ lib.optionals (stdenv.isDarwin) [ cctools libcxx sigtool CoreFoundation CoreServices Foundation ];
# Bazel makes extensive use of symlinks in the WORKSPACE. # Bazel makes extensive use of symlinks in the WORKSPACE.
# This causes problems with infinite symlinks if the build output is in the same location as the # This causes problems with infinite symlinks if the build output is in the same location as the

View File

@ -18265,7 +18265,7 @@ with pkgs;
}; };
bazel_6 = darwin.apple_sdk_11_0.callPackage ../development/tools/build-managers/bazel/bazel_6 { bazel_6 = darwin.apple_sdk_11_0.callPackage ../development/tools/build-managers/bazel/bazel_6 {
inherit (darwin) cctools; inherit (darwin) cctools sigtool;
inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation CoreServices Foundation; inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation CoreServices Foundation;
buildJdk = jdk11_headless; buildJdk = jdk11_headless;
runJdk = jdk11_headless; runJdk = jdk11_headless;