-
-
Notifications
You must be signed in to change notification settings - Fork 12
Add support for visionOS #50
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
Changes from all commits
50f3205
cac80e3
c2d3c79
42b1743
ac6e409
21cba8e
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 |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ jobs: | |
| runs-on: macOS-latest | ||
| strategy: | ||
| matrix: | ||
| target: [ "iOS", "tvOS", "watchOS" ] | ||
| target: [ "iOS", "tvOS", "watchOS", "visionOS" ] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/[email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ jobs: | |
| BUILD_NUMBER: ${{ steps.build-vars.outputs.BUILD_NUMBER }} | ||
| strategy: | ||
| matrix: | ||
| target: [ "iOS", "tvOS", "watchOS" ] | ||
| target: [ "iOS", "tvOS", "watchOS", "visionOS" ] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/[email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,32 +4,38 @@ | |||||||||||
| # - iOS - build everything for iOS | ||||||||||||
| # - tvOS - build everything for tvOS | ||||||||||||
| # - watchOS - build everything for watchOS | ||||||||||||
| # - visionOS - build everything for visionOS | ||||||||||||
| # - BZip2 - build BZip2 for all platforms | ||||||||||||
| # - BZip2-iOS - build BZip2 for iOS | ||||||||||||
| # - BZip2-tvOS - build BZip2 for tvOS | ||||||||||||
| # - BZip2-watchOS - build BZip2 for watchOS | ||||||||||||
| # - BZip2-visionOS - build BZip2 for visionOS | ||||||||||||
| # - XZ - build XZ for all platforms | ||||||||||||
| # - XZ-iOS - build XZ for iOS | ||||||||||||
| # - XZ-tvOS - build XZ for tvOS | ||||||||||||
| # - XZ-watchOS - build XZ for watchOS | ||||||||||||
| # - XZ-xrOS - build XZ for xrOS | ||||||||||||
| # - OpenSSL - build OpenSSL for all platforms | ||||||||||||
| # - OpenSSL-iOS - build OpenSSL for iOS | ||||||||||||
| # - OpenSSL-tvOS - build OpenSSL for tvOS | ||||||||||||
| # - OpenSSL-watchOS - build OpenSSL for watchOS | ||||||||||||
| # - OpenSSL-visionOS- build OpenSSL for visionOS | ||||||||||||
| # - mpdecimal - build mpdecimal for all platforms | ||||||||||||
| # - mpdecimal-iOS - build mpdecimal for iOS | ||||||||||||
| # - mpdecimal-tvOS - build mpdecimal for tvOS | ||||||||||||
| # - mpdecimal-watchOS - build mpdecimal for watchOS | ||||||||||||
| # - mpdecimal-visionOS- build mpdecimal for visionOS | ||||||||||||
| # - libFFI-iOS - build libFFI for iOS | ||||||||||||
| # - libFFI-tvOS - build libFFI for tvOS | ||||||||||||
| # - libFFI-watchOS - build libFFI for watchOS | ||||||||||||
| # - libFFI-visionOS - build libFFI for visionOS | ||||||||||||
|
|
||||||||||||
| # Current directory | ||||||||||||
| PROJECT_DIR=$(shell pwd) | ||||||||||||
|
|
||||||||||||
| # Supported OS and products | ||||||||||||
| PRODUCTS=BZip2 XZ OpenSSL libFFI | ||||||||||||
| OS_LIST=iOS tvOS watchOS | ||||||||||||
| OS_LIST=iOS tvOS watchOS visionOS | ||||||||||||
|
|
||||||||||||
| # The versions to compile by default. | ||||||||||||
| # In practice, these should be | ||||||||||||
|
|
@@ -73,6 +79,12 @@ VERSION_MIN-watchOS=4.0 | |||||||||||
| CFLAGS-watchOS=-mwatchos-version-min=$(VERSION_MIN-watchOS) | ||||||||||||
| PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack=no | ||||||||||||
|
|
||||||||||||
| # visionOS targets | ||||||||||||
| TARGETS-visionOS=xrsimulator.arm64 xros.arm64 | ||||||||||||
| VERSION_MIN-visionOS=2.0 | ||||||||||||
| # Apple made lives harder by NOT having a -version-min flag | ||||||||||||
|
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.
Suggested change
|
||||||||||||
| PYTHON_CONFIGURE-xrOS=ac_cv_func_sigaltstack=no | ||||||||||||
|
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 variable won't be used as-defined... which does raise the question of whether it is needed at all.
Suggested change
|
||||||||||||
|
|
||||||||||||
| # The architecture of the machine doing the build | ||||||||||||
| HOST_ARCH=$(shell uname -m) | ||||||||||||
|
|
||||||||||||
|
|
@@ -550,6 +562,7 @@ $$(LIBFFI_SRCDIR-$(os))/darwin_common/include/ffi.h: downloads/libffi-$(LIBFFI_V | |||||||||||
| @echo ">>> Unpack and configure libFFI sources on $(os)" | ||||||||||||
| mkdir -p $$(LIBFFI_SRCDIR-$(os)) | ||||||||||||
| tar zxf $$< --strip-components 1 -C $$(LIBFFI_SRCDIR-$(os)) | ||||||||||||
| cd $$(LIBFFI_SRCDIR-$(os)) && patch -p1 < $(PROJECT_DIR)/patch/libffi.patch | ||||||||||||
| # Configure the build | ||||||||||||
| cd $$(LIBFFI_SRCDIR-$(os)) && \ | ||||||||||||
| python3 generate-darwin-source-and-headers.py --only-$(shell echo $(os) | tr '[:upper:]' '[:lower:]') \ | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,94 @@ | ||||||
| diff -ur libffi-3.4.7 2/config.sub libffi-3.4.7/config.sub | ||||||
| --- libffi-3.4.7 2/config.sub 2024-12-13 04:38:19 | ||||||
| +++ libffi-3.4.7/config.sub 2025-04-12 17:44:40 | ||||||
| @@ -1742,7 +1742,7 @@ | ||||||
| | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | ||||||
| | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ | ||||||
| | hiux* | abug | nacl* | netware* | windows* \ | ||||||
| - | os9* | macos* | osx* | ios* | tvos* | watchos* \ | ||||||
| + | os9* | macos* | osx* | ios* | tvos* | watchos* | xros* | visionos* \ | ||||||
|
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.
Suggested change
|
||||||
| | mpw* | magic* | mmixware* | mon960* | lnews* \ | ||||||
| | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | ||||||
| | aos* | aros* | cloudabi* | sortix* | twizzler* \ | ||||||
| @@ -1864,7 +1864,7 @@ | ||||||
| ;; | ||||||
| os2-emx-) | ||||||
| ;; | ||||||
| - ios*-simulator* | tvos*-simulator* | watchos*-simulator*) | ||||||
| + ios*-simulator* | tvos*-simulator* | watchos*-simulator* | xros*-simulator* | visionos*-simulator*) | ||||||
|
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.
Suggested change
|
||||||
| ;; | ||||||
| *-eabi*- | *-gnueabi*-) | ||||||
| ;; | ||||||
| diff -ur libffi-3.4.7 2/generate-darwin-source-and-headers.py libffi-3.4.7/generate-darwin-source-and-headers.py | ||||||
| --- libffi-3.4.7 2/generate-darwin-source-and-headers.py 2024-06-01 12:42:02 | ||||||
| +++ libffi-3.4.7/generate-darwin-source-and-headers.py 2025-04-12 18:02:51 | ||||||
| @@ -152,8 +152,22 @@ | ||||||
| sdk = 'watchos' | ||||||
| arch = 'arm64_32' | ||||||
| version_min = '-mwatchos-version-min=4.0' | ||||||
| + | ||||||
| +class visionos_simulator_arm64_platform(arm64_platform): | ||||||
| + target = 'arm64-apple-visionos-simulator' | ||||||
|
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.
Suggested change
|
||||||
| + directory = 'darwin_visionos' | ||||||
| + sdk = 'xrsimulator' | ||||||
| + version_min = '' | ||||||
|
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. For consistency, my inlination here would be to enforce visionOS 2.0 as well. 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. see above. |
||||||
|
|
||||||
|
|
||||||
| +class visionos_device_arm64_platform(arm64_platform): | ||||||
| + target = 'arm64-apple-visionos' | ||||||
|
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.
Suggested change
I'd also leave a comment against |
||||||
| + directory = 'darwin_visionos' | ||||||
| + sdk = 'xros' | ||||||
| + arch = 'arm64' | ||||||
| + version_min = '' | ||||||
| + | ||||||
| + | ||||||
| def mkdir_p(path): | ||||||
| try: | ||||||
| os.makedirs(path) | ||||||
| @@ -243,6 +257,7 @@ | ||||||
| generate_ios=True, | ||||||
| generate_tvos=True, | ||||||
| generate_watchos=True, | ||||||
| + generate_visionos=True | ||||||
| ): | ||||||
| copy_files('src', 'darwin_common/src', pattern='*.c') | ||||||
| copy_files('include', 'darwin_common/include', pattern='*.h') | ||||||
| @@ -266,6 +281,9 @@ | ||||||
| copy_src_platform_files(watchos_simulator_arm64_platform) | ||||||
| copy_src_platform_files(watchos_device_armv7k_platform) | ||||||
| copy_src_platform_files(watchos_device_arm64_32_platform) | ||||||
| + if generate_visionos: | ||||||
| + copy_src_platform_files(visionos_simulator_arm64_platform) | ||||||
| + copy_src_platform_files(visionos_device_arm64_platform) | ||||||
|
|
||||||
| platform_headers = collections.defaultdict(set) | ||||||
|
|
||||||
| @@ -288,6 +306,9 @@ | ||||||
| build_target(watchos_simulator_arm64_platform, platform_headers) | ||||||
| build_target(watchos_device_armv7k_platform, platform_headers) | ||||||
| build_target(watchos_device_arm64_32_platform, platform_headers) | ||||||
| + if generate_visionos: | ||||||
| + build_target(visionos_simulator_arm64_platform, platform_headers) | ||||||
| + build_target(visionos_device_arm64_platform, platform_headers) | ||||||
|
|
||||||
| mkdir_p('darwin_common/include') | ||||||
| for header_name, tag_tuples in platform_headers.items(): | ||||||
| @@ -302,11 +323,13 @@ | ||||||
| parser.add_argument('--only-osx', action='store_true', default=False) | ||||||
| parser.add_argument('--only-tvos', action='store_true', default=False) | ||||||
| parser.add_argument('--only-watchos', action='store_true', default=False) | ||||||
| + parser.add_argument('--only-visionos', action='store_true', default=False) | ||||||
| args = parser.parse_args() | ||||||
|
|
||||||
| generate_source_and_headers( | ||||||
| - generate_osx=not args.only_ios and not args.only_tvos and not args.only_watchos, | ||||||
| - generate_ios=not args.only_osx and not args.only_tvos and not args.only_watchos, | ||||||
| - generate_tvos=not args.only_ios and not args.only_osx and not args.only_watchos, | ||||||
| - generate_watchos=not args.only_ios and not args.only_osx and not args.only_tvos, | ||||||
| + generate_osx=not args.only_ios and not args.only_tvos and not args.only_watchos and not args.only_visionos, | ||||||
| + generate_ios=not args.only_osx and not args.only_tvos and not args.only_watchos and not args.only_visionos, | ||||||
| + generate_tvos=not args.only_ios and not args.only_osx and not args.only_watchos and not args.only_visionos, | ||||||
| + generate_watchos=not args.only_ios and not args.only_osx and not args.only_tvos and not args.only_visionos, | ||||||
| + generate_visionos=not args.only_ios and not args.only_osx and not args.only_tvos and not args.only_watchos, | ||||||
| ) | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,12 +10,17 @@ diff -ur mpdecimal-4.0.0-orig/config.sub mpdecimal-4.0.0/config.sub | |||||
| cpu=aarch64 | ||||||
| ;; | ||||||
|
|
||||||
| @@ -1713,3 +1713,3 @@ | ||||||
| | hiux* | abug | nacl* | netware* | windows* \ | ||||||
| - | os9* | macos* | osx* | ios* | tvos* | watchos* \ | ||||||
| + | os9* | macos* | osx* | ios* | tvos* | watchos* | xros* | visionos* \ | ||||||
|
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.
Suggested change
|
||||||
| | mpw* | magic* | mmixware* | mon960* | lnews* \ | ||||||
| @@ -1792,6 +1792,8 @@ | ||||||
| os2-emx) | ||||||
| ;; | ||||||
| *-eabi* | *-gnueabi*) | ||||||
| + ;; | ||||||
| + ios*-simulator | tvos*-simulator | watchos*-simulator) | ||||||
| + ios*-simulator | tvos*-simulator | watchos*-simulator | xros*-simulator | visionos*-simulator) | ||||||
|
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.
Suggested change
|
||||||
| ;; | ||||||
| none-coff* | none-elf*) | ||||||
| # None (no kernel, i.e. freestanding / bare metal), | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More generally, there's an indentation issue across these comments - the
- build...comments should all be aligned.