diff options
author | Mike Gilbert <floppym@gentoo.org> | 2015-02-07 21:24:18 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2015-02-07 21:24:18 +0000 |
commit | 5145fac779e6bfe6796c7384be4dc512242b0a0e (patch) | |
tree | d7db9b79eed7768a439b74d11f916a4bdeb7b874 /dev-lang | |
parent | Version bump. (diff) | |
download | historical-5145fac779e6bfe6796c7384be4dc512242b0a0e.tar.gz historical-5145fac779e6bfe6796c7384be4dc512242b0a0e.tar.bz2 historical-5145fac779e6bfe6796c7384be4dc512242b0a0e.zip |
Drop 61_all_process_data.patch, fixes musl build, bug 539210.
Package-Manager: portage-2.2.15/cvs/Linux x86_64
Manifest-Sign-Key: 0x0BBEEA1FEA4843A4
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/python/ChangeLog | 7 | ||||
-rw-r--r-- | dev-lang/python/Manifest | 10 | ||||
-rw-r--r-- | dev-lang/python/python-2.7.9-r2.ebuild | 358 |
3 files changed, 370 insertions, 5 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog index d25d4dbce007..fbff92f5309c 100644 --- a/dev-lang/python/ChangeLog +++ b/dev-lang/python/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-lang/python # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.811 2015/02/07 21:20:29 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.812 2015/02/07 21:24:15 floppym Exp $ + +*python-2.7.9-r2 (07 Feb 2015) + + 07 Feb 2015; Mike Gilbert <floppym@gentoo.org> +python-2.7.9-r2.ebuild: + Drop 61_all_process_data.patch, fixes musl build, bug 539210. 07 Feb 2015; Mike Gilbert <floppym@gentoo.org> -python-2.7.7.ebuild, -python-2.7.8.ebuild: diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 92e39300c32f..803ec9865f3c 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -25,24 +25,26 @@ DIST Python-3.4.0.tar.xz 14084912 SHA256 f13686c0a2d45e7146759e9d5d1cbd8097a0606 DIST Python-3.4.1.tar.xz 14125788 SHA256 c595a163104399041fcbe1c5c04db4c1da94f917b82ce89e8944c8edff7aedc4 SHA512 09b6390c07334974f189fb1c90bc2310898aef76661b1cecaa2b4d50001fa3df0fa0c63d3471a5a0dc7f9e08dd559d38d3bc45a6c05a816d8b2ed6b2a20e5fa9 WHIRLPOOL c8f879bb5d42a759b0804aa58d90330d9be6f4c29652ec40f07ca7da31510eadbd6b4eceb2b213af9a1af031c8321fc25faccae77763a31814eb0569831b8bfd DIST Python-3.4.2.tar.xz 14223804 SHA256 1c6d9682d145c056537e477bbfa060ce727f9edd38df1827e0f970dcf04b2def SHA512 12de5309cfaf91f5292efd660b5abe31581b902fdcc302317b597ffa74c9f5ec14ec1dd55994bcccd50d40473ae344ae19bf917ccfb8ab4906c8777d6ea95b17 WHIRLPOOL 358a2ca605676a7b6decf7cc9edfcf5edd6e15eb7b08e48fbf5f78422d3470a1233830867e3986a6bd564e105726298d3664ad04b90a233f90a46d6b81d8d60f DIST python-gentoo-patches-2.7.9-0.tar.xz 14020 SHA256 d1ae164ab14e265ff63d6a724e0c2b5519bdb790fe8b7796c2124a30cecc8ef8 SHA512 83aa867ce562ff3acf970a4b3ecf7132f34aca1ecf286b90575a20e6e044600b98ff1d7f1a7ee613d4429a6a71cfe8beaff144b64b6beb456ea8691ca00937b0 WHIRLPOOL 5b4f7bd2dcec3a45e12fe5baf1c196faf2b754376a6bccb555dd12a1af28a202d51a0d956e4450ff2f334df13b296ee27b36aa967cb179925c386cd58389050b +DIST python-gentoo-patches-2.7.9-1.tar.xz 12872 SHA256 9d912c55db56b5bfe054a6164614969fc9605f48f2ffec8770941f798a16470a SHA512 cbbae0faa246516361cd39e55d841660471931bb26cae8396a7d3929c9f4b4a3d8d5a76f7fa295deeb6335c26ed95aab18399e34c2603a582743b6e760f2b280 WHIRLPOOL 422ace8a204481458acd9cfd3b3b85e4b02fb2fe656c8ef8473a76444d5a1b54cd9d690e0009904f8c251697f60105769ce6a97c26224548476c0ece6595e484 DIST python-gentoo-patches-3.2.5-1.tar.xz 14628 SHA256 0acc5531421781ab7f30e6fc8a502f202b79aa285b4f411eb16ea0a9e6d958c1 SHA512 1abbd53e92466d258802717309e1839ae931b8a4b0a5a27d4d0da748e71cf96ac47c6837bdbae5dd6921a46cee339c178f86ff3108afe95e6a0a42c4f4300791 WHIRLPOOL de003cccb8b311413889713d66b7987f28a1f906cc9642621d1fd2a379ceae4f0f901c137503d808dc3da7295ac611de09781bf8661cdbcd14c1d7c94ba489c2 DIST python-gentoo-patches-3.3.5-0.tar.xz 12892 SHA256 a7240de9598033cb40f8f273d8104d4e2b1dcaea028d45ac28efaa3c680ff6f7 SHA512 27eef4c2b3f631b000db3f6a5c426d9b498d63a08fe82b1ab7c2c010fb72208109461a5f008d47703852526655b70a734ea95be8742897026db5750bb9cc9d16 WHIRLPOOL edab9222d7da94cab3b1de0e1a27c6c7dbd49194b813a0a1cf9e532063029c4e4f19151c9f4878eeabed3168ff1f97eae7f008280c7ed2897fc14c5516c68d7e DIST python-gentoo-patches-3.4.0-0.tar.xz 12900 SHA256 5e5ca54eaf446c7dde4155e5d792df5229c7790b32abb5aca38cbc4fc30f9c45 SHA512 be9851f9062f6aebbd2f23d91a4038dad1a8757049745ccbb1cc618ff6bc3dfab0326d520d27678541f4421e5db41d64f632fe6fb3e80f2cf4e73dadd3d5620b WHIRLPOOL df998b5588c928ca506f9f4434093a1f60637206f03f5e067444531dae02168f88b22c8de7d58e745bdb9d85e17abd667ed51f7f5651779c2c94da98f0925679 DIST python-gentoo-patches-3.4.1-0.tar.xz 11164 SHA256 7d88e40ed02bef2d26802516fc0138a28cca58e298204e6b1a32054f9224fcb6 SHA512 5ecdf6a1ccb8d12b5b7436e1b7f641a41afcd7fde573e9249e3dc0d438bacb1eb6a5255e149388194dbfd2951fee4f8c800199362dfd072ff96776bbbcad0bbe WHIRLPOOL 707f943f9af7c3fc6deed7cfca5a4198f65a34434893840ba8e4f4c2a3d055e8f927069cb8855b5fe20dff643b7e2d41f35f65e1f3f300e350c0f291b4df6bc2 DIST python-gentoo-patches-3.4.2-0.tar.xz 11568 SHA256 86028c50ecb16fdbaae68662d9749f8c5dbbad6359423ed02c7b379d4aaeb7e3 SHA512 786d74df8ca168655f38d052a3e79541fd1d9f58845f8fdc296246208f8ddc61e5a0d95d675432fcac77dda7c0ab419162790d0e39337bce2fb5c5d3f23c9ef4 WHIRLPOOL 5b26c7d5facd93ca334f23057e26e3a2af71d9d590ab270d4619bb57e0d14bc6465c08ea34c53e1ccf347f5938fd0199a0edf2ddada3c3a891a5568f1eb81227 EBUILD python-2.7.9-r1.ebuild 10539 SHA256 e1a1da2b2f5b752633bac1794b816bd0658f50524bfee40d071ea517138a43a6 SHA512 2ca3e5bdf9265f559ccb93610a1d29223ad9c611cd0453c66b0d9dafdf6e0690013a976e0e795661dde3f0d81d0fb0a40c43d2aee2db46ddcf0e8952df0ec633 WHIRLPOOL 2340df54b575fad4de2f5dcef3d702b2a26ecf5544f872f82b16fe4a83a43a56b85aea0ec92e85a3442255418f65f07936fa093e2db1c6244d02097e794ebc7d +EBUILD python-2.7.9-r2.ebuild 10547 SHA256 8589e7e9018e5406d71ebee41ee18f7adea3566fa22291acd45c36d9b8b09dea SHA512 67bd50ec5f6c7664c8656c7e1dbd40ce10fd4dcfe1f57223e7e81fcd3aacff1f5e68efa0fa3e047bde3ed0f7f96e21c7532432a11012ead2fc6d22067fa4f82b WHIRLPOOL aa05e58579f1645ddc8ab37072ba805597cc11e42d5364565b0f5b977a304ca976acfda27b28855effc386a3c42fde19042dddbbb9ac103d2243c5f037d557eb EBUILD python-3.2.5-r6.ebuild 11464 SHA256 1b4cca8c0d41fd10dc1e9fa685e6a2a5e1f829dd217f2b5e9384ac111b12f088 SHA512 ff1af6153b38bc8483b2a76d51b97d3ea080c9cd2dac31e20c50144ac0f5dcadc603991fee625623b7e819e0cb23e2504bfbea480165fa936c94e0aa4f6a0a8a WHIRLPOOL 3ea4ec2d7a8d8b3513f48a040a301d8343665a51f233769ca4b841134e9ba909132d566e39b02465b3b7869f3be7a50a267aa7b675a7da81de0cd7bc66e9b7a6 EBUILD python-3.3.5-r1.ebuild 9523 SHA256 27d6d0444e6b948b49e5438f53aaa0796a9c785096ea63cbe9b4788745077cb1 SHA512 edacf0952c26ca36e754c03a292068554bf1a77c0dab7317eaf0f92ec6fd7e5784072f74d446723d12897d6b464fb275d6884474e9e47d11ed50665873fd154f WHIRLPOOL 34e35e62843e9d2d770fccf9439c23ffbda15bebc9dcb6d2665a46d7f6f27f6b5522483faf74657b4c311b310d3c45ded9d9a60ea9c5b8c1588fc9512f5d9066 EBUILD python-3.4.0.ebuild 9308 SHA256 4af07645d7b8ab88742c10332fd1e16649c25abfb38638db3060ae087c9f1876 SHA512 a6c94c99a019f9bf68f69ec3ebea041a42cd833a1a7e1fe63bcc4756cd81184e895ccd120ba2d8adfd8158428a82e660132f6e5fdab70592c19eedad9557b366 WHIRLPOOL c6bfda5a4022ee5fb901ba376299b3c809b78a40a917feea5acf29e241c70e71d3fc801ee34b2a6d187257886f7aeb5ef77213d4403ad83185763e0c8ac13ef9 EBUILD python-3.4.1.ebuild 9233 SHA256 362656400124c36a04091d91e3952c0fd5009b744dd513012c6cd71380652fe8 SHA512 697fc0ccee84292bc1406f04ff9492e181a18f46c24c34512a06ec4979236e380fa3d9e9dacc808863209056a061715c3b7c675f163f3c95a365881d2a9485da WHIRLPOOL f82ab0a9fd49e3f1218172462442b676c8245a12dfe5669396808eac6a9085769921341e40af5d68bf4c535368f20917e3b8106a740ad2e4608d29a7925047af EBUILD python-3.4.2.ebuild 9242 SHA256 312fc7a668ac3a821d5c561b04be2be0b10ac8e9cbe8d6a3170f477c355cf88e SHA512 74216fc9bd79b09b763b96026dfb88fbe83716944bd7c208003fd457cec11562e79088ab5620e8e7eb9cf226fbdd1770914b023a78719554425cbfb159a92f2c WHIRLPOOL e2a3910e38d75a29732a039dfe6d0d6a1ac850f391e580bcab24782665027ce51b82ac55483c8e3d16f2871b4beadd79c0c486f48ca01c6389efc777c1ad1f72 -MISC ChangeLog 39276 SHA256 8bb929a63b4a5342fd41f3a7f83e2b526394bd6c6ba7c0a30a3af1f63b8f139a SHA512 eb699ef00a496834aa0bb6c86df09508f4b9049aee87d970071cf3e491471b59119bea1dbd18963d2edd4b0d9cf5e46edc502a237077cdafce84403355a8ed1d WHIRLPOOL f6f1e306afc93e590830ec50ea630b3b2cf8f590ee2adae85db75a051ae63d04ad38a15406745623c41b847eadaa3e9b75c9082e0ec3c19c144fd3d2d8f1dc64 +MISC ChangeLog 39447 SHA256 95808d3e02d3be798b204bb9afb66d23f5b34fc4d1742dee74d4c9646e41a8c2 SHA512 85a360e0ad65a48d9db9da310ebe54629db1b704e5ae394a58e0d2ad912c72c521ca3a7f5dcd1eee77a16e357a7e7aa7d0b451c1bb2b40435c255a8d9228db3a WHIRLPOOL 06e3d8909db87685338471886ca93f353c4c9c1cb37b1d0c8dd6767e0d88e348731b6a503c0d78f72a6e26b9e4985ac624efb3892a68d733bc3c75682613f297 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 -iF4EAREIAAYFAlTWgZ4ACgkQC77qH+pIQ6TLGAD9Fu6X/pJSmsmH8VAoO09xCc1v -X5THKxbPC+dmopPD8mEA/2IeqJIBlyGh09l9nmhlrxJC/nkVSyN+zMKTOYzIQC5F -=Ztr3 +iF4EAREIAAYFAlTWgoEACgkQC77qH+pIQ6TyqwD/XlMmJwhm4o2EKljga6+b6Cu3 +Eq48FDx8NfLjsxfjZlYA+gOvZslbpc60E4iunNfT7rhrZW6XQ3zr/PXjBky/GOVU +=6F2T -----END PGP SIGNATURE----- diff --git a/dev-lang/python/python-2.7.9-r2.ebuild b/dev-lang/python/python-2.7.9-r2.ebuild new file mode 100644 index 000000000000..fea6a38eb2e8 --- /dev/null +++ b/dev-lang/python/python-2.7.9-r2.ebuild @@ -0,0 +1,358 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.9-r2.ebuild,v 1.1 2015/02/07 21:24:15 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_VERSION="2.7.9-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.xz + http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz" + +LICENSE="PSF-2" +SLOT="2.7" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~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 ) + ssl? ( dev-libs/openssl ) + tk? ( + >=dev-lang/tk-8.0 + dev-tcltk/blt + dev-tcltk/tix + ) + 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 + + if tc-is-cross-compiler; then + local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch" + fi + + EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" + + # Fix for cross-compiling. + epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch" + + 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 + + if tc-is-cross-compiler; then + # Force some tests that try to poke fs paths. + export ac_cv_file__dev_ptc=no + export ac_cv_file__dev_ptmx=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 + + BUILD_DIR="${WORKDIR}/${CHOST}" + mkdir -p "${BUILD_DIR}" || die + cd "${BUILD_DIR}" || die + + 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 \ + --without-ensurepip + + if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then + eerror "configure has detected that the sem_open function is broken." + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." + die "Broken sem_open function (bug 496328)" + fi +} + +src_compile() { + # Avoid invoking pgen for cross-compiles. + touch Include/graminit.h Python/graminit.c + + cd "${BUILD_DIR}" || die + emake + + # 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 "${BUILD_DIR}" || die + + # 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 "${BUILD_DIR}" || die + 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} + + 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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${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 +} |