sys-apps/portage: add native-extensions USE flag (bug 571444)
authorZac Medico <zmedico@gentoo.org>
Wed, 1 Feb 2017 16:55:44 +0000 (08:55 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 1 Feb 2017 19:53:59 +0000 (11:53 -0800)
The native-extensions USE flag will enable building of the
libc bindings. This is not enabled by default because it does
not support cross compilation.

X-Gentoo-bug: 571444
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=571444
Package-Manager: Portage-2.3.3, Repoman-2.3.1

sys-apps/portage/metadata.xml
sys-apps/portage/portage-2.3.3.ebuild
sys-apps/portage/portage-9999.ebuild

index e032ea5deddc82269d9ee2acf076208a26e30894..882d3baa00232c1486a6d1c1f112d23b41ff2d71 100644 (file)
@@ -12,6 +12,7 @@
   <use>
     <flag name="epydoc">Build html API documentation with epydoc.</flag>
     <flag name="ipc">Use inter-process communication between portage and running ebuilds.</flag>
+    <flag name="native-extensions">Build native extensions. Cross-compilation is not supported.</flag>
     <flag name="xattr">Preserve extended attributes (filesystem-stored metadata) when installing files. Usually only required for hardened systems.</flag>
   </use>
 </pkgmetadata>
index 92b48f4aab08472170311eb20baa371598ca2431..4764398d9f75ddb688cdb669f0fb65b0e29eeb26 100644 (file)
@@ -19,7 +19,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
 LICENSE="GPL-2"
 KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
 SLOT="0"
-IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
+IUSE="build doc epydoc +ipc linguas_ru native-extensions selinux xattr"
 
 DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
        >=app-arch/tar-1.27
@@ -85,6 +85,11 @@ pkg_setup() {
 python_prepare_all() {
        distutils-r1_python_prepare_all
 
+       if use native-extensions; then
+               printf "[build_ext]\nportage-ext-modules=true\n" >> \
+                       setup.cfg || die
+       fi
+
        if ! use ipc ; then
                einfo "Disabling ipc..."
                sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
index 6a6f515f1adda8dcfd99f97a53ec791491385ae1..f4f3fec7d67d088f40e0bdad681f8be6622ed421 100644 (file)
@@ -19,7 +19,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
 LICENSE="GPL-2"
 KEYWORDS=""
 SLOT="0"
-IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
+IUSE="build doc epydoc +ipc linguas_ru native-extensions selinux xattr"
 
 DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
        >=app-arch/tar-1.27
@@ -85,6 +85,11 @@ pkg_setup() {
 python_prepare_all() {
        distutils-r1_python_prepare_all
 
+       if use native-extensions; then
+               printf "[build_ext]\nportage-ext-modules=true\n" >> \
+                       setup.cfg || die
+       fi
+
        if ! use ipc ; then
                einfo "Disabling ipc..."
                sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \