summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-lang/python/ChangeLog14
-rw-r--r--dev-lang/python/Manifest21
-rw-r--r--dev-lang/python/files/linux2.patch24
-rw-r--r--dev-lang/python/files/pydoc.conf9
-rwxr-xr-xdev-lang/python/files/pydoc.init16
-rw-r--r--dev-lang/python/files/python-2.4.4-test-cross.patch19
-rw-r--r--dev-lang/python/files/python-2.5-cross-printf.patch34
-rw-r--r--dev-lang/python/files/python-2.6-chflags-cross.patch59
-rw-r--r--dev-lang/python/files/python-2.6-test-cross.patch19
-rw-r--r--dev-lang/python/files/python-2.7.1-BJA-cross.diff29
-rw-r--r--dev-lang/python/files/python-2.7.3-BJA-cross.diff17
-rw-r--r--dev-lang/python/files/python-3.2-soname_typo.patch51
-rw-r--r--dev-lang/python/files/python-config-2.4-r158
-rw-r--r--dev-lang/python/python-2.7.1-r1.ebuild365
-rw-r--r--dev-lang/python/python-2.7.3-r3.ebuild386
15 files changed, 436 insertions, 685 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index b1c6a1e4..0b1affa2 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -2,6 +2,19 @@
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*python-2.7.3-r3 (30 May 2013)
+
+ 30 May 2013; Bertrand Jacquin <beber@meleeweb.net>
+ +files/python-2.7.3-BJA-cross.diff, +python-2.7.3-r3.ebuild,
+ -files/linux2.patch, -files/python-2.4.4-test-cross.patch,
+ -files/python-2.5-cross-printf.patch, -files/python-2.6-chflags-cross.patch,
+ -files/python-2.6-test-cross.patch, -files/python-2.7.1-BJA-cross.diff,
+ -files/python-3.2-soname_typo.patch, -files/python-config-2.4-r1,
+ -python-2.7.1-r1.ebuild, files/pydoc.conf, files/pydoc.init:
+ dev-lang/python: Refresh SLOT 2.7 with upstream, add a nicer patch Reported
+ as https://bugs.gentoo.org/show_bug.cgi?id=471812 Clean FILESDIR, by deleting
+ unused files/patchs
+
28 May 2013; Bertrand Jacquin <beber@meleeweb.net> +metadata.xml:
Add missing metadata.xml
@@ -21,4 +34,3 @@
+python-3.1.3-r1.ebuild:
add outdated patch to be able to cross compile python
2.7 and 3.1
-
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 85074ca5..fd2b0b05 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,19 +1,12 @@
-AUX linux2.patch 606 SHA256 a178120a3022ecb14044c82eff7e828f6d060b6885acacd4a4d8569fde372fd7 WHIRLPOOL 82e2d6622e76fa487725265fdb654be5ed68fea8d069563d1beede396b18e2a017ff0c435cab92d4a7a9e56b1e4c781133d8bfb2ffc9ff830dd89dfeb7c44357
-AUX pydoc.conf 330 SHA256 a45ebba2de5f2b0e963db4101507203d095c5ff667ae5002c4897a9c87786fa1 WHIRLPOOL d957424a7d56121e9216178f3a6fa9a8b25fcf315accd964ede7ea365b8f5876e379f6728588983db478091027488b0659fc9b80e4553c4e8333b25dd1211867
-AUX pydoc.init 679 SHA256 8f6c1753a28462fa61d22a927debed7ec3994b3617d728932357e739ede6516f WHIRLPOOL e5c471022714771b428d0ce00f1a15dce6d9df2f71e343e1366c15887f0dc37ac3b6a658380b2806fc8d4d4cf1406cf64edf5205ab34db71e62f2941874e5fba
-AUX python-2.4.4-test-cross.patch 977 SHA256 ff2a131776d560d188ec5069e17fea3eb09c26fdd02124ae5ff34d791c9fd9f6 WHIRLPOOL 25780561d85ca2ec81084f531d2441464fe42585e70604265ecdae42606fa514a14e395b4b886fd3b94251eac48ce73cb43504053b0ea4974e4aa74ae7015a25
-AUX python-2.5-cross-printf.patch 903 SHA256 1e91e5123d74d89aa8fc9dc60d98516b785f851e43da9b634ae535130e24e780 WHIRLPOOL 083d4e5fb4b3fd15ddf88ebc516407d634d891d55049bde086b2b7351ce565ce6563b5e90b8f2a70f37b52159bf9fe3e870c94e44dc2003ea75953760293457e
-AUX python-2.6-chflags-cross.patch 1716 SHA256 7c36689db47720052069725036983c2fb6959f425e3777aae55976b2788d463f WHIRLPOOL ab38e28ee9141b213b6ac77a4e421ac5bd95fbe4a644d1b49627a5953ac23cbfd1b99efbdaba12d5eb9a5dc4dc6bd26d41c0f063c350a312f287b6b850eae3bb
-AUX python-2.6-test-cross.patch 914 SHA256 8264f6ffe5aedcce67bea00b0346e5416a5486da2229bf82fe748d87ec65c4de WHIRLPOOL 273b52e9f1a46d2a6105d3ea28b051d3e717ef08cc6e5b09f7ae84333ffd990e985c27a1073acaf4f7b6fc9d3f5b08a6faf84c43c19708cf182a0caca7a71698
-AUX python-2.7.1-BJA-cross.diff 1355 SHA256 69bd7fb750ca6b4b7b9f24795ef7572507d91e859eab66163ef8cc1a523aa1c1 WHIRLPOOL 55e005095e068044320ecc4856ea92fc0d21cbfd8b404caae4891d893bcda3e0d4e3c874ed228295010e6e0b1df13ea7f7b9f8776e664310e3decc6ce9504a8d
+AUX pydoc.conf 279 SHA256 6437e85d16d34efaf2665b3cabb0707392e6dee3df04989d3fcac63fd22997e8 WHIRLPOOL 1ba44797765939d7c0bcbecb08cb6201eeff9b134d4d3caef9339729dcad9f258e20b16db5f369f49b378df3c91e530115dbce5ce3595d71cd325a48793ac814
+AUX pydoc.init 741 SHA256 c2611330da516682d9a489e21b426550d6896d57d1b15eaafde3e8c518931460 WHIRLPOOL b9fe7bafcd984de6b80d58961fb31704ea40235a8ac6a896f2c9dbc015db11b0c711320e6687ac88e6621a8a217d5b8468b4e17f32ae25592b0708d894f0fc44
+AUX python-2.7.3-BJA-cross.diff 791 SHA256 d062e76017795ea11a560d37465dcde8be26ae79e430037b0fb3b33376562930 WHIRLPOOL a66f2eb9865d73d777ce19ce8ea7df333d1842b9e893087962c7f021ff89e0a66645feec7ce44c03fe7c8e0a7042cfd6be34a97c29672117eabae4212a6cab66
AUX python-3.1.3-BJA-cross.diff 931 SHA256 a55958807d2d226921e299bba899cc566186e66cf2d1d6a64bdf701c0898ece7 WHIRLPOOL b4857c0988592ad6bde7d5ea834b6a20ef9982a0c3f96e45e3e74f95c23951af4312825b9aa4705d47bc9d3130699e59e638ff6f2bc1ef46e06840b017461609
-AUX python-3.2-soname_typo.patch 1724 SHA256 776366c3cc67c7d66883846acee8cc1b795c25f6e35e927793be8c54162491e2 WHIRLPOOL 63ee4f4c6ca16d33787044e6e73abeebf2cdd4ac23819aa75a9997e82c5d2920320fadc228c499d7c5e7fd85c7b091c7094bbda44bf6417026aa9c4b9bfbba67
-AUX python-config-2.4-r1 1624 SHA256 923a9e896f99cca5aa4ccbb02f981c6e26a2b1aa42326de2359d3c884bde2a9f WHIRLPOOL f2fe759b05ac0eb3b8dd196b0c68b8b8e0145ab79659eb4a45adee1bf7ae7260f457ae6192b9792990babd59cb98cceec05a8d93a50a3203517fe49ec30f5e0e
-DIST Python-2.7.1.tar.bz2 11722546 SHA256 80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292
+DIST Python-2.7.3.tar.bz2 11793433 SHA256 726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c WHIRLPOOL c980f465066ef0881d8b1141c6d8d4c54991c765fc258ddcd37ed2ec483f0686b8cc4cd076c56e0c8fa8891852905bed74d70b3f5071210cef7a9713542ab1a8
DIST Python-3.1.3.tar.bz2 9875464 SHA256 77f6f41a51be4ca85d83670405c8281dd1237bb00d8be8a7560cb3ccdf5558cb
-DIST python-gentoo-patches-2.7.1-r1.tar.bz2 13384 SHA256 cc9b4239a3276c6fd447e3bb3ab8a2f94fbc49e08bb5b20ba5f05b4becda2bf8
+DIST python-gentoo-patches-2.7.3-1.tar.bz2 13858 SHA256 51f6981ba02064998dfb020725c33233641b3743c4f5cf04091657313a49b8fd WHIRLPOOL b8c4e83354f913eb50b9c91ad558a4cc042a395fd4bd7227cc2e5e6ede8962eb699d44ec3b3a05b47ea658fce2e90b2d0e035282d9737d602f313bad1a7d314a
DIST python-gentoo-patches-3.1.3-r1.tar.bz2 13730 SHA256 f23056436b298ed0ff9823b52902aaaa63eae0c4585a4a19e47571685127631e
-EBUILD python-2.7.1-r1.ebuild 11162 SHA256 99e005f7edc447aaa9278fda4079a66ce0f04d4e1eb824648b234ac7916a160c WHIRLPOOL f074e35df6f3d3632a79c3d6a9a1ba98301ba865778596e36f25c1eeda961ff94fdbef9955fc606f0681aab27e4595a826ee23990b12d19b01c66d0c50058c6a
+EBUILD python-2.7.3-r3.ebuild 11665 SHA256 976876f4263f8b09d7419a2731409fae60acc986a9da37f5af555648c4d74dbf WHIRLPOOL 0a7bd167e94223b2ba5523139515d87501aa57f84ac1e8afca7f134999cdd98ed0a842bffd716415acbf3f5ade9ffae9029b4c43440de75f01a92b606f1cd0d6
EBUILD python-3.1.3-r1.ebuild 9839 SHA256 2b0e1f6f5698362dc9fcf467696f0f7571edd3c0baaa2b0f6efaf180d01ee441 WHIRLPOOL 17a919a49548a4b4940c880e1e6900b9be83ae49fde8b29dab348f453cd74cfd1c998dd31d4e16f1bf8010540a632779222398b662f048b2496383a3559abf00
-MISC ChangeLog 955 SHA256 2669dca34db226dcf994d420837d79cd48f1b13ffa9965cf9b8e88acbdb16faa WHIRLPOOL 77dd0972572335827e7d2540a6dcb254acda74a403fccbf99bff986f48d2d9bbcb6a9217d3002a5bc87b26c9ef330bfa844d4b1d2b68b32a7de55b1116b33dcd
+MISC ChangeLog 1630 SHA256 a1320868208cce8601b0a4fdc80b97333b9f5cc236029dd794a1c763bf8115eb WHIRLPOOL c280615e95e19d522cd3df2c36474ac2bfda623712edf83f5cda60f7fa3e716e790aebf8c0bfdf00e5f7ba406aaa4a122d3d929c7f9bf5426e66a71508970deb
MISC metadata.xml 646 SHA256 1a7d28445660381ad5989180cfe129cf6ae58c080cf489c504d96eed437d57a7 WHIRLPOOL 51e5c8521020b00a16a2a8cba2dea477ff1d08594e047a09e8865d9697c1660fe8310f2639867960022e2e72757998cc30864d8d8f1e420012f4a13159aff9e9
diff --git a/dev-lang/python/files/linux2.patch b/dev-lang/python/files/linux2.patch
deleted file mode 100644
index c3414238..00000000
--- a/dev-lang/python/files/linux2.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-http://hg.python.org/cpython/rev/c816479f6aaf/
-diff --git a/configure b/configure
---- a/configure
-+++ b/configure
-@@ -2995,6 +2995,7 @@ then
- MACHDEP="$ac_md_system$ac_md_release"
-
- case $MACHDEP in
-+ linux*) MACHDEP="linux2";;
- cygwin*) MACHDEP="cygwin";;
- darwin*) MACHDEP="darwin";;
- atheos*) MACHDEP="atheos";;
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -293,6 +293,7 @@ then
- MACHDEP="$ac_md_system$ac_md_release"
-
- case $MACHDEP in
-+ linux*) MACHDEP="linux2";;
- cygwin*) MACHDEP="cygwin";;
- darwin*) MACHDEP="darwin";;
- atheos*) MACHDEP="atheos";;
-
diff --git a/dev-lang/python/files/pydoc.conf b/dev-lang/python/files/pydoc.conf
index 4a98fd40..20e3628b 100644
--- a/dev-lang/python/files/pydoc.conf
+++ b/dev-lang/python/files/pydoc.conf
@@ -1,8 +1,7 @@
# /etc/init.d/pydoc.conf
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.conf,v 1.2 2008/06/30 15:10:28 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.conf,v 1.3 2011/10/27 13:56:55 neurogeek Exp $
-# This file contains the configuration information for pydoc's internal
-# webserver. The variables should be rather self explanatory :-)
+# This file contains the configuration for pydoc's internal webserver.
-# Default port for Python's pydoc server
-PYDOC_PORT=7464
+# Default port for Python's pydoc server.
+@PYDOC_PORT_VARIABLE@="7464"
diff --git a/dev-lang/python/files/pydoc.init b/dev-lang/python/files/pydoc.init
index f67371d8..fee16531 100755
--- a/dev-lang/python/files/pydoc.init
+++ b/dev-lang/python/files/pydoc.init
@@ -1,27 +1,29 @@
#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Technologies, Inc.
+# Copyright 1999-2013 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public Licence v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.init,v 1.3 2011/05/17 15:14:43 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.init,v 1.4 2011/10/27 13:56:55 neurogeek Exp $
depend() {
need net
}
start() {
- if [ -z "${PYDOC_PORT}" ]; then
+ local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}"
+
+ if [ -z "${pydoc_port}" ]; then
eerror "Port not set"
return 1
fi
- ebegin "Starting pydoc server on port ${PYDOC_PORT}"
+ ebegin "Starting pydoc server on port ${pydoc_port}"
start-stop-daemon --start --background --make-pidfile \
- --pidfile /var/run/pydoc.pid \
- --startas /usr/bin/@PYDOC@ -- -p "${PYDOC_PORT}"
+ --pidfile /var/run/@PYDOC@.pid \
+ --exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}"
eend $?
}
stop() {
ebegin "Stopping pydoc server"
- start-stop-daemon --stop --quiet --pidfile /var/run/pydoc.pid
+ start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid
eend $?
}
diff --git a/dev-lang/python/files/python-2.4.4-test-cross.patch b/dev-lang/python/files/python-2.4.4-test-cross.patch
deleted file mode 100644
index d32cb3ff..00000000
--- a/dev-lang/python/files/python-2.4.4-test-cross.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- Python-2.4.4/Lib/test/test_multibytecodec.py.orig 2007-09-10 14:52:34.424592960 -0400
-+++ Python-2.4.4/Lib/test/test_multibytecodec.py 2007-09-10 14:53:30.646201491 -0400
-@@ -81,11 +81,11 @@ class Test_ISO2022(unittest.TestCase):
- uni = u':hu4:unit\xe9 de famille'
- self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
-
-- def test_iso2022_jp_g0(self):
-- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
-- for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
-- e = u'\u3406'.encode(encoding)
-- self.failIf(filter(lambda x: x >= '\x80', e))
-+# def test_iso2022_jp_g0(self):
-+# self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
-+# for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
-+# e = u'\u3406'.encode(encoding)
-+# self.failIf(filter(lambda x: x >= '\x80', e))
-
- def test_bug1572832(self):
- if sys.maxunicode >= 0x10000:
diff --git a/dev-lang/python/files/python-2.5-cross-printf.patch b/dev-lang/python/files/python-2.5-cross-printf.patch
deleted file mode 100644
index 9a3eaf71..00000000
--- a/dev-lang/python/files/python-2.5-cross-printf.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-http://bugs.gentoo.org/239110
-
-assume %zd is supported when cross-compiling. any target we care about
-supports it, so ...
-
---- configure.in
-+++ configure.in
-@@ -3417,7 +3417,7 @@
-
-
-
--AC_MSG_CHECKING(for %zd printf() format support)
-+AC_CACHE_CHECK([for %zd printf() format support], [py_cv_has_zd_printf], [dnl
- AC_TRY_RUN([#include <stdio.h>
- #include <stddef.h>
- #include <string.h>
-@@ -3451,10 +3451,13 @@
- return 1;
-
- return 0;
--}],
--[AC_MSG_RESULT(yes)
-- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
-- AC_MSG_RESULT(no))
-+}], [py_cv_has_zd_printf="yes"],
-+ [py_cv_has_zd_printf="no"],
-+ [py_cv_has_zd_printf="cross -- assuming yes"]
-+)])
-+if test "$py_cv_has_zd_printf" != "no" ; then
-+ AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])
-+fi
-
- AC_CHECK_TYPE(socklen_t,,
- AC_DEFINE(socklen_t,int,
diff --git a/dev-lang/python/files/python-2.6-chflags-cross.patch b/dev-lang/python/files/python-2.6-chflags-cross.patch
deleted file mode 100644
index 9c4b6d2a..00000000
--- a/dev-lang/python/files/python-2.6-chflags-cross.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-if we're cross-compiling, fall back to a link-only test rather than trying
-to run a program for the chflags functions
-
---- python-2.6/configure.in
-+++ python-2.6/configure.in
-@@ -2565,7 +2565,7 @@
-
- # On Tru64, chflags seems to be present, but calling it will
- # exit Python
--AC_MSG_CHECKING(for chflags)
-+AC_CACHE_CHECK([for chflags], [py_cv_has_chflags], [dnl
- AC_TRY_RUN([
- #include <sys/stat.h>
- #include <unistd.h>
-@@ -2575,12 +2575,18 @@
- return 1;
- return 0;
- }
--],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
-- AC_MSG_RESULT(yes),
-- AC_MSG_RESULT(no)
--)
-+], [py_cv_has_chflags="yes"],
-+ [py_cv_has_chflags="no"],
-+ [py_cv_has_chflags="cross"])
-+])
-+if test "$py_cv_has_chflags" = "cross" ; then
-+ AC_CHECK_FUNC([chflags], [py_cv_has_chflags="yes"], [py_cv_has_chflags="no"])
-+fi
-+if test "$py_cv_has_chflags" = "yes" ; then
-+ AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
-+fi
-
--AC_MSG_CHECKING(for lchflags)
-+AC_CACHE_CHECK([for lchflags], [py_cv_has_lchflags], [dnl
- AC_TRY_RUN([
- #include <sys/stat.h>
- #include <unistd.h>
-@@ -2590,10 +2596,16 @@
- return 1;
- return 0;
- }
--],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
-- AC_MSG_RESULT(yes),
-- AC_MSG_RESULT(no)
--)
-+], [py_cv_has_lchflags="yes"],
-+ [py_cv_has_lchflags="no"],
-+ [py_cv_has_lchflags="cross"])
-+])
-+if test "$py_cv_has_lchflags" = "cross" ; then
-+ AC_CHECK_FUNC([lchflags], [py_cv_has_lchflags="yes"], [py_cv_has_lchflags="no"])
-+fi
-+if test "$py_cv_has_lchflags" = "yes" ; then
-+ AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
-+fi
-
- dnl Check if system zlib has *Copy() functions
- dnl
diff --git a/dev-lang/python/files/python-2.6-test-cross.patch b/dev-lang/python/files/python-2.6-test-cross.patch
deleted file mode 100644
index 0ff41939..00000000
--- a/dev-lang/python/files/python-2.6-test-cross.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- Lib/test/test_multibytecodec.py.orig 2008-04-19 18:48:59.000000000 +0300
-+++ Lib/test/test_multibytecodec.py 2008-04-19 18:49:44.000000000 +0300
-@@ -212,11 +212,11 @@
- uni = u':hu4:unit\xe9 de famille'
- self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
-
-- def test_iso2022_jp_g0(self):
-- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
-- for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
-- e = u'\u3406'.encode(encoding)
-- self.failIf(filter(lambda x: x >= '\x80', e))
-+ #def test_iso2022_jp_g0(self):
-+ # self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
-+ # for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
-+ # e = u'\u3406'.encode(encoding)
-+ # self.failIf(filter(lambda x: x >= '\x80', e))
-
- def test_bug1572832(self):
- if sys.maxunicode >= 0x10000:
diff --git a/dev-lang/python/files/python-2.7.1-BJA-cross.diff b/dev-lang/python/files/python-2.7.1-BJA-cross.diff
deleted file mode 100644
index 9d6c1cf6..00000000
--- a/dev-lang/python/files/python-2.7.1-BJA-cross.diff
+++ /dev/null
@@ -1,29 +0,0 @@
---- Python-2.7.1/Makefile.pre.in.ori 2011-10-02 23:12:02.563007250 +0200
-+++ Python-2.7.1/Makefile.pre.in 2011-10-02 23:12:16.435076152 +0200
-@@ -934,26 +934,6 @@
- done; \
- done
- $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
-- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- ./$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST) -f \
-- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
-- $(DESTDIR)$(LIBDEST)
-- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- ./$(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST) -f \
-- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
-- $(DESTDIR)$(LIBDEST)
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- ./$(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST)/site-packages -f \
-- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- ./$(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-- -d $(LIBDEST)/site-packages -f \
-- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
-- ./$(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
-
- # Create the PLATDIR source directory, if one wasn't distributed..
- $(srcdir)/Lib/$(PLATDIR):
diff --git a/dev-lang/python/files/python-2.7.3-BJA-cross.diff b/dev-lang/python/files/python-2.7.3-BJA-cross.diff
new file mode 100644
index 00000000..33636fde
--- /dev/null
+++ b/dev-lang/python/files/python-2.7.3-BJA-cross.diff
@@ -0,0 +1,17 @@
+--- Python-2.7.3/Makefile.pre.in.ori 2013-05-30 16:46:58.618945844 +0200
++++ Python-2.7.3/Makefile.pre.in 2013-05-30 16:47:27.115558791 +0200
+@@ -952,12 +952,12 @@
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ ./$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ ./$(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
diff --git a/dev-lang/python/files/python-3.2-soname_typo.patch b/dev-lang/python/files/python-3.2-soname_typo.patch
deleted file mode 100644
index 357274c4..00000000
--- a/dev-lang/python/files/python-3.2-soname_typo.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-# HG changeset patch
-# User Martin v. Löwis <martin@v.loewis.de>
-# Date 1304919465 -7200
-# Node ID 749686064642118c5ccc8ad28105472321931353
-# Parent 4f3f67a595fb05f04d89ed906df911b743e47463
-Use --as-needed when linking libpython3.so. Closes #11347.
-Patch by Arfrever Frehtes Taifersar Arahesis.
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -76,6 +76,7 @@ PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIG
- # environment variables
- PY_CPPFLAGS= -I. -IInclude -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
- PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)
-+NO_AS_NEEDED= @NO_AS_NEEDED@
- LDLAST= @LDLAST@
- SGI_ABI= @SGI_ABI@
- CCSHARED= @CCSHARED@
-@@ -459,7 +460,7 @@ libpython$(LDVERSION).so: $(LIBRARY_OBJS
- fi
-
- libpython3.so: libpython$(LDVERSION).so
-- $(BLDSHARED) -o $@ -Wl,-hl$@ $^
-+ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
-
- libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
- $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -525,6 +525,18 @@ then
- fi
-
-
-+AC_MSG_CHECKING([for -Wl,--no-as-needed])
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
-+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
-+ [NO_AS_NEEDED="-Wl,--no-as-needed"
-+ AC_MSG_RESULT([yes])],
-+ [NO_AS_NEEDED=""
-+ AC_MSG_RESULT([no])])
-+LDFLAGS="$save_LDFLAGS"
-+AC_SUBST(NO_AS_NEEDED)
-+
-+
- # checks for UNIX variants that set C preprocessor variables
- AC_USE_SYSTEM_EXTENSIONS
-
-
diff --git a/dev-lang/python/files/python-config-2.4-r1 b/dev-lang/python/files/python-config-2.4-r1
deleted file mode 100644
index af451131..00000000
--- a/dev-lang/python/files/python-config-2.4-r1
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /usr/bin/python2.4
-
-import sys
-import os
-import getopt
-from distutils import sysconfig
-
-valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
- 'ldflags', 'help']
-
-def exit_with_usage(code=1):
- print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
- '|'.join('--'+opt for opt in valid_opts))
- sys.exit(code)
-
-try:
- opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
-except getopt.error:
- exit_with_usage()
-
-if not opts:
- #exit_with_usage()
- #be compatible with our old python-config-2.4
- import string
- print "-lpython2.4 -lm -L/usr/lib/python2.4/config",string.join(string.split(sysconfig.get_config_var("MODLIBS")))
- sys.exit(0)
-
-opt = opts[0][0]
-
-pyver = sysconfig.get_config_var('VERSION')
-getvar = sysconfig.get_config_var
-
-if opt == '--help':
- exit_with_usage(0)
-
-elif opt == '--prefix':
- print sysconfig.PREFIX
-
-elif opt == '--exec-prefix':
- print sysconfig.EXEC_PREFIX
-
-elif opt in ('--includes', '--cflags'):
- flags = ['-I' + sysconfig.get_python_inc(),
- '-I' + sysconfig.get_python_inc(plat_specific=True)]
- if opt == '--cflags':
- flags.extend(getvar('CFLAGS').split())
- print ' '.join(flags)
-
-elif opt in ('--libs', '--ldflags'):
- libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
- libs.append('-lpython'+pyver)
- # add the prefix/lib/pythonX.Y/config dir, but only if there is no
- # shared library in prefix/lib/.
- if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
- libs.insert(0, '-L' + getvar('LIBPL'))
- print ' '.join(libs)
-
-
diff --git a/dev-lang/python/python-2.7.1-r1.ebuild b/dev-lang/python/python-2.7.1-r1.ebuild
deleted file mode 100644
index c2d99e5d..00000000
--- a/dev-lang/python/python-2.7.1-r1.ebuild
+++ /dev/null
@@ -1,365 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.1-r1.ebuild,v 1.12 2011/05/17 15:14:43 arfrever Exp $
-
-EAPI="2"
-WANT_AUTOMAKE="none"
-
-inherit autotools eutils flag-o-matic multilib python toolchain-funcs
-
-if [[ "${PV}" == *_pre* ]]; then
- inherit subversion
-
- ESVN_PROJECT="python"
- ESVN_REPO_URI="http://svn.python.org/projects/python/branches/release27-maint"
- ESVN_REVISION=""
-else
- MY_PV="${PV%_p*}"
- MY_P="Python-${MY_PV}"
-fi
-
-PATCHSET_REVISION="1"
-
-DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
-HOMEPAGE="http://www.python.org/"
-if [[ "${PV}" == *_pre* ]]; then
- SRC_URI=""
-else
- SRC_URI="http://www.python.org/ftp/python/${MY_PV}/${MY_P}.tar.bz2
- mirror://gentoo/python-gentoo-patches-${MY_PV}$([[ "${PATCHSET_REVISION}" != "0" ]] && echo "-r${PATCHSET_REVISION}").tar.bz2"
-fi
-
-LICENSE="PSF-2.2"
-SLOT="2.7"
-PYTHON_ABI="${SLOT}"
-KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~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-admin/eselect-python-20091230
- >=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 )
- 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 )
- xml? ( >=dev-libs/expat-2 )
- )
- !!<sys-apps/portage-2.1.9"
-DEPEND="${RDEPEND}
- $([[ "${PV}" == *_pre* ]] && echo "=${CATEGORY}/${PN}-${PV%%.*}*")
- virtual/pkgconfig
- $([[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+_pre ]] && echo "doc? ( dev-python/sphinx )")
- !sys-devel/gcc[libffi]"
-RDEPEND+=" !build? ( app-misc/mime-types )
- $([[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+_pre ]] || echo "doc? ( dev-python/python-docs:${SLOT} )")"
-PDEPEND="app-admin/python-updater"
-
-if [[ "${PV}" != *_pre* ]]; then
- S="${WORKDIR}/${MY_P}"
-fi
-
-pkg_setup() {
- python_pkg_setup
-
- if use berkdb; then
- ewarn "\"bsddb\" module is out-of-date and no longer maintained inside dev-lang/python. It has"
- ewarn "been additionally removed in Python 3. You should use external, still maintained \"bsddb3\""
- ewarn "module provided by dev-python/bsddb3 which supports both Python 2 and Python 3."
- 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
-
- if [[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+_pre ]]; then
- if grep -Eq '#define PY_RELEASE_LEVEL[[:space:]]+PY_RELEASE_LEVEL_FINAL' Include/patchlevel.h; then
- # Update micro version, release level and version string.
- local micro_version="${PV%_pre*}"
- micro_version="${micro_version##*.}"
- local version_string="${PV%.*}.$((${micro_version} - 1))+"
- sed \
- -e "s/\(#define PY_MICRO_VERSION[[:space:]]\+\)[^[:space:]]\+/\1${micro_version}/" \
- -e "s/\(#define PY_RELEASE_LEVEL[[:space:]]\+\)[^[:space:]]\+/\1PY_RELEASE_LEVEL_ALPHA/" \
- -e "s/\(#define PY_VERSION[[:space:]]\+\"\)[^\"]\+\(\"\)/\1${version_string}\2/" \
- -i Include/patchlevel.h || die "sed failed"
- fi
- fi
-
- local excluded_patches
- if ! tc-is-cross-compiler; then
- excluded_patches="*_all_crosscompile.patch"
- fi
-
- local patchset_dir
- if [[ "${PV}" == *_pre* ]]; then
- patchset_dir="${FILESDIR}/${SLOT}-${PATCHSET_REVISION}"
- else
- patchset_dir="${WORKDIR}/${MY_PV}"
- fi
-
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" epatch "${patchset_dir}"
-
- epatch "${FILESDIR}/${P}-BJA-cross.diff"
-
- 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@@"
-
- if ! use wininst; then
- # Remove Microsoft Windows executables.
- rm Lib/distutils/command/wininst-*.exe
- fi
-
- # Support versions of Autoconf other than 2.65.
- sed -e "/version_required(2\.65)/d" -i configure.in || die "sed failed"
-
- if [[ "${PV}" == *_pre* ]]; then
- sed -e "s/\(-DSVNVERSION=\).*\( -o\)/\1\\\\\"${ESVN_REVISION}\\\\\"\2/" -i Makefile.pre.in || die "sed failed"
- fi
-
- eautoreconf
-}
-
-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"
-}
-
-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 skip_tests="distutils gdb minidom pyexpat sax"
-
- for test in ${skip_tests}; do
- mv "${S}/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 ${skip_tests}; do
- mv "${T}/test_${test}.py" "${S}/Lib/test/test_${test}.py"
- done
-
- elog "The following tests have been skipped:"
- for test in ${skip_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,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,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"
-
- dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
-
- if use examples; then
- insinto /usr/share/doc/${PF}/examples
- doins -r "${S}/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@:pydoc${SLOT}:" -i "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
-
- # Do not install empty directory.
- rmdir "${ED}$(python_get_libdir)/lib-old"
-}
-
-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
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of Python."
- ewarn "You should run 'python-updater \${options}' to rebuild Python modules."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ebeep 12
- fi
-}
-
-pkg_postrm() {
- eselect_python_update
-
- python_mod_cleanup $(python_get_libdir)
-}
diff --git a/dev-lang/python/python-2.7.3-r3.ebuild b/dev-lang/python/python-2.7.3-r3.ebuild
new file mode 100644
index 00000000..4f6ecb28
--- /dev/null
+++ b/dev-lang/python/python-2.7.3-r3.ebuild
@@ -0,0 +1,386 @@
+# 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.22 2013/05/25 22:32:46 floppym Exp $
+
+EAPI="2"
+WANT_AUTOMAKE="none"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
+
+MY_P="Python-${PV}"
+PATCHSET_REVISION="1"
+
+DESCRIPTION="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"
+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 hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+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}
+ virtual/pkgconfig
+ >=sys-devel/autoconf-2.65
+ !sys-devel/gcc[libffi]"
+RDEPEND+=" !build? ( app-misc/mime-types )
+ doc? ( dev-python/python-docs:${SLOT} )"
+PDEPEND="app-admin/eselect-python
+ app-admin/python-updater"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ if use berkdb; then
+ ewarn "'bsddb' module is out-of-date and no longer maintained inside"
+ ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
+ ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
+ ewarn "is provided by dev-python/bsddb3."
+ else
+ if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
+ ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
+ ewarn "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}"
+
+ epatch "${FILESDIR}/${P}-BJA-cross.diff"
+
+ 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
+
+ # Run the configure scripts in parallel.
+ multijob_init
+
+ mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
+
+ if tc-is-cross-compiler; then
+ (
+ 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
+ export ac_cv_have_long_long_format=yes
+ fi
+
+ # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
+ tc-export CXX
+ # The configure script fails to use pkg-config correctly.
+ # http://bugs.python.org/issue15506
+ export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+ # 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
+
+ cd "${WORKDIR}"/${CHOST}
+ ECONF_SOURCE=${S} 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
+
+ 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.
+ 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
+
+ cd "${WORKDIR}"/${CHOST}
+
+ # Skip failing tests.
+ local skipped_tests="distutils gdb"
+
+ for test in ${skipped_tests}; do
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
+ done
+
+ # Rerun failed tests in verbose mode (regrtest -w).
+ PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-w" < /dev/tty
+ local result="$?"
+
+ for test in ${skipped_tests}; do
+ mv "${T}/test_${test}.py" "${S}"/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}/usr/$(get_libdir)/python${SLOT}/test'"
+ elog "and run the tests separately."
+
+ if [[ "${result}" -ne 0 ]]; then
+ die "emake test failed"
+ fi
+}
+
+src_install() {
+ [[ -z "${ED}" ]] && ED="${D%/}${EPREFIX}/"
+
+ 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"
+
+ # Backwards compat with Gentoo divergence.
+ dosym python${SLOT}-config /usr/bin/python-config-${SLOT} || die
+
+ # 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}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test}
+ else
+ use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
+ use berkdb || rm -fr "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*}
+ use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
+ use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk}
+ fi
+
+ use threads || rm -fr "${libdir}/multiprocessing"
+ use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
+
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ 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 "${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"
+ 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"
+
+ # for python-exec
+ python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
+
+ # if not using a cross-compiler, use the fresh binary
+ if ! tc-is-cross-compiler; then
+ local PYTHON=./python \
+ LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
+ export LD_LIBRARY_PATH
+ fi
+
+ echo "EPYTHON='${EPYTHON}'" > epython.py
+ python_domodule epython.py
+}
+
+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
+
+ 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
+}