From 708460e50bca1d251a826bf74c00a3021ea76f10 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 23 Jan 2023 22:30:37 +0000 Subject: [PATCH] dev-lang/python: Fix cross-compiling, particularly 3.11 Despite efforts to avoid needing the same version of Python installed on the build host, this was still required due to libpython.so not being found. Even when it was found, it was erroneously looking under /usr rather than ${S} for the Python modules. For some unknown reason, this caused 3.11 to fail. The easiest solution is to just build a static Python with no libpython.so. This also ensures modules are loaded from ${S}. Closes: https://bugs.gentoo.org/889874 Signed-off-by: James Le Cuirot --- dev-lang/python/python-3.10.9.ebuild | 3 +++ dev-lang/python/python-3.11.1.ebuild | 3 +++ dev-lang/python/python-3.12.0_alpha4.ebuild | 3 +++ dev-lang/python/python-3.8.16-r3.ebuild | 3 +++ dev-lang/python/python-3.9.16.ebuild | 3 +++ 5 files changed, 15 insertions(+) diff --git a/dev-lang/python/python-3.10.9.ebuild b/dev-lang/python/python-3.10.9.ebuild index 1b3700f2b2b96..390bba98511da 100644 --- a/dev-lang/python/python-3.10.9.ebuild +++ b/dev-lang/python/python-3.10.9.ebuild @@ -246,6 +246,9 @@ src_configure() { --libdir="${cbuild_libdir:2}" + # Avoid needing to load the right libpython.so. + --disable-shared + # As minimal as possible for the mini CBUILD Python # we build just for cross. --without-lto diff --git a/dev-lang/python/python-3.11.1.ebuild b/dev-lang/python/python-3.11.1.ebuild index f0e59a0411052..5d2077e3f7c7d 100644 --- a/dev-lang/python/python-3.11.1.ebuild +++ b/dev-lang/python/python-3.11.1.ebuild @@ -235,6 +235,9 @@ src_configure() { --libdir="${cbuild_libdir:2}" + # Avoid needing to load the right libpython.so. + --disable-shared + # As minimal as possible for the mini CBUILD Python # we build just for cross to satisfy --with-build-python. --without-lto diff --git a/dev-lang/python/python-3.12.0_alpha4.ebuild b/dev-lang/python/python-3.12.0_alpha4.ebuild index 93317e0a722a7..e3431855d0e70 100644 --- a/dev-lang/python/python-3.12.0_alpha4.ebuild +++ b/dev-lang/python/python-3.12.0_alpha4.ebuild @@ -229,6 +229,9 @@ src_configure() { --libdir="${cbuild_libdir:2}" + # Avoid needing to load the right libpython.so. + --disable-shared + # As minimal as possible for the mini CBUILD Python # we build just for cross to satisfy --with-build-python. --without-lto diff --git a/dev-lang/python/python-3.8.16-r3.ebuild b/dev-lang/python/python-3.8.16-r3.ebuild index 848ce784881ce..3032411863bcf 100644 --- a/dev-lang/python/python-3.8.16-r3.ebuild +++ b/dev-lang/python/python-3.8.16-r3.ebuild @@ -203,6 +203,9 @@ src_configure() { --libdir="${cbuild_libdir:2}" + # Avoid needing to load the right libpython.so. + --disable-shared + # As minimal as possible for the mini CBUILD Python # we build just for cross. --without-lto diff --git a/dev-lang/python/python-3.9.16.ebuild b/dev-lang/python/python-3.9.16.ebuild index f6dbbd4312df6..cb84012fc09bc 100644 --- a/dev-lang/python/python-3.9.16.ebuild +++ b/dev-lang/python/python-3.9.16.ebuild @@ -240,6 +240,9 @@ src_configure() { --libdir="${cbuild_libdir:2}" + # Avoid needing to load the right libpython.so. + --disable-shared + # As minimal as possible for the mini CBUILD Python # we build just for cross. --without-lto