summary refs log tree commit diff
path: root/pkgs/development/tools/xcbuild
diff options
context:
space:
mode:
authorIvan Babrou <github@ivan.computer>2021-02-05 09:34:12 -0800
committerAndrew Childs <lorne@cons.org.nz>2021-05-17 00:27:03 +0900
commitbac1418031a6c4e9cf891aa7d3e07df0ba008147 (patch)
tree9f2337ff84277e049101c3ff7c34edbf984858d3 /pkgs/development/tools/xcbuild
parent23cae56ca720fadb1040e7739a30bff7dbda38c8 (diff)
downloadnixpkgs-bac1418031a6c4e9cf891aa7d3e07df0ba008147.tar
nixpkgs-bac1418031a6c4e9cf891aa7d3e07df0ba008147.tar.gz
nixpkgs-bac1418031a6c4e9cf891aa7d3e07df0ba008147.tar.bz2
nixpkgs-bac1418031a6c4e9cf891aa7d3e07df0ba008147.tar.lz
nixpkgs-bac1418031a6c4e9cf891aa7d3e07df0ba008147.tar.xz
nixpkgs-bac1418031a6c4e9cf891aa7d3e07df0ba008147.tar.zst
nixpkgs-bac1418031a6c4e9cf891aa7d3e07df0ba008147.zip
xcbuild: allow building arm64 binaries
File paths are copied from XCode 12.
Diffstat (limited to 'pkgs/development/tools/xcbuild')
-rw-r--r--pkgs/development/tools/xcbuild/platforms.nix30
-rw-r--r--pkgs/development/tools/xcbuild/wrapper.nix2
2 files changed, 16 insertions, 16 deletions
diff --git a/pkgs/development/tools/xcbuild/platforms.nix b/pkgs/development/tools/xcbuild/platforms.nix
index e20dc878b53..0108ac8ef69 100644
--- a/pkgs/development/tools/xcbuild/platforms.nix
+++ b/pkgs/development/tools/xcbuild/platforms.nix
@@ -1,4 +1,4 @@
-{ runCommand, lib, sdks, xcodePlatform, writeText }:
+{ stdenv, runCommand, lib, sdks, xcodePlatform, writeText }:
 
 let
 
@@ -15,23 +15,23 @@ let
   };
 
   # These files are all based off of Xcode spec fies found in
-  # /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Speciications/.
+  # /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/PrivatePlugIns/IDEOSXSupportCore.ideplugin/Contents/Resources.
 
-  # Based off of the MacOSX Architectures.xcpsec file. All i386 stuff
-  # is removed because NixPkgs only supports darwin-x86_64.
+  # Based off of the "MacOSX Architectures.xcspec" file. All i386 stuff
+  # is removed because NixPkgs only supports darwin-x86_64 and darwin-arm64.
   Architectures = [
     {
       Identifier = "Standard";
       Type = "Architecture";
-      Name = "Standard Architectures (64-bit Intel)";
-      RealArchitectures = [ "x86_64" ];
+      Name = "Standard Architectures (Apple Silicon, 64-bit Intel)";
+      RealArchitectures = [ "arm64" "x86_64" ];
       ArchitectureSetting = "ARCHS_STANDARD";
     }
     {
       Identifier = "Universal";
       Type = "Architecture";
-      Name = "Universal (64-bit Intel)";
-      RealArchitectures = [ "x86_64" ];
+      Name = "Universal (Apple Silicon, 64-bit Intel)";
+      RealArchitectures = [ "arm64" "x86_64" ];
       ArchitectureSetting = "ARCHS_STANDARD_32_64_BIT";
     }
     {
@@ -43,25 +43,25 @@ let
     {
       Identifier = "Standard64bit";
       Type = "Architecture";
-      Name = "64-bit Intel";
-      RealArchitectures = [ "x86_64" ];
+      Name = "Apple Silicon, 64-bit Intel";
+      RealArchitectures = [ "arm64" "x86_64" ];
       ArchitectureSetting = "ARCHS_STANDARD_64_BIT";
     }
     {
-      Identifier = "x86_64";
+      Identifier = if stdenv.isAarch64 then "arm64" else "x86_64";
       Type = "Architecture";
-      Name = "Intel 64-bit";
+      Name = "Apple Silicon or Intel 64-bit";
     }
     {
       Identifier = "Standard_Including_64_bit";
       Type = "Architecture";
       Name = "Standard Architectures (including 64-bit)";
-      RealArchitectures = [ "x86_64" ];
+      RealArchitectures = [ "arm64" "x86_64" ];
       ArchitectureSetting = "ARCHS_STANDARD_INCLUDING_64_BIT";
     }
   ];
 
-  # Based off of the MacOSX Package Types.xcpsec file. Only keep the
+  # Based off of the "MacOSX Package Types.xcspec" file. Only keep the
   # bare minimum needed.
   PackageTypes = [
     {
@@ -169,7 +169,7 @@ let
     }
   ];
 
-  # Based off of the MacOSX Product Types.xcpsec file. All
+  # Based off of the "MacOSX Product Types.xcspec" file. All
   # bundles/wrapper are removed, because we prefer dynamic products in
   # NixPkgs.
   ProductTypes = [
diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix
index 4f74b093717..ca69bbe907d 100644
--- a/pkgs/development/tools/xcbuild/wrapper.nix
+++ b/pkgs/development/tools/xcbuild/wrapper.nix
@@ -28,7 +28,7 @@ let
   };
 
   platforms = callPackage ./platforms.nix {
-    inherit sdks xcodePlatform;
+    inherit sdks xcodePlatform stdenv;
   };
 
   xcconfig = writeText "nix.xcconfig" ''