python3: Restore platform triplet to paths

This removes 014-remove-platform-so-suffix.patch and
016-adjust-config-paths.patch, restoring the platform triplet to paths
for:

* C extensions (*.cpython-311-*.so)

* Build config data directory (/usr/lib/python3.11/config-3.11-*/)

* sysconfig data file (/usr/lib/python3.11/_sysconfigdata_*.py)

Setting `_PYTHON_SYSCONFIGDATA_NAME` during package builds ensures that
sysconfig data for target Python is loaded, in particular so that C
extensions built will have the correct extension / platform triplet.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To
2023-06-29 16:33:25 +08:00
parent 5a0055df06
commit 0fe1011420
5 changed files with 22 additions and 106 deletions

View File

@@ -20,7 +20,7 @@ PYTHON3:=python$(PYTHON3_VERSION)
PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
-include $(PYTHON3_LIB_DIR)/config-$(PYTHON3_VERSION)/Makefile-vars
-include $(PYTHON3_LIB_DIR)/openwrt/Makefile-vars
# These configure args are needed in detection of path to Python header files
# using autotools.
@@ -39,6 +39,7 @@ PYTHON3_VARS = \
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
_PYTHON_HOST_PLATFORM="$(_PYTHON_HOST_PLATFORM)" \
_PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH)" \
PYTHONPATH="$(PYTHON3PATH)" \
PYTHONDONTWRITEBYTECODE=1 \
_python_sysroot="$(STAGING_DIR)" \