From 7450d599d0b8860780d3fdfbb12d8b469be572bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Wed, 10 Aug 2022 09:50:08 +0200 Subject: [PATCH] xcbuild: allow using xcrun separately Sometimes, builds only call xcrun for very basic detection. This exposes a `xcbuild.xcrun` that has a significantly simpler closure. (It's just some files and shell scripts.) --- pkgs/development/tools/xcbuild/wrapper.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix index 55ea298a98ea..490e1af11b1f 100644 --- a/pkgs/development/tools/xcbuild/wrapper.nix +++ b/pkgs/development/tools/xcbuild/wrapper.nix @@ -1,4 +1,4 @@ -{ stdenv, makeWrapper, writeText, runCommand +{ stdenv, makeWrapper, writeText, writeShellScriptBin, runCommand , CoreServices, ImageIO, CoreGraphics , runtimeShell, callPackage , xcodePlatform ? stdenv.targetPlatform.xcodePlatform or "MacOSX" @@ -50,8 +50,7 @@ while [ $# -gt 0 ]; do done ''; - xcrun = writeText "xcrun" '' -#!${runtimeShell} + xcrun = writeShellScriptBin "xcrun" '' while [ $# -gt 0 ]; do case "$1" in --sdk | -sdk) shift ;; @@ -90,7 +89,7 @@ runCommand "xcodebuild-${xcbuild.version}" { propagatedBuildInputs = [ "${toolchains}/XcodeDefault.xctoolchain" ]; passthru = { - inherit xcbuild; + inherit xcbuild xcrun; toolchain = "${toolchains}/XcodeDefault.xctoolchain"; sdk = "${sdks}/${sdkName}"; platform = "${platforms}/${xcodePlatform}.platform"; @@ -127,8 +126,7 @@ runCommand "xcodebuild-${xcbuild.version}" { --subst-var-by DEVELOPER_DIR $out/Applications/Xcode.app/Contents/Developer chmod +x $out/bin/xcode-select - substitute ${xcrun} $out/bin/xcrun - chmod +x $out/bin/xcrun + cp ${xcrun}/bin/xcrun $out/bin/xcrun for bin in PlistBuddy actool builtin-copy builtin-copyPlist \ builtin-copyStrings builtin-copyTiff \