-
-
Notifications
You must be signed in to change notification settings - Fork 19k
various: add iOS and iOS simulator cross-compilation #512100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Changes from all commits
f696e75
bc21f20
2601356
4cee1d6
bffe046
7dd9858
4de0fd4
0ad41af
5976e11
2e77977
5f2b5d5
6925b79
0f7ec38
fe4c863
f9ef44b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -758,6 +758,8 @@ rec { | |
| }; | ||
| uclibc = { }; | ||
|
|
||
| simulator = { }; | ||
|
|
||
| unknown = { }; | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,17 @@ | ||
| { lib, config }: | ||
| { | ||
| lib, | ||
| config, | ||
| sdkPlatform, | ||
| }: | ||
|
|
||
| self: super: { | ||
| preBuild = super.preBuild or "" + '' | ||
| platformPath=$out/Platforms/MacOSX.platform | ||
| platformPath=$out/Platforms/${sdkPlatform}.platform | ||
| sdkpath=$platformPath/Developer/SDKs | ||
| ''; | ||
|
|
||
| preInstall = super.preInstall or "" + '' | ||
| platformPath=$out/Platforms/MacOSX.platform | ||
| platformPath=$out/Platforms/${sdkPlatform}.platform | ||
| sdkpath=$platformPath/Developer/SDKs | ||
| ''; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| lib, | ||
| stdenvNoCC, | ||
| buildPackages, | ||
| }: | ||
|
|
||
| { | ||
| sdkPlatform, | ||
| version, | ||
| }: | ||
|
|
||
| stdenvNoCC.mkDerivation { | ||
| pname = "${sdkPlatform}-SDK"; | ||
| inherit version; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for your review! I'll have to look into content addressable derivations, frankly I didn't know that was possible when making this PR. I'm happy to do that if it speeds things up though, since I do have a CI workflow with xcode that takes 2min to the CI run purely from importing xcode to the nix store |
||
|
|
||
| src = buildPackages.darwin.xcode; | ||
This comment was marked as resolved.
Sorry, something went wrong.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Xcode package already has its license set to unfree, which should cover that. The license on |
||
|
|
||
| dontConfigure = true; | ||
| dontBuild = true; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
|
|
||
| sdkPath="Contents/Developer/Platforms/${sdkPlatform}.platform/Developer/SDKs/${sdkPlatform}.sdk" | ||
|
|
||
| # Extract the iOS SDK from the nested Xcode.app such that it | ||
| # matches the fetched macOS SDKs | ||
| if [ ! -d "$sdkPath" ]; then | ||
| echo "Error: iOS SDK not found at $sdkPath in Xcode.app" | ||
| echo "Available platforms:" | ||
| ls -la Contents/Developer/Platforms/ || true | ||
| exit 1 | ||
| fi | ||
|
|
||
| mkdir -p "$out" | ||
| cp -rd "$sdkPath"/* "$out/" | ||
| rm -rf "$out/usr/bin" "$out/usr/share" 2>/dev/null || true | ||
|
|
||
| runHook postInstall | ||
| ''; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,23 +11,23 @@ | |
| # files. | ||
|
|
||
| let | ||
| rev = "948ae97ca5703224bd3eada06b7a69f40dd15a02"; | ||
| rev = "a2287c3041a3f2a204eb942e09c015eab00dc7dd"; | ||
|
|
||
| # Don't use fetchgit as this is needed during Aarch64 bootstrapping | ||
| configGuess = fetchurl { | ||
| name = "config.guess-${builtins.substring 0 7 rev}"; | ||
| url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=${rev}"; | ||
| hash = "sha256-ZByuPAx0xJNU0+3gCfP+vYD+vhUBp3wdn6yNQsxFtss="; | ||
| hash = "sha256-UCBc8+xcdhWxf5N6Cle6v07FzQqt49ezzMvl8b+Rp+8="; | ||
| }; | ||
| configSub = fetchurl { | ||
| name = "config.sub-${builtins.substring 0 7 rev}"; | ||
| url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=${rev}"; | ||
| hash = "sha256-/jovMvuv9XhIcyVJ9I2YP9ZSYCTsLw9ancdcL0NZo6Y="; | ||
| hash = "sha256-JrhS91pjdEg2CpVpMUOffoGL9jFQ6q25uFSENHYo0f0="; | ||
| }; | ||
| in | ||
| stdenv.mkDerivation { | ||
| pname = "gnu-config"; | ||
| version = "2024-01-01"; | ||
| version = "2025-07-09"; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this version of gnu-config contains updates that include ios-simulator triples, making life easier in nixpkgs for that target |
||
|
|
||
| unpackPhase = '' | ||
| runHook preUnpack | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.