commit:     24631f38a61a53ffd2773090585eb98e9d4e8185
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 21 23:33:08 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 21 23:33:08 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24631f38

sys-apps/portage: disable USE=native-extensions for cross-compilation

It doesn't work because cross-compiling Python modules is
either tricky or flat-out impossible, so let's disable
it when cross-compiling to make life easier for people.

Bug: https://bugs.gentoo.org/612158
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/portage/portage-3.0.30-r1.ebuild | 6 +++++-
 sys-apps/portage/portage-9999.ebuild      | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys-apps/portage/portage-3.0.30-r1.ebuild 
b/sys-apps/portage/portage-3.0.30-r1.ebuild
index 590e0036a88a..87f2831cdf96 100644
--- a/sys-apps/portage/portage-3.0.30-r1.ebuild
+++ b/sys-apps/portage/portage-3.0.30-r1.ebuild
@@ -76,6 +76,10 @@ PDEPEND="
 pkg_pretend() {
        local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
 
+       if use native-extensions && tc-is-cross-compiler; then
+               einfo "Disabling USE=native-extensions for cross-compilation 
(bug #612158)"
+       fi
+
        check_extra_config
 }
 
@@ -99,7 +103,7 @@ python_prepare_all() {
                        >> cnf/make.globals || die
        fi
 
-       if use native-extensions; then
+       if use native-extensions && ! tc-is-cross-compiler; then
                printf "[build_ext]\nportage_ext_modules=true\n" >> \
                        setup.cfg || die
        fi

diff --git a/sys-apps/portage/portage-9999.ebuild 
b/sys-apps/portage/portage-9999.ebuild
index c741638d18e9..860091097621 100644
--- a/sys-apps/portage/portage-9999.ebuild
+++ b/sys-apps/portage/portage-9999.ebuild
@@ -76,6 +76,10 @@ PDEPEND="
 pkg_pretend() {
        local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
 
+       if use native-extensions && tc-is-cross-compiler; then
+               einfo "Disabling USE=native-extensions for cross-compilation 
(bug #612158)"
+       fi
+
        check_extra_config
 }
 
@@ -93,7 +97,7 @@ python_prepare_all() {
                        >> cnf/make.globals || die
        fi
 
-       if use native-extensions; then
+       if use native-extensions && ! tc-is-cross-compiler; then
                printf "[build_ext]\nportage_ext_modules=true\n" >> \
                        setup.cfg || die
        fi

Reply via email to