summaryrefslogtreecommitdiff
path: root/lang/python/python3/Makefile
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2023-06-29 16:33:25 +0800
committerJeffery To <jeffery.to@gmail.com>2023-08-25 02:24:38 +0800
commit0fe10114208e2c5cd572df043945a52e3ebeb6dd (patch)
treea1f13e6a6112236ebdc93fa04f4142d40e32fcd4 /lang/python/python3/Makefile
parent5a0055df0621d4347723993b04a2fcf045929acf (diff)
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>
Diffstat (limited to 'lang/python/python3/Makefile')
-rw-r--r--lang/python/python3/Makefile31
1 files changed, 19 insertions, 12 deletions
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
index f35556769..0b4eb3159 100644
--- a/lang/python/python3/Makefile
+++ b/lang/python/python3/Makefile
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
include ../python3-version.mk
PKG_NAME:=python3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
@@ -112,7 +112,7 @@ endef
PYTHON3_LIB_FILES_DEL:=
PYTHON3_PACKAGES:=
-PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
+PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR)-*.so
PYTHON3_PACKAGES_DEPENDS:=
define Py3BasePackage
PYTHON3_PACKAGES+=$(1)
@@ -148,7 +148,7 @@ installation.
endef
# Set READELF here so that the exact same readelf program name can be
-# replaced in _sysconfigdata.py (in Build/Install)
+# replaced in _sysconfigdata_*.py (in Build/Install)
TARGET_CONFIGURE_OPTS+= \
READELF="$(TARGET_CROSS)readelf"
@@ -200,27 +200,34 @@ define Build/Install
$(call Build/Install/Default,)
$(SED) 's|$(TARGET_AR)|ar|g;s|$(TARGET_CROSS)readelf|readelf|g;s|$(TARGET_CC)|gcc|g;s|$(TARGET_CXX)|g++|g' \
- $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata.py \
- $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/Makefile
+ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata_*.py \
+ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)-*/Makefile
endef
define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
- $(INSTALL_DIR) $(2)/bin
+ $(INSTALL_DIR) $(1)/usr/include
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON3_VERSION) \
$(1)/usr/include/
+
+ $(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION) \
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* \
$(1)/usr/lib/
- grep \
- '^_PYTHON_HOST_PLATFORM=' \
- $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/Makefile > \
- $(1)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/Makefile-vars
+
+ $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/openwrt
+ grep -E \
+ '^(_PYTHON_HOST_PLATFORM|ABIFLAGS|MACHDEP|MULTIARCH)=' \
+ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)-*/Makefile > \
+ $(1)/usr/lib/python$(PYTHON3_VERSION)/openwrt/Makefile-vars
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/python*.pc \
$(1)/usr/lib/pkgconfig
+
+ $(INSTALL_DIR) $(2)/bin
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config \
$(2)/bin/
@@ -233,7 +240,7 @@ PYTHON3_BASE_LIB_FILES:= \
/usr/lib/python$(PYTHON3_VERSION)/encodings \
/usr/lib/python$(PYTHON3_VERSION)/_collections_abc.py \
/usr/lib/python$(PYTHON3_VERSION)/_sitebuiltins.py \
- /usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata.py \
+ /usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata_*.py \
/usr/lib/python$(PYTHON3_VERSION)/_weakrefset.py \
/usr/lib/python$(PYTHON3_VERSION)/abc.py \
/usr/lib/python$(PYTHON3_VERSION)/codecs.py \