diff options
author | Mike Gilbert <floppym@gentoo.org> | 2012-04-26 16:31:30 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2012-04-26 16:31:30 +0000 |
commit | f9d1c57c3e951349a664aeea404f235c45977105 (patch) | |
tree | 8dd297229a468659484045d684116c85c5950fff /dev-lang/python | |
parent | sci-libs/ogdi: Correct typo in ChangeLog (diff) | |
download | historical-f9d1c57c3e951349a664aeea404f235c45977105.tar.gz historical-f9d1c57c3e951349a664aeea404f235c45977105.tar.bz2 historical-f9d1c57c3e951349a664aeea404f235c45977105.zip |
Version bumps for security bug 396329.
Ebuilds and patchsets based on work by Arfrever in Progress overlay.
Package-Manager: portage-2.2.0_alpha101/cvs/Linux x86_64
Diffstat (limited to 'dev-lang/python')
-rw-r--r-- | dev-lang/python/ChangeLog | 12 | ||||
-rw-r--r-- | dev-lang/python/Manifest | 23 | ||||
-rw-r--r-- | dev-lang/python/python-2.6.8.ebuild | 306 | ||||
-rw-r--r-- | dev-lang/python/python-2.7.3-r1.ebuild | 321 | ||||
-rw-r--r-- | dev-lang/python/python-3.1.5.ebuild | 287 | ||||
-rw-r--r-- | dev-lang/python/python-3.2.3.ebuild | 298 |
6 files changed, 1240 insertions, 7 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog index 7afe7976d990..6fd4ceaed0c1 100644 --- a/dev-lang/python/ChangeLog +++ b/dev-lang/python/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for dev-lang/python # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.578 2012/04/26 14:58:36 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.579 2012/04/26 16:31:30 floppym Exp $ + +*python-3.1.5 (26 Apr 2012) +*python-2.7.3-r1 (26 Apr 2012) +*python-3.2.3 (26 Apr 2012) +*python-2.6.8 (26 Apr 2012) + + 26 Apr 2012; Mike Gilbert <floppym@gentoo.org> +python-2.6.8.ebuild, + +python-2.7.3-r1.ebuild, +python-3.1.5.ebuild, +python-3.2.3.ebuild: + Version bumps for security bug 396329. Ebuilds and patchsets based on work by + Arfrever in Progress overlay. 26 Apr 2012; Alexis Ballier <aballier@gentoo.org> python-3.2.2-r1.ebuild: keyword ~amd64-fbsd diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 0f8a25303970..175bdd159177 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -1,5 +1,5 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 +Hash: SHA256 AUX linux2.patch 332 RMD160 b6c4f45baee17fc5b0a88b63bbca87b77eaa16d3 SHA1 7722cc338a88d690e06f2ed0d9257b086286c288 SHA256 8c5f8d73e279767190c9567f959514167101ea2648f9f4c8146704c5946d8b41 AUX pydoc.conf 279 RMD160 85dcc3abd24faf09f3753b5c2299517f9b2ebc6a SHA1 c1faef486a0041c2175bfbc2cf10eccaa574e8c2 SHA256 6437e85d16d34efaf2665b3cabb0707392e6dee3df04989d3fcac63fd22997e8 @@ -14,33 +14,44 @@ AUX python-config-2.4-r1 1624 RMD160 e4e6893c9e8414289c0c70c0f4be58835911e376 SH DIST Python-2.5.4.tar.bz2 9821313 RMD160 3a76c83464c3b1c38a60351ab054e33ac7195663 SHA1 0f2e819d6381f72f26c734e00a6780b3933ea404 SHA256 bc8d896a2bfe5523ba93b8d89b71017b74e8e6cb21dc676a0ccff668c8780110 DIST Python-2.6.6.tar.bz2 11080872 RMD160 2d63f4f0ad3c124a8e62215ca94bd0231350e912 SHA1 a1daf2c2c7cffe0939c015260447572fe75c7e50 SHA256 134c5e0736bae2e5570d0b915693374f11108ded63c35a23a35d282737d2ce83 DIST Python-2.6.7.tar.bz2 11084667 RMD160 513e84a7cb76ca876e3803bb03ed558bd0378063 SHA1 5d35eb746e85fb3deaff8518448137c9b9fb6daa SHA256 4502c1a064ce68416188005662c0269d31175b855502f64c6dfa8f51226a0e5c +DIST Python-2.6.8.tar.bz2 11127915 RMD160 fcfa3554af415cbddd3e8d68aead46f1e7b8e616 SHA1 348b727a9818146a57aa43203f37d8c6b462fe79 SHA256 c34036718ee1f091736677f543bc7960861cf9fcbea77d49572b59f7f1ab3c3f DIST Python-2.7.2.tar.bz2 11754834 RMD160 c3bf4f09b7c429a4d9f4cc251c795304cd5232c5 SHA1 417bdeea77abfaf1b9257fc6b4a04aaa209f4547 SHA256 5057eb067eb5b5a6040dbd0e889e06550bde9ec041dadaa855ee9490034cbdab DIST Python-2.7.3.tar.bz2 11793433 RMD160 bfc511d54080898d7008d4b84d49f957859d66c3 SHA1 842c4e2aff3f016feea3c6e992c7fa96e49c9aa0 SHA256 726457e11cb153adc3f428aaf1901fc561a374c30e5e7da6742c0742a338663c DIST Python-3.1.4.tar.xz 8184052 RMD160 beb24a2a1227aa2bc036263b4c808daa72fa3e02 SHA1 e5767a4fc92433816451de75c8721f2e1a81f6ea SHA256 21aa936b3989a8e32ba17799fcf235e0979a2e1c95e70bcd3bc066185a559afc +DIST Python-3.1.5.tar.xz 8189536 RMD160 021362658310f9ea5f6825bf0919f160304f4833 SHA1 3fa78edeefd892a50b5f41bab018b51ecad0b56f SHA256 035c4370354d901924ce0fd8df65c5452839f590ec1b9c17fae2ada3e5f3b4d7 DIST Python-3.2.2.tar.xz 8923224 RMD160 f28dc7a6b8a6ed1cc359791b1c70367d36ae0af3 SHA1 5e654dbd48476193ccdef4d604ed4f45b48c6769 SHA256 1072d13d846373e7eaa4f94c21f0985d2965e916ff1096abe72d1af67c5f55f9 +DIST Python-3.2.3.tar.xz 8970368 RMD160 8e34a4dd2544a9b6a691557a0ab0e69b21e5ee0e SHA1 3d607dbcfdf100dd659978195ccf3ade9d221823 SHA256 23c16f621f21e54987079765c060196cbe50235c7867147c6126d433054b1754 DIST python-gentoo-patches-2.5.4-r3.tar.bz2 19473 RMD160 c3a807693103f9e26c3cce4add5a1f3d975ef216 SHA1 c6170894865ee8aac8c813916c21a0d0458691bc SHA256 03f5bdb0a4ac8eb498a90c5cd444a5c76ed7e79bff5e8dca00efe77cf80c6391 DIST python-gentoo-patches-2.6.6-r2.tar.bz2 16277 RMD160 432a63f7313e98a99cd300ee3c1f905d343c401e SHA1 30f5ba4e5eb25833331f193966c3e00be4470cf9 SHA256 2754d2aa27086efccc2de73442cf0022f3f9768431b10ff72c9181c4ddd95428 DIST python-gentoo-patches-2.6.7.tar.bz2 15173 RMD160 0ffb5eb49d463f54e3398973603dd9ead0ab2f9a SHA1 7590bc2dc31ee2c1f6cd04968393137fa43c59f4 SHA256 dcaca7d0a5f266c41c72a3047db24d23e675ce4a0ac9196dae42d7892d5edb33 +DIST python-gentoo-patches-2.6.8-0.tar.bz2 17608 RMD160 a819e233a25ef63a0f730dd077d126fa165c7b0e SHA1 07b8bdb07ecd88e53bcbfc7048a5b7f981ec0eb8 SHA256 277dbeb19107d3244e58aee98f130ce98d03775e7d4074ff9e1577125c999c06 DIST python-gentoo-patches-2.7.2.tar.bz2 14485 RMD160 6b66705d61b525d0089326ddb700ad3c5ad6e23e SHA1 94fc9b00cc7e7c60cce41640dc09fd2395a5c5d9 SHA256 29616ce50244c0f7c85b903dcb939d656bfd9d5e8a930d90bff6cf878f3ac5a5 +DIST python-gentoo-patches-2.7.3-0.tar.bz2 15173 RMD160 a402c7f7514a195a19993beec36594cefed1e7a8 SHA1 8bc09024ed8494d4f3b7492f4854157081205131 SHA256 04dd97ace76e69e78708e7886c8d2ed03dca450996ab6367c07091a073028a13 DIST python-gentoo-patches-2.7.3.tar.bz2 13759 RMD160 3002476cffcba288d5bd80ab3b33795a08808c8d SHA1 5ea4025ffd9e92a08bd2ab74c12329c21a567b7b SHA256 f2f5b3c7785cbbbb5f2b404b177d56a4ec21e1a1415c5b9b153f7e1f598d0a8b DIST python-gentoo-patches-3.1.4.tar.bz2 12930 RMD160 5ba5d20e065e6c346848d0c3ed12d65cd6b089be SHA1 b6bb595e03a78a87e3164874a9a12711bee4b9f8 SHA256 9800f3a9989c8aac4c96a7e6411baf96af0c18c041627a330681783a84cb4316 +DIST python-gentoo-patches-3.1.5-0.tar.bz2 16939 RMD160 d4069224df17323055d12438d481bcfa694c70e3 SHA1 263769f0ddaed5bbd91d4e5781f48476d19cbc1e SHA256 ceacc96a370dfaa232d0a62336af37b809dd7d55adacf5f8befe17e2f72981ff DIST python-gentoo-patches-3.2.2.tar.bz2 10834 RMD160 f1ca3bec5705b72ee488a37ea71dc7110b4495f1 SHA1 c5daaea3c52a564228c84be741da6cf039b10e19 SHA256 521c1bd7c360fb66788e7c5e191497e014bb104f2ef2272d99a40b764082d7cb +DIST python-gentoo-patches-3.2.3-0.tar.bz2 14265 RMD160 90d2d94efbbbdf2d4018f97bd25083464131f36d SHA1 f4ddb5e1f6873634d22444599736a5aff931a7a5 SHA256 2ad8829aa6594edc405afd0ed148a2b4b608d7c6f09ea90bfb90d87580a4784b EBUILD python-2.5.4-r4.ebuild 9758 RMD160 10db51f6007c6e3baea435f72d1b23f3252fc03e SHA1 0577fb9820a4dfe978c63a691b4d7e4ac414a2b6 SHA256 e346b52c7fdc35a6881d994a8ffb254be7324f67b229d4c28d8b0a0db166a887 EBUILD python-2.6.6-r2.ebuild 10643 RMD160 05d2ccb6c2190fd8670e4746813661402492d228 SHA1 e9593163f531cb8bcebf65e510671fc762fbaefa SHA256 4c662ef2238e60fe0007566b2ac19869edfef18c2b3b965eb94606ae525ac45c EBUILD python-2.6.7-r2.ebuild 11713 RMD160 8ae1389d4475f4257684f2bfebbe07a1989123bd SHA1 d7040fbeb217975d4d109795052e10763757f9e2 SHA256 2ca0e45d147cefe8114015d0756425de97ecea8f241c1ac4881aa53bb40653c7 +EBUILD python-2.6.8.ebuild 9279 RMD160 31785031fc5b2e4d120ebb640f31abe53d8b0e69 SHA1 a44102942e14041f337f8b7cff334cfb6e1c194c SHA256 eb5dd1024bfb4375392b7c8a6bfab8934f2b45e278f6a8a973d4af99c111c5ea EBUILD python-2.7.2-r3.ebuild 12003 RMD160 8edbbcd451e1a3b60a6f36a2be88690cd302d661 SHA1 9a0fbeff4cd481b3aea2aed624fafee45984c3f3 SHA256 323c805b10ece2125f2950f3ac93e1c1f7008483fdcd43730159c5e60c36b8f9 +EBUILD python-2.7.3-r1.ebuild 9599 RMD160 d05d31fbd3d97d9cfcc0077247043392ab1f6293 SHA1 4329f7b4a6ebaa29ab491a2b4c7e30fb2531cea2 SHA256 d209c002b7ca33dcf729473a8633c95d4156983657e13ef70873b1f8959fe958 EBUILD python-2.7.3.ebuild 10514 RMD160 ed2180da276704719d722c4bacc243d06ff58558 SHA1 20701ddc7bb553b4c8c83b4334b58016c5c18e48 SHA256 3c8c368607d9de3d9e31e276c815e8a0ba9758d4eb203909e5ac8a917e86135f EBUILD python-3.1.4-r3.ebuild 10502 RMD160 7394f5044a668c595cb6c1155bbaf1275765818a SHA1 84d53cdc94a04dfa72dc8ce8c3e6d39ff31a86e4 SHA256 58d1f2cab26a26b49526a3a5b02100a57e5a2811ee638e942918731379e8b42b EBUILD python-3.1.4-r4.ebuild 10610 RMD160 02ef48bc76c9d5c30d2f35e9331076b3a8adb4a5 SHA1 be1f56063ec82fcf84310a73ef3c22aa810a5594 SHA256 3400eb206e13fbcbd43b7a2a2889e574bdd02b03beb61411c1e89ae57b66cfcf +EBUILD python-3.1.5.ebuild 8079 RMD160 225ac43c3169e7d52ce5a69378f8d278a5957908 SHA1 364ca6c637705e359839285a7f8623fb884f75d9 SHA256 53d8bb6f8e35f5978bfe7c906a899884759e2f7109b819974462e2f12afaaf58 EBUILD python-3.2.2-r1.ebuild 10948 RMD160 e1b138294ac62bffff6208372d2509e72cc43a60 SHA1 3fb7f8ce8d394c20d0829914a1a063d9e1f78ac9 SHA256 e8e29aebb7d348b588c7269b95e2dcaab0f045be3d28f59a5471b1402f402c6d EBUILD python-3.2.2.ebuild 10821 RMD160 2d51343b5a915c8880a0a5a846bbd86ce6805992 SHA1 4aff2efe6d752e4bee654cd96c08c17f521fe276 SHA256 584046f821e5a9abc733662fde2b0156a62767a12c9c5c9a4d42b359d823f6c1 -MISC ChangeLog 2270 RMD160 feaa0e0f22b9946e196b2be901a7fe3636867104 SHA1 fdc361902f57d874a1735b2296404aad990a7b13 SHA256 a83c51cbe65885a99b77861edb4f9b2cfde5ba379d737f4829b7fd77d3c6d329 +EBUILD python-3.2.3.ebuild 8509 RMD160 1c8066e119f9d83177eeb036b2c6f546b69f182c SHA1 4484239337696cc8829f5b6d91c7b8cf80895afb SHA256 1818a25f6253f7033138d58a4d716536adaa253710b927f3441e0418af865a20 +MISC ChangeLog 2640 RMD160 b265451a9962091ac1913527a4f4caf4946ff4c1 SHA1 2e6cc6e159291806ecee544bf98dc3fc4b4ad3a5 SHA256 2ef4e82bba5c9fe4db3d4b231ace840ab4278446a5733f28c904bb832c7e23dd MISC ChangeLog-2011 100599 RMD160 2b79c394a837d8d321a2750084da3fe0835e1d3b SHA1 3dbff45b51526c994fa3aa85f4eed7b962bdd09f SHA256 23129cb47321b2a6b1cb9323f1815d0cd11d6f30c3893908ed51575c270a0cc8 MISC metadata.xml 661 RMD160 54831d16b8807086bfabdbb3df9d33336b5d42a0 SHA1 9867c337fe9e6f4e967004fc9409763e0fedf43b SHA256 2c6c3407251f7ccd6501dee49494e539a9544f2fbae99a4373eefdf4e83e8908 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) +Version: GnuPG v2.0.17 (GNU/Linux) -iEYEARECAAYFAk+ZYqEACgkQvFcC4BYPU0rkNACgjIr5cfinzX5XMxNbWoxi6w4S -c48AoITLNOfzMJzAc29IIzRt+1a/lrG1 -=frnL +iF4EAREIAAYFAk+ZeGoACgkQC77qH+pIQ6T6AgD9HC+PCr+BydVbsc0oA6tMZM9F +h6y3GtwU1NiBe+y+RGAA/2gakQ9Q+biw65pInDdbSP6FX04j+jzQU5dxljwBgYpU +=cDur -----END PGP SIGNATURE----- diff --git a/dev-lang/python/python-2.6.8.ebuild b/dev-lang/python/python-2.6.8.ebuild new file mode 100644 index 000000000000..2d621d1fd83d --- /dev/null +++ b/dev-lang/python/python-2.6.8.ebuild @@ -0,0 +1,306 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.8.ebuild,v 1.1 2012/04/26 16:31:30 floppym Exp $ + +EAPI="2" +WANT_AUTOMAKE="none" +WANT_LIBTOOL="none" + +inherit autotools eutils flag-o-matic multilib pax-utils python toolchain-funcs + +MY_P="Python-${PV}" +PATCHSET_REVISION="0" + +DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." +HOMEPAGE="http://www.python.org/" +SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2 + mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.bz2" + +LICENSE="PSF-2" +SLOT="2.6" +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-arch/bzip2 + >=sys-libs/zlib-1.1.3 + virtual/libffi + virtual/libintl + !build? ( + berkdb? ( || ( + 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.3:3 ) + ssl? ( dev-libs/openssl ) + tk? ( + >=dev-lang/tk-8.0 + dev-tcltk/blt + ) + xml? ( >=dev-libs/expat-2.1 ) + ) + !!<sys-apps/portage-2.1.9" +DEPEND="${RDEPEND} + dev-util/pkgconfig + >=sys-devel/autoconf-2.61 + !sys-devel/gcc[libffi]" +RDEPEND+=" !build? ( app-misc/mime-types ) + doc? ( dev-python/python-docs:${SLOT} )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + python_pkg_setup + + if use berkdb; then + ewarn "\"bsddb\" module is out-of-date and no longer maintained inside dev-lang/python." + ewarn "\"bsddb\" and \"dbhash\" modules have been additionally removed in Python 3." + ewarn "You should use external, still maintained \"bsddb3\" module provided by dev-python/bsddb3," + ewarn "which supports both Python 2 and Python 3." + else + if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then + ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb] to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." + ewarn "You might need to migrate your databases." + fi + fi +} + +src_prepare() { + # Ensure that internal copies of expat, libffi and zlib are not used. + rm -fr Modules/expat + rm -fr Modules/_ctypes/libffi* + rm -fr Modules/zlib + + local excluded_patches + if ! tc-is-cross-compiler; then + excluded_patches="*_all_crosscompile.patch" + fi + + EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}" + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + Lib/distutils/command/install.py \ + Lib/distutils/sysconfig.py \ + Lib/site.py \ + Makefile.pre.in \ + Modules/Setup.dist \ + Modules/getpath.c \ + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" + + eautoconf + eautoheader +} + +src_configure() { + if use build; then + # Disable extraneous modules with extra dependencies. + export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" + export PYTHON_DISABLE_SSL="1" + else + # dbm module can be linked against berkdb or gdbm. + # Defaults to gdbm when both are enabled, #204343. + local disable + use berkdb || use gdbm || disable+=" dbm" + use berkdb || disable+=" _bsddb" + use gdbm || disable+=" gdbm" + use ncurses || disable+=" _curses _curses_panel" + use readline || disable+=" readline" + use sqlite || disable+=" _sqlite3" + use ssl || export PYTHON_DISABLE_SSL="1" + use tk || disable+=" _tkinter" + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. + export PYTHON_DISABLE_MODULES="${disable}" + + if ! use xml; then + ewarn "You have configured Python without XML support." + ewarn "This is NOT a recommended configuration as you" + ewarn "may face problems parsing any XML documents." + fi + fi + + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" + fi + + if [[ "$(gcc-major-version)" -ge 4 ]]; then + append-flags -fwrapv + fi + + filter-flags -malign-double + + [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC + + # https://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flagq -O3; then + is-flagq -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi + + if tc-is-cross-compiler; then + OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \ + ./configure --{build,host}=${CBUILD} || die "cross-configure failed" + emake python Parser/pgen || die "cross-make failed" + mv python hostpython + mv Parser/pgen Parser/hostpgen + make distclean + sed -i \ + -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \ + -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \ + Makefile.pre.in || die "sed failed" + fi + + # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. + tc-export CXX + + # Set LDFLAGS so we link modules with -lpython2.6 correctly. + # Needed on FreeBSD unless Python 2.6 is already installed. + # Please query BSD team before removing this! + append-ldflags "-L." + + 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-libc="" \ + --with-system-ffi +} + +src_compile() { + emake EPYTHON="python${PV%%.*}" || die "emake failed" + + pax-mark m libpython${SLOT}.so.1.0 python +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + # Byte compiling should be enabled here. + # Otherwise test_import fails. + python_enable_pyc + + # Skip failing tests. + local skipped_tests="distutils tcl" + + for test in ${skipped_tests}; do + mv Lib/test/test_${test}.py "${T}" + done + + # Rerun failed tests in verbose mode (regrtest -w). + emake test EXTRATESTOPTS="-w" < /dev/tty + local result="$?" + + for test in ${skipped_tests}; do + mv "${T}/test_${test}.py" Lib/test + done + + elog "The following tests have been skipped:" + for test in ${skipped_tests}; do + elog "test_${test}.py" + done + + elog "If you would like to run them, you may:" + elog "cd '${EPREFIX}$(python_get_libdir)/test'" + elog "and run the tests separately." + + python_disable_pyc + + if [[ "${result}" -ne 0 ]]; then + die "emake test failed" + fi +} + +src_install() { + [[ -z "${ED}" ]] && ED="${D%/}${EPREFIX}/" + + emake DESTDIR="${D}" altinstall maninstall || die "emake altinstall maninstall failed" + python_clean_installation_image -q + + 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}" + mv "${ED}usr/share/man/man1/python.1" "${ED}usr/share/man/man1/python${SLOT}.1" + rm -f "${ED}usr/bin/smtpd.py" + + if use build; then + rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test} + else + use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/"{bsddb/test,test} + use berkdb || rm -fr "${ED}$(python_get_libdir)/"{bsddb,dbhash.py,test/test_bsddb*} + use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*} + use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,lib-tk} + fi + + use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing" + use wininst || rm -f "${ED}$(python_get_libdir)/distutils/command/"wininst-*.exe + + dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed" + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r Tools || die "doins failed" + fi + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed" + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed" + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${SLOT}:" \ + -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.6" && ! has_version "${CATEGORY}/${PN}:2.7"; then + python_updater_warning="1" + fi +} + +eselect_python_update() { + [[ -z "${EROOT}" || (! -d "${EROOT}" && -d "${ROOT}") ]] && EROOT="${ROOT%/}${EPREFIX}/" + + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then + eselect python update + fi + + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then + eselect python update --python${PV%%.*} + fi +} + +pkg_postinst() { + eselect_python_update + + python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir) + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn "You should switch active version of Python ${PV%%.*} and run" + ewarn "'python-updater \${options}' to rebuild Python modules." + fi +} + +pkg_postrm() { + eselect_python_update + + python_mod_cleanup $(python_get_libdir) +} diff --git a/dev-lang/python/python-2.7.3-r1.ebuild b/dev-lang/python/python-2.7.3-r1.ebuild new file mode 100644 index 000000000000..8c542c91e5d3 --- /dev/null +++ b/dev-lang/python/python-2.7.3-r1.ebuild @@ -0,0 +1,321 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.3-r1.ebuild,v 1.1 2012/04/26 16:31:30 floppym Exp $ + +EAPI="2" +WANT_AUTOMAKE="none" +WANT_LIBTOOL="none" + +inherit autotools eutils flag-o-matic multilib pax-utils python toolchain-funcs + +MY_P="Python-${PV}" +PATCHSET_REVISION="0" + +DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." +HOMEPAGE="http://www.python.org/" +SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2 + mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.bz2" + +LICENSE="PSF-2" +SLOT="2.7" +PYTHON_ABI="${SLOT}" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="-berkdb build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" + +RDEPEND="app-arch/bzip2 + >=sys-libs/zlib-1.1.3 + virtual/libffi + virtual/libintl + !build? ( + berkdb? ( || ( + sys-libs/db:4.8 + sys-libs/db:4.7 + sys-libs/db:4.6 + sys-libs/db:4.5 + sys-libs/db:4.4 + sys-libs/db:4.3 + sys-libs/db:4.2 + ) ) + gdbm? ( sys-libs/gdbm[berkdb] ) + ncurses? ( + >=sys-libs/ncurses-5.2 + readline? ( >=sys-libs/readline-4.1 ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] ) + ssl? ( dev-libs/openssl ) + tk? ( + >=dev-lang/tk-8.0 + dev-tcltk/blt + ) + xml? ( >=dev-libs/expat-2.1 ) + ) + !!<sys-apps/portage-2.1.9" +DEPEND="${RDEPEND} + dev-util/pkgconfig + >=sys-devel/autoconf-2.65 + !sys-devel/gcc[libffi]" +RDEPEND+=" !build? ( app-misc/mime-types ) + doc? ( dev-python/python-docs:${SLOT} )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + python_pkg_setup + + if use berkdb; then + ewarn "\"bsddb\" module is out-of-date and no longer maintained inside dev-lang/python." + ewarn "\"bsddb\" and \"dbhash\" modules have been additionally removed in Python 3." + ewarn "You should use external, still maintained \"bsddb3\" module provided by dev-python/bsddb3," + ewarn "which supports both Python 2 and Python 3." + else + if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then + ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb] to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." + ewarn "You might need to migrate your databases." + fi + fi +} + +src_prepare() { + # Ensure that internal copies of expat, libffi and zlib are not used. + rm -fr Modules/expat + rm -fr Modules/_ctypes/libffi* + rm -fr Modules/zlib + + local excluded_patches + if ! tc-is-cross-compiler; then + excluded_patches="*_all_crosscompile.patch" + fi + + EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}" + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + Lib/distutils/command/install.py \ + Lib/distutils/sysconfig.py \ + Lib/site.py \ + Lib/sysconfig.py \ + Lib/test/test_site.py \ + Makefile.pre.in \ + Modules/Setup.dist \ + Modules/getpath.c \ + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" + + eautoconf + eautoheader +} + +src_configure() { + if use build; then + # Disable extraneous modules with extra dependencies. + export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" + export PYTHON_DISABLE_SSL="1" + else + # dbm module can be linked against berkdb or gdbm. + # Defaults to gdbm when both are enabled, #204343. + local disable + use berkdb || use gdbm || disable+=" dbm" + use berkdb || disable+=" _bsddb" + use gdbm || disable+=" gdbm" + use ncurses || disable+=" _curses _curses_panel" + use readline || disable+=" readline" + use sqlite || disable+=" _sqlite3" + use ssl || export PYTHON_DISABLE_SSL="1" + use tk || disable+=" _tkinter" + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. + export PYTHON_DISABLE_MODULES="${disable}" + + if ! use xml; then + ewarn "You have configured Python without XML support." + ewarn "This is NOT a recommended configuration as you" + ewarn "may face problems parsing any XML documents." + fi + fi + + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" + fi + + if [[ "$(gcc-major-version)" -ge 4 ]]; then + append-flags -fwrapv + fi + + filter-flags -malign-double + + [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC + + # https://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flagq -O3; then + is-flagq -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi + + if tc-is-cross-compiler; then + OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \ + ./configure --{build,host}=${CBUILD} || die "cross-configure failed" + emake python Parser/pgen || die "cross-make failed" + mv python hostpython + mv Parser/pgen Parser/hostpgen + make distclean + sed -i \ + -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \ + -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \ + Makefile.pre.in || die "sed failed" + fi + + # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. + tc-export CXX + + # Set LDFLAGS so we link modules with -lpython2.7 correctly. + # Needed on FreeBSD unless Python 2.7 is already installed. + # Please query BSD team before removing this! + append-ldflags "-L." + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + if use berkdb; then + dbmliborder+="${dbmliborder:+:}bdb" + fi + + OPT="" econf \ + --with-fpectl \ + --enable-shared \ + $(use_enable ipv6) \ + $(use_with threads) \ + $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \ + --infodir='${prefix}/share/info' \ + --mandir='${prefix}/share/man' \ + --with-dbmliborder="${dbmliborder}" \ + --with-libc="" \ + --enable-loadable-sqlite-extensions \ + --with-system-expat \ + --with-system-ffi +} + +src_compile() { + emake EPYTHON="python${PV%%.*}" || die "emake failed" + + pax-mark m libpython${SLOT}.so.1.0 python +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + # Byte compiling should be enabled here. + # Otherwise test_import fails. + python_enable_pyc + + # Skip failing tests. + local skipped_tests="distutils gdb" + + for test in ${skipped_tests}; do + mv Lib/test/test_${test}.py "${T}" + done + + # Rerun failed tests in verbose mode (regrtest -w). + emake test EXTRATESTOPTS="-w" < /dev/tty + local result="$?" + + for test in ${skipped_tests}; do + mv "${T}/test_${test}.py" Lib/test + done + + elog "The following tests have been skipped:" + for test in ${skipped_tests}; do + elog "test_${test}.py" + done + + elog "If you would like to run them, you may:" + elog "cd '${EPREFIX}$(python_get_libdir)/test'" + elog "and run the tests separately." + + python_disable_pyc + + if [[ "${result}" -ne 0 ]]; then + die "emake test failed" + fi +} + +src_install() { + [[ -z "${ED}" ]] && ED="${D%/}${EPREFIX}/" + + emake DESTDIR="${D}" altinstall maninstall || die "emake altinstall maninstall failed" + python_clean_installation_image -q + + sed -e "s/\(LDFLAGS=\).*/\1/" -i "${ED}$(python_get_libdir)/config/Makefile" || die "sed failed" + + mv "${ED}usr/bin/python${SLOT}-config" "${ED}usr/bin/python-config-${SLOT}" + + # Fix collisions between different slots of Python. + mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}" + mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}" + mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}" + rm -f "${ED}usr/bin/smtpd.py" + + if use build; then + rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test} + else + use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/"{bsddb/test,test} + use berkdb || rm -fr "${ED}$(python_get_libdir)/"{bsddb,dbhash.py,test/test_bsddb*} + use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*} + use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,lib-tk} + fi + + use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing" + use wininst || rm -f "${ED}$(python_get_libdir)/distutils/command/"wininst-*.exe + + dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed" + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r Tools || die "doins failed" + fi + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed" + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed" + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${SLOT}:" \ + -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then + python_updater_warning="1" + fi +} + +eselect_python_update() { + [[ -z "${EROOT}" || (! -d "${EROOT}" && -d "${ROOT}") ]] && EROOT="${ROOT%/}${EPREFIX}/" + + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then + eselect python update + fi + + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then + eselect python update --python${PV%%.*} + fi +} + +pkg_postinst() { + eselect_python_update + + python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir) + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn "You should switch active version of Python ${PV%%.*} and run" + ewarn "'python-updater \${options}' to rebuild Python modules." + fi +} + +pkg_postrm() { + eselect_python_update + + python_mod_cleanup $(python_get_libdir) +} diff --git a/dev-lang/python/python-3.1.5.ebuild b/dev-lang/python/python-3.1.5.ebuild new file mode 100644 index 000000000000..6fbb3ed8efbd --- /dev/null +++ b/dev-lang/python/python-3.1.5.ebuild @@ -0,0 +1,287 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.5.ebuild,v 1.1 2012/04/26 16:31:30 floppym Exp $ + +EAPI="3" +WANT_AUTOMAKE="none" +WANT_LIBTOOL="none" + +inherit autotools eutils flag-o-matic multilib pax-utils python toolchain-funcs + +MY_P="Python-${PV}" +PATCHSET_REVISION="0" + +DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." +HOMEPAGE="http://www.python.org/" +SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz + mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.bz2" + +LICENSE="PSF-2" +SLOT="3.1" +PYTHON_ABI="${SLOT}" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" +IUSE="build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" + +RDEPEND="app-arch/bzip2 + >=sys-libs/zlib-1.1.3 + virtual/libffi + virtual/libintl + !build? ( + gdbm? ( sys-libs/gdbm[berkdb] ) + ncurses? ( + >=sys-libs/ncurses-5.2 + readline? ( >=sys-libs/readline-4.1 ) + ) + sqlite? ( >=dev-db/sqlite-3.3.3:3 ) + ssl? ( dev-libs/openssl ) + tk? ( + >=dev-lang/tk-8.0 + dev-tcltk/blt + ) + xml? ( >=dev-libs/expat-2.1 ) + )" +DEPEND="${RDEPEND} + dev-util/pkgconfig + >=sys-devel/autoconf-2.61 + !sys-devel/gcc[libffi]" +RDEPEND+=" !build? ( app-misc/mime-types ) + doc? ( dev-python/python-docs:${SLOT} )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + python_pkg_setup +} + +src_prepare() { + # Ensure that internal copies of expat, libffi and zlib are not used. + rm -fr Modules/expat + rm -fr Modules/_ctypes/libffi* + rm -fr Modules/zlib + + local excluded_patches + if ! tc-is-cross-compiler; then + excluded_patches="*_all_crosscompile.patch" + fi + + EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}" + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + Lib/distutils/command/install.py \ + Lib/distutils/sysconfig.py \ + Lib/site.py \ + 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="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" + export PYTHON_DISABLE_SSL="1" + else + local disable + use gdbm || disable+=" gdbm" + use ncurses || disable+=" _curses _curses_panel" + use readline || disable+=" readline" + use sqlite || disable+=" _sqlite3" + use ssl || export PYTHON_DISABLE_SSL="1" + use tk || disable+=" _tkinter" + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. + export PYTHON_DISABLE_MODULES="${disable}" + + if ! use xml; then + ewarn "You have configured Python without XML support." + ewarn "This is NOT a recommended configuration as you" + ewarn "may face problems parsing any XML documents." + fi + fi + + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" + fi + + if [[ "$(gcc-major-version)" -ge 4 ]]; then + append-flags -fwrapv + fi + + filter-flags -malign-double + + [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC + + # https://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flagq -O3; then + is-flagq -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi + + if tc-is-cross-compiler; then + OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \ + ./configure --{build,host}=${CBUILD} || die "cross-configure failed" + emake python Parser/pgen || die "cross-make failed" + mv python hostpython + mv Parser/pgen Parser/hostpgen + make distclean + sed -i \ + -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \ + -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \ + Makefile.pre.in || die "sed failed" + fi + + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. + tc-export CXX + + # Set LDFLAGS so we link modules with -lpython3.1 correctly. + # Needed on FreeBSD unless Python 3.1 is already installed. + # Please query BSD team before removing this! + append-ldflags "-L." + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + OPT="" econf \ + --with-fpectl \ + --enable-shared \ + $(use_enable ipv6) \ + $(use_with threads) \ + $(use_with wide-unicode) \ + --infodir='${prefix}/share/info' \ + --mandir='${prefix}/share/man' \ + --with-computed-gotos \ + --with-dbmliborder="${dbmliborder}" \ + --with-libc="" \ + --with-system-ffi +} + +src_compile() { + emake || die "emake failed" + + pax-mark m libpython${SLOT}.so.1.0 python +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + if ! use threads; then + ewarn "Disabling tests due to USE=\"-threads\"" + return + fi + + # Byte compiling should be enabled here. + # Otherwise test_import fails. + python_enable_pyc + + # Skip failing tests. + local skipped_tests="distutils" + + for test in ${skipped_tests}; do + mv Lib/test/test_${test}.py "${T}" + done + + # Rerun failed tests in verbose mode (regrtest -w). + emake test EXTRATESTOPTS="-w" < /dev/tty + local result="$?" + + for test in ${skipped_tests}; do + mv "${T}/test_${test}.py" Lib/test + done + + elog "The following tests have been skipped:" + for test in ${skipped_tests}; do + elog "test_${test}.py" + done + + elog "If you would like to run them, you may:" + elog "cd '${EPREFIX}$(python_get_libdir)/test'" + elog "and run the tests separately." + + python_disable_pyc + + if [[ "${result}" -ne 0 ]]; then + die "emake test failed" + fi +} + +src_install() { + emake DESTDIR="${D}" altinstall || die "emake altinstall failed" + python_clean_installation_image -q + + 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/pydoc3" "${ED}usr/bin/pydoc${SLOT}" + mv "${ED}usr/bin/idle3" "${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)/"{idlelib,sqlite3,test,tkinter} + else + use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/test" + use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*} + use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,tkinter,test/test_tk*} + fi + + use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing" + use wininst || rm -f "${ED}$(python_get_libdir)/distutils/command/"wininst-*.exe + + dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed" + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins -r Tools || die "doins failed" + fi + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed" + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed" + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${SLOT}:" \ + -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then + python_updater_warning="1" + fi +} + +eselect_python_update() { + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then + eselect python update + fi + + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then + eselect python update --python${PV%%.*} + fi +} + +pkg_postinst() { + eselect_python_update + + python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir) + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn "You should switch active version of Python ${PV%%.*} and run" + ewarn "'python-updater \${options}' to rebuild Python modules." + fi +} + +pkg_postrm() { + eselect_python_update + + python_mod_cleanup $(python_get_libdir) +} diff --git a/dev-lang/python/python-3.2.3.ebuild b/dev-lang/python/python-3.2.3.ebuild new file mode 100644 index 000000000000..41cc491a5b32 --- /dev/null +++ b/dev-lang/python/python-3.2.3.ebuild @@ -0,0 +1,298 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.2.3.ebuild,v 1.1 2012/04/26 16:31:30 floppym Exp $ + +EAPI="3" +WANT_AUTOMAKE="none" +WANT_LIBTOOL="none" + +inherit autotools eutils flag-o-matic multilib pax-utils python toolchain-funcs + +MY_P="Python-${PV}" +PATCHSET_REVISION="0" + +DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." +HOMEPAGE="http://www.python.org/" +SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz + mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.bz2" + +LICENSE="PSF-2" +SLOT="3.2" +PYTHON_ABI="${SLOT}" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" + +RDEPEND="app-arch/bzip2 + >=sys-libs/zlib-1.1.3 + virtual/libffi + virtual/libintl + !build? ( + gdbm? ( sys-libs/gdbm[berkdb] ) + ncurses? ( + >=sys-libs/ncurses-5.2 + readline? ( >=sys-libs/readline-4.1 ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] ) + ssl? ( dev-libs/openssl ) + tk? ( + >=dev-lang/tk-8.0 + dev-tcltk/blt + ) + xml? ( >=dev-libs/expat-2.1 ) + )" +DEPEND="${RDEPEND} + dev-util/pkgconfig + >=sys-devel/autoconf-2.65 + !sys-devel/gcc[libffi]" +RDEPEND+=" !build? ( app-misc/mime-types ) + doc? ( dev-python/python-docs:${SLOT} )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + python_pkg_setup + + if [[ "${PV}" =~ ^3\.2(\.[1234])?(_pre)? ]]; then + rm -f "${EROOT}usr/$(get_libdir)/llibpython3.so" + else + die "Deprecated code not deleted" + fi +} + +src_prepare() { + # Ensure that internal copies of expat, libffi and zlib are not used. + rm -fr Modules/expat + rm -fr Modules/_ctypes/libffi* + rm -fr Modules/zlib + + local excluded_patches + if ! tc-is-cross-compiler; then + excluded_patches="*_all_crosscompile.patch" + fi + + EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}" + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + Lib/distutils/command/install.py \ + Lib/distutils/sysconfig.py \ + Lib/site.py \ + Lib/sysconfig.py \ + Lib/test/test_site.py \ + Makefile.pre.in \ + Modules/Setup.dist \ + Modules/getpath.c \ + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" + + # Disable ABI flags. + sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.in || die "sed failed" + + eautoconf + eautoheader +} + +src_configure() { + if use build; then + # Disable extraneous modules with extra dependencies. + export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat" + export PYTHON_DISABLE_SSL="1" + else + local disable + use gdbm || disable+=" gdbm" + use ncurses || disable+=" _curses _curses_panel" + use readline || disable+=" readline" + use sqlite || disable+=" _sqlite3" + use ssl || export PYTHON_DISABLE_SSL="1" + use tk || disable+=" _tkinter" + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. + export PYTHON_DISABLE_MODULES="${disable}" + + if ! use xml; then + ewarn "You have configured Python without XML support." + ewarn "This is NOT a recommended configuration as you" + ewarn "may face problems parsing any XML documents." + fi + fi + + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" + fi + + if [[ "$(gcc-major-version)" -ge 4 ]]; then + append-flags -fwrapv + fi + + filter-flags -malign-double + + [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC + + # https://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flagq -O3; then + is-flagq -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi + + if tc-is-cross-compiler; then + OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \ + ./configure --{build,host}=${CBUILD} || die "cross-configure failed" + emake python Parser/pgen || die "cross-make failed" + mv python hostpython + mv Parser/pgen Parser/hostpgen + make distclean + sed -i \ + -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \ + -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \ + Makefile.pre.in || die "sed failed" + fi + + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. + tc-export CXX + + # Set LDFLAGS so we link modules with -lpython3.2 correctly. + # Needed on FreeBSD unless Python 3.2 is already installed. + # Please query BSD team before removing this! + append-ldflags "-L." + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + OPT="" econf \ + --with-fpectl \ + --enable-shared \ + $(use_enable ipv6) \ + $(use_with threads) \ + $(use_with wide-unicode) \ + --infodir='${prefix}/share/info' \ + --mandir='${prefix}/share/man' \ + --with-computed-gotos \ + --with-dbmliborder="${dbmliborder}" \ + --with-libc="" \ + --enable-loadable-sqlite-extensions \ + --with-system-expat \ + --with-system-ffi +} + +src_compile() { + emake CPPFLAGS="" CFLAGS="" LDFLAGS="" || die "emake failed" + + pax-mark m libpython${SLOT}.so.1.0 python +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + # Byte compiling should be enabled here. + # Otherwise test_import fails. + python_enable_pyc + + # Skip failing tests. + local skipped_tests="gdb" + + for test in ${skipped_tests}; do + mv Lib/test/test_${test}.py "${T}" + done + + # Rerun failed tests in verbose mode (regrtest -w). + emake test EXTRATESTOPTS="-w" CPPFLAGS="" CFLAGS="" LDFLAGS="" < /dev/tty + local result="$?" + + for test in ${skipped_tests}; do + mv "${T}/test_${test}.py" Lib/test + done + + elog "The following tests have been skipped:" + for test in ${skipped_tests}; do + elog "test_${test}.py" + done + + elog "If you would like to run them, you may:" + elog "cd '${EPREFIX}$(python_get_libdir)/test'" + elog "and run the tests separately." + + python_disable_pyc + + if [[ "${result}" -ne 0 ]]; then + die "emake test failed" + fi +} + +src_install() { + emake DESTDIR="${D}" altinstall || die "emake altinstall failed" + python_clean_installation_image -q + + sed \ + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ + -e "s/\(PY_LDFLAGS=\).*/\1/" \ + -i "${ED}$(python_get_libdir)/config-${SLOT}/Makefile" || die "sed failed" + + mv "${ED}usr/bin/python${SLOT}-config" "${ED}usr/bin/python-config-${SLOT}" + + # Fix collisions between different slots of Python. + rm -f "${ED}usr/$(get_libdir)/libpython3.so" + + if use build; then + rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,sqlite3,test,tkinter} + else + use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/test" + use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*} + use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,tkinter,test/test_tk*} + fi + + use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing" + use wininst || rm -f "${ED}$(python_get_libdir)/distutils/command/"wininst-*.exe + + dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed" + + if use examples; then + insinto /usr/share/doc/${PF}/examples + find Tools -name __pycache__ -print0 | xargs -0 rm -fr + doins -r Tools || die "doins failed" + fi + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed" + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed" + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${SLOT}:" \ + -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then + python_updater_warning="1" + fi +} + +eselect_python_update() { + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then + eselect python update + fi + + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then + eselect python update --python${PV%%.*} + fi +} + +pkg_postinst() { + eselect_python_update + + python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir) + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn "You should switch active version of Python ${PV%%.*} and run" + ewarn "'python-updater \${options}' to rebuild Python modules." + fi +} + +pkg_postrm() { + eselect_python_update + + python_mod_cleanup $(python_get_libdir) +} |