summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-06-07 10:29:59 +0100
committerSam James <sam@gentoo.org>2022-06-17 22:03:25 +0100
commit72fc7c1bbcf983d4778811e5d68bfc8a85873a74 (patch)
tree292def8de966c1617dd1f22f7e5f02505f03013e /dev-lang
parentapp-crypt/pinentry: update EAPI 7 -> 8 (diff)
downloadgentoo-72fc7c1bbcf983d4778811e5d68bfc8a85873a74.tar.gz
gentoo-72fc7c1bbcf983d4778811e5d68bfc8a85873a74.tar.bz2
gentoo-72fc7c1bbcf983d4778811e5d68bfc8a85873a74.zip
dev-lang/python: use --with-build-python for cross builds for 3.11
Tested with sparc64-unknown-linux-gnu. Closes: https://bugs.gentoo.org/847910 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/python-3.11.0_beta3.ebuild51
1 files changed, 50 insertions, 1 deletions
diff --git a/dev-lang/python/python-3.11.0_beta3.ebuild b/dev-lang/python/python-3.11.0_beta3.ebuild
index 155e017bf32a..628ac16dde42 100644
--- a/dev-lang/python/python-3.11.0_beta3.ebuild
+++ b/dev-lang/python/python-3.11.0_beta3.ebuild
@@ -144,7 +144,8 @@ src_configure() {
fi
# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
- tc-export CXX
+ # PKG_CONFIG needed for cross.
+ tc-export CXX PKG_CONFIG
# Fix implicit declarations on cross and prefix builds. Bug #674070.
use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
@@ -203,6 +204,54 @@ src_configure() {
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
+ if tc-is-cross-compiler ; then
+ # We need to build our own Python on CBUILD first, and feed it in.
+ # bug #847910
+ local myeconfargs_cbuild=(
+ "${myeconfargs[@]}"
+
+ # As minimal as possible for the mini CBUILD Python
+ # we build just for cross, to satisfy --with-build-python.
+ --without-lto
+ --without-readline
+ --disable-optimizations
+ )
+
+ myeconfargs+=(
+ # Point the imminent CHOST build to the Python we just
+ # built for CBUILD.
+ --with-build-python="${WORKDIR}"/${P}-${CBUILD}/python
+ )
+
+ mkdir "${WORKDIR}"/${P}-${CBUILD} || die
+ pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die
+ ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
+
+ # Avoid as many dependencies as possible for the cross build.
+ cat >> Makefile <<-EOF || die
+ MODULE_NIS=disabled
+ MODULE__DBM=disabled
+ MODULE__GDBM=disabled
+ MODULE__DBM=disabled
+ MODULE__SQLITE3=disabled
+ MODULE__HASHLIB=disabled
+ MODULE__SSL=disabled
+ MODULE__CURSES=disabled
+ MODULE__CURSES_PANEL=disabled
+ MODULE_READLINE=disabled
+ MODULE__TKINTER=disabled
+ MODULE_PYEXPAT=disabled
+ MODULE_ZLIB=disabled
+ EOF
+
+ # Unfortunately, we do have to build this immediately, and
+ # not in src_compile, because CHOST configure for Python
+ # will check the existence of the --with-build-python value
+ # immediately.
+ emake
+ popd &> /dev/null || die
+ fi
+
econf "${myeconfargs[@]}"
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then