Merge pull request #254330 from alexfmpe/verify-xip

Use rcodesign verification on Xcode
This commit is contained in:
Weijia Wang 2024-04-29 17:19:49 +02:00 committed by GitHub
commit 00c13ab034
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@
let requireXcode = version: sha256:
let
xip = "Xcode_" + version + ".xip";
# TODO(alexfmpe): Find out how to validate the .xip signature in Linux
unxip = if stdenv.buildPlatform.isDarwin
then ''
open -W ${xip}
@ -14,7 +14,9 @@ let requireXcode = version: sha256:
rm -rf ${xip}
pbzx -n Content | cpio -i
rm Content Metadata
rcodesign verify Xcode.app/Contents/MacOS/Xcode
'';
app = requireFile rec {
name = "Xcode.app";
url = "https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_${version}/${xip}";
@ -83,4 +85,3 @@ in lib.makeExtensible (self: {
xcode_15_1 = requireXcode "15.1" "sha256-0djqoSamU87rCpjo50Un3cFg9wKf+pSczRko6uumGM0=";
xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if (stdenv.targetPlatform ? xcodeVer) then stdenv.targetPlatform.xcodeVer else "12.3")}";
})