@@ -19,7 +19,7 @@ BUILD_NUMBER=custom
19
19
# of a release cycle, as official binaries won't be published.
20
20
# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
21
21
# PYTHON_VER is the major/minor version (e.g., 3.10)
22
- PYTHON_VERSION =3.14.0rc1
22
+ PYTHON_VERSION =3.14.0rc3
23
23
PYTHON_PKG_VERSION =$(PYTHON_VERSION )
24
24
PYTHON_MICRO_VERSION =$(shell echo $(PYTHON_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
25
25
PYTHON_PKG_MICRO_VERSION =$(shell echo $(PYTHON_PKG_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
@@ -32,6 +32,7 @@ LIBFFI_VERSION=3.4.7-2
32
32
MPDECIMAL_VERSION =4.0.0-2
33
33
OPENSSL_VERSION =3.0.16-2
34
34
XZ_VERSION =5.6.4-2
35
+ ZSTD_VERSION =1.5.7-1
35
36
36
37
# Supported OS
37
38
OS_LIST =macOS iOS tvOS watchOS visionOS
@@ -41,25 +42,30 @@ CURL_FLAGS=--disable --fail --location --create-dirs --progress-bar
41
42
# macOS targets
42
43
TARGETS-macOS =macosx.x86_64 macosx.arm64
43
44
TRIPLE_OS-macOS =macos
45
+ PLATFORM_NAME-macOS =macOS
44
46
VERSION_MIN-macOS =11.0
45
47
46
48
# iOS targets
47
49
TARGETS-iOS =iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
48
50
TRIPLE_OS-iOS =ios
51
+ PLATFORM_NAME-iOS =iOS
49
52
VERSION_MIN-iOS =13.0
50
53
51
54
# tvOS targets
52
55
TARGETS-tvOS =appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
53
56
TRIPLE_OS-tvOS =tvos
57
+ PLATFORM_NAME-tvOS =tvOS
54
58
VERSION_MIN-tvOS =12.0
55
59
56
60
# watchOS targets
57
61
TARGETS-watchOS =watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
58
62
TRIPLE_OS-watchOS =watchos
63
+ PLATFORM_NAME-watchOS =watchOS
59
64
VERSION_MIN-watchOS =4.0
60
65
61
66
TARGETS-visionOS =xrsimulator.arm64 xros.arm64
62
67
TRIPLE_OS-visionOS =xros
68
+ PLATFORM_NAME-visionOS =xrOS
63
69
VERSION_MIN-visionOS =2.0
64
70
65
71
# The architecture of the machine doing the build
@@ -95,7 +101,7 @@ update-patch:
95
101
# call
96
102
if [ -z " $( PYTHON_REPO_DIR) " ]; then echo " \n\nPYTHON_REPO_DIR must be set to the root of your Python github checkout\n\n" ; fi
97
103
cd $(PYTHON_REPO_DIR ) && \
98
- git diff -D v$(PYTHON_VERSION ) $(PYTHON_VER ) -patched \
104
+ git diff --no-renames - D v$(PYTHON_VERSION ) $(PYTHON_VER ) -patched \
99
105
| PATH=" /usr/local/bin:/opt/homebrew/bin:$( PATH) " filterdiff \
100
106
-X $(PROJECT_DIR ) /patch/Python/diff.exclude -p 1 --clean \
101
107
> $(PROJECT_DIR ) /patch/Python/Python.patch
@@ -187,6 +193,26 @@ $$(XZ_LIB-$(target)): downloads/xz-$(XZ_VERSION)-$(target).tar.gz
187
193
# Ensure the target is marked as clean.
188
194
touch $$(XZ_LIB-$(target ) )
189
195
196
+ # ##########################################################################
197
+ # Target: zstd (ZStandard)
198
+ # ##########################################################################
199
+
200
+ ZSTD_INSTALL-$(target ) =$(PROJECT_DIR ) /install/$(os ) /$(target ) /zstd-$(ZSTD_VERSION )
201
+ ZSTD_LIB-$(target ) =$$(ZSTD_INSTALL-$(target ) ) /lib/libzstd.a
202
+
203
+ downloads/zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz:
204
+ @echo ">>> Download zstd for $(target ) "
205
+ mkdir -p downloads
206
+ curl $(CURL_FLAGS ) -o $$@ \
207
+ https://github.com/beeware/cpython-apple-source-deps/releases/download/zstd-$(ZSTD_VERSION ) /zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz
208
+
209
+ $$(ZSTD_LIB-$(target ) ) : downloads/zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz
210
+ @echo ">>> Install zstd for $(target ) "
211
+ mkdir -p $$(ZSTD_INSTALL-$(target ) )
212
+ cd $$(ZSTD_INSTALL-$(target ) ) && tar zxvf $(PROJECT_DIR ) /downloads/zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz --exclude="*.dylib"
213
+ # Ensure the target is marked as clean.
214
+ touch $$(ZSTD_LIB-$(target ) )
215
+
190
216
# ##########################################################################
191
217
# Target: mpdecimal
192
218
# ##########################################################################
@@ -280,22 +306,23 @@ $$(PYTHON_SRCDIR-$(target))/configure: \
280
306
$$(LIBFFI_LIB-$(target ) ) \
281
307
$$(MPDECIMAL_LIB-$(target ) ) \
282
308
$$(OPENSSL_SSL_LIB-$(target ) ) \
283
- $$(XZ_LIB-$(target ) )
309
+ $$(XZ_LIB-$(target ) ) \
310
+ $$(ZSTD_LIB-$(target ) )
284
311
@echo " >>> Unpack and configure Python for $( target) "
285
312
mkdir -p $$(PYTHON_SRCDIR-$(target ) )
286
313
tar zxf downloads/Python-$(PYTHON_VERSION ) .tar.gz --strip-components 1 -C $$(PYTHON_SRCDIR-$(target ) )
287
314
# Apply target Python patches
288
315
cd $$(PYTHON_SRCDIR-$(target ) ) && patch -p1 < $(PROJECT_DIR ) /patch/Python/Python.patch
289
316
# Make sure the binary scripts are executable
290
- chmod 755 $$(PYTHON_SRCDIR-$(target ) ) /$(os ) /Resources/bin/*
317
+ chmod 755 $$(PYTHON_SRCDIR-$(target ) ) /Apple/ $(os ) /Resources/bin/*
291
318
# Touch the configure script to ensure that Make identifies it as up to date.
292
319
touch $$(PYTHON_SRCDIR-$(target ) ) /configure
293
320
294
321
$$(PYTHON_SRCDIR-$(target ) ) /Makefile : \
295
322
$$(PYTHON_SRCDIR-$(target ) ) /configure
296
323
# Configure target Python
297
324
cd $$(PYTHON_SRCDIR-$(target ) ) && \
298
- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
325
+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
299
326
./configure \
300
327
LIBLZMA_CFLAGS=" -I$$ (XZ_INSTALL-$( target) )/include" \
301
328
LIBLZMA_LIBS=" -L$$ (XZ_INSTALL-$( target) )/lib -llzma" \
@@ -305,6 +332,8 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
305
332
LIBMPDEC_LIBS=" -L$$ (MPDECIMAL_INSTALL-$( target) )/lib -lmpdec" \
306
333
LIBFFI_CFLAGS=" -I$$ (LIBFFI_INSTALL-$( target) )/include" \
307
334
LIBFFI_LIBS=" -L$$ (LIBFFI_INSTALL-$( target) )/lib -lffi" \
335
+ LIBZSTD_CFLAGS ="-I$$(ZSTD_INSTALL-$(target ) ) /include" \
336
+ LIBZSTD_LIBS="-L$$(ZSTD_INSTALL-$(target ) ) /lib -lzstd" \
308
337
--host=$$(TARGET_TRIPLE-$(target ) ) \
309
338
--build=$(HOST_ARCH ) -apple-darwin \
310
339
--with-build-python=$(HOST_PYTHON ) \
@@ -317,14 +346,14 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
317
346
$$(PYTHON_SRCDIR-$(target ) ) /python.exe : $$(PYTHON_SRCDIR-$(target ) ) /Makefile
318
347
@echo " >>> Build Python for $( target) "
319
348
cd $$(PYTHON_SRCDIR-$(target ) ) && \
320
- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
349
+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
321
350
make -j8 all \
322
351
2>&1 | tee -a ../python-$(PYTHON_VERSION ) .build.log
323
352
324
353
$$(PYTHON_LIB-$(target ) ) : $$(PYTHON_SRCDIR-$(target ) ) /python.exe
325
354
@echo " >>> Install Python for $( target) "
326
355
cd $$(PYTHON_SRCDIR-$(target ) ) && \
327
- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
356
+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
328
357
make install \
329
358
2>&1 | tee -a ../python-$(PYTHON_VERSION ) .install.log
330
359
@@ -490,15 +519,11 @@ $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h: $$(PYTHON_LIB-$(sdk))
490
519
mkdir -p $$(PYTHON_INSTALL-$(sdk))/include
491
520
ln -si ../Python.framework/Headers $$(PYTHON_INSTALL-$(sdk))/include/python$(PYTHON_VER)
492
521
493
- ifeq ($(os ) , visionOS)
494
- echo "Skipping arch-specific header copying for visionOS"
495
- else
496
522
# Add the individual headers from each target in an arch-specific name
497
523
$$(foreach target,$$(SDK_TARGETS-$(sdk)),cp $$(PYTHON_INCLUDE-$$(target))/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig-$$(ARCH-$$(target)).h; )
498
524
499
525
# Copy the cross-target header from the source folder of the first target in the $(sdk) SDK
500
- cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
501
- endif
526
+ cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/Apple/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
502
527
503
528
504
529
$$(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 ) ) )
@@ -666,6 +691,11 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
666
691
-output $$(PYTHON_XCFRAMEWORK-$(os ) ) $$(foreach sdk,$$(SDKS-$(os ) ) ,-framework $$(PYTHON_FRAMEWORK-$$(sdk ) ) ) \
667
692
2>&1 | tee -a support/$(PYTHON_VER ) /python-$(os ) .xcframework.log
668
693
694
+ @echo ">>> Install build tools for $(os)"
695
+ mkdir $$(PYTHON_XCFRAMEWORK-$(os))/build
696
+ cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple/testbed/Python.xcframework/build/utils.sh $$(PYTHON_XCFRAMEWORK-$(os))/build
697
+ cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple/testbed/Python.xcframework/build/$$(PLATFORM_NAME-$(os))-dylib-Info-template.plist $$(PYTHON_XCFRAMEWORK-$(os))/build
698
+
669
699
@echo ">>> Install PYTHONHOME for $(os)"
670
700
$$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/include $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
671
701
$$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/bin $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
@@ -674,9 +704,9 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
674
704
# Disable dSYM production (for now)
675
705
# $$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/Python.dSYM $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
676
706
677
- ifeq ($(filter $(os ) ,iOS visionOS) ,$(os ) )
707
+ ifeq ($(filter $(os ) ,iOS tvOS visionOS) ,$(os ) )
678
708
@echo ">>> Clone testbed project for $(os)"
679
- $(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/$(os) /testbed clone --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
709
+ $(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple /testbed clone --platform $(os) --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
680
710
endif
681
711
682
712
@echo ">>> Create VERSIONS file for $(os)"
@@ -689,6 +719,7 @@ endif
689
719
echo "mpdecimal: $(MPDECIMAL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
690
720
echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
691
721
echo "XZ: $(XZ_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
722
+ echo "Zstandard: $(ZSTD_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
692
723
693
724
dist/Python-$(PYTHON_VER ) -$(os ) -support.$(BUILD_NUMBER ) .tar.gz : \
694
725
$$(PYTHON_XCFRAMEWORK-$(os ) ) /Info.plist \
@@ -757,6 +788,7 @@ config:
757
788
@echo " MPDECIMAL_VERSION=$( MPDECIMAL_VERSION) "
758
789
@echo " OPENSSL_VERSION=$( OPENSSL_VERSION) "
759
790
@echo " XZ_VERSION=$( XZ_VERSION) "
791
+ @echo " ZSTD_VERSION=$( ZSTD_VERSION) "
760
792
761
793
# Expand cross-platform build and clean targets for each output product
762
794
clean : $(foreach os,$(OS_LIST ) ,clean-$(os ) )
0 commit comments