Skip to content

Commit 2df2daf

Browse files
committed
Clean up consistency issues in xros/visionOS usage.
1 parent 21cba8e commit 2df2daf

File tree

4 files changed

+50
-47
lines changed

4 files changed

+50
-47
lines changed

Makefile

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
#
22
# Useful targets:
3-
# - all - build everything
4-
# - iOS - build everything for iOS
5-
# - tvOS - build everything for tvOS
6-
# - watchOS - build everything for watchOS
7-
# - visionOS - build everything for visionOS
8-
# - BZip2 - build BZip2 for all platforms
9-
# - BZip2-iOS - build BZip2 for iOS
10-
# - BZip2-tvOS - build BZip2 for tvOS
11-
# - BZip2-watchOS - build BZip2 for watchOS
12-
# - BZip2-visionOS - build BZip2 for visionOS
13-
# - XZ - build XZ for all platforms
14-
# - XZ-iOS - build XZ for iOS
15-
# - XZ-tvOS - build XZ for tvOS
16-
# - XZ-watchOS - build XZ for watchOS
17-
# - XZ-xrOS - build XZ for xrOS
18-
# - OpenSSL - build OpenSSL for all platforms
19-
# - OpenSSL-iOS - build OpenSSL for iOS
20-
# - OpenSSL-tvOS - build OpenSSL for tvOS
21-
# - OpenSSL-watchOS - build OpenSSL for watchOS
22-
# - OpenSSL-visionOS- build OpenSSL for visionOS
23-
# - mpdecimal - build mpdecimal for all platforms
24-
# - mpdecimal-iOS - build mpdecimal for iOS
25-
# - mpdecimal-tvOS - build mpdecimal for tvOS
26-
# - mpdecimal-watchOS - build mpdecimal for watchOS
27-
# - mpdecimal-visionOS- build mpdecimal for visionOS
28-
# - libFFI-iOS - build libFFI for iOS
29-
# - libFFI-tvOS - build libFFI for tvOS
30-
# - libFFI-watchOS - build libFFI for watchOS
31-
# - libFFI-visionOS - build libFFI for visionOS
3+
# - all - build everything
4+
# - iOS - build everything for iOS
5+
# - tvOS - build everything for tvOS
6+
# - watchOS - build everything for watchOS
7+
# - visionOS - build everything for visionOS
8+
# - BZip2 - build BZip2 for all platforms
9+
# - BZip2-iOS - build BZip2 for iOS
10+
# - BZip2-tvOS - build BZip2 for tvOS
11+
# - BZip2-watchOS - build BZip2 for watchOS
12+
# - BZip2-visionOS - build BZip2 for visionOS
13+
# - XZ - build XZ for all platforms
14+
# - XZ-iOS - build XZ for iOS
15+
# - XZ-tvOS - build XZ for tvOS
16+
# - XZ-watchOS - build XZ for watchOS
17+
# - XZ-visionOS - build XZ for xrOS
18+
# - OpenSSL - build OpenSSL for all platforms
19+
# - OpenSSL-iOS - build OpenSSL for iOS
20+
# - OpenSSL-tvOS - build OpenSSL for tvOS
21+
# - OpenSSL-watchOS - build OpenSSL for watchOS
22+
# - OpenSSL-visionOS - build OpenSSL for visionOS
23+
# - mpdecimal - build mpdecimal for all platforms
24+
# - mpdecimal-iOS - build mpdecimal for iOS
25+
# - mpdecimal-tvOS - build mpdecimal for tvOS
26+
# - mpdecimal-watchOS - build mpdecimal for watchOS
27+
# - mpdecimal-visionOS - build mpdecimal for visionOS
28+
# - libFFI-iOS - build libFFI for iOS
29+
# - libFFI-tvOS - build libFFI for tvOS
30+
# - libFFI-watchOS - build libFFI for watchOS
31+
# - libFFI-visionOS - build libFFI for visionOS
3232

