refactor(nix): replace apple-sdk wrappers with xcbuild (#995)

Co-authored-by: Can Celik <ogulcancelik@gmail.com>
This commit is contained in:
Mirza Arnaut 2026-07-05 21:31:46 +02:00 committed by GitHub
parent b1d1a07b1c
commit 96fc43c960
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 26 deletions

View File

@ -4,13 +4,12 @@
rustPlatform,
callPackage,
runCommand,
writeShellScriptBin,
zig_0_15,
zstd,
pkg-config,
git,
apple-sdk ? null,
cctools ? null,
xcbuild ? null,
}:
let
@ -27,25 +26,6 @@ let
'') entries}
'';
};
darwinSdkRoot = "${apple-sdk}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk";
darwinDeveloperDir = "${apple-sdk}/Platforms/MacOSX.platform/Developer";
darwinXcodeSelect = writeShellScriptBin "xcode-select" ''
if [ "$1" = "--print-path" ]; then
echo ${lib.escapeShellArg darwinDeveloperDir}
exit 0
fi
echo "unsupported xcode-select invocation: $*" >&2
exit 1
'';
darwinXcrun = writeShellScriptBin "xcrun" ''
if [ "$1" = "--sdk" ] && [ "$3" = "--show-sdk-path" ]; then
echo ${lib.escapeShellArg darwinSdkRoot}
exit 0
fi
echo "unsupported xcrun invocation: $*" >&2
exit 1
'';
in
rustPlatform.buildRustPackage {
pname = "herdr";
@ -78,8 +58,7 @@ rustPlatform.buildRustPackage {
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
darwinXcodeSelect
darwinXcrun
xcbuild
];
env = {
@ -87,9 +66,6 @@ rustPlatform.buildRustPackage {
LIBGHOSTTY_VT_SIMD = "true";
LIBGHOSTTY_VT_ZIG_SYSTEM_DIR = zigDeps;
ZIG = lib.getExe zig_0_15;
}
// lib.optionalAttrs stdenv.hostPlatform.isDarwin {
SDKROOT = darwinSdkRoot;
};
preBuild = ''