From a0537d633fdbd90f26808df5ca0a890cb4d6ebdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Sun, 22 Jan 2023 13:04:57 +0100 Subject: [PATCH] apple_sdk_11_0: simplify SDK unpacking The SDK was missing SDKSettings files. This is usually not a problem for Nix builds, because we generate our own fake SDK structure when necessary (in xcbuild), but not having these files blocks using the upstream Apple SDK in tooling such as gen-frameworks.py. --- pkgs/os-specific/darwin/apple-sdk-11.0/default.nix | 10 ++-------- pkgs/os-specific/darwin/gen-frameworks.py | 6 ++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix index 8c9e16a6ca9a9..1133cca002a8b 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix @@ -31,10 +31,7 @@ let }; installPhase = '' - cd Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk - - mkdir $out - cp -r System usr $out/ + mv Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk $out ''; }; @@ -49,10 +46,7 @@ let }; installPhase = '' - cd Library/Developer/CommandLineTools - - mkdir $out - cp -r Library usr $out/ + mv Library/Developer/CommandLineTools $out ''; }; diff --git a/pkgs/os-specific/darwin/gen-frameworks.py b/pkgs/os-specific/darwin/gen-frameworks.py index f6e981952f422..ec2a6c7c16ecd 100755 --- a/pkgs/os-specific/darwin/gen-frameworks.py +++ b/pkgs/os-specific/darwin/gen-frameworks.py @@ -3,6 +3,12 @@ """ Generate a frameworks.nix for a macOS SDK. + +You may point this tool at an Xcode bundled SDK, but more ideal is using the +SDK from Nixpkgs. For example: + +SDK_PATH="$(nix-build --no-link -A darwin.apple_sdk_11_0.MacOSX-SDK)" +./gen-frameworks.py "$SDK_PATH" > ./new-frameworks.nix """ import json