mirror of
https://github.com/openwrt/packages.git
synced 2025-12-20 09:31:20 +00:00
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>
(cherry picked from commit 0fe1011420)
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
--- 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
|
||||
@@ -1,70 +0,0 @@
|
||||
--- 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}"
|
||||
Reference in New Issue
Block a user