55# - iOS - build everything for iOS
66# - tvOS - build everything for tvOS
77# - watchOS - build everything for watchOS
8+ # - visionOS - build everything for visionOS
89
910# Current directory
1011PROJECT_DIR =$(shell pwd)
@@ -18,41 +19,49 @@ BUILD_NUMBER=custom
1819# of a release cycle, as official binaries won't be published.
1920# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
2021# PYTHON_VER is the major/minor version (e.g., 3.10)
21- PYTHON_VERSION =3.14.0a6
22+ PYTHON_VERSION =3.14.0a7
2223PYTHON_PKG_VERSION =$(PYTHON_VERSION )
2324PYTHON_MICRO_VERSION =$(shell echo $(PYTHON_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
2425PYTHON_PKG_MICRO_VERSION =$(shell echo $(PYTHON_PKG_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
2526PYTHON_VER =$(basename $(PYTHON_VERSION ) )
2627
2728# The binary releases of dependencies, published at:
2829# https://github.com/beeware/cpython-apple-source-deps/releases
29- BZIP2_VERSION =1.0.8-1
30- LIBFFI_VERSION =3.4.7-1
31- MPDECIMAL_VERSION =4.0.0-1
32- OPENSSL_VERSION =3.0.16-1
33- XZ_VERSION =5.6.4-1
30+ BZIP2_VERSION =1.0.8-2
31+ LIBFFI_VERSION =3.4.7-2
32+ MPDECIMAL_VERSION =4.0.0-2
33+ OPENSSL_VERSION =3.0.16-2
34+ XZ_VERSION =5.6.4-2
3435
3536# Supported OS
36- OS_LIST =macOS iOS tvOS watchOS
37+ OS_LIST =macOS iOS tvOS watchOS visionOS
3738
3839CURL_FLAGS =--disable --fail --location --create-dirs --progress-bar
3940
4041# macOS targets
4142TARGETS-macOS =macosx.x86_64 macosx.arm64
43+ TRIPLE_OS-macOS =macos
4244VERSION_MIN-macOS =11.0
4345
4446# iOS targets
4547TARGETS-iOS =iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
48+ TRIPLE_OS-iOS =ios
4649VERSION_MIN-iOS =13.0
4750
4851# tvOS targets
4952TARGETS-tvOS =appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
53+ TRIPLE_OS-tvOS =tvos
5054VERSION_MIN-tvOS =12.0
5155
5256# watchOS targets
5357TARGETS-watchOS =watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
58+ TRIPLE_OS-watchOS =watchos
5459VERSION_MIN-watchOS =4.0
5560
61+ TARGETS-visionOS =xrsimulator.arm64 xros.arm64
62+ TRIPLE_OS-visionOS =xros
63+ VERSION_MIN-visionOS =2.0
64+
5665# The architecture of the machine doing the build
5766HOST_ARCH =$(shell uname -m)
5867HOST_PYTHON =$(shell which python$(PYTHON_VER ) )
@@ -128,10 +137,10 @@ ARCH-$(target)=$$(subst .,,$$(suffix $(target)))
128137
129138ifneq ($(os ) ,macOS)
130139 ifeq ($$(findstring simulator,$$(SDK-$(target))),)
131- TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(OS_LOWER -$(target ) )$$(VERSION_MIN-$(os ) )
140+ TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS -$(os ) )$$(VERSION_MIN-$(os ) )
132141IS_SIMULATOR-$(target) =False
133142 else
134- TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(OS_LOWER -$(target ) )$$(VERSION_MIN-$(os ) ) -simulator
143+ TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS -$(os ) )$$(VERSION_MIN-$(os ) ) -simulator
135144IS_SIMULATOR-$(target) =True
136145 endif
137146endif
@@ -398,15 +407,13 @@ define build-sdk
398407sdk=$1
399408os=$2
400409
401- OS_LOWER-$(sdk ) =$(shell echo $(os ) | tr '[:upper:]' '[:lower:]')
402-
403410SDK_TARGETS-$(sdk ) =$$(filter $(sdk ) .% ,$$(TARGETS-$(os ) ) )
404411SDK_ARCHES-$(sdk ) =$$(sort $$(subst .,,$$(suffix $$(SDK_TARGETS-$(sdk ) ) ) ) )
405412
406413ifeq ($$(findstring simulator,$(sdk ) ) ,)
407- SDK_SLICE-$(sdk) =$$(OS_LOWER -$(sdk ) ) -$$(shell echo $$(SDK_ARCHES-$(sdk ) ) | sed "s/ /_/g")
414+ SDK_SLICE-$(sdk) =$$(TRIPLE_OS -$(os ) ) -$$(shell echo $$(SDK_ARCHES-$(sdk ) ) | sed "s/ /_/g")
408415else
409- SDK_SLICE-$(sdk) =$$(OS_LOWER -$(sdk ) ) -$$(shell echo $$(SDK_ARCHES-$(sdk ) ) | sed "s/ /_/g") -simulator
416+ SDK_SLICE-$(sdk) =$$(TRIPLE_OS -$(os ) ) -$$(shell echo $$(SDK_ARCHES-$(sdk ) ) | sed "s/ /_/g") -simulator
410417endif
411418
412419# Expand the build-target macro for target on this OS
@@ -481,11 +488,15 @@ $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h: $$(PYTHON_LIB-$(sdk))
481488 mkdir -p $$(PYTHON_INSTALL-$(sdk))/include
482489 ln -si ../Python.framework/Headers $$(PYTHON_INSTALL-$(sdk))/include/python$(PYTHON_VER)
483490
491+ ifeq ($(os ) , visionOS)
492+ echo "Skipping arch-specific header copying for visionOS"
493+ else
484494 # Add the individual headers from each target in an arch-specific name
485495 $$(foreach target,$$(SDK_TARGETS-$(sdk)),cp $$(PYTHON_INCLUDE-$$(target))/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig-$$(ARCH-$$(target)).h; )
486496
487497 # Copy the cross-target header from the source folder of the first target in the $(sdk) SDK
488498 cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
499+ endif
489500
490501
491502$$(PYTHON_STDLIB-$(sdk ) ) /LICENSE.TXT : $$(PYTHON_LIB-$(sdk ) ) $$(PYTHON_FRAMEWORK-$(sdk ) ) /Info.plist $$(PYTHON_INCLUDE-$(sdk ) ) /pyconfig.h $$(foreach target,$$(SDK_TARGETS-$(sdk ) ) ,$$(PYTHON_PLATFORM_SITECUSTOMIZE-$$(target ) ) )
@@ -650,7 +661,7 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
650661 $$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/lib $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
651662 $$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/platform-config $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
652663
653- ifeq ($(os ) ,iOS)
664+ ifeq ($(filter $( os ) ,iOS visionOS) , $( os ) )
654665 @echo ">>> Clone testbed project for $(os)"
655666 $(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/iOS/testbed clone --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
656667endif
0 commit comments