Skip to content

Commit

Permalink
Merge branch 'main' into 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Aug 6, 2024
2 parents d92ed41 + 600b9e0 commit 080a753
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI
on:
pull_request:
push:
branches:
- main
- 3.*

env:
FORCE_COLOR: "1"
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ jobs:
run: |
PYTHON_VERSION=$(grep "Python version:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 3)
BZIP2_VERSION=$(grep "BZip2:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
LIBFFI_VERSION=$(grep "libFFI:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
MPDECIMAL_VERSION=$(grep "mpdecimal:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
OPENSSL_VERSION=$(grep "OpenSSL:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
XZ_VERSION=$(grep "XZ:" support/${{ steps.build-vars.outputs.PYTHON_VER }}/${{ matrix.target }}/VERSIONS | cut -d " " -f 2)
echo "PYTHON_VERSION=${PYTHON_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "BZIP2_VERSION=${BZIP2_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "LIBFFI_VERSION=${LIBFFI_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "MPDECIMAL_VERSION=${MPDECIMAL_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "OPENSSL_VERSION=${OPENSSL_VERSION}" | tee -a ${GITHUB_OUTPUT}
echo "XZ_VERSION=${XZ_VERSION}" | tee -a ${GITHUB_OUTPUT}
- name: Upload Build Artifact
uses: actions/[email protected]
Expand Down Expand Up @@ -95,8 +97,9 @@ jobs:
Includes:
* Python ${{ needs.build.outputs.PYTHON_VERSION }}
* OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }}
* BZip2 ${{ needs.build.outputs.BZIP2_VERSION }}
* libFFI ${{ needs.build.outputs.LIBFFI_VERSION }}
* mpdecimal ${{ needs.build.outputs.MPDECIMAL_VERSION }}
* OpenSSL ${{ needs.build.outputs.OPENSSL_VERSION }}
* XZ ${{ needs.build.outputs.XZ_VERSION }}
* LibFFI ${{ needs.build.outputs.LIBFFI_VERSION }}
artifacts: "dist/*"
37 changes: 21 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ BUILD_NUMBER=custom

# Version of packages that will be compiled by this meta-package
# PYTHON_VERSION is the full version number (e.g., 3.10.0b3)
# PYTHON_PKG_VERSION is the version number with binary package releases to use
# for macOS binaries. This will be less than PYTHON_VERSION towards the end
# of a release cycle, as official binaries won't be published.
# PYTHON_MICRO_VERSION is the full version number, without any alpha/beta/rc suffix. (e.g., 3.10.0)
# PYTHON_VER is the major/minor version (e.g., 3.10)
PYTHON_VERSION=3.12.4
PYTHON_PKG_VERSION=$(PYTHON_VERSION)
PYTHON_MICRO_VERSION=$(shell echo $(PYTHON_VERSION) | grep -Eo "\d+\.\d+\.\d+")
PYTHON_PKG_MICRO_VERSION=$(shell echo $(PYTHON_PKG_VERSION) | grep -Eo "\d+\.\d+\.\d+")
PYTHON_VER=$(basename $(PYTHON_VERSION))

# The binary releases of dependencies, published at:
# https://github.com/beeware/cpython-apple-source-deps/releases
BZIP2_VERSION=1.0.8-1
LIBFFI_VERSION=3.4.6-1
MPDECIMAL_VERSION=4.0.0-1
OPENSSL_VERSION=3.0.14-1
XZ_VERSION=5.4.7-1
LIBFFI_VERSION=3.4.6-1

# Supported OS
OS_LIST=macOS iOS tvOS watchOS
Expand Down Expand Up @@ -96,11 +101,11 @@ downloads/Python-$(PYTHON_VERSION).tar.gz:
curl $(CURL_FLAGS) -o $@ \
https://www.python.org/ftp/python/$(PYTHON_MICRO_VERSION)/Python-$(PYTHON_VERSION).tgz

downloads/python-$(PYTHON_VERSION)-macos11.pkg:
downloads/python-$(PYTHON_PKG_VERSION)-macos11.pkg:
@echo ">>> Download macOS Python package"
mkdir -p downloads
curl $(CURL_FLAGS) -o $@ \
https://www.python.org/ftp/python/$(PYTHON_MICRO_VERSION)/python-$(PYTHON_VERSION)-macos11.pkg
https://www.python.org/ftp/python/$(PYTHON_PKG_MICRO_VERSION)/python-$(PYTHON_PKG_VERSION)-macos11.pkg

###########################################################################
# Build for specified target (from $(TARGETS-*))
Expand Down Expand Up @@ -258,10 +263,10 @@ PYTHON_STDLIB-$(target)=$$(PYTHON_INSTALL-$(target))/lib/python$(PYTHON_VER)
$$(PYTHON_SRCDIR-$(target))/configure: \
downloads/Python-$(PYTHON_VERSION).tar.gz \
$$(BZIP2_LIB-$(target)) \
$$(XZ_LIB-$(target)) \
$$(OPENSSL_SSL_LIB-$(target)) \
$$(LIBFFI_LIB-$(target)) \
$$(MPDECIMAL_LIB-$(target)) \
$$(LIBFFI_LIB-$(target))
$$(OPENSSL_SSL_LIB-$(target)) \
$$(XZ_LIB-$(target))
@echo ">>> Unpack and configure Python for $(target)"
mkdir -p $$(PYTHON_SRCDIR-$(target))
tar zxf downloads/Python-$(PYTHON_VERSION).tar.gz --strip-components 1 -C $$(PYTHON_SRCDIR-$(target))
Expand Down Expand Up @@ -335,14 +340,14 @@ vars-$(target):
@echo "SDK_ROOT-$(target): $$(SDK_ROOT-$(target))"
@echo "BZIP2_INSTALL-$(target): $$(BZIP2_INSTALL-$(target))"
@echo "BZIP2_LIB-$(target): $$(BZIP2_LIB-$(target))"
@echo "XZ_INSTALL-$(target): $$(XZ_INSTALL-$(target))"
@echo "XZ_LIB-$(target): $$(XZ_LIB-$(target))"
@echo "OPENSSL_INSTALL-$(target): $$(OPENSSL_INSTALL-$(target))"
@echo "OPENSSL_SSL_LIB-$(target): $$(OPENSSL_SSL_LIB-$(target))"
@echo "MPDECIMAL_INSTALL-$(target): $$(MPDECIMAL_INSTALL-$(target))"
@echo "MPDECIMAL_LIB-$(target): $$(MPDECIMAL_LIB-$(target))"
@echo "LIBFFI_INSTALL-$(target): $$(LIBFFI_INSTALL-$(target))"
@echo "LIBFFI_LIB-$(target): $$(LIBFFI_LIB-$(target))"
@echo "MPDECIMAL_INSTALL-$(target): $$(MPDECIMAL_INSTALL-$(target))"
@echo "MPDECIMAL_LIB-$(target): $$(MPDECIMAL_LIB-$(target))"
@echo "OPENSSL_INSTALL-$(target): $$(OPENSSL_INSTALL-$(target))"
@echo "OPENSSL_SSL_LIB-$(target): $$(OPENSSL_SSL_LIB-$(target))"
@echo "XZ_INSTALL-$(target): $$(XZ_INSTALL-$(target))"
@echo "XZ_LIB-$(target): $$(XZ_LIB-$(target))"
@echo "PYTHON_SRCDIR-$(target): $$(PYTHON_SRCDIR-$(target))"
@echo "PYTHON_INSTALL-$(target): $$(PYTHON_INSTALL-$(target))"
@echo "PYTHON_FRAMEWORK-$(target): $$(PYTHON_FRAMEWORK-$(target))"
Expand Down Expand Up @@ -521,15 +526,15 @@ ifeq ($(os),macOS)
PYTHON_FRAMEWORK-$(os)=$$(PYTHON_INSTALL-$(sdk))/Python.framework

$$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
downloads/python-$(PYTHON_VERSION)-macos11.pkg
downloads/python-$(PYTHON_PKG_VERSION)-macos11.pkg
@echo ">>> Repackage macOS package as XCFramework"

# Unpack .pkg file. It turns out .pkg files are readable by tar... although
# their internal format is a bit of a mess. From tar's perspective, the .pkg
# is a tarball that contains additional tarballs; the inner tarball has the
# "payload" that is the framework.
mkdir -p build/macOS/macosx/python-$(PYTHON_VERSION)
tar zxf downloads/python-$(PYTHON_VERSION)-macos11.pkg -C build/macOS/macosx/python-$(PYTHON_VERSION)
tar zxf downloads/python-$(PYTHON_PKG_VERSION)-macos11.pkg -C build/macOS/macosx/python-$(PYTHON_VERSION)

# Unpack payload inside .pkg file
mkdir -p $$(PYTHON_FRAMEWORK-macosx)
Expand Down Expand Up @@ -594,10 +599,10 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
echo "Build: $(BUILD_NUMBER)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "Min $(os) version: $$(VERSION_MIN-$(os))" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "---------------------" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "libFFI: $(LIBFFI_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "BZip2: $(BZIP2_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "libFFI: $(LIBFFI_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "mpdecimal: $(MPDECIMAL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "OpenSSL: $(OPENSSL_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS
echo "XZ: $(XZ_VERSION)" >> support/$(PYTHON_VER)/$(os)/VERSIONS

dist/Python-$(PYTHON_VER)-$(os)-support.$(BUILD_NUMBER).tar.gz: \
Expand Down

0 comments on commit 080a753

Please sign in to comment.