xcbuild: allow building arm64 binaries

File paths are copied from XCode 12.

authored by Ivan Babrou and committed by Andrew Childs bac14180 23cae56c

+16 -16
+15 -15
pkgs/development/tools/xcbuild/platforms.nix
··· 1 - { runCommand, lib, sdks, xcodePlatform, writeText }: 2 3 let 4 ··· 15 }; 16 17 # These files are all based off of Xcode spec fies found in 18 - # /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Speciications/. 19 20 - # Based off of the MacOSX Architectures.xcpsec file. All i386 stuff 21 - # is removed because NixPkgs only supports darwin-x86_64. 22 Architectures = [ 23 { 24 Identifier = "Standard"; 25 Type = "Architecture"; 26 - Name = "Standard Architectures (64-bit Intel)"; 27 - RealArchitectures = [ "x86_64" ]; 28 ArchitectureSetting = "ARCHS_STANDARD"; 29 } 30 { 31 Identifier = "Universal"; 32 Type = "Architecture"; 33 - Name = "Universal (64-bit Intel)"; 34 - RealArchitectures = [ "x86_64" ]; 35 ArchitectureSetting = "ARCHS_STANDARD_32_64_BIT"; 36 } 37 { ··· 43 { 44 Identifier = "Standard64bit"; 45 Type = "Architecture"; 46 - Name = "64-bit Intel"; 47 - RealArchitectures = [ "x86_64" ]; 48 ArchitectureSetting = "ARCHS_STANDARD_64_BIT"; 49 } 50 { 51 - Identifier = "x86_64"; 52 Type = "Architecture"; 53 - Name = "Intel 64-bit"; 54 } 55 { 56 Identifier = "Standard_Including_64_bit"; 57 Type = "Architecture"; 58 Name = "Standard Architectures (including 64-bit)"; 59 - RealArchitectures = [ "x86_64" ]; 60 ArchitectureSetting = "ARCHS_STANDARD_INCLUDING_64_BIT"; 61 } 62 ]; 63 64 - # Based off of the MacOSX Package Types.xcpsec file. Only keep the 65 # bare minimum needed. 66 PackageTypes = [ 67 { ··· 169 } 170 ]; 171 172 - # Based off of the MacOSX Product Types.xcpsec file. All 173 # bundles/wrapper are removed, because we prefer dynamic products in 174 # NixPkgs. 175 ProductTypes = [
··· 1 + { stdenv, runCommand, lib, sdks, xcodePlatform, writeText }: 2 3 let 4 ··· 15 }; 16 17 # These files are all based off of Xcode spec fies found in 18 + # /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/PrivatePlugIns/IDEOSXSupportCore.ideplugin/Contents/Resources. 19 20 + # Based off of the "MacOSX Architectures.xcspec" file. All i386 stuff 21 + # is removed because NixPkgs only supports darwin-x86_64 and darwin-arm64. 22 Architectures = [ 23 { 24 Identifier = "Standard"; 25 Type = "Architecture"; 26 + Name = "Standard Architectures (Apple Silicon, 64-bit Intel)"; 27 + RealArchitectures = [ "arm64" "x86_64" ]; 28 ArchitectureSetting = "ARCHS_STANDARD"; 29 } 30 { 31 Identifier = "Universal"; 32 Type = "Architecture"; 33 + Name = "Universal (Apple Silicon, 64-bit Intel)"; 34 + RealArchitectures = [ "arm64" "x86_64" ]; 35 ArchitectureSetting = "ARCHS_STANDARD_32_64_BIT"; 36 } 37 { ··· 43 { 44 Identifier = "Standard64bit"; 45 Type = "Architecture"; 46 + Name = "Apple Silicon, 64-bit Intel"; 47 + RealArchitectures = [ "arm64" "x86_64" ]; 48 ArchitectureSetting = "ARCHS_STANDARD_64_BIT"; 49 } 50 { 51 + Identifier = if stdenv.isAarch64 then "arm64" else "x86_64"; 52 Type = "Architecture"; 53 + Name = "Apple Silicon or Intel 64-bit"; 54 } 55 { 56 Identifier = "Standard_Including_64_bit"; 57 Type = "Architecture"; 58 Name = "Standard Architectures (including 64-bit)"; 59 + RealArchitectures = [ "arm64" "x86_64" ]; 60 ArchitectureSetting = "ARCHS_STANDARD_INCLUDING_64_BIT"; 61 } 62 ]; 63 64 + # Based off of the "MacOSX Package Types.xcspec" file. Only keep the 65 # bare minimum needed. 66 PackageTypes = [ 67 { ··· 169 } 170 ]; 171 172 + # Based off of the "MacOSX Product Types.xcspec" file. All 173 # bundles/wrapper are removed, because we prefer dynamic products in 174 # NixPkgs. 175 ProductTypes = [
+1 -1
pkgs/development/tools/xcbuild/wrapper.nix
··· 28 }; 29 30 platforms = callPackage ./platforms.nix { 31 - inherit sdks xcodePlatform; 32 }; 33 34 xcconfig = writeText "nix.xcconfig" ''
··· 28 }; 29 30 platforms = callPackage ./platforms.nix { 31 + inherit sdks xcodePlatform stdenv; 32 }; 33 34 xcconfig = writeText "nix.xcconfig" ''