summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-10-11 15:18:03 +0100
committerSam James <sam@gentoo.org>2022-10-11 18:53:26 +0100
commit29d2314810bd8e1de73df5c3ebe30c826281c253 (patch)
treef1884a45383198743a6b6c459269187ba36ad1d5 /dev-lang/python
parentdev-python/dbus-python: Remove old (diff)
downloadgentoo-29d2314810bd8e1de73df5c3ebe30c826281c253.tar.gz
gentoo-29d2314810bd8e1de73df5c3ebe30c826281c253.tar.bz2
gentoo-29d2314810bd8e1de73df5c3ebe30c826281c253.zip
dev-lang/python: build CBUILD Python for cross in older versions
See bug 864911 for details. Bug: https://bugs.gentoo.org/847910 Closes: https://bugs.gentoo.org/864911 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/python-3.10.7.ebuild45
-rw-r--r--dev-lang/python/python-3.8.14.ebuild45
-rw-r--r--dev-lang/python/python-3.9.14.ebuild45
3 files changed, 135 insertions, 0 deletions
diff --git a/dev-lang/python/python-3.10.7.ebuild b/dev-lang/python/python-3.10.7.ebuild
index 5670e81124d4..921468637a1a 100644
--- a/dev-lang/python/python-3.10.7.ebuild
+++ b/dev-lang/python/python-3.10.7.ebuild
@@ -237,6 +237,51 @@ 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 and bug #864911.
+ local myeconfargs_cbuild=(
+ "${myeconfargs[@]}"
+
+ # As minimal as possible for the mini CBUILD Python
+ # we build just for cross.
+ --without-lto
+ --disable-optimizations
+ )
+
+ # Point the imminent CHOST build to the Python we just
+ # built for CBUILD.
+ export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}"
+
+ 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 Python it was pointed to
+ # immediately.
+ emake
+ popd &> /dev/null || die
+ fi
+
econf "${myeconfargs[@]}"
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
diff --git a/dev-lang/python/python-3.8.14.ebuild b/dev-lang/python/python-3.8.14.ebuild
index 034a3f2c94f2..a38985990051 100644
--- a/dev-lang/python/python-3.8.14.ebuild
+++ b/dev-lang/python/python-3.8.14.ebuild
@@ -190,6 +190,51 @@ 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 and bug #864911.
+ local myeconfargs_cbuild=(
+ "${myeconfargs[@]}"
+
+ # As minimal as possible for the mini CBUILD Python
+ # we build just for cross.
+ --without-lto
+ --disable-optimizations
+ )
+
+ # Point the imminent CHOST build to the Python we just
+ # built for CBUILD.
+ export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}"
+
+ 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 Python it was pointed to
+ # immediately.
+ emake
+ popd &> /dev/null || die
+ fi
+
econf "${myeconfargs[@]}"
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
diff --git a/dev-lang/python/python-3.9.14.ebuild b/dev-lang/python/python-3.9.14.ebuild
index 34c4173385b1..0ceb169b200f 100644
--- a/dev-lang/python/python-3.9.14.ebuild
+++ b/dev-lang/python/python-3.9.14.ebuild
@@ -231,6 +231,51 @@ 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 and bug #864911.
+ local myeconfargs_cbuild=(
+ "${myeconfargs[@]}"
+
+ # As minimal as possible for the mini CBUILD Python
+ # we build just for cross.
+ --without-lto
+ --disable-optimizations
+ )
+
+ # Point the imminent CHOST build to the Python we just
+ # built for CBUILD.
+ export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}"
+
+ 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 Python it was pointed to
+ # immediately.
+ emake
+ popd &> /dev/null || die
+ fi
+
econf "${myeconfargs[@]}"
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then