summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-03-26 21:29:32 +0000
committerMike Frysinger <vapier@gentoo.org>2013-03-26 21:29:32 +0000
commit6ef5cd01303d0ec7df9ea1219c1def069f9b8540 (patch)
tree50ae6bd4c33431bca96365b60f4e2a50f4defee6 /dev-lang/python
parentcleanup, version bump (diff)
downloadgentoo-2-6ef5cd01303d0ec7df9ea1219c1def069f9b8540.tar.gz
gentoo-2-6ef5cd01303d0ec7df9ea1219c1def069f9b8540.tar.bz2
gentoo-2-6ef5cd01303d0ec7df9ea1219c1def069f9b8540.zip
When cross-compiling, run the configures in parallel for a nice speed up #462264 by SpanKY.
(Portage version: 2.2.0_alpha169/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/ChangeLog8
-rw-r--r--dev-lang/python/python-2.6.8-r1.ebuild75
-rw-r--r--dev-lang/python/python-2.7.3-r3.ebuild77
-rw-r--r--dev-lang/python/python-3.1.5-r1.ebuild75
-rw-r--r--dev-lang/python/python-3.2.3-r2.ebuild79
-rw-r--r--dev-lang/python/python-3.3.0-r1.ebuild79
6 files changed, 302 insertions, 91 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index 8546adea7333..fe84ad609d9c 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-lang/python
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.639 2013/03/24 01:41:31 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.640 2013/03/26 21:29:32 vapier Exp $
+
+ 26 Mar 2013; Mike Frysinger <vapier@gentoo.org> python-2.6.8-r1.ebuild,
+ python-2.7.3-r3.ebuild, python-3.1.5-r1.ebuild, python-3.2.3-r2.ebuild,
+ python-3.3.0-r1.ebuild:
+ When cross-compiling, run the configures in parallel for a nice speed up
+ #462264 by SpanKY.
24 Mar 2013; Mike Gilbert <floppym@gentoo.org> python-3.3.0-r1.ebuild,
python-3.3.0.ebuild:
diff --git a/dev-lang/python/python-2.6.8-r1.ebuild b/dev-lang/python/python-2.6.8-r1.ebuild
index 8744e64af9f8..30349ffd90ce 100644
--- a/dev-lang/python/python-2.6.8-r1.ebuild
+++ b/dev-lang/python/python-2.6.8-r1.ebuild
@@ -1,12 +1,12 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.8-r1.ebuild,v 1.13 2013/03/23 13:28:36 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.8-r1.ebuild,v 1.14 2013/03/26 21:29:32 vapier Exp $
EAPI="2"
WANT_AUTOMAKE="none"
WANT_LIBTOOL="none"
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
MY_P="Python-${PV}"
PATCHSET_REVISION="0"
@@ -151,17 +151,21 @@ src_configure() {
use hardened && replace-flags -O3 -O2
fi
+ # Run the configure scripts in parallel.
+ multijob_init
+
+ mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
+
if tc-is-cross-compiler; then
- OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
- emake python Parser/pgen || die "cross-make failed"
- mv python hostpython
- mv Parser/pgen Parser/hostpgen
- make distclean
- sed -i \
- -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
- -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
- Makefile.pre.in || die "sed failed"
+ (
+ multijob_child_init
+ cd "${WORKDIR}"/${CBUILD} >/dev/null
+ OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
+ "${S}"/configure \
+ --{build,host}=${CBUILD} \
+ || die "cross-configure failed"
+ ) &
+ multijob_post_fork
fi
# Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
@@ -175,7 +179,9 @@ src_configure() {
# Please query BSD team before removing this!
append-ldflags "-L."
- OPT="" econf \
+ cd "${WORKDIR}"/${CHOST}
+ ECONF_SOURCE=${S} OPT="" \
+ econf \
--with-fpectl \
--enable-shared \
$(use_enable ipv6) \
@@ -185,9 +191,41 @@ src_configure() {
--mandir='${prefix}/share/man' \
--with-libc="" \
--with-system-ffi
+
+ if tc-is-cross-compiler; then
+ # Modify the Makefile.pre so we don't regen for the host/ one.
+ # We need to link the host python programs into $PWD and run
+ # them from here because the distutils sysconfig module will
+ # parse Makefile/etc... from argv[0], and we need it to pick
+ # up the target settings, not the host ones.
+ sed -i \
+ -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
+ -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
+ Makefile{.pre,} || die "sed failed"
+ fi
+
+ multijob_finish
}
src_compile() {
+ if tc-is-cross-compiler; then
+ cd "${WORKDIR}"/${CBUILD}
+ # Disable as many modules as possible -- but we need a few to install.
+ PYTHON_DISABLE_MODULES=$(
+ sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
+ egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
+ ) \
+ PTHON_DISABLE_SSL="1" \
+ SYSROOT= \
+ emake || die "cross-make failed"
+ # See comment in src_configure about these.
+ ln python ../${CHOST}/hostpython || die
+ ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
+ ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
+ fi
+
+ cd "${WORKDIR}"/${CHOST}
default
# Work around bug 329499. See also bug 413751.
@@ -201,11 +239,13 @@ src_test() {
return
fi
+ cd "${WORKDIR}"/${CHOST}
+
# Skip failing tests.
local skipped_tests="distutils tcl"
for test in ${skipped_tests}; do
- mv Lib/test/test_${test}.py "${T}"
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
done
# Rerun failed tests in verbose mode (regrtest -w).
@@ -213,7 +253,7 @@ src_test() {
local result="$?"
for test in ${skipped_tests}; do
- mv "${T}/test_${test}.py" Lib/test
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
done
elog "The following tests have been skipped:"
@@ -237,6 +277,7 @@ src_install() {
local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
+ cd "${WORKDIR}"/${CHOST}
emake DESTDIR="${D}" altinstall maninstall || die "emake altinstall maninstall failed"
# Backwards compat with Gentoo divergence.
@@ -261,11 +302,11 @@ src_install() {
use threads || rm -fr "${libdir}/multiprocessing"
use wininst || rm -f "${libdir})/distutils/command/"wininst-*.exe
- dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
if use examples; then
insinto /usr/share/doc/${PF}/examples
- doins -r Tools || die "doins failed"
+ doins -r "${S}"/Tools || die "doins failed"
fi
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
diff --git a/dev-lang/python/python-2.7.3-r3.ebuild b/dev-lang/python/python-2.7.3-r3.ebuild
index 9cde17d191a9..a8ac14ead5d7 100644
--- a/dev-lang/python/python-2.7.3-r3.ebuild
+++ b/dev-lang/python/python-2.7.3-r3.ebuild
@@ -1,12 +1,12 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.3-r3.ebuild,v 1.15 2013/03/23 13:28:36 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.3-r3.ebuild,v 1.16 2013/03/26 21:29:32 vapier Exp $
EAPI="2"
WANT_AUTOMAKE="none"
WANT_LIBTOOL="none"
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
MY_P="Python-${PV}"
PATCHSET_REVISION="1"
@@ -154,17 +154,21 @@ src_configure() {
use hardened && replace-flags -O3 -O2
fi
+ # Run the configure scripts in parallel.
+ multijob_init
+
+ mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
+
if tc-is-cross-compiler; then
- OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
- emake python Parser/pgen || die "cross-make failed"
- mv python hostpython
- mv Parser/pgen Parser/hostpgen
- make distclean
- sed -i \
- -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
- -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
- Makefile.pre.in || die "sed failed"
+ (
+ multijob_child_init
+ cd "${WORKDIR}"/${CBUILD} >/dev/null
+ OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
+ "${S}"/configure \
+ --{build,host}=${CBUILD} \
+ || die "cross-configure failed"
+ ) &
+ multijob_post_fork
# The configure script assumes it's buggy when cross-compiling.
export ac_cv_buggy_getaddrinfo=no
@@ -190,7 +194,9 @@ src_configure() {
dbmliborder+="${dbmliborder:+:}bdb"
fi
- OPT="" econf \
+ cd "${WORKDIR}"/${CHOST}
+ ECONF_SOURCE=${S} OPT="" \
+ econf \
--with-fpectl \
--enable-shared \
$(use_enable ipv6) \
@@ -203,9 +209,41 @@ src_configure() {
--enable-loadable-sqlite-extensions \
--with-system-expat \
--with-system-ffi
+
+ if tc-is-cross-compiler; then
+ # Modify the Makefile.pre so we don't regen for the host/ one.
+ # We need to link the host python programs into $PWD and run
+ # them from here because the distutils sysconfig module will
+ # parse Makefile/etc... from argv[0], and we need it to pick
+ # up the target settings, not the host ones.
+ sed -i \
+ -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
+ -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
+ Makefile{.pre,} || die "sed failed"
+ fi
+
+ multijob_finish
}
src_compile() {
+ if tc-is-cross-compiler; then
+ cd "${WORKDIR}"/${CBUILD}
+ # Disable as many modules as possible -- but we need a few to install.
+ PYTHON_DISABLE_MODULES=$(
+ sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
+ egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
+ ) \
+ PTHON_DISABLE_SSL="1" \
+ SYSROOT= \
+ emake || die "cross-make failed"
+ # See comment in src_configure about these.
+ ln python ../${CHOST}/hostpython || die
+ ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
+ ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
+ fi
+
+ cd "${WORKDIR}"/${CHOST}
default
# Work around bug 329499. See also bug 413751.
@@ -219,11 +257,13 @@ src_test() {
return
fi
+ cd "${WORKDIR}"/${CHOST}
+
# Skip failing tests.
local skipped_tests="distutils gdb"
for test in ${skipped_tests}; do
- mv Lib/test/test_${test}.py "${T}"
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
done
# Rerun failed tests in verbose mode (regrtest -w).
@@ -231,7 +271,7 @@ src_test() {
local result="$?"
for test in ${skipped_tests}; do
- mv "${T}/test_${test}.py" Lib/test
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
done
elog "The following tests have been skipped:"
@@ -255,6 +295,7 @@ src_install() {
local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
+ cd "${WORKDIR}"/${CHOST}
emake DESTDIR="${D}" altinstall maninstall || die "emake altinstall maninstall failed"
sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
@@ -280,16 +321,16 @@ src_install() {
use threads || rm -fr "${libdir}/multiprocessing"
use wininst || rm -f "${libdir})/distutils/command/"wininst-*.exe
- dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
if use examples; then
insinto /usr/share/doc/${PF}/examples
- doins -r Tools || die "doins failed"
+ doins -r "${S}"/Tools || die "doins failed"
fi
insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
emake --no-print-directory -s -f - 2>/dev/null)
- newins Tools/gdb/libpython.py "${libname}"-gdb.py
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
diff --git a/dev-lang/python/python-3.1.5-r1.ebuild b/dev-lang/python/python-3.1.5-r1.ebuild
index 4fe36f2fc607..4990cf636e07 100644
--- a/dev-lang/python/python-3.1.5-r1.ebuild
+++ b/dev-lang/python/python-3.1.5-r1.ebuild
@@ -1,12 +1,12 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.5-r1.ebuild,v 1.13 2013/03/23 13:28:36 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.5-r1.ebuild,v 1.14 2013/03/26 21:29:32 vapier Exp $
EAPI="3"
WANT_AUTOMAKE="none"
WANT_LIBTOOL="none"
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
MY_P="Python-${PV}"
PATCHSET_REVISION="0"
@@ -123,17 +123,21 @@ src_configure() {
use hardened && replace-flags -O3 -O2
fi
+ # Run the configure scripts in parallel.
+ multijob_init
+
+ mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
+
if tc-is-cross-compiler; then
- OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
- emake python Parser/pgen || die "cross-make failed"
- mv python hostpython
- mv Parser/pgen Parser/hostpgen
- make distclean
- sed -i \
- -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
- -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
- Makefile.pre.in || die "sed failed"
+ (
+ multijob_child_init
+ cd "${WORKDIR}"/${CBUILD} >/dev/null
+ OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
+ "${S}"/configure \
+ --{build,host}=${CBUILD} \
+ || die "cross-configure failed"
+ ) &
+ multijob_post_fork
fi
# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
@@ -152,7 +156,9 @@ src_configure() {
dbmliborder+="${dbmliborder:+:}gdbm"
fi
- OPT="" econf \
+ cd "${WORKDIR}"/${CHOST}
+ ECONF_SOURCE=${S} OPT="" \
+ econf \
--with-fpectl \
--enable-shared \
$(use_enable ipv6) \
@@ -164,9 +170,41 @@ src_configure() {
--with-dbmliborder="${dbmliborder}" \
--with-libc="" \
--with-system-ffi
+
+ if tc-is-cross-compiler; then
+ # Modify the Makefile.pre so we don't regen for the host/ one.
+ # We need to link the host python programs into $PWD and run
+ # them from here because the distutils sysconfig module will
+ # parse Makefile/etc... from argv[0], and we need it to pick
+ # up the target settings, not the host ones.
+ sed -i \
+ -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
+ -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
+ Makefile{.pre,} || die "sed failed"
+ fi
+
+ multijob_finish
}
src_compile() {
+ if tc-is-cross-compiler; then
+ cd "${WORKDIR}"/${CBUILD}
+ # Disable as many modules as possible -- but we need a few to install.
+ PYTHON_DISABLE_MODULES=$(
+ sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
+ egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
+ ) \
+ PTHON_DISABLE_SSL="1" \
+ SYSROOT= \
+ emake || die "cross-make failed"
+ # See comment in src_configure about these.
+ ln python ../${CHOST}/hostpython || die
+ ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
+ ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
+ fi
+
+ cd "${WORKDIR}"/${CHOST}
default
# Work around bug 329499. See also bug 413751.
@@ -185,11 +223,13 @@ src_test() {
return
fi
+ cd "${WORKDIR}"/${CHOST}
+
# Skip failing tests.
local skipped_tests="distutils"
for test in ${skipped_tests}; do
- mv Lib/test/test_${test}.py "${T}"
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
done
# Rerun failed tests in verbose mode (regrtest -w).
@@ -197,7 +237,7 @@ src_test() {
local result="$?"
for test in ${skipped_tests}; do
- mv "${T}/test_${test}.py" Lib/test
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
done
elog "The following tests have been skipped:"
@@ -217,6 +257,7 @@ src_test() {
src_install() {
local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
+ cd "${WORKDIR}"/${CHOST}
emake DESTDIR="${D}" altinstall || die "emake altinstall failed"
# Backwards compat with Gentoo divergence.
@@ -239,11 +280,11 @@ src_install() {
use threads || rm -fr "${libdir}/multiprocessing"
use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
- dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
if use examples; then
insinto /usr/share/doc/${PF}/examples
- doins -r Tools || die "doins failed"
+ doins -r "${S}"/Tools || die "doins failed"
fi
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
diff --git a/dev-lang/python/python-3.2.3-r2.ebuild b/dev-lang/python/python-3.2.3-r2.ebuild
index 3f8652747e3d..7ab96b9c15aa 100644
--- a/dev-lang/python/python-3.2.3-r2.ebuild
+++ b/dev-lang/python/python-3.2.3-r2.ebuild
@@ -1,12 +1,12 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.2.3-r2.ebuild,v 1.16 2013/03/23 13:28:36 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.2.3-r2.ebuild,v 1.17 2013/03/26 21:29:32 vapier Exp $
EAPI="3"
WANT_AUTOMAKE="none"
WANT_LIBTOOL="none"
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
MY_P="Python-${PV}"
PATCHSET_REVISION="0"
@@ -137,17 +137,21 @@ src_configure() {
use hardened && replace-flags -O3 -O2
fi
+ # Run the configure scripts in parallel.
+ multijob_init
+
+ mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
+
if tc-is-cross-compiler; then
- OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
- emake python Parser/pgen || die "cross-make failed"
- mv python hostpython
- mv Parser/pgen Parser/hostpgen
- make distclean
- sed -i \
- -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
- -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
- Makefile.pre.in || die "sed failed"
+ (
+ multijob_child_init
+ cd "${WORKDIR}"/${CBUILD} >/dev/null
+ OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
+ "${S}"/configure \
+ --{build,host}=${CBUILD} \
+ || die "cross-configure failed"
+ ) &
+ multijob_post_fork
# The configure script assumes it's buggy when cross-compiling.
export ac_cv_buggy_getaddrinfo=no
@@ -170,7 +174,9 @@ src_configure() {
dbmliborder+="${dbmliborder:+:}gdbm"
fi
- OPT="" econf \
+ cd "${WORKDIR}"/${CHOST}
+ ECONF_SOURCE=${S} OPT="" \
+ econf \
--with-fpectl \
--enable-shared \
$(use_enable ipv6) \
@@ -184,9 +190,41 @@ src_configure() {
--enable-loadable-sqlite-extensions \
--with-system-expat \
--with-system-ffi
+
+ if tc-is-cross-compiler; then
+ # Modify the Makefile.pre so we don't regen for the host/ one.
+ # We need to link the host python programs into $PWD and run
+ # them from here because the distutils sysconfig module will
+ # parse Makefile/etc... from argv[0], and we need it to pick
+ # up the target settings, not the host ones.
+ sed -i \
+ -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
+ -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
+ Makefile{.pre,} || die "sed failed"
+ fi
+
+ multijob_finish
}
src_compile() {
+ if tc-is-cross-compiler; then
+ cd "${WORKDIR}"/${CBUILD}
+ # Disable as many modules as possible -- but we need a few to install.
+ PYTHON_DISABLE_MODULES=$(
+ sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
+ egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
+ ) \
+ PTHON_DISABLE_SSL="1" \
+ SYSROOT= \
+ emake || die "cross-make failed"
+ # See comment in src_configure about these.
+ ln python ../${CHOST}/hostpython || die
+ ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
+ ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
+ fi
+
+ cd "${WORKDIR}"/${CHOST}
emake CPPFLAGS="" CFLAGS="" LDFLAGS="" || die "emake failed"
# Work around bug 329499. See also bug 413751.
@@ -200,11 +238,13 @@ src_test() {
return
fi
+ cd "${WORKDIR}"/${CHOST}
+
# Skip failing tests.
local skipped_tests="gdb"
for test in ${skipped_tests}; do
- mv Lib/test/test_${test}.py "${T}"
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
done
# Rerun failed tests in verbose mode (regrtest -w).
@@ -212,7 +252,7 @@ src_test() {
local result="$?"
for test in ${skipped_tests}; do
- mv "${T}/test_${test}.py" Lib/test
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
done
elog "The following tests have been skipped:"
@@ -232,6 +272,7 @@ src_test() {
src_install() {
local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
+ cd "${WORKDIR}"/${CHOST}
emake DESTDIR="${D}" altinstall || die "emake altinstall failed"
sed \
@@ -256,17 +297,17 @@ src_install() {
use threads || rm -fr "${libdir}/multiprocessing"
use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
- dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
if use examples; then
insinto /usr/share/doc/${PF}/examples
- find Tools -name __pycache__ -print0 | xargs -0 rm -fr
- doins -r Tools || die "doins failed"
+ find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
+ doins -r "${S}"/Tools || die "doins failed"
fi
insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
emake --no-print-directory -s -f - 2>/dev/null)
- newins Tools/gdb/libpython.py "${libname}"-gdb.py
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
diff --git a/dev-lang/python/python-3.3.0-r1.ebuild b/dev-lang/python/python-3.3.0-r1.ebuild
index 65161d865a1f..84865b5fc536 100644
--- a/dev-lang/python/python-3.3.0-r1.ebuild
+++ b/dev-lang/python/python-3.3.0-r1.ebuild
@@ -1,12 +1,12 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.3.0-r1.ebuild,v 1.10 2013/03/24 01:41:31 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.3.0-r1.ebuild,v 1.11 2013/03/26 21:29:32 vapier Exp $
EAPI="3"
WANT_AUTOMAKE="none"
WANT_LIBTOOL="none"
-inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
MY_P="Python-${PV}"
PATCHSET_REVISION="1"
@@ -129,17 +129,21 @@ src_configure() {
use hardened && replace-flags -O3 -O2
fi
+ # Run the configure scripts in parallel.
+ multijob_init
+
+ mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
+
if tc-is-cross-compiler; then
- OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
- emake python Parser/pgen || die "cross-make failed"
- mv python hostpython
- mv Parser/pgen Parser/hostpgen
- make distclean
- sed -i \
- -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
- -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
- Makefile.pre.in || die "sed failed"
+ (
+ multijob_child_init
+ cd "${WORKDIR}"/${CBUILD} >/dev/null
+ OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
+ "${S}"/configure \
+ --{build,host}=${CBUILD} \
+ || die "cross-configure failed"
+ ) &
+ multijob_post_fork
# The configure script assumes it's buggy when cross-compiling.
export ac_cv_buggy_getaddrinfo=no
@@ -162,7 +166,9 @@ src_configure() {
dbmliborder+="${dbmliborder:+:}gdbm"
fi
- OPT="" econf \
+ cd "${WORKDIR}"/${CHOST}
+ ECONF_SOURCE=${S} OPT="" \
+ econf \
--with-fpectl \
--enable-shared \
$(use_enable ipv6) \
@@ -175,9 +181,41 @@ src_configure() {
--enable-loadable-sqlite-extensions \
--with-system-expat \
--with-system-ffi
+
+ if tc-is-cross-compiler; then
+ # Modify the Makefile.pre so we don't regen for the host/ one.
+ # We need to link the host python programs into $PWD and run
+ # them from here because the distutils sysconfig module will
+ # parse Makefile/etc... from argv[0], and we need it to pick
+ # up the target settings, not the host ones.
+ sed -i \
+ -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
+ -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
+ -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
+ Makefile{.pre,} || die "sed failed"
+ fi
+
+ multijob_finish
}
src_compile() {
+ if tc-is-cross-compiler; then
+ cd "${WORKDIR}"/${CBUILD}
+ # Disable as many modules as possible -- but we need a few to install.
+ PYTHON_DISABLE_MODULES=$(
+ sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
+ egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
+ ) \
+ PTHON_DISABLE_SSL="1" \
+ SYSROOT= \
+ emake || die "cross-make failed"
+ # See comment in src_configure about these.
+ ln python ../${CHOST}/hostpython || die
+ ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
+ ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
+ fi
+
+ cd "${WORKDIR}"/${CHOST}
emake CPPFLAGS="" CFLAGS="" LDFLAGS="" || die "emake failed"
# Work around bug 329499. See also bug 413751.
@@ -191,11 +229,13 @@ src_test() {
return
fi
+ cd "${WORKDIR}"/${CHOST}
+
# Skip failing tests.
local skipped_tests="gdb"
for test in ${skipped_tests}; do
- mv Lib/test/test_${test}.py "${T}"
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
done
# Rerun failed tests in verbose mode (regrtest -w).
@@ -203,7 +243,7 @@ src_test() {
local result="$?"
for test in ${skipped_tests}; do
- mv "${T}/test_${test}.py" Lib/test
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
done
elog "The following tests have been skipped:"
@@ -223,6 +263,7 @@ src_test() {
src_install() {
local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
+ cd "${WORKDIR}"/${CHOST}
emake DESTDIR="${D}" altinstall || die "emake altinstall failed"
sed \
@@ -247,17 +288,17 @@ src_install() {
use threads || rm -fr "${libdir}/multiprocessing"
use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
- dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
if use examples; then
insinto /usr/share/doc/${PF}/examples
- find Tools -name __pycache__ -print0 | xargs -0 rm -fr
- doins -r Tools || die "doins failed"
+ find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
+ doins -r "${S}"/Tools || die "doins failed"
fi
insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
emake --no-print-directory -s -f - 2>/dev/null)
- newins Tools/gdb/libpython.py "${libname}"-gdb.py
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"