3333
# Current directory
3434
PROJECT_DIR=$(shell pwd)
@@ -64,26 +64,33 @@ CURL_FLAGS=--disable --fail --location --create-dirs --progress-bar
6464

6565
# iOS targets
6666
TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
67+
TRIPLE_OS-iOS=ios
6768
VERSION_MIN-iOS=13.0
6869
CFLAGS-iOS=-mios-version-min=$(VERSION_MIN-iOS)
6970

7071
# tvOS targets
7172
TARGETS-tvOS=appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
73+
TRIPLE_OS-tvOS=tvos
7274
VERSION_MIN-tvOS=9.0
7375
CFLAGS-tvOS=-mtvos-version-min=$(VERSION_MIN-tvOS)
7476
PYTHON_CONFIGURE-tvOS=ac_cv_func_sigaltstack=no
7577

7678
# watchOS targets
7779
TARGETS-watchOS=watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
80+
TRIPLE_OS-watchOS=watchos
7881
VERSION_MIN-watchOS=4.0
7982
CFLAGS-watchOS=-mwatchos-version-min=$(VERSION_MIN-watchOS)
8083
PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack=no
8184

8285
# visionOS targets
8386
TARGETS-visionOS=xrsimulator.arm64 xros.arm64
87+
TRIPLE_OS-visionOS=xros
8488
VERSION_MIN-visionOS=2.0
85-
# Apple made lives harder by NOT having a -version-min flag
86-
PYTHON_CONFIGURE-xrOS=ac_cv_func_sigaltstack=no
89+
# visionOS doesn't expose -mxros-version-min or similar; it uses the version
90+
# number in the -target triple, or a definition like:
91+
# CFLAGS-visionOS=-arch arm64 -mtargetos=xros$(VERSION_MIN-visionOS)
92+
# For consistency with existing tooling, we use the -target form.
93+
PYTHON_CONFIGURE-visionOS=ac_cv_func_sigaltstack=no
8794

8895
# The architecture of the machine doing the build
8996
HOST_ARCH=$(shell uname -m)
@@ -177,16 +184,14 @@ define build-target
177184
target=$1
178185
os=$2
179186

180-
OS_LOWER-$(target)=$(shell echo $(os) | tr '[:upper:]' '[:lower:]')
181-
182187
# $(target) can be broken up into is composed of $(SDK).$(ARCH)
183188
SDK-$(target)=$$(basename $(target))
184189
ARCH-$(target)=$$(subst .,,$$(suffix $(target)))
185190

186191
ifeq ($$(findstring simulator,$$(SDK-$(target))),)
187-
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))$$(VERSION_MIN-$(os))
192+
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(os))
188193
else
189-
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))$$(VERSION_MIN-$(os))-simulator
194+
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(TRIPLE_OS-$(os))$$(VERSION_MIN-$(os))-simulator
190195
endif
191196

192197
SDK_ROOT-$(target)=$$(shell xcrun --sdk $$(SDK-$(target)) --show-sdk-path)
@@ -506,8 +511,6 @@ os=$2
506511

507512
OS_LOWER-$(sdk)=$(shell echo $(os) | tr '[:upper:]' '[:lower:]')
508513

509-
WHEEL_TAG-$(sdk)=py3-none-$$(shell echo $$(OS_LOWER-$(sdk))_$$(VERSION_MIN-$(os))_$(sdk) | sed "s/\./_/g")
510-
511514
SDK_TARGETS-$(sdk)=$$(filter $(sdk).%,$$(TARGETS-$(os)))
512515
SDK_ARCHES-$(sdk)=$$(sort $$(subst .,,$$(suffix $$(SDK_TARGETS-$(sdk)))))
513516

patch/libffi.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ diff -ur libffi-3.4.7 2/config.sub libffi-3.4.7/config.sub
66
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
77
| hiux* | abug | nacl* | netware* | windows* \
88
- | os9* | macos* | osx* | ios* | tvos* | watchos* \
9-
+ | os9* | macos* | osx* | ios* | tvos* | watchos* | xros* | visionos* \
9+
+ | os9* | macos* | osx* | ios* | tvos* | watchos* | xros* \
1010
| mpw* | magic* | mmixware* | mon960* | lnews* \
1111
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1212
| aos* | aros* | cloudabi* | sortix* | twizzler* \
@@ -15,7 +15,7 @@ diff -ur libffi-3.4.7 2/config.sub libffi-3.4.7/config.sub
1515
os2-emx-)
1616
;;
1717
- ios*-simulator* | tvos*-simulator* | watchos*-simulator*)
18-
+ ios*-simulator* | tvos*-simulator* | watchos*-simulator* | xros*-simulator* | visionos*-simulator*)
18+
+ ios*-simulator* | tvos*-simulator* | watchos*-simulator* | xros*-simulator*)
1919
;;
2020
*-eabi*- | *-gnueabi*-)
2121
;;
@@ -28,15 +28,15 @@ diff -ur libffi-3.4.7 2/generate-darwin-source-and-headers.py libffi-3.4.7/gener
2828
version_min = '-mwatchos-version-min=4.0'
2929
+
3030
+class visionos_simulator_arm64_platform(arm64_platform):
31-
+ target = 'arm64-apple-visionos-simulator'
32-
+ directory = 'darwin_visionos'
31+
+ target = 'arm64-apple-xros2.0-simulator'
32+
+ directory = 'darwin_xros'
3333
+ sdk = 'xrsimulator'
3434
+ version_min = ''
3535

3636

3737
+class visionos_device_arm64_platform(arm64_platform):
38-
+ target = 'arm64-apple-visionos'
39-
+ directory = 'darwin_visionos'
38+
+ target = 'arm64-apple-xros2.0'
39+
+ directory = 'darwin_xros'
4040
+ sdk = 'xros'
4141
+ arch = 'arm64'
4242
+ version_min = ''

patch/mpdecimal.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ diff -ur mpdecimal-4.0.0-orig/config.sub mpdecimal-4.0.0/config.sub
1313
@@ -1713,3 +1713,3 @@
1414
| hiux* | abug | nacl* | netware* | windows* \
1515
- | os9* | macos* | osx* | ios* | tvos* | watchos* \
16-
+ | os9* | macos* | osx* | ios* | tvos* | watchos* | xros* | visionos* \
16+
+ | os9* | macos* | osx* | ios* | tvos* | watchos* | xros* \
1717
| mpw* | magic* | mmixware* | mon960* | lnews* \
1818
@@ -1792,6 +1792,8 @@
1919
os2-emx)
2020
;;
2121
*-eabi* | *-gnueabi*)
2222
+ ;;
23-
+ ios*-simulator | tvos*-simulator | watchos*-simulator | xros*-simulator | visionos*-simulator)
23+
+ ios*-simulator | tvos*-simulator | watchos*-simulator | xros*-simulator)
2424
;;
2525
none-coff* | none-elf*)
2626
# None (no kernel, i.e. freestanding / bare metal),

patch/xz.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ diff -ru xz-5.4.7-orig/build-aux/config.sub xz-5.4.7/build-aux/config.sub
1212

1313
@@ -2150,2 +2150,3 @@
1414
| xray* \
15-
+ | xros* | visionos* \
15+
+ | xros* \
1616
| zephyr* \
1717
@@ -1865,6 +1865,8 @@
1818
os2-emx-)
1919
;;
2020
*-eabi*- | *-gnueabi*-)
2121
+ ;;
22-
+ ios*-simulator- | tvos*-simulator- | watchos*-simulator- | xros*-simulator- | visionos*-simulator- )
22+
+ ios*-simulator- | tvos*-simulator- | watchos*-simulator- | xros*-simulator-)
2323
;;
2424
none--*)
2525
# None (no kernel, i.e. freestanding / bare metal),

0 commit comments

Comments
 (0)