summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven J Newbury <steve@snewbury.org.uk>2009-04-07 04:27:23 +0100
committerSteven J Newbury <steve@snewbury.org.uk>2009-04-07 04:27:23 +0100
commitdb59b91b230454e519c3cc91fe3e49e91444b17e (patch)
tree7ab85482c130d3750586374147b903730deb6e96 /dev-lang
parentOnly "cd" into an existing directory (diff)
downloadmultilib-portage-db59b91b230454e519c3cc91fe3e49e91444b17e.tar.gz
multilib-portage-db59b91b230454e519c3cc91fe3e49e91444b17e.tar.bz2
multilib-portage-db59b91b230454e519c3cc91fe3e49e91444b17e.zip
Fix dev-lang/python
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/Manifest6
-rw-r--r--dev-lang/python/python-2.5.2-r7.ebuild158
-rw-r--r--dev-lang/python/python-2.5.4-r2.ebuild178
-rw-r--r--dev-lang/python/python-2.6.1-r1.ebuild4
4 files changed, 115 insertions, 231 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 41da41d60..32a9b3b99 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -19,6 +19,6 @@ DIST Python-2.6.1.tar.bz2 10960385 RMD160 497dafaca9c150fca611b0175eeb13c2fc4d3e
DIST python-gentoo-patches-2.5.2-r7.tar.bz2 28160 RMD160 c2a8c71f464f1cf0cd8e3d142a3f3454de46bc55 SHA1 b64fc90f331e42ea2c364fd61d13b515300fdcbf SHA256 8afff4ed12c3c5ca4418da657617317a8c646a69ae341a3d494747659825355f
DIST python-gentoo-patches-2.5.4.tar.bz2 19474 RMD160 00bb0918414db251b11b7f19a9f8a112c9e49fbd SHA1 fd4955f7da3049abecc4df0e203e783a90390cf8 SHA256 6e050dd8e8a90655bf935af99ad1ae6456bc072f075ddb9bcd532201bbb37274
DIST python-gentoo-patches-2.6-r5.tar.bz2 7431 RMD160 dbfc0715773446614843b45818d4152ca133140a SHA1 495cbfbf333052faf6860cf2d682f249a787557c SHA256 ef81eac97d933c77afcfd2434f44132717cd0a1550d1092e388e3c2f3dd5f3cf
-EBUILD python-2.5.2-r7.ebuild 10920 RMD160 9fd278a3ad293841d816f330a86ffc80975c1411 SHA1 89a5a17d99272cefe381bed700788a5ecdc2e915 SHA256 4a823c38c25dea1dd71abe17bb685e71646ae17a31466147e59149889ae16ebb
-EBUILD python-2.5.4-r2.ebuild 10888 RMD160 753f6dfe39fc585f1607b1aaf33749ec2361f84c SHA1 ff130122cd70f2db08420dc738a6f144cc12a3df SHA256 c6b87564c7e958094f1011c2e2d2112306fd4c7f92a9b753b3e716705e2740fd
-EBUILD python-2.6.1-r1.ebuild 9031 RMD160 9cdc8e9b6a9eb3d6c52689b0a7fce27a47f41b00 SHA1 206fba58a660bbbed670eaf8da404276a47ba75c SHA256 c279c715424233614db8babf9c38d2804bd2325e3dd6da249700b635eac5379c
+EBUILD python-2.5.2-r7.ebuild 8987 RMD160 46860edf93cb730d3b287e0107b0d143bfde2387 SHA1 a43cd0cb0423f7b00d39b3c072c703f90ba68fa1 SHA256 123983b40c035d89a3274a08ca2180b1dd91696fbbef0f0c045f410fb7563693
+EBUILD python-2.5.4-r2.ebuild 8996 RMD160 a1359f4ddbecf68eff2a9c56b6897c76ebef985b SHA1 25fd5463056fdb27b626ea6cc23d2a0ab1b55a28 SHA256 445c4375e7ebd5c55e4c8ac26391cf4af7f115b92d34203cff6eee419662231d
+EBUILD python-2.6.1-r1.ebuild 9071 RMD160 cb8444e3343d94c167a2ae1668cb151513d1f415 SHA1 b5846dfdc5ece608fd2f780608ab3bf176863bae SHA256 3f971760495e02a5b2c3c5f8f35d3a3a2d806e5cd2ce9070337e8f4000490061
diff --git a/dev-lang/python/python-2.5.2-r7.ebuild b/dev-lang/python/python-2.5.2-r7.ebuild
index 0a94c45ef..513ae228b 100644
--- a/dev-lang/python/python-2.5.2-r7.ebuild
+++ b/dev-lang/python/python-2.5.2-r7.ebuild
@@ -1,15 +1,17 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.2-r7.ebuild,v 1.15 2009/03/26 05:10:31 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.1-r1.ebuild,v 1.2 2009/03/26 05:10:31 zmedico Exp $
# NOTE about python-portage interactions :
# - Do not add a pkg_setup() check for a certain version of portage
# in dev-lang/python. It _WILL_ stop people installing from
# Gentoo 1.4 images.
-EAPI="2"
+EAPI=2
-inherit eutils autotools flag-o-matic python versionator toolchain-funcs alternatives libtool multilib-native
+MULTILIB_IN_SOURCE_BUILD="yes"
+
+inherit eutils autotools flag-o-matic python versionator toolchain-funcs libtool multilib-native
# we need this so that we don't depends on python.eclass
PYVER_MAJOR=$(get_major_version)
@@ -32,17 +34,17 @@ IUSE="ncurses gdbm ssl readline tk berkdb ipv6 build ucs2 sqlite doc +threads ex
# NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
# do not conflict with the ones in python proper. - liquidx
-DEPEND=">=sys-libs/zlib-1.1.3[lib32?]
+DEPEND=">=app-admin/eselect-python-20080925
+ >=sys-libs/zlib-1.1.3[lib32?]
!build? (
sqlite? ( >=dev-db/sqlite-3[lib32?] )
- tk? ( >=dev-lang/tk-8.0 )
+ tk? ( >=dev-lang/tk-8.0[lib32?] )
ncurses? ( >=sys-libs/ncurses-5.2[lib32?]
readline? ( >=sys-libs/readline-4.1[lib32?] ) )
- berkdb? ( || ( sys-libs/db:4.5[lib32?] sys-libs/db:4.4[lib32?]
- sys-libs/db:4.3[lib32?] sys-libs/db:4.2[lib32?] ) )
+ berkdb? ( >=sys-libs/db-3.1[lib32?] )
gdbm? ( sys-libs/gdbm[lib32?] )
ssl? ( dev-libs/openssl[lib32?] )
- doc? ( dev-python/python-docs:2.5 )
+ doc? ( dev-python/python-docs:2.6 )
xml? ( dev-libs/expat[lib32?] )
)"
@@ -53,14 +55,17 @@ PDEPEND="${DEPEND} app-admin/python-updater"
PROVIDE="virtual/python"
multilib-native_src_prepare_internal() {
- if tc-is-cross-compiler ; then
- epatch "${FILESDIR}"/python-2.4.4-test-cross.patch \
- "${FILESDIR}"/python-2.5-cross-printf.patch
- else
- rm -f "${WORKDIR}/${PV}"/*_all_crosscompile.patch
+ default
+
+ if tc-is-cross-compiler ; then
+ epatch "${FILESDIR}"/python-2.4.4-test-cross.patch \
+ "${FILESDIR}"/python-2.5-cross-printf.patch
+ else
+ rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
fi
EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
+
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
Lib/distutils/command/install.py \
Lib/distutils/sysconfig.py \
@@ -68,7 +73,7 @@ multilib-native_src_prepare_internal() {
Makefile.pre.in \
Modules/Setup.dist \
Modules/getpath.c \
- setup.py || die
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
# fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04)
# PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
@@ -82,7 +87,7 @@ multilib-native_src_prepare_internal() {
eautoreconf
}
-src_configure_internal() {
+multilib-native_src_configure_internal() {
# disable extraneous modules with extra dependencies
if use build; then
export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
@@ -93,13 +98,13 @@ src_configure_internal() {
local disable
use berkdb || use gdbm || disable="${disable} dbm"
use berkdb || disable="${disable} bsddb"
+ use xml || disable="${disable} pyexpat"
use gdbm || disable="${disable} gdbm"
use ncurses || disable="${disable} _curses _curses_panel"
use readline || disable="${disable} readline"
use sqlite || disable="${disable} _sqlite3"
use ssl || export PYTHON_DISABLE_SSL=1
use tk || disable="${disable} _tkinter"
- use xml || disable="${disable} pyexpat"
export PYTHON_DISABLE_MODULES="${disable}"
fi
@@ -110,27 +115,6 @@ src_configure_internal() {
fi
einfo "Disabled modules: $PYTHON_DISABLE_MODULES"
-}
-
-src_configure() { :; }
-
-multilib-native_src_compile_internal() {
- filter-flags -malign-double
-
- # Seems to no longer be necessary
- #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
- [ "${ARCH}" = "alpha" ] && append-flags -fPIC
-
- # http://bugs.gentoo.org/show_bug.cgi?id=50309
- if is-flag -O3; then
- is-flag -fstack-protector-all && replace-flags -O3 -O2
- use hardened && replace-flags -O3 -O2
- fi
-
- # See #228905
- if [[ $(gcc-major-version) -ge 4 ]]; then
- append-flags -fwrapv
- fi
export OPT="${CFLAGS}"
@@ -143,15 +127,21 @@ multilib-native_src_compile_internal() {
&& myconf="${myconf} --enable-unicode=ucs2" \
|| myconf="${myconf} --enable-unicode=ucs4"
- use threads \
- && myconf="${myconf} --with-threads" \
- || myconf="${myconf} --without-threads"
+ filter-flags -malign-double
- src_configure_internal
+ # Seems to no longer be necessary
+ #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
+ [ "${ARCH}" = "alpha" ] && append-flags -fPIC
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flag -O3; then
+ is-flag -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
if tc-is-cross-compiler ; then
OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
+ ./configure || die "cross-configure failed"
emake python Parser/pgen || die "cross-make failed"
mv python hostpython
mv Parser/pgen Parser/hostpgen
@@ -159,7 +149,7 @@ multilib-native_src_compile_internal() {
sed -i \
-e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
-e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
- Makefile.pre.in || die
+ Makefile.pre.in || die "sed failed"
fi
# export CXX so it ends up in /usr/lib/python2.x/config/Makefile
@@ -173,22 +163,22 @@ multilib-native_src_compile_internal() {
econf \
--with-fpectl \
--enable-shared \
- `use_enable ipv6` \
+ $(use_enable ipv6) \
+ $(use_with threads) \
--infodir='${prefix}'/share/info \
--mandir='${prefix}'/share/man \
--with-libc='' \
- ${myconf} || die
- emake || die "Parallel make failed"
+ ${myconf}
}
multilib-native_src_install_internal() {
dodir /usr
- src_configure_internal
- make DESTDIR="${D}" altinstall maninstall || die
+ emake DESTDIR="${D}" altinstall maninstall || die
mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
# Fix slotted collisions
+ mv "${D}"/usr/bin/2to3 "${D}"/usr/bin/2to3-${PYVER}
mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
mv "${D}"/usr/share/man/man1/python.1 \
@@ -220,75 +210,28 @@ multilib-native_src_install_internal() {
doins "${S}"/Makefile.pre.in
if use examples ; then
- mkdir -p "${D}"/usr/share/doc/${P}/examples
- cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples
+ insinto /usr/share/doc/${PF}/examples
+ doins -r "${S}"/Tools || die "doins failed"
fi
newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
+
+ # Installs empty directory.
+ rmdir "${D}"/usr/$(get_libdir)/${PN}${PV}/lib-old
}
multilib-native_pkg_postrm_internal() {
- local mansuffix=$(ecompress --suffix)
- python_makesym
- alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/python-config" \
- "python-config-[0-9].[0-9]"
-
- alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
- "python[0-9].[0-9].1${mansuffix}"
-
- python_mod_cleanup /usr/lib/python${PYVER}
- [[ "$(get_libdir)" == "lib" ]] || \
- python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
+ eselect python update --ignore 3.0
+ python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
}
multilib-native_pkg_postinst_internal() {
- local myroot
- myroot=$(echo $ROOT | sed 's:/$::')
- local mansuffix=$(ecompress --suffix)
+ eselect python update --ignore 3.0
+ python_version
- python_makesym
- alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/python-config" \
- "python-config-[0-9].[0-9]"
-
- alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
- "python[0-9].[0-9].1${mansuffix}"
-
- python_mod_optimize
python_mod_optimize -x "(site-packages|test)" \
- /usr/lib/python${PYVER}
- [[ "$(get_libdir)" == "lib" ]] || \
- python_mod_optimize -x "(site-packages|test)" \
- /usr/$(get_libdir)/python${PYVER}
-
- # workaround possible python-upgrade-breaks-portage situation
- if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
- if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
- einfo "Working around possible python-portage upgrade breakage"
- mkdir -p ${myroot}/usr/lib/portage/pym
- cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
- python_mod_optimize /usr/lib/portage/pym
- fi
- fi
-
- echo
- ewarn
- ewarn "If you have just upgraded from an older version of python you will"
- ewarn "need to run:"
- ewarn
- ewarn "/usr/sbin/python-updater"
- ewarn
- ewarn "This will automatically rebuild all the python dependent modules"
- ewarn "to run with python-${PYVER}."
- ewarn
- ewarn "Your original Python is still installed and can be accessed via"
- ewarn "/usr/bin/python2.x."
- ewarn
- ebeep 5
+ /usr/$(get_libdir)/python${PYVER}
}
src_test() {
@@ -298,12 +241,13 @@ src_test() {
return
fi
- # Disabling byte compiling breaks test_import
+ # Byte compiling should be enabled here.
+ # Otherwise test_import fails.
python_enable_pyc
#skip all tests that fail during emerge but pass without emerge:
#(See bug# 67970)
- local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
+ local skip_tests="distutils global httpservers mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
# test_pow fails on alpha.
# http://bugs.python.org/issue756093
diff --git a/dev-lang/python/python-2.5.4-r2.ebuild b/dev-lang/python/python-2.5.4-r2.ebuild
index e55b275c6..19a637fc0 100644
--- a/dev-lang/python/python-2.5.4-r2.ebuild
+++ b/dev-lang/python/python-2.5.4-r2.ebuild
@@ -1,15 +1,17 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.4-r2.ebuild,v 1.5 2009/03/26 05:10:31 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.1-r1.ebuild,v 1.2 2009/03/26 05:10:31 zmedico Exp $
# NOTE about python-portage interactions :
# - Do not add a pkg_setup() check for a certain version of portage
# in dev-lang/python. It _WILL_ stop people installing from
# Gentoo 1.4 images.
-EAPI="2"
+EAPI=2
-inherit eutils autotools flag-o-matic python multilib versionator toolchain-funcs alternatives libtool multilib-native
+MULTILIB_IN_SOURCE_BUILD="yes"
+
+inherit eutils autotools flag-o-matic python versionator toolchain-funcs libtool multilib-native
# we need this so that we don't depends on python.eclass
PYVER_MAJOR=$(get_major_version)
@@ -22,7 +24,7 @@ S="${WORKDIR}/${MY_P}"
DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
HOMEPAGE="http://www.python.org/"
SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
- mirror://gentoo/python-gentoo-patches-${PV}.tar.bz2"
+ mirror://gentoo/python-gentoo-patches-${PV}.tar.bz2"
LICENSE="PSF-2.2"
SLOT="2.5"
@@ -32,17 +34,17 @@ IUSE="+xml ncurses gdbm ssl readline tk berkdb ipv6 build ucs2 sqlite doc +threa
# NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
# do not conflict with the ones in python proper. - liquidx
-DEPEND=">=sys-libs/zlib-1.1.3[lib32?]
- !build? (
- sqlite? ( >=dev-db/sqlite-3 )
- tk? ( >=dev-lang/tk-8.0 )
- ncurses? ( >=sys-libs/ncurses-5.2
- readline? ( >=sys-libs/readline-4.1 ) )
- berkdb? ( || ( sys-libs/db:4.5 sys-libs/db:4.4 sys-libs/db:4.3
- sys-libs/db:4.2 ) )
- gdbm? ( sys-libs/gdbm )
- ssl? ( dev-libs/openssl )
- doc? ( dev-python/python-docs:2.5 )
+DEPEND=">=app-admin/eselect-python-20080925
+ >=sys-libs/zlib-1.1.3[lib32?]
+ !build? (
+ sqlite? ( >=dev-db/sqlite-3[lib32?] )
+ tk? ( >=dev-lang/tk-8.0[lib32?] )
+ ncurses? ( >=sys-libs/ncurses-5.2[lib32?]
+ readline? ( >=sys-libs/readline-4.1[lib32?] ) )
+ berkdb? ( >=sys-libs/db-3.1[lib32?] )
+ gdbm? ( sys-libs/gdbm[lib32?] )
+ ssl? ( dev-libs/openssl[lib32?] )
+ doc? ( dev-python/python-docs:2.6 )
xml? ( dev-libs/expat[lib32?] )
)"
@@ -53,14 +55,17 @@ PDEPEND="${DEPEND} app-admin/python-updater"
PROVIDE="virtual/python"
multilib-native_src_prepare_internal() {
- if tc-is-cross-compiler ; then
- epatch "${FILESDIR}"/python-2.4.4-test-cross.patch \
- "${FILESDIR}"/python-2.5-cross-printf.patch
- else
+ default
+
+ if tc-is-cross-compiler ; then
+ epatch "${FILESDIR}"/python-2.4.4-test-cross.patch \
+ "${FILESDIR}"/python-2.5-cross-printf.patch
+ else
rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
fi
EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
+
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
Lib/distutils/command/install.py \
Lib/distutils/sysconfig.py \
@@ -68,10 +73,9 @@ multilib-native_src_prepare_internal() {
Makefile.pre.in \
Modules/Setup.dist \
Modules/getpath.c \
- setup.py || die
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
- # fix os.utime() on hppa. utimes it not supported but unfortunately reported
- # as working - gmsoft (22 May 04)
+ # fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04)
# PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
[ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
@@ -83,7 +87,7 @@ multilib-native_src_prepare_internal() {
eautoreconf
}
-src_configure_internal() {
+multilib-native_src_configure_internal() {
# disable extraneous modules with extra dependencies
if use build; then
export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
@@ -111,27 +115,6 @@ src_configure_internal() {
fi
einfo "Disabled modules: $PYTHON_DISABLE_MODULES"
-}
-
-src_configure() { :; }
-
-multilib-native_src_compile_internal() {
- filter-flags -malign-double
-
- # Seems to no longer be necessary
- #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
- [ "${ARCH}" = "alpha" ] && append-flags -fPIC
-
- # http://bugs.gentoo.org/show_bug.cgi?id=50309
- if is-flag -O3; then
- is-flag -fstack-protector-all && replace-flags -O3 -O2
- use hardened && replace-flags -O3 -O2
- fi
-
- # See #228905
- if [[ $(gcc-major-version) -ge 4 ]]; then
- append-flags -fwrapv
- fi
export OPT="${CFLAGS}"
@@ -144,15 +127,21 @@ multilib-native_src_compile_internal() {
&& myconf="${myconf} --enable-unicode=ucs2" \
|| myconf="${myconf} --enable-unicode=ucs4"
- use threads \
- && myconf="${myconf} --with-threads" \
- || myconf="${myconf} --without-threads"
+ filter-flags -malign-double
- src_configure_internal
+ # Seems to no longer be necessary
+ #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
+ [ "${ARCH}" = "alpha" ] && append-flags -fPIC
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flag -O3; then
+ is-flag -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
if tc-is-cross-compiler ; then
OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
+ ./configure || die "cross-configure failed"
emake python Parser/pgen || die "cross-make failed"
mv python hostpython
mv Parser/pgen Parser/hostpgen
@@ -160,7 +149,7 @@ multilib-native_src_compile_internal() {
sed -i \
-e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
-e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
- Makefile.pre.in || die
+ Makefile.pre.in || die "sed failed"
fi
# export CXX so it ends up in /usr/lib/python2.x/config/Makefile
@@ -174,23 +163,22 @@ multilib-native_src_compile_internal() {
econf \
--with-fpectl \
--enable-shared \
- `use_enable ipv6` \
+ $(use_enable ipv6) \
+ $(use_with threads) \
--infodir='${prefix}'/share/info \
--mandir='${prefix}'/share/man \
--with-libc='' \
- ${myconf} || die
- emake || die "Parallel make failed"
+ ${myconf}
}
multilib-native_src_install_internal() {
dodir /usr
- src_configure_internal
- make DESTDIR="${D}" altinstall maninstall || die
+ emake DESTDIR="${D}" altinstall maninstall || die
- mv "${D}"/usr/bin/python${PYVER}-config \
- "${D}"/usr/bin/python-config-${PYVER}
+ mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
# Fix slotted collisions
+ mv "${D}"/usr/bin/2to3 "${D}"/usr/bin/2to3-${PYVER}
mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
mv "${D}"/usr/share/man/man1/python.1 \
@@ -204,11 +192,9 @@ multilib-native_src_install_internal() {
/usr/$(get_libdir)/python${PYVER}/config/Makefile
if use build ; then
- rm -rf \
- "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
+ rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
else
- use elibc_uclibc && rm -rf \
- "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
+ use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
fi
@@ -230,71 +216,22 @@ multilib-native_src_install_internal() {
newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
+
+ # Installs empty directory.
+ rmdir "${D}"/usr/$(get_libdir)/${PN}${PV}/lib-old
}
multilib-native_pkg_postrm_internal() {
- local mansuffix=$(ecompress --suffix)
- python_makesym
- alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/python-config" \
- "python-config-[0-9].[0-9]"
-
- alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
- "python[0-9].[0-9].1${mansuffix}"
-
- python_mod_cleanup /usr/lib/python${PYVER}
- [[ "$(get_libdir)" == "lib" ]] || \
- python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
+ eselect python update --ignore 3.0
+ python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
}
multilib-native_pkg_postinst_internal() {
- local myroot
- myroot=$(echo $ROOT | sed 's:/$::')
- local mansuffix=$(ecompress --suffix)
+ eselect python update --ignore 3.0
+ python_version
- python_makesym
- alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
- alternatives_auto_makesym "/usr/bin/python-config" \
- "python-config-[0-9].[0-9]"
-
- alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
- "python[0-9].[0-9].1${mansuffix}"
-
- python_mod_optimize
python_mod_optimize -x "(site-packages|test)" \
- /usr/lib/python${PYVER}
- [[ "$(get_libdir)" == "lib" ]] || \
- python_mod_optimize -x "(site-packages|test)" \
- /usr/$(get_libdir)/python${PYVER}
-
- # workaround possible python-upgrade-breaks-portage situation
- if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
- if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
- einfo "Working around possible python-portage upgrade breakage"
- mkdir -p ${myroot}/usr/lib/portage/pym
- cp \
- ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py \
- ${myroot}/usr/lib/portage/pym
- python_mod_optimize /usr/lib/portage/pym
- fi
- fi
-
- echo
- ewarn
- ewarn "If you have just upgraded from an older version of python you will"
- ewarn "need to run:"
- ewarn
- ewarn "/usr/sbin/python-updater"
- ewarn
- ewarn "This will automatically rebuild all the python dependent modules"
- ewarn "to run with python-${PYVER}."
- ewarn
- ewarn "Your original Python is still installed and can be accessed via"
- ewarn "/usr/bin/python2.x."
- ewarn
- ebeep 5
+ /usr/$(get_libdir)/python${PYVER}
}
src_test() {
@@ -304,12 +241,13 @@ src_test() {
return
fi
- # Disabling byte compiling breaks test_import
+ # Byte compiling should be enabled here.
+ # Otherwise test_import fails.
python_enable_pyc
#skip all tests that fail during emerge but pass without emerge:
#(See bug# 67970)
- local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
+ local skip_tests="distutils global httpservers mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
# test_pow fails on alpha.
# http://bugs.python.org/issue756093
diff --git a/dev-lang/python/python-2.6.1-r1.ebuild b/dev-lang/python/python-2.6.1-r1.ebuild
index 2ee2414a0..d50b39272 100644
--- a/dev-lang/python/python-2.6.1-r1.ebuild
+++ b/dev-lang/python/python-2.6.1-r1.ebuild
@@ -9,6 +9,8 @@
EAPI=2
+MULTILIB_IN_SOURCE_BUILD="yes"
+
inherit eutils autotools flag-o-matic python versionator toolchain-funcs libtool multilib-native
# we need this so that we don't depends on python.eclass
@@ -36,7 +38,7 @@ DEPEND=">=app-admin/eselect-python-20080925
>=sys-libs/zlib-1.1.3[lib32?]
!build? (
sqlite? ( >=dev-db/sqlite-3[lib32?] )
- tk? ( >=dev-lang/tk-8.0 )
+ tk? ( >=dev-lang/tk-8.0[lib32?] )
ncurses? ( >=sys-libs/ncurses-5.2[lib32?]
readline? ( >=sys-libs/readline-4.1[lib32?] ) )
berkdb? ( >=sys-libs/db-3.1[lib32?] )