diff options
author | Mike Gilbert <floppym@gentoo.org> | 2013-07-12 01:56:46 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2013-07-12 01:56:46 +0000 |
commit | f5e17815f2db9732cd6e2fd57c8f69fde0585e64 (patch) | |
tree | 99d82067699694d2003a08cf2fff8de4a1df3959 /dev-lang | |
parent | Fix copyright line (diff) | |
download | historical-f5e17815f2db9732cd6e2fd57c8f69fde0585e64.tar.gz historical-f5e17815f2db9732cd6e2fd57c8f69fde0585e64.tar.bz2 historical-f5e17815f2db9732cd6e2fd57c8f69fde0585e64.zip |
Apply patch to fix regex crash, bug 476426 by Fabio Rossi.
Package-Manager: portage-2.2.0_alpha188/cvs/Linux x86_64
Manifest-Sign-Key: 0x0BBEEA1FEA4843A4
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/python/ChangeLog | 8 | ||||
-rw-r--r-- | dev-lang/python/Manifest | 22 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch | 23 | ||||
-rw-r--r-- | dev-lang/python/python-2.7.5-r1.ebuild | 393 |
4 files changed, 430 insertions, 16 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog index 60cea4360441..0b4870e3c22e 100644 --- a/dev-lang/python/ChangeLog +++ b/dev-lang/python/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-lang/python # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.681 2013/07/07 15:20:34 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.682 2013/07/12 01:56:41 floppym Exp $ + +*python-2.7.5-r1 (12 Jul 2013) + + 12 Jul 2013; Mike Gilbert <floppym@gentoo.org> + +files/python-2.7.5-re_unsigned_ptrdiff.patch, +python-2.7.5-r1.ebuild: + Apply patch to fix regex crash, bug 476426 by Fabio Rossi. 07 Jul 2013; Agostino Sarubbo <ago@gentoo.org> python-3.2.5-r1.ebuild: Stable for ia64, wrt bug #469988 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 30d2153f74db..b14ce97a034c 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -1,5 +1,5 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 +Hash: SHA256 AUX linux2.patch 332 SHA256 8c5f8d73e279767190c9567f959514167101ea2648f9f4c8146704c5946d8b41 SHA512 75e56ebb36fab5a207086a6928a895caff25c7593784961e9dd9597d15477b318f24784f34fa9b95528bd2437bc388907dbdd228cdd6e06da3ba08f72f05f557 WHIRLPOOL 79447a543490ef15034540e4cab0d8285a28bcf1bd151f910a929d535f575d3d93c751f3f0dddd9d645435159fdc3fd92138307cfa364627bf85c0a10f166cbc AUX pydoc.conf 279 SHA256 6437e85d16d34efaf2665b3cabb0707392e6dee3df04989d3fcac63fd22997e8 SHA512 2d552b6262fa4c7cd75f45d93b8a2657eb9154decbc08f9b73d2e67e1d84367b498f8556fbba20f7b57414281cfd673fff607da3c688c1d6bb9842e92cf0c32a WHIRLPOOL 1ba44797765939d7c0bcbecb08cb6201eeff9b134d4d3caef9339729dcad9f258e20b16db5f369f49b378df3c91e530115dbce5ce3595d71cd325a48793ac814 @@ -10,6 +10,7 @@ AUX python-2.5-tcl86.patch 615 SHA256 cc649fbd471c7e348fc64f3844d9f4e1aab604cb3a AUX python-2.6-chflags-cross.patch 1716 SHA256 7c36689db47720052069725036983c2fb6959f425e3777aae55976b2788d463f SHA512 18c5cd579086711e4eccc7c6a5c3312fb8c0a4b6bf36010942bd87e45557e0ea6e8f1f3950f4a74fc50580239e40c4b716da82ed7e6b5a9b36a014a40faa23fe WHIRLPOOL ab38e28ee9141b213b6ac77a4e421ac5bd95fbe4a644d1b49627a5953ac23cbfd1b99efbdaba12d5eb9a5dc4dc6bd26d41c0f063c350a312f287b6b850eae3bb AUX python-2.6-test-cross.patch 914 SHA256 8264f6ffe5aedcce67bea00b0346e5416a5486da2229bf82fe748d87ec65c4de SHA512 6cd2bbc6c1ca13cd7f5cbb92d595ba5ec7ae1fb66873cd24d233244a55586ecd0b7d020f494ceb83bf350c927886109e261c7449b5ca33a8690f2f5cb7d3a1fc WHIRLPOOL 273b52e9f1a46d2a6105d3ea28b051d3e717ef08cc6e5b09f7ae84333ffd990e985c27a1073acaf4f7b6fc9d3f5b08a6faf84c43c19708cf182a0caca7a71698 AUX python-2.7.5-library-path.patch 991 SHA256 ff7a4a1846ebcadc2dbf979ea619072caac22e47909fe188fc4b6becce6ea2eb SHA512 74916d541eb38c526dc1243fe5e5a9de3a7875f02c53e5f49e60182ba042de2f15514364e7fbd821146dcf92db2bba88d8a9f46d4c71237b73fd39cbabf93d85 WHIRLPOOL 62bb1c85941ccaac7ca6f6fb2d93dc27f206cf9f815b90ef1f89748dfdd1d38deda9f6bf7eb2ce9fd8635d1a77576819192e8049ec5de52fdeb9f981dfb32f9f +AUX python-2.7.5-re_unsigned_ptrdiff.patch 941 SHA256 5b0c0465a23d27e1c8f0961a8d88b3af75fbc9933ab60c2a71091720a3681079 SHA512 d46fbbc8411fae78cdfca2564faca42f32bb95ee348b9aa3fd1ca90b346cc52cd468945cee07e6df4dff46c10cee6856a58004f8e453960f6dca2751c077802b WHIRLPOOL 10bb08242dd9a055f6bdaf3eb1546786b58f180667c6355ea7276114cbac0ffba6c34822add7965fe3b5d41cc92ce8ec45e2d1d56377d8a6aa2755ef4267d101 AUX python-3-distutils-egg-utf8.patch 1636 SHA256 81d66620f0774aa2fb6c9664670862eb1b666ba15874b5498af28360f2e1aa52 SHA512 276ef8e6eb752090983e5b89214e333447dde4047e4b382ae2712f86c30d152bb2344f57ef2ddc218cbaa9cf135f83238e7478844a2fe3cb2aeb7a89bfd56a18 WHIRLPOOL 5f6a2e8a372a33a334b82e3dbe26ec16cdda8fdd8d4e4b1ed69e0cc5e2b6700b7af3d59a6ea8be6efb7b3cf090cfe4e3eef4d3e605b2b82968719e08005ad620 AUX python-3.2-CVE-2013-2099.patch 2102 SHA256 76a89951e7efcf14d37e30e0104446429ca121c68cbb1753ec362a177c1b5a54 SHA512 03d2a09fe730bf8c94df1eb10f8bac37a31a28dfb45b7d49abe1c3ffe26ca948f8d00eb58319d34102f8a747a038d447d3507b11c051c778c42ae21ac1066c8e WHIRLPOOL 3cd701c606ef1f4f557d1d250af41a860a6a5c4b6d9ff9a9f469ab6974f13e1205d2c4c791e9bd353fd4ff726f6cbf979f9a3927b83b04af5128c1aea7070496 AUX python-3.2-soname_typo.patch 1724 SHA256 776366c3cc67c7d66883846acee8cc1b795c25f6e35e927793be8c54162491e2 SHA512 1282241ea5ac222fa9dd135d810112761614de1ab5efb14a9d4e40503fa437e415eae0a248c4934e23f3ca2cad42cc1891d32dad678d2951a18899c2f78bff00 WHIRLPOOL 63ee4f4c6ca16d33787044e6e73abeebf2cdd4ac23819aa75a9997e82c5d2920320fadc228c499d7c5e7fd85c7b091c7094bbda44bf6417026aa9c4b9bfbba67 @@ -42,6 +43,7 @@ EBUILD python-2.6.8-r1.ebuild 10967 SHA256 d28318fe2567d4dcab80f872646073ed54570 EBUILD python-2.6.8-r2.ebuild 11004 SHA256 0dbb22d66969e6ac00ab9666fd076b8cc6513a6489ccb1d01f64ffb25ed0dd85 SHA512 906616a674535b4d957d256e50d637d2b2d9d6a5fdcde6933f0c3a36acf704ca25b864311118d6e854818830639a0add472ab62220edeb9be6cf6ed5c8b90855 WHIRLPOOL d2993a663d3128a3f5d7430019dd6c65999b771065e6fc9a385e94014d97eec21d739b2c25a365c526e9d426127ae6def0661d9ba8c1d1c0dfae629ab8fea995 EBUILD python-2.7.3-r2.ebuild 9907 SHA256 b339b4e83a9b7d75d0e04b85300cfa827ed7ede252784ac1b3b2ace60b07e32c SHA512 fc37232bbe6c7344d0381c9b79c967519ee401e14c596d87d4dc07d8100c6f672c7a69b2b204af7db50c3961273f5408f3b8ba01dd35ba5307af1894774bca40 WHIRLPOOL e455203a9a9610f9ef076d2c448f5da4aade7955209b58f17eca30f949794af18dac8d7c3fcf85df9a074826c8947b07e5c69a726d77a6011dd34675321c434d EBUILD python-2.7.3-r3.ebuild 11622 SHA256 ea158b63a1c75c839d64c0f62992e2ff4bde28146a6ee0425d074638b1335eed SHA512 fd62ca48d9dc3d1ce0e2c100a0a4a45ed3cc9e78ac8b2a32b3bfd938e894455176ff445a89f2b1075e4112dfce9203e15116178861655deb1c4ccaf157f00c23 WHIRLPOOL 5431b0fab0ee90e4c4399d16ede72cf41dc4569a80d85d425e154fb5962a8499c492af04acab697ffbdf08cd3b67a640d559399a52d01567187bad399a898b34 +EBUILD python-2.7.5-r1.ebuild 11655 SHA256 d275c43158959aeabd7632a949cd9700e64c6eda9bb4d526744f7a73d9772c5a SHA512 93c3468b655bff972b2eddf1a9b7895c15176f9672fa0e6bf2fe530e46ce1329e089b524ed6c594a532845785116112b8133c14e583f51acb07311cf05c68289 WHIRLPOOL 9d20b01517a1aa1a351d3ab55e4aff0a9a0ccd39853cd4aa5298d7ca94b65fe7c9073e2c6a5ba551956fcf1ccf7318e6e8834064ea6fce8fd159d4f0bcc28db6 EBUILD python-2.7.5.ebuild 11580 SHA256 16e1fe208ce47b89912a2f31e4a9f4ae1b04fd20f11ea8491c3305fc189d95ba SHA512 61490b46f9ab4a88e1b7a565c5c8f18c000d7e8de9d63c9578a89c23425d5797a52b42bbd3715495ac8f2daee53de987e9de19bdaf5cb1349b9f46411b657f93 WHIRLPOOL 13a830a06ce605163e0e86c3417ac72ddedde59193d1d0bb5c11ec3e559b5f0233c5e9037e226fed67b7e066bc3e0842d116b50580f32f562a8e98c3f65f935c EBUILD python-3.1.5-r1.ebuild 9806 SHA256 cbea376cf423f5355e21526c4e05919d35c0ffe24bc35655ecfaa0adf9d4f77e SHA512 27cff82c911017b40c4011bfa623e60c6e7aafa57794c908d7aef11b0e4fc36fae716f2e5a5253632832b3cc499609a9b9e0750602fcbf76470ef9d984929aa1 WHIRLPOOL 5abd6a4fc19e050742b74ca3a09cc2aa0c6d966c6a7aaddc648eb5b1a291dfe4a61042311d146fb0ea8b446009396f000c45792781c1f368ffd683820b5905a1 EBUILD python-3.1.5.ebuild 8243 SHA256 925c87e1b3f3b839b5b07a1465f9ceef834f8d726bca5eb106a3304fb6a09245 SHA512 36bd432ffc21c39a582577d428b6af78d942ad5fd5710ddfa58853fcbcfd279080cff8575b9b28bce5b161d7207c937cce21184ca729a4222aa27ef6208f57a3 WHIRLPOOL c8aaa3697c0d53e92756c152c47b7c278f2cc5212c544d4f6856249441a2b4d05481444109b1d401b52c7d5b517b0be02e60aa04f7fd2da5bd8dfb0e7bcc69fd @@ -54,23 +56,13 @@ EBUILD python-3.2.5.ebuild 10595 SHA256 37fd9d73921c0e6bbab2e9b9260aa7ead4e796e1 EBUILD python-3.3.1.ebuild 10337 SHA256 014e508a7b939f30d69e671775027e3cf1c9ec3f0d44afe4e60421147d16feeb SHA512 52d87b931d2782bc1c4ae9275adae6fe8ad675f424a2e4546c0e4bc8956996449cbc1983a7cbc377f26a0fab9f20adb29fc4d20cfa997d0375252c76556ea0de WHIRLPOOL 9b27ba2e99eab62af1ffe9e5a000856da0797b0640c46ee2b9cd74e7f2e7c3c45627d9d803a608c7013e98af970649705d1262bfb4c3e2acf07a850a10bb9439 EBUILD python-3.3.2-r1.ebuild 10505 SHA256 392bba7c335ee826ac72af1fc342aaa7962727856351e7f478e3bff2004ac23c SHA512 304713a3167ef3c813172d30d570f370859f27a324a2e088aad5b7b7686f6812559d0a833ad88af147eefd2128211bfb8cfdbc45c0b826d0b77dc7349540f338 WHIRLPOOL c6eeefb8b52d5c83ee97d7a7471502da0032fe152d36556f0be6bd08f9679a136d2bbcebcac8e7ab571868cfbecd7a5df839f479c76fed8903cc2271bdb12b6d EBUILD python-3.3.2.ebuild 10449 SHA256 4612eb9ed4c2eaa6b4b65f073a3b74f566027e19a466c61e29fe2d6a40871c27 SHA512 83bf55465e655394d2b09f6aae83c6783e93e2ae9b5adf91b07280d96a68db65eaf0228e8791e3fcf79b026bbd8d6cfcef9ff7214e30f42572e40d93a59a367c WHIRLPOOL b92ff94f1eafd965b2981fa3f3f2dc19810970ffe5b892c9531f476d0c1a8da7ef49fab72dd8deebd1e448cc37d8486b44d11a82c71979c6772cfa67ad6c26f0 -MISC ChangeLog 20444 SHA256 2b95429c9c1af5a10ea878cf101059fe3fa9f0c3dea8e369cc05a1c388996acf SHA512 dfe95d152b41aee1de2be321d3738e6206e7a44b38618c6f157d1fab78b011a865e40d5cb9f7e80acc4a1f5837c0ea37dd62c45d2dc36e749ebb43d06a29ab43 WHIRLPOOL d718a3b2ccb63094b093f47163c1ec3ee5b94a4d023cb8db08eb36dfdaf13b5096f6aa0c8c48e7cf2490fb85754847c6e5a012308b6aaeba4f367099c8c38276 +MISC ChangeLog 20665 SHA256 26362bd160e6593d6731ccbaab074cef5e3b3865c838220f549e795f48e6a29e SHA512 ee8138c90c6d6460678613862eabb4c56c55f905f0ef0f049a70bd02321990540317a1d202c52cd2e880a87677783bf1060bfe0bdf0783c6e5f51093e82282f5 WHIRLPOOL eccde2c464b7c19852012f841c4fa47776dba060a53d01c0068f5b71ab2c2e0d83c81732862b0a94a37ab0482c4ef37b61f9da60cf8613da0e33e038c07acd91 MISC ChangeLog-2011 100599 SHA256 23129cb47321b2a6b1cb9323f1815d0cd11d6f30c3893908ed51575c270a0cc8 SHA512 4181ba9d965139ba58218da5b960c87b7a611b27606a1ab1ce1b4c3c9255b4e0e2947307cbfffc531f0f8b6b545ee11e083fcb29dc7b2b7ba31c6bb40b8ab128 WHIRLPOOL 4ceebb6a6ed58b906d3a7331795748ac6e4fe2e1401bcccae9024a8e81e2c444aebc5fec610398cfe6002354ad3b10487484598da5091867874727f07e239c56 MISC metadata.xml 661 SHA256 2c6c3407251f7ccd6501dee49494e539a9544f2fbae99a4373eefdf4e83e8908 SHA512 871989a29417ce20d95da950fa385f1a958139de7b1567beb9cda28a1217901243cd9d25235fe3c7b0e43a82176d72286e31e4e97310b26488d2a3252ef3a8a0 WHIRLPOOL b694b1b4270ba15640d04a3b0b26a08575ea4afc9be256717f7f3b1768d75da9f71ceca6afd2f69971906227d5ba42263d2df2fc9387441aa240222d39fd094e -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) -iQIcBAEBCgAGBQJR2YaMAAoJELp701BxlEWfM3QP/Ao6f6axe8lUiIIuDcDRwbIp -Xq0TL3k1qoABXhc6ML7MDEdKphkMtx8jTpANrz2qbumCPpV1/3fsY12v08OsSyTF -PZy90IpdemanrnDWd/BQSaG3lwtO0waTLy0KDcxebiLeay1D5/5r/XhGIVJZfHXf -LA9+x7aMdSLLoMIrUTP+fjbBn5DOfccTlanYpB3/l5YNXFDTjLKRmhyhkPsr9gl9 -mO5nCvoFZnx2pT4+DHsL+28KrEJEyNOD9oPSh0lwYQbM4XxhAZ/L7H3AUYjI3eQP -Wt80v0eIt55ZrerUNvl1GzCp2Jr0nUCaHH78iFdc3y2/5wES76lRhVDDXoEoottx -plBXZ2xRIrYsl5PlhW0KUkoJ04OF7Zapv/Az7dotbdb69SkILl8tscYqXXWqLtFn -dgJX+EYhj8hzqwqDn30UtaCIItVyrcKXoWacY5ssi2tdLTLejyscI+M3UriZS56N -saxPwZ732KICxZgCE8jfVuBYK/q0FSLZG64HqRJj/CF4ehFP0buWIbMDlLQmXjTQ -mHuLTyHm1feeJDmGmSyRYCvYr9lkZLV6zTt0me4bnxtGWIOXBbEWQeZmR9bbI+WW -ovfR6uxtKBNaLkdMINd59bpnjpcOiDSVKbedXUVNBwpayWkfndcFE1KWKBzmMiou -eqow2xN9ONR0R2MPEFw3 -=IonQ +iF4EAREIAAYFAlHfYl4ACgkQC77qH+pIQ6TyBgEAq1mREiFK+AYOy9hHYHA8UsdL +++eX92kkK/Xh0eVhIWgA/jdPdhRz2mcUUDDOrS9EkW129yxb53CZW4kTQ1QKH4zM +=ePda -----END PGP SIGNATURE----- diff --git a/dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch b/dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch new file mode 100644 index 000000000000..a905839a2544 --- /dev/null +++ b/dev-lang/python/files/python-2.7.5-re_unsigned_ptrdiff.patch @@ -0,0 +1,23 @@ +https://bugs.gentoo.org/show_bug.cgi?id=476426 +http://bugs.python.org/issue17998 +diff -r d91da96a55bf Modules/_sre.c +--- a/Modules/_sre.c Thu May 16 22:47:47 2013 +0100 ++++ b/Modules/_sre.c Fri May 17 21:02:48 2013 +0300 +@@ -1028,7 +1028,7 @@ + TRACE(("|%p|%p|REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr, + ctx->pattern[1], ctx->pattern[2])); + +- if (ctx->pattern[1] > end - ctx->ptr) ++ if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr) + RETURN_FAILURE; /* cannot match */ + + state->ptr = ctx->ptr; +@@ -1111,7 +1111,7 @@ + TRACE(("|%p|%p|MIN_REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr, + ctx->pattern[1], ctx->pattern[2])); + +- if (ctx->pattern[1] > end - ctx->ptr) ++ if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr) + RETURN_FAILURE; /* cannot match */ + + state->ptr = ctx->ptr; diff --git a/dev-lang/python/python-2.7.5-r1.ebuild b/dev-lang/python/python-2.7.5-r1.ebuild new file mode 100644 index 000000000000..20db791d6ebb --- /dev/null +++ b/dev-lang/python/python-2.7.5-r1.ebuild @@ -0,0 +1,393 @@ +# 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.5-r1.ebuild,v 1.1 2013/07/12 01:56:41 floppym Exp $ + +EAPI="4" +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="0" + +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.xz + mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz" + +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:5.3 + sys-libs/db:5.2 + sys-libs/db:5.1 + sys-libs/db:5.0 + 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 -r Modules/expat || die + rm -r Modules/_ctypes/libffi* || die + rm -r Modules/zlib || die + + 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}-library-path.patch" #474882 + epatch "${FILESDIR}/${P}-re_unsigned_ptrdiff.patch" #476426 + + 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@@" + + epatch_user + + 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 + # 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 and 457194. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E python + else + pax-mark m python + fi +} + +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). + 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() { + local libdir=${ED}/usr/$(get_libdir)/python${SLOT} + + cd "${WORKDIR}"/${CHOST} + emake DESTDIR="${D}" altinstall + + 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} + + # 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 berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die + use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die + use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} + fi + + use threads || rm -r "${libdir}/multiprocessing" || die + use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die + + dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed" + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r "${S}"/Tools + 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} + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} + 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() { + 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 +} |