diff --git a/cross/cryptography/Makefile b/cross/cryptography/Makefile index f87252594f6..1ce92258010 100644 --- a/cross/cryptography/Makefile +++ b/cross/cryptography/Makefile @@ -2,7 +2,7 @@ PKG_NAME = cryptography PKG_VERS = 41.0.3 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) -PKG_DIST_SITE = https://files.pythonhosted.org/packages/source/c/$(PKG_NAME) +PKG_DIST_SITE = https://files.pythonhosted.org/packages/source/c/cryptography PKG_DIR = $(PKG_NAME)-$(PKG_VERS) DEPENDS = cross/openssl3 cross/cffi @@ -11,11 +11,4 @@ HOMEPAGE = https://github.com/pyca/cryptography COMMENT = Provide cryptographic recipes and primitives to Python developers LICENSE = BSD/ASL2 -### -### This cross/cryptography is needed to generate python-limited abi3 wheels -### Ref: https://github.com/pyca/cryptography/issues/7671 -### - -WHEELS_BUILD_ARGS = --py-limited-api=$(PYTHON_LIMITED_API) - include ../../mk/spksrc.python-wheel.mk diff --git a/mk/crossenv/requirements-default.txt b/mk/crossenv/requirements-default.txt index ad6f40ef11f..0946ba23703 100644 --- a/mk/crossenv/requirements-default.txt +++ b/mk/crossenv/requirements-default.txt @@ -1,6 +1,7 @@ pip==24.3.1 pip-tools==7.4.1 setuptools==75.4.0 +build==1.2.2 wheel==0.45.0 # cffi==1.17.1 diff --git a/mk/spksrc.python-module.mk b/mk/spksrc.python-module.mk index c260efab255..b609e3628d2 100644 --- a/mk/spksrc.python-module.mk +++ b/mk/spksrc.python-module.mk @@ -1,5 +1,5 @@ ### Python module rules -# Invoke make to (cross-) compile a python module. +# Invoke make to (cross-) compile a python extension module. # You can do some customization through python-cc.mk # Python module targets @@ -24,11 +24,11 @@ build_crossenv_module: @$(MSG) WHEEL="$(PKG_NAME)-$(PKG_VERS)" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) @WHEEL="$(PKG_NAME)-$(PKG_VERS)" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) -### Python module rules +### Python extension module rules compile_python_module: build_crossenv_module $(foreach e,$(shell cat $(CROSSENV_MODULE_PATH)/build/python-cc.mk),$(eval $(e))) $(eval PYTHONPATH = $(PYTHON_SITE_PACKAGES_NATIVE):$(PYTHON_LIB_NATIVE):$(INSTALL_DIR)$(INSTALL_PREFIX)/$(PYTHON_LIB_DIR)/site-packages/) - @$(MSG) "activate crossenv found: $(CROSSENV)" + @$(MSG) "PYTHON MODULE: activate crossenv found: $(CROSSENV)" @. $(CROSSENV) ; \ $(RUN) PYTHONPATH=$(PYTHONPATH) python setup.py build_ext \ -I $(STAGING_INSTALL_PREFIX)/include \ diff --git a/mk/spksrc.python-wheel.mk b/mk/spksrc.python-wheel.mk index d01f77ca462..f3bbc0c7422 100644 --- a/mk/spksrc.python-wheel.mk +++ b/mk/spksrc.python-wheel.mk @@ -39,11 +39,17 @@ include ../../mk/spksrc.wheel-env.mk ### Python wheel rules build_python_wheel_target: - @$(MSG) "activate crossenv found: $(CROSSENV)" - @. $(CROSSENV) ; \ - $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) python3 setup.py $(BUILD_ARGS) bdist_wheel $(WHEELS_BUILD_ARGS) -d $(WHEELHOUSE) + @$(MSG) "PYTHON WHEEL: activate crossenv found: $(CROSSENV)" + @$(MSG) "CROSSENV_PATH = $(CROSSENV_PATH)" + @. $(CROSSENV_PATH)/bin/activate ; \ + $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) python3 -m build $(BUILD_ARGS) --wheel $(WHEELS_BUILD_ARGS) --outdir $(WHEELHOUSE) @$(RUN) echo "$(PKG_NAME)==$(PKG_VERS)" >> $(WHEELHOUSE)/$(WHEELS_CROSS_COMPILE) post_install_python_wheel_target: $(WHEEL_TARGET) install_python_wheel all: install + +### + +# Use crossenv +include ../../mk/spksrc.crossenv.mk diff --git a/mk/spksrc.wheel.mk b/mk/spksrc.wheel.mk index c65396da761..662b9b9d047 100644 --- a/mk/spksrc.wheel.mk +++ b/mk/spksrc.wheel.mk @@ -156,7 +156,7 @@ ifneq ($(strip $(WHEELS)),) [ -d $${crossenv} ] && . $${crossenv}/build/python-cc.mk && break ; \ done ; \ crossenvPIP=$(PIP) ; \ - $(MSG) "activate crossenv found: $${CROSSENV}" ; \ + $(MSG) "WHEEL: activate crossenv found: $${CROSSENV}" ; \ if [ -s "$${CROSSENV}" ] ; then \ crossenvPIP=$$(. $${CROSSENV} && which pip) ; \ $(MSG) "Python crossenv found: [$${CROSSENV}]" ; \