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.
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)" \
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
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)
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"
$(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/
/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 \
endef
$(eval $(call Py3BasePackage,python3-dev, \
- /usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION) \
+ /usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)-* \
/usr/include/python$(PYTHON3_VERSION) \
/usr/lib/pkgconfig \
, \
+++ /dev/null
---- a/configure
-+++ b/configure
-@@ -23352,7 +23352,7 @@ printf %s "checking ABIFLAGS... " >&6; }
- printf "%s\n" "$ABIFLAGS" >&6; }
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
- printf %s "checking SOABI... " >&6; }
--SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
-+SOABI='cpython-'`echo $VERSION | tr -d .`
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
- printf "%s\n" "$SOABI" >&6; }
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -5683,7 +5683,7 @@ AC_SUBST(SOABI)
- AC_MSG_CHECKING(ABIFLAGS)
- AC_MSG_RESULT($ABIFLAGS)
- AC_MSG_CHECKING(SOABI)
--SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
-+SOABI='cpython-'`echo $VERSION | tr -d .`
- AC_MSG_RESULT($SOABI)
-
- # Release and debug (Py_DEBUG) ABI are compatible, but not Py_TRACE_REFS ABI
+++ /dev/null
---- a/Lib/sysconfig.py
-+++ b/Lib/sysconfig.py
-@@ -461,6 +461,7 @@ def get_makefile_filename():
-
-
- def _get_sysconfigdata_name():
-+ return '_sysconfigdata'
- multiarch = getattr(sys.implementation, '_multiarch', '')
- return os.environ.get(
- '_PYTHON_SYSCONFIGDATA_NAME',
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -2111,7 +2111,7 @@ libinstall: all $(srcdir)/Modules/xxmodu
- esac; \
- done; \
- done
-- $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
-+ $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
- $(DESTDIR)$(LIBDEST); \
- $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
-@@ -2273,7 +2273,7 @@ sharedinstall: all
- --install-scripts=$(BINDIR) \
- --install-platlib=$(DESTSHARED) \
- --root=$(DESTDIR)/
-- -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
-+ -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata*.py
- -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
-
- # Here are a couple of targets for MacOSX again, to install a full
---- a/configure
-+++ b/configure
-@@ -3630,7 +3630,7 @@ fi
- fi
- ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
- PYTHON_FOR_FREEZE="$with_build_python"
-- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
-+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata '$with_build_python
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_build_python" >&5
- printf "%s\n" "$with_build_python" >&6; }
-
-@@ -23421,7 +23421,7 @@ fi
-
-
-
--if test x$PLATFORM_TRIPLET = x; then
-+if true ; then
- LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}"
- else
- LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
---- a/configure.ac
-+++ b/configure.ac
-@@ -162,7 +162,7 @@ AC_ARG_WITH(
- dnl Build Python interpreter is used for regeneration and freezing.
- ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
- PYTHON_FOR_FREEZE="$with_build_python"
-- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
-+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata '$with_build_python
- AC_MSG_RESULT([$with_build_python])
- ], [
- AS_VAR_IF([cross_compiling], [yes],
-@@ -5741,7 +5741,7 @@ fi],
-
- dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
- AC_SUBST(PY_ENABLE_SHARED)
--if test x$PLATFORM_TRIPLET = x; then
-+if true ; then
- LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}"
- else
- LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"