@@ -19,7 +19,7 @@ BUILD_NUMBER=custom
1919# of a release cycle, as official binaries won't be published.
2020# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
2121# PYTHON_VER is the major/minor version (e.g., 3.10)
22- PYTHON_VERSION =3.14.0rc1
22+ PYTHON_VERSION =3.14.0rc3
2323PYTHON_PKG_VERSION =$(PYTHON_VERSION )
2424PYTHON_MICRO_VERSION =$(shell echo $(PYTHON_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
2525PYTHON_PKG_MICRO_VERSION =$(shell echo $(PYTHON_PKG_VERSION ) | grep -Eo "\d+\.\d+\.\d+")
@@ -32,6 +32,7 @@ LIBFFI_VERSION=3.4.7-2
3232MPDECIMAL_VERSION =4.0.0-2
3333OPENSSL_VERSION =3.0.16-2
3434XZ_VERSION =5.6.4-2
35+ ZSTD_VERSION =1.5.7-1
3536
3637# Supported OS
3738OS_LIST =macOS iOS tvOS watchOS visionOS
@@ -95,7 +96,7 @@ update-patch:
9596 # call
9697 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
9798 cd $(PYTHON_REPO_DIR ) && \
98- git diff -D v$(PYTHON_VERSION ) $(PYTHON_VER ) -patched \
99+ git diff --no-renames - D v$(PYTHON_VERSION ) $(PYTHON_VER ) -patched \
99100 | PATH=" /usr/local/bin:/opt/homebrew/bin:$( PATH) " filterdiff \
100101 -X $(PROJECT_DIR ) /patch/Python/diff.exclude -p 1 --clean \
101102 > $(PROJECT_DIR ) /patch/Python/Python.patch
@@ -187,6 +188,26 @@ $$(XZ_LIB-$(target)): downloads/xz-$(XZ_VERSION)-$(target).tar.gz
187188 # Ensure the target is marked as clean.
188189 touch $$(XZ_LIB-$(target ) )
189190
191+ # ##########################################################################
192+ # Target: zstd (ZStandard)
193+ # ##########################################################################
194+
195+ ZSTD_INSTALL-$(target ) =$(PROJECT_DIR ) /install/$(os ) /$(target ) /zstd-$(ZSTD_VERSION )
196+ ZSTD_LIB-$(target ) =$$(ZSTD_INSTALL-$(target ) ) /lib/libzstd.a
197+
198+ downloads/zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz:
199+ @echo ">>> Download zstd for $(target ) "
200+ mkdir -p downloads
201+ curl $(CURL_FLAGS ) -o $$@ \
202+ https://github.com/beeware/cpython-apple-source-deps/releases/download/zstd-$(ZSTD_VERSION ) /zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz
203+
204+ $$(ZSTD_LIB-$(target ) ) : downloads/zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz
205+ @echo ">>> Install zstd for $(target ) "
206+ mkdir -p $$(ZSTD_INSTALL-$(target ) )
207+ cd $$(ZSTD_INSTALL-$(target ) ) && tar zxvf $(PROJECT_DIR ) /downloads/zstd-$(ZSTD_VERSION ) -$(target ) .tar.gz --exclude="*.dylib"
208+ # Ensure the target is marked as clean.
209+ touch $$(ZSTD_LIB-$(target ) )
210+
190211# ##########################################################################
191212# Target: mpdecimal
192213# ##########################################################################
@@ -280,22 +301,23 @@ $$(PYTHON_SRCDIR-$(target))/configure: \
280301 $$(LIBFFI_LIB-$(target ) ) \
281302 $$(MPDECIMAL_LIB-$(target ) ) \
282303 $$(OPENSSL_SSL_LIB-$(target ) ) \
283- $$(XZ_LIB-$(target ) )
304+ $$(XZ_LIB-$(target ) ) \
305+ $$(ZSTD_LIB-$(target ) )
284306 @echo " >>> Unpack and configure Python for $( target) "
285307 mkdir -p $$(PYTHON_SRCDIR-$(target ) )
286308 tar zxf downloads/Python-$(PYTHON_VERSION ) .tar.gz --strip-components 1 -C $$(PYTHON_SRCDIR-$(target ) )
287309 # Apply target Python patches
288310 cd $$(PYTHON_SRCDIR-$(target ) ) && patch -p1 < $(PROJECT_DIR ) /patch/Python/Python.patch
289311 # Make sure the binary scripts are executable
290- chmod 755 $$(PYTHON_SRCDIR-$(target ) ) /$(os ) /Resources/bin/*
312+ chmod 755 $$(PYTHON_SRCDIR-$(target ) ) /Apple/ $(os ) /Resources/bin/*
291313 # Touch the configure script to ensure that Make identifies it as up to date.
292314 touch $$(PYTHON_SRCDIR-$(target ) ) /configure
293315
294316$$(PYTHON_SRCDIR-$(target ) ) /Makefile : \
295317 $$(PYTHON_SRCDIR-$(target ) ) /configure
296318 # Configure target Python
297319 cd $$(PYTHON_SRCDIR-$(target ) ) && \
298- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
320+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
299321 ./configure \
300322 LIBLZMA_CFLAGS=" -I$$ (XZ_INSTALL-$( target) )/include" \
301323 LIBLZMA_LIBS=" -L$$ (XZ_INSTALL-$( target) )/lib -llzma" \
@@ -305,6 +327,8 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
305327 LIBMPDEC_LIBS=" -L$$ (MPDECIMAL_INSTALL-$( target) )/lib -lmpdec" \
306328 LIBFFI_CFLAGS=" -I$$ (LIBFFI_INSTALL-$( target) )/include" \
307329 LIBFFI_LIBS=" -L$$ (LIBFFI_INSTALL-$( target) )/lib -lffi" \
330+ LIBZSTD_CFLAGS ="-I$$(ZSTD_INSTALL-$(target ) ) /include" \
331+ LIBZSTD_LIBS="-L$$(ZSTD_INSTALL-$(target ) ) /lib -lzstd" \
308332 --host=$$(TARGET_TRIPLE-$(target ) ) \
309333 --build=$(HOST_ARCH ) -apple-darwin \
310334 --with-build-python=$(HOST_PYTHON ) \
@@ -317,14 +341,14 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
317341$$(PYTHON_SRCDIR-$(target ) ) /python.exe : $$(PYTHON_SRCDIR-$(target ) ) /Makefile
318342 @echo " >>> Build Python for $( target) "
319343 cd $$(PYTHON_SRCDIR-$(target ) ) && \
320- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
344+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
321345 make -j8 all \
322346 2>&1 | tee -a ../python-$(PYTHON_VERSION ) .build.log
323347
324348$$(PYTHON_LIB-$(target ) ) : $$(PYTHON_SRCDIR-$(target ) ) /python.exe
325349 @echo " >>> Install Python for $( target) "
326350 cd $$(PYTHON_SRCDIR-$(target ) ) && \
327- PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/$( os) /Resources/bin:$( PATH) " \
351+ PATH=" $( PROJECT_DIR) /$$ (PYTHON_SRCDIR-$( target) )/Apple/ $( os) /Resources/bin:$( PATH) " \
328352 make install \
329353 2>&1 | tee -a ../python-$(PYTHON_VERSION ) .install.log
330354
@@ -490,15 +514,11 @@ $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h: $$(PYTHON_LIB-$(sdk))
490514 mkdir -p $$(PYTHON_INSTALL-$(sdk))/include
491515 ln -si ../Python.framework/Headers $$(PYTHON_INSTALL-$(sdk))/include/python$(PYTHON_VER)
492516
493- ifeq ($(os ) , visionOS)
494- echo "Skipping arch-specific header copying for visionOS"
495- else
496517 # Add the individual headers from each target in an arch-specific name
497518 $$(foreach target,$$(SDK_TARGETS-$(sdk)),cp $$(PYTHON_INCLUDE-$$(target))/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig-$$(ARCH-$$(target)).h; )
498519
499520 # 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
521+ cp $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$(sdk))))/Apple/$(os)/Resources/pyconfig.h $$(PYTHON_INCLUDE-$(sdk))/pyconfig.h
502522
503523
504524$$(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 ) ) )
@@ -674,9 +694,9 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
674694 # Disable dSYM production (for now)
675695 # $$(foreach sdk,$$(SDKS-$(os)),cp -r $$(PYTHON_INSTALL-$$(sdk))/Python.dSYM $$(PYTHON_XCFRAMEWORK-$(os))/$$(SDK_SLICE-$$(sdk)); )
676696
677- ifeq ($(filter $(os ) ,iOS visionOS) ,$(os ) )
697+ ifeq ($(filter $(os ) ,iOS tvOS visionOS) ,$(os ) )
678698 @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
699+ $(HOST_PYTHON) $$(PYTHON_SRCDIR-$$(firstword $$(SDK_TARGETS-$$(firstword $$(SDKS-$(os))))))/Apple /testbed clone --platform $(os) --framework $$(PYTHON_XCFRAMEWORK-$(os)) support/$(PYTHON_VER)/$(os)/testbed
680700endif
681701
682702 @echo ">>> Create VERSIONS file for $(os)"
@@ -689,6 +709,7 @@ endif
689709 echo "mpdecimal: $(MPDECIMAL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
690710 echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
691711 echo "XZ: $(XZ_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
712+ echo "Zstandard: $(ZSTD_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
692713
693714dist/Python-$(PYTHON_VER ) -$(os ) -support.$(BUILD_NUMBER ) .tar.gz : \
694715 $$(PYTHON_XCFRAMEWORK-$(os ) ) /Info.plist \
@@ -757,6 +778,7 @@ config:
757778 @echo " MPDECIMAL_VERSION=$( MPDECIMAL_VERSION) "
758779 @echo " OPENSSL_VERSION=$( OPENSSL_VERSION) "
759780 @echo " XZ_VERSION=$( XZ_VERSION) "
781+ @echo " ZSTD_VERSION=$( ZSTD_VERSION) "
760782
761783# Expand cross-platform build and clean targets for each output product
762784clean : $(foreach os,$(OS_LIST ) ,clean-$(os ) )
0 commit comments