summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2012-05-01 16:07:57 +0000
committerMike Gilbert <floppym@gentoo.org>2012-05-01 16:07:57 +0000
commit8330165122b29817b89e92d13d1dc425de6ec165 (patch)
treebd659fb3623bb4521d6f1b602c6ac954f930a5c2 /dev-lang/python
parentJulian is a dev now, he can take care of this. (diff)
downloadhistorical-8330165122b29817b89e92d13d1dc425de6ec165.tar.gz
historical-8330165122b29817b89e92d13d1dc425de6ec165.tar.bz2
historical-8330165122b29817b89e92d13d1dc425de6ec165.zip
Drop several patches that upstream has not accepted.
Package-Manager: portage-2.2.0_alpha101/cvs/Linux x86_64
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/ChangeLog9
-rw-r--r--dev-lang/python/Manifest12
-rw-r--r--dev-lang/python/python-2.7.3-r2.ebuild322
-rw-r--r--dev-lang/python/python-3.2.3-r1.ebuild299
4 files changed, 637 insertions, 5 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index 6cd6f2c02409..dded4fef8f98 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-lang/python
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.585 2012/04/28 05:02:04 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.586 2012/05/01 16:07:57 floppym Exp $
+
+*python-3.2.3-r1 (01 May 2012)
+*python-2.7.3-r2 (01 May 2012)
+
+ 01 May 2012; Mike Gilbert <floppym@gentoo.org> +python-2.7.3-r2.ebuild,
+ +python-3.2.3-r1.ebuild:
+ Drop several patches that upstream has not accepted.
28 Apr 2012; Mike Gilbert <floppym@gentoo.org> python-2.6.8.ebuild,
python-2.7.3-r1.ebuild, python-3.1.5.ebuild, python-3.2.3.ebuild:
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 18e140e4b1d3..8d9836f63bff 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -27,31 +27,35 @@ DIST python-gentoo-patches-2.6.7.tar.bz2 15173 RMD160 0ffb5eb49d463f54e339897360
DIST python-gentoo-patches-2.6.8-0.tar.bz2 17608 RMD160 a819e233a25ef63a0f730dd077d126fa165c7b0e SHA1 07b8bdb07ecd88e53bcbfc7048a5b7f981ec0eb8 SHA256 277dbeb19107d3244e58aee98f130ce98d03775e7d4074ff9e1577125c999c06
DIST python-gentoo-patches-2.7.2.tar.bz2 14485 RMD160 6b66705d61b525d0089326ddb700ad3c5ad6e23e SHA1 94fc9b00cc7e7c60cce41640dc09fd2395a5c5d9 SHA256 29616ce50244c0f7c85b903dcb939d656bfd9d5e8a930d90bff6cf878f3ac5a5
DIST python-gentoo-patches-2.7.3-0.tar.bz2 15173 RMD160 a402c7f7514a195a19993beec36594cefed1e7a8 SHA1 8bc09024ed8494d4f3b7492f4854157081205131 SHA256 04dd97ace76e69e78708e7886c8d2ed03dca450996ab6367c07091a073028a13
+DIST python-gentoo-patches-2.7.3-1.tar.bz2 13858 RMD160 beeef5c66d9641f1f06153efcf386c4a6fa19beb SHA1 d1fca7b5903b415bde0f00271ee57077e3c63231 SHA256 51f6981ba02064998dfb020725c33233641b3743c4f5cf04091657313a49b8fd
DIST python-gentoo-patches-2.7.3.tar.bz2 13759 RMD160 3002476cffcba288d5bd80ab3b33795a08808c8d SHA1 5ea4025ffd9e92a08bd2ab74c12329c21a567b7b SHA256 f2f5b3c7785cbbbb5f2b404b177d56a4ec21e1a1415c5b9b153f7e1f598d0a8b
DIST python-gentoo-patches-3.1.4.tar.bz2 12930 RMD160 5ba5d20e065e6c346848d0c3ed12d65cd6b089be SHA1 b6bb595e03a78a87e3164874a9a12711bee4b9f8 SHA256 9800f3a9989c8aac4c96a7e6411baf96af0c18c041627a330681783a84cb4316
DIST python-gentoo-patches-3.1.5-0.tar.bz2 16939 RMD160 d4069224df17323055d12438d481bcfa694c70e3 SHA1 263769f0ddaed5bbd91d4e5781f48476d19cbc1e SHA256 ceacc96a370dfaa232d0a62336af37b809dd7d55adacf5f8befe17e2f72981ff
DIST python-gentoo-patches-3.2.2.tar.bz2 10834 RMD160 f1ca3bec5705b72ee488a37ea71dc7110b4495f1 SHA1 c5daaea3c52a564228c84be741da6cf039b10e19 SHA256 521c1bd7c360fb66788e7c5e191497e014bb104f2ef2272d99a40b764082d7cb
DIST python-gentoo-patches-3.2.3-0.tar.bz2 14265 RMD160 90d2d94efbbbdf2d4018f97bd25083464131f36d SHA1 f4ddb5e1f6873634d22444599736a5aff931a7a5 SHA256 2ad8829aa6594edc405afd0ed148a2b4b608d7c6f09ea90bfb90d87580a4784b
+DIST python-gentoo-patches-3.2.3-1.tar.bz2 12677 RMD160 437e369aa14a1763d7c0dd84b6661c17196a9a31 SHA1 96f5e5ae91b0743b68d387c1c3627add5a4483e2 SHA256 57a04bb081b3f12e60cd23b090545963c5f3a5eab7139da2dcb17e809695b313
EBUILD python-2.5.4-r4.ebuild 9758 RMD160 10db51f6007c6e3baea435f72d1b23f3252fc03e SHA1 0577fb9820a4dfe978c63a691b4d7e4ac414a2b6 SHA256 e346b52c7fdc35a6881d994a8ffb254be7324f67b229d4c28d8b0a0db166a887
EBUILD python-2.6.6-r2.ebuild 10643 RMD160 05d2ccb6c2190fd8670e4746813661402492d228 SHA1 e9593163f531cb8bcebf65e510671fc762fbaefa SHA256 4c662ef2238e60fe0007566b2ac19869edfef18c2b3b965eb94606ae525ac45c
EBUILD python-2.6.7-r2.ebuild 11713 RMD160 8ae1389d4475f4257684f2bfebbe07a1989123bd SHA1 d7040fbeb217975d4d109795052e10763757f9e2 SHA256 2ca0e45d147cefe8114015d0756425de97ecea8f241c1ac4881aa53bb40653c7
EBUILD python-2.6.8.ebuild 9301 RMD160 ae93ec80f7142250daf08ff5b997a4e74de36634 SHA1 942d4330107912d891825a849706c6edfae3190d SHA256 753aa34ae1da2d0a6301bdda557035949635ea481cbe00ac6f048c2418b54eb5
EBUILD python-2.7.2-r3.ebuild 12003 RMD160 8edbbcd451e1a3b60a6f36a2be88690cd302d661 SHA1 9a0fbeff4cd481b3aea2aed624fafee45984c3f3 SHA256 323c805b10ece2125f2950f3ac93e1c1f7008483fdcd43730159c5e60c36b8f9
EBUILD python-2.7.3-r1.ebuild 9621 RMD160 a86737be22cd8203af6c916f45b52a12f28c81f8 SHA1 d0edec43740f8d7fc8418e5b1b5eeae00f576274 SHA256 08068e17d050dee9e83ac24bdc53aafc6e85819ada3632f5119cd6221cf5927f
+EBUILD python-2.7.3-r2.ebuild 9621 RMD160 0b756d5c452979cbdb1cca041c9b626738d22b88 SHA1 8fb9cbe7de8fff597e2bcd115f01f21e5ae581c5 SHA256 67930f9e598e6c9598bf52046df51e97d88634b5ce1e5e35f48b06b76e3fe3d5
EBUILD python-2.7.3.ebuild 10514 RMD160 ed2180da276704719d722c4bacc243d06ff58558 SHA1 20701ddc7bb553b4c8c83b4334b58016c5c18e48 SHA256 3c8c368607d9de3d9e31e276c815e8a0ba9758d4eb203909e5ac8a917e86135f
EBUILD python-3.1.4-r3.ebuild 10502 RMD160 7394f5044a668c595cb6c1155bbaf1275765818a SHA1 84d53cdc94a04dfa72dc8ce8c3e6d39ff31a86e4 SHA256 58d1f2cab26a26b49526a3a5b02100a57e5a2811ee638e942918731379e8b42b
EBUILD python-3.1.4-r4.ebuild 10610 RMD160 02ef48bc76c9d5c30d2f35e9331076b3a8adb4a5 SHA1 be1f56063ec82fcf84310a73ef3c22aa810a5594 SHA256 3400eb206e13fbcbd43b7a2a2889e574bdd02b03beb61411c1e89ae57b66cfcf
EBUILD python-3.1.5.ebuild 8101 RMD160 b4f0d3b7296a5cf67bc5c5756226efb2299cdd59 SHA1 6deb0ab999e9f9a0d4e39b554835174e7cf11eab SHA256 4f058d78111b9cbcdfa8efaba9ec7dc340aad947a8be6e99336d1c730edce659
EBUILD python-3.2.2-r1.ebuild 10948 RMD160 e1b138294ac62bffff6208372d2509e72cc43a60 SHA1 3fb7f8ce8d394c20d0829914a1a063d9e1f78ac9 SHA256 e8e29aebb7d348b588c7269b95e2dcaab0f045be3d28f59a5471b1402f402c6d
EBUILD python-3.2.2.ebuild 10821 RMD160 2d51343b5a915c8880a0a5a846bbd86ce6805992 SHA1 4aff2efe6d752e4bee654cd96c08c17f521fe276 SHA256 584046f821e5a9abc733662fde2b0156a62767a12c9c5c9a4d42b359d823f6c1
+EBUILD python-3.2.3-r1.ebuild 8534 RMD160 7c1e8fb92d348e4002dc94106f97efccb68f2070 SHA1 558e43f24f6fb84e5e46ea80a814e9d90539ae5e SHA256 d345dd98ac681ad718fe91a3947e9710f1215883b15c09d263a0af60ffa59e07
EBUILD python-3.2.3.ebuild 8531 RMD160 5e23451250b381326013dddce269ed4ca9ca8e3e SHA1 9842b34456bbcb07914ea127decc8816cf7583c5 SHA256 a8610f94af5a10b23b949d162878467369c94a7059506650d99bf39c700da4de
-MISC ChangeLog 3888 RMD160 ca24996a4e475b4d1a8a5f1cd816c9fc33686acd SHA1 1b7d19728ca85a66d496f73e30ca007f15d21b8e SHA256 a4dc987760372f6a19c7c2bc13ca2c6a18af132d8b82c9ab3150b10c40ce70e9
+MISC ChangeLog 4108 RMD160 aa671f8ca75e673e2e7d9dc967ef1967eea230d4 SHA1 aec226059d77cd3147544c66ff84cc8dc6f3c08b SHA256 a7b8c54d0c8df6d4c83fcaf9e52446ad46ef41edf2120c09471fee4c077bf73d
MISC ChangeLog-2011 100599 RMD160 2b79c394a837d8d321a2750084da3fe0835e1d3b SHA1 3dbff45b51526c994fa3aa85f4eed7b962bdd09f SHA256 23129cb47321b2a6b1cb9323f1815d0cd11d6f30c3893908ed51575c270a0cc8
MISC metadata.xml 661 RMD160 54831d16b8807086bfabdbb3df9d33336b5d42a0 SHA1 9867c337fe9e6f4e967004fc9409763e0fedf43b SHA256 2c6c3407251f7ccd6501dee49494e539a9544f2fbae99a4373eefdf4e83e8908
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iF4EAREIAAYFAk+bedMACgkQC77qH+pIQ6TQ6AEAguFcrMaGfu7XKW6//nYg4+/u
-ZUHKIKCMB2woYmi2hjMA/AtnwwLkDal38C1eT+d4IfekswHM1dkJ5F1+TLwBzamZ
-=y/oJ
+iF4EAREIAAYFAk+gCmQACgkQC77qH+pIQ6Tt6wEAl1QW0y+N54mLxYCH/nZVGfgA
+Pwsyk5cXk2LRd0NuWo4A/17FhWBNgBdsxHSVKXcbwlIU8KpuYYeat5LVD7vPuCpp
+=7cdY
-----END PGP SIGNATURE-----
diff --git a/dev-lang/python/python-2.7.3-r2.ebuild b/dev-lang/python/python-2.7.3-r2.ebuild
new file mode 100644
index 000000000000..4cd2f27e40ec
--- /dev/null
+++ b/dev-lang/python/python-2.7.3-r2.ebuild
@@ -0,0 +1,322 @@
+# Copyright 1999-2012 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-r2.ebuild,v 1.1 2012/05/01 16:07:57 floppym Exp $
+
+EAPI="2"
+WANT_AUTOMAKE="none"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python toolchain-funcs
+
+MY_P="Python-${PV}"
+PATCHSET_REVISION="1"
+
+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}-${PATCHSET_REVISION}.tar.bz2"
+
+LICENSE="PSF-2"
+SLOT="2.7"
+PYTHON_ABI="${SLOT}"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="-berkdb build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
+
+RDEPEND="app-arch/bzip2
+ >=sys-libs/zlib-1.1.3
+ virtual/libffi
+ virtual/libintl
+ !build? (
+ berkdb? ( || (
+ sys-libs/db:4.8
+ sys-libs/db:4.7
+ sys-libs/db:4.6
+ sys-libs/db:4.5
+ sys-libs/db:4.4
+ sys-libs/db:4.3
+ sys-libs/db:4.2
+ ) )
+ gdbm? ( sys-libs/gdbm[berkdb] )
+ ncurses? (
+ >=sys-libs/ncurses-5.2
+ readline? ( >=sys-libs/readline-4.1 )
+ )
+ sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] )
+ ssl? ( dev-libs/openssl )
+ tk? (
+ >=dev-lang/tk-8.0
+ dev-tcltk/blt
+ )
+ xml? ( >=dev-libs/expat-2.1 )
+ )
+ !!<sys-apps/portage-2.1.9"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ >=sys-devel/autoconf-2.65
+ !sys-devel/gcc[libffi]"
+RDEPEND+=" !build? ( app-misc/mime-types )
+ doc? ( dev-python/python-docs:${SLOT} )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python_pkg_setup
+
+ if use berkdb; then
+ ewarn "\"bsddb\" module is out-of-date and no longer maintained inside dev-lang/python."
+ ewarn "\"bsddb\" and \"dbhash\" modules have been additionally removed in Python 3."
+ ewarn "You should use external, still maintained \"bsddb3\" module provided by dev-python/bsddb3,"
+ ewarn "which supports both Python 2 and Python 3."
+ else
+ if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
+ ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb] to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
+ ewarn "You might need to migrate your databases."
+ fi
+ fi
+}
+
+src_prepare() {
+ # Ensure that internal copies of expat, libffi and zlib are not used.
+ rm -fr Modules/expat
+ rm -fr Modules/_ctypes/libffi*
+ rm -fr Modules/zlib
+
+ local excluded_patches
+ if ! tc-is-cross-compiler; then
+ excluded_patches="*_all_crosscompile.patch"
+ fi
+
+ EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}"
+
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ Lib/distutils/command/install.py \
+ Lib/distutils/sysconfig.py \
+ Lib/site.py \
+ Lib/sysconfig.py \
+ Lib/test/test_site.py \
+ Makefile.pre.in \
+ Modules/Setup.dist \
+ Modules/getpath.c \
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+ eautoconf
+ eautoheader
+}
+
+src_configure() {
+ if use build; then
+ # Disable extraneous modules with extra dependencies.
+ export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
+ export PYTHON_DISABLE_SSL="1"
+ else
+ # dbm module can be linked against berkdb or gdbm.
+ # Defaults to gdbm when both are enabled, #204343.
+ local disable
+ use berkdb || use gdbm || disable+=" dbm"
+ use berkdb || disable+=" _bsddb"
+ use gdbm || disable+=" gdbm"
+ use ncurses || disable+=" _curses _curses_panel"
+ use readline || disable+=" readline"
+ use sqlite || disable+=" _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL="1"
+ use tk || disable+=" _tkinter"
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+ export PYTHON_DISABLE_MODULES="${disable}"
+
+ if ! use xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+ fi
+
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+ fi
+
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then
+ append-flags -fwrapv
+ fi
+
+ filter-flags -malign-double
+
+ [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
+
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flagq -O3; then
+ is-flagq -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"
+ 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"
+ fi
+
+ # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
+ tc-export CXX
+
+ # Set LDFLAGS so we link modules with -lpython2.7 correctly.
+ # Needed on FreeBSD unless Python 2.7 is already installed.
+ # Please query BSD team before removing this!
+ append-ldflags "-L."
+
+ local dbmliborder
+ if use gdbm; then
+ dbmliborder+="${dbmliborder:+:}gdbm"
+ fi
+ if use berkdb; then
+ dbmliborder+="${dbmliborder:+:}bdb"
+ fi
+
+ OPT="" econf \
+ --with-fpectl \
+ --enable-shared \
+ $(use_enable ipv6) \
+ $(use_with threads) \
+ $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
+ --infodir='${prefix}/share/info' \
+ --mandir='${prefix}/share/man' \
+ --with-dbmliborder="${dbmliborder}" \
+ --with-libc="" \
+ --enable-loadable-sqlite-extensions \
+ --with-system-expat \
+ --with-system-ffi
+}
+
+src_compile() {
+ emake EPYTHON="python${PV%%.*}" || die "emake failed"
+
+ # Work around bug 329499. See also bug 413751.
+ pax-mark m python
+}
+
+src_test() {
+ # Tests will not work when cross compiling.
+ if tc-is-cross-compiler; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ # Byte compiling should be enabled here.
+ # Otherwise test_import fails.
+ python_enable_pyc
+
+ # Skip failing tests.
+ local skipped_tests="distutils gdb"
+
+ for test in ${skipped_tests}; do
+ mv Lib/test/test_${test}.py "${T}"
+ done
+
+ # Rerun failed tests in verbose mode (regrtest -w).
+ emake test EXTRATESTOPTS="-w" < /dev/tty
+ local result="$?"
+
+ for test in ${skipped_tests}; do
+ mv "${T}/test_${test}.py" Lib/test
+ done
+
+ elog "The following tests have been skipped:"
+ for test in ${skipped_tests}; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you would like to run them, you may:"
+ elog "cd '${EPREFIX}$(python_get_libdir)/test'"
+ elog "and run the tests separately."
+
+ python_disable_pyc
+
+ if [[ "${result}" -ne 0 ]]; then
+ die "emake test failed"
+ fi
+}
+
+src_install() {
+ [[ -z "${ED}" ]] && ED="${D%/}${EPREFIX}/"
+
+ emake DESTDIR="${D}" altinstall maninstall || die "emake altinstall maninstall failed"
+ python_clean_installation_image -q
+
+ sed -e "s/\(LDFLAGS=\).*/\1/" -i "${ED}$(python_get_libdir)/config/Makefile" || die "sed failed"
+
+ mv "${ED}usr/bin/python${SLOT}-config" "${ED}usr/bin/python-config-${SLOT}"
+
+ # Fix collisions between different slots of Python.
+ mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
+ mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
+ mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
+ rm -f "${ED}usr/bin/smtpd.py"
+
+ if use build; then
+ rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test}
+ else
+ use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/"{bsddb/test,test}
+ use berkdb || rm -fr "${ED}$(python_get_libdir)/"{bsddb,dbhash.py,test/test_bsddb*}
+ use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*}
+ use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,lib-tk}
+ fi
+
+ use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing"
+ use wininst || rm -f "${ED}$(python_get_libdir)/distutils/command/"wininst-*.exe
+
+ dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r Tools || die "doins failed"
+ fi
+
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
+ sed \
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
+ -e "s:@PYDOC@:pydoc${SLOT}:" \
+ -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
+}
+
+pkg_preinst() {
+ if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then
+ python_updater_warning="1"
+ fi
+}
+
+eselect_python_update() {
+ [[ -z "${EROOT}" || (! -d "${EROOT}" && -d "${ROOT}") ]] && EROOT="${ROOT%/}${EPREFIX}/"
+
+ if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+ eselect python update
+ fi
+
+ if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
+pkg_postinst() {
+ eselect_python_update
+
+ python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
+
+ if [[ "${python_updater_warning}" == "1" ]]; then
+ ewarn "You have just upgraded from an older version of Python."
+ ewarn "You should switch active version of Python ${PV%%.*} and run"
+ ewarn "'python-updater [options]' to rebuild Python modules."
+ fi
+}
+
+pkg_postrm() {
+ eselect_python_update
+
+ python_mod_cleanup $(python_get_libdir)
+}
diff --git a/dev-lang/python/python-3.2.3-r1.ebuild b/dev-lang/python/python-3.2.3-r1.ebuild
new file mode 100644
index 000000000000..90166e0bc8a3
--- /dev/null
+++ b/dev-lang/python/python-3.2.3-r1.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2012 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-r1.ebuild,v 1.1 2012/05/01 16:07:57 floppym Exp $
+
+EAPI="3"
+WANT_AUTOMAKE="none"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python toolchain-funcs
+
+MY_P="Python-${PV}"
+PATCHSET_REVISION="1"
+
+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.xz
+ mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.bz2"
+
+LICENSE="PSF-2"
+SLOT="3.2"
+PYTHON_ABI="${SLOT}"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
+
+RDEPEND="app-arch/bzip2
+ >=sys-libs/zlib-1.1.3
+ virtual/libffi
+ virtual/libintl
+ !build? (
+ gdbm? ( sys-libs/gdbm[berkdb] )
+ ncurses? (
+ >=sys-libs/ncurses-5.2
+ readline? ( >=sys-libs/readline-4.1 )
+ )
+ sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] )
+ ssl? ( dev-libs/openssl )
+ tk? (
+ >=dev-lang/tk-8.0
+ dev-tcltk/blt
+ )
+ xml? ( >=dev-libs/expat-2.1 )
+ )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ >=sys-devel/autoconf-2.65
+ !sys-devel/gcc[libffi]"
+RDEPEND+=" !build? ( app-misc/mime-types )
+ doc? ( dev-python/python-docs:${SLOT} )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python_pkg_setup
+
+ if [[ "${PV}" =~ ^3\.2(\.[1234])?(_pre)? ]]; then
+ rm -f "${EROOT}usr/$(get_libdir)/llibpython3.so"
+ else
+ die "Deprecated code not deleted"
+ fi
+}
+
+src_prepare() {
+ # Ensure that internal copies of expat, libffi and zlib are not used.
+ rm -fr Modules/expat
+ rm -fr Modules/_ctypes/libffi*
+ rm -fr Modules/zlib
+
+ local excluded_patches
+ if ! tc-is-cross-compiler; then
+ excluded_patches="*_all_crosscompile.patch"
+ fi
+
+ EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}"
+
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ Lib/distutils/command/install.py \
+ Lib/distutils/sysconfig.py \
+ Lib/site.py \
+ Lib/sysconfig.py \
+ Lib/test/test_site.py \
+ Makefile.pre.in \
+ Modules/Setup.dist \
+ Modules/getpath.c \
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+ # Disable ABI flags.
+ sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.in || die "sed failed"
+
+ eautoconf
+ eautoheader
+}
+
+src_configure() {
+ if use build; then
+ # Disable extraneous modules with extra dependencies.
+ export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
+ export PYTHON_DISABLE_SSL="1"
+ else
+ local disable
+ use gdbm || disable+=" gdbm"
+ use ncurses || disable+=" _curses _curses_panel"
+ use readline || disable+=" readline"
+ use sqlite || disable+=" _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL="1"
+ use tk || disable+=" _tkinter"
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+ export PYTHON_DISABLE_MODULES="${disable}"
+
+ if ! use xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+ fi
+
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+ fi
+
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then
+ append-flags -fwrapv
+ fi
+
+ filter-flags -malign-double
+
+ [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
+
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flagq -O3; then
+ is-flagq -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"
+ 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"
+ fi
+
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
+ tc-export CXX
+
+ # Set LDFLAGS so we link modules with -lpython3.2 correctly.
+ # Needed on FreeBSD unless Python 3.2 is already installed.
+ # Please query BSD team before removing this!
+ append-ldflags "-L."
+
+ local dbmliborder
+ if use gdbm; then
+ dbmliborder+="${dbmliborder:+:}gdbm"
+ fi
+
+ OPT="" econf \
+ --with-fpectl \
+ --enable-shared \
+ $(use_enable ipv6) \
+ $(use_with threads) \
+ $(use_with wide-unicode) \
+ --infodir='${prefix}/share/info' \
+ --mandir='${prefix}/share/man' \
+ --with-computed-gotos \
+ --with-dbmliborder="${dbmliborder}" \
+ --with-libc="" \
+ --enable-loadable-sqlite-extensions \
+ --with-system-expat \
+ --with-system-ffi
+}
+
+src_compile() {
+ emake CPPFLAGS="" CFLAGS="" LDFLAGS="" || die "emake failed"
+
+ # Work around bug 329499. See also bug 413751.
+ pax-mark m python
+}
+
+src_test() {
+ # Tests will not work when cross compiling.
+ if tc-is-cross-compiler; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ # Byte compiling should be enabled here.
+ # Otherwise test_import fails.
+ python_enable_pyc
+
+ # Skip failing tests.
+ local skipped_tests="gdb"
+
+ for test in ${skipped_tests}; do
+ mv Lib/test/test_${test}.py "${T}"
+ done
+
+ # Rerun failed tests in verbose mode (regrtest -w).
+ emake test EXTRATESTOPTS="-w" CPPFLAGS="" CFLAGS="" LDFLAGS="" < /dev/tty
+ local result="$?"
+
+ for test in ${skipped_tests}; do
+ mv "${T}/test_${test}.py" Lib/test
+ done
+
+ elog "The following tests have been skipped:"
+ for test in ${skipped_tests}; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you would like to run them, you may:"
+ elog "cd '${EPREFIX}$(python_get_libdir)/test'"
+ elog "and run the tests separately."
+
+ python_disable_pyc
+
+ if [[ "${result}" -ne 0 ]]; then
+ die "emake test failed"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" altinstall || die "emake altinstall failed"
+ python_clean_installation_image -q
+
+ sed \
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \
+ -i "${ED}$(python_get_libdir)/config-${SLOT}/Makefile" || die "sed failed"
+
+ mv "${ED}usr/bin/python${SLOT}-config" "${ED}usr/bin/python-config-${SLOT}"
+
+ # Fix collisions between different slots of Python.
+ rm -f "${ED}usr/$(get_libdir)/libpython3.so"
+
+ if use build; then
+ rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,sqlite3,test,tkinter}
+ else
+ use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/test"
+ use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*}
+ use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,tkinter,test/test_tk*}
+ fi
+
+ use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing"
+ use wininst || rm -f "${ED}$(python_get_libdir)/distutils/command/"wininst-*.exe
+
+ dodoc 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"
+ fi
+
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
+ sed \
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
+ -e "s:@PYDOC@:pydoc${SLOT}:" \
+ -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
+}
+
+pkg_preinst() {
+ if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then
+ python_updater_warning="1"
+ fi
+}
+
+eselect_python_update() {
+ if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+ eselect python update
+ fi
+
+ if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
+pkg_postinst() {
+ eselect_python_update
+
+ python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
+
+ if [[ "${python_updater_warning}" == "1" ]]; then
+ ewarn "You have just upgraded from an older version of Python."
+ ewarn "You should switch active version of Python ${PV%%.*} and run"
+ ewarn "'python-updater [options]' to rebuild Python modules."
+ fi
+}
+
+pkg_postrm() {
+ eselect_python_update
+
+ python_mod_cleanup $(python_get_libdir)
+}