commit:     ca57e96ecbcd060e4f70aa24ccd83470ccb8a434
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 22 11:33:10 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Apr 22 13:32:23 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca57e96e

dev-lang/python: Bump to 2.7.18

Bug: https://bugs.gentoo.org/707822
Closes: https://bugs.gentoo.org/716332
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/python/Manifest             |   2 +
 dev-lang/python/python-2.7.18.ebuild | 366 +++++++++++++++++++++++++++++++++++
 2 files changed, 368 insertions(+)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 75bec42afd3..56928c5db26 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,10 +1,12 @@
 DIST Python-2.7.17.tar.xz 12855568 BLAKE2B 
6d09214a51d6595fe5253a279ee556d7510dcb9a0e8ad71e9cf73b4fb00c3abd3680e2429f4f87d9387d1fc16d4887f5f33fc600b24b0ca2c70f36bf34df2157
 SHA512 
2dc19a0b0d818c71429dae94783e58b2aac0fa31f5faa1e840cac06245a59932ecc4658d913515736601bcf70a78c9ec60367aed75f4567d1e41ff3bb104da9a
+DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 
060a621c91dd8e3d321aec99d44c17aa67381998256a1a002d316b38288349884d5960de35c49352d03129ed0bae599e641ec2225898158ebce50a7a2fd74d2c
 SHA512 
a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c
 DIST Python-3.6.10.tar.xz 17212220 BLAKE2B 
822e231cf2755e6477e49e9128a983185a4f1e30e9d6c221f1b5720891c0de345e8c5402af458d3627eba124e75fea4b5daa94e01b0eaddc116dc3281263ecbe
 SHA512 
26147099e1f1a0ffc85febad26e18e991f019599a150887ea0b925e34663fad8e03b3c2a941e2770c1a63960695e173ef32709572c9361e7f2cb862ccf75b28a
 DIST Python-3.7.7.tar.xz 17268888 BLAKE2B 
5f16c9559249470a9e6c0aa686965e7d78ce0f7364b5d03fc9590613c7a5456f92835340e49bf9becbec18b18d1e5a6fc318b6e30f2349da3246a918cf8b05ff
 SHA512 
ddc838a7b0c442c2e465616f20231f2b703ed6b69ed2dc17858aac8760814fdf7cff43d350d359300e47b6bb1f0bd38c31126b855e423a3a65ed06a8fa16d136
 DIST Python-3.8.2.tar.xz 17869888 BLAKE2B 
f42b35bea5e65f1f0a3fa6f1fd3d749fba3fa46d958608a314c1a98d0e3ca890e856da4d40ee489fe546fc02ce0fc9fa2daaaba96a8928d92ae7eb3d2dda3fe4
 SHA512 
ca37ad0e7c5845f5f228566aa8ff654a8f428c7d4a5aaabff29baebb0ca3219b31ba8bb2607f89e37cf3fc564f023b8407e53a4f2c47bd99122c1cc222613e37
 DIST Python-3.9.0a4.tar.xz 18032300 BLAKE2B 
1c9ad55c7c055c3a704c4062e092d44b8d778e334e05589e7166777da328df54ef257aeb2e203416710bb9f9f1571d7700c2c12aed5b8e63adf7a1b3aedb08b5
 SHA512 
8f7ca0a891fb7e7868dfe5f040e9ceb7ce14d036bc5d9eae1493570c5a9631832e796a1972590c444d2347c585b0c8216345375dd1476b4da7bd47e187591afc
 DIST Python-3.9.0a5.tar.xz 18039660 BLAKE2B 
2d8e273ef577ea3f19cb3f64c89f2229d68bd647112fc61753487b53f8efd78a9797ceaf68fecbd9d13483e825f79f20a7b01be2e0aeca2ee2e978108467b77f
 SHA512 
b2f884a492eeb9fa7347c664bb6fd1dc3c25f663ebb4f9455b66540e12ce8da845c2ad4960999d5475625bc64c834f3cff28f61cd37881bdf53efa349c44bff3
 DIST python-gentoo-patches-2.7.17-r1.tar.xz 14708 BLAKE2B 
f6e25236a471649de122d0f29506f7a4f34044a568ead47a68980411d9722b761fe1f9d653d5edccb6978b65c8c1eecbef55f403b94f32b37c0ad68e061505a8
 SHA512 
ecdde5e38c6fe5e69691fb3a68c8f4f43da7857d4abaff763d3cf6ad864ba43c769c03b186b60f2736a1ffb1e3e4c9982715d1b8a99ff3f5740096153bb8a90f
+DIST python-gentoo-patches-2.7.18.tar.xz 15012 BLAKE2B 
f691e231c793bb8f11fb64c89b90e022af8e0fe0e28839822c2ae6214fdab6c6fd9c07466c4b5797d3964b7db09fd979597774fb7872dc674e8df59321b6bf95
 SHA512 
a2952b27bfc0a52f322b2f3e177cbe09fa288c9ca5967c13fb9c2d45d3e81033407e30e86bdaaaa258f0b3cfa2cef6eda5502bddb6390f9512a493d145d34e03
 DIST python-gentoo-patches-3.6.10.tar.xz 10964 BLAKE2B 
e32c8cb3050c7324ee234f585be7fc40cfacc6ad87759eaa300e57289e6dc6cbaed3913f33ad632b8754638e8d71983d8364ceeaad8ef325cfa6d4d2dfb56df0
 SHA512 
71fea7306c876c63888c4547eaf14dc2e0413dec343609d748cd1b5888e4605d47888758ebc5120a287ce833b69dd538073f91989460da7c40462b53eefca7ce
 DIST python-gentoo-patches-3.7.6.tar.xz 10084 BLAKE2B 
220869e85bdaf9c21b1b05e13803bdb6ecc22ac0f69da77e57fd7c1cd93ef45ec43401b62732842e1bb3467feb6d65c8204120e2741e9eb6f4cab673fd3a8d62
 SHA512 
4c04b0cf7da55fa7973ab178e3ac2c59bc2142924bdced5954c058053280b6c663d7c39912286d10fe0e82ca30af6a0dd6a56fa85433f836217ca3dcbb284def
 DIST python-gentoo-patches-3.8.1-r2.tar.xz 10108 BLAKE2B 
02d3e2ae95b5cfa67c0ba4ff618fbee51d2342955d0a064b80575beda73902bd72462e4f6dba63743bf9fc031d92c69153ef8bd8a0ab5d6e17bfdf8ed0152da5
 SHA512 
757f7cf6b0cb6c1493d8ed8e5780780efcb32860a9aeba4f933a3a3fb22c412bebde8854e34609465d8a12cb9545a7b19e5d5dbe87d772bb83acd9fe829b75cc

diff --git a/dev-lang/python/python-2.7.18.ebuild 
b/dev-lang/python/python-2.7.18.ebuild
new file mode 100644
index 00000000000..44ee796141c
--- /dev/null
+++ b/dev-lang/python/python-2.7.18.ebuild
@@ -0,0 +1,366 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+WANT_LIBTOOL="none"
+
+inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
+
+MY_P="Python-${PV}"
+PYVER=$(ver_cut 1-2)
+PATCHSET="python-gentoo-patches-2.7.18"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/";
+SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
+       https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz";
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="PSF-2"
+SLOT="${PYVER}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sparc ~x86"
+IUSE="-berkdb bluetooth build elibc_uclibc examples gdbm hardened ipv6 
libressl +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:=
+       dev-libs/libffi:=
+       >=sys-libs/zlib-1.1.3:=
+       virtual/libcrypt:=
+       virtual/libintl
+       berkdb? ( || (
+               sys-libs/db:5.3
+               sys-libs/db:5.1
+               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? (
+               !libressl? ( dev-libs/openssl:= )
+               libressl? ( dev-libs/libressl:= )
+       )
+       tk? (
+               >=dev-lang/tcl-8.0:=
+               >=dev-lang/tk-8.0:=
+               dev-tcltk/blt:=
+               dev-tcltk/tix
+       )
+       xml? ( >=dev-libs/expat-2.1:= )"
+# bluetooth requires headers from bluez
+DEPEND="${RDEPEND}
+       bluetooth? ( net-wireless/bluez )
+       virtual/pkgconfig
+       !sys-devel/gcc[libffi(-)]"
+RDEPEND+=" !build? ( app-misc/mime-types )"
+PDEPEND=">=app-eselect/eselect-python-20140125-r1"
+
+pkg_setup() {
+       if use berkdb; then
+               ewarn "'bsddb' module is out-of-date and no longer maintained 
inside"
+               ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been 
additionally"
+               ewarn "removed in Python 3. A maintained alternative of 
'bsddb3' module"
+               ewarn "is provided by dev-python/bsddb3."
+       else
+               if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
+                       ewarn "You are migrating from 
=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
+                       ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
+                       ewarn "You might need to migrate your databases."
+               fi
+       fi
+}
+
+src_prepare() {
+       # Ensure that internal copies of expat, libffi and zlib are not used.
+       rm -fr Modules/expat || die
+       rm -fr Modules/_ctypes/libffi* || die
+       rm -fr Modules/zlib || die
+
+       local PATCHES=(
+               "${WORKDIR}/${PATCHSET}"
+       )
+
+       default
+
+       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@@"
+
+       eautoreconf
+}
+
+src_configure() {
+       # 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"
+       # disable automagic bluetooth headers detection
+       use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
+       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
+
+       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
+
+       # 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
+
+       local myeconfargs=(
+               # The check is broken on clang, and gives false positive:
+               # https://bugs.gentoo.org/596798
+               # (upstream dropped this flag in 3.2a4 anyway)
+               ac_cv_opt_olimit_ok=no
+               # glibc-2.30 removes it; since we can't cleanly force-rebuild
+               # Python on glibc upgrade, remove it proactively to give
+               # a chance for users rebuilding python before glibc
+               ac_cv_header_stropts_h=no
+
+               --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-computed-gotos
+               --with-dbmliborder="${dbmliborder}"
+               --with-libc=
+               --enable-loadable-sqlite-extensions
+               --with-system-expat
+               --with-system-ffi
+               --without-ensurepip
+       )
+
+       OPT="" econf "${myeconfargs[@]}"
+
+       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() {
+       # Ensure sed works as expected
+       # https://bugs.gentoo.org/594768
+       local -x LC_ALL=C
+
+       # Avoid invoking pgen for cross-compiles.
+       touch Include/graminit.h Python/graminit.c
+
+       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
+
+       # Skip failing tests.
+       local skipped_tests="distutils gdb"
+
+       for test in ${skipped_tests}; do
+               mv "${S}"/Lib/test/test_${test}.py "${T}"
+       done
+
+       # bug 660358
+       local -x COLUMNS=80
+
+       # Daylight saving time problem
+       # https://bugs.python.org/issue22067
+       # https://bugs.gentoo.org/610628
+       local -x TZ=UTC
+
+       # 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${PYVER}/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${PYVER}
+
+       emake DESTDIR="${D}" altinstall
+
+       sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die
+
+       # Fix collisions between different slots of Python.
+       mv "${ED}/usr/bin/2to3" "${ED}/usr/bin/2to3-${PYVER}" || die
+       mv "${ED}/usr/bin/pydoc" "${ED}/usr/bin/pydoc${PYVER}" || die
+       mv "${ED}/usr/bin/idle" "${ED}/usr/bin/idle${PYVER}" || die
+       rm "${ED}/usr/bin/smtpd.py" || die
+
+       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${PYVER}" 
"${libdir}/"{idlelib,lib-tk} || die
+       use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
+
+       use threads || rm -r "${libdir}/multiprocessing" || die
+       use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
+
+       dodoc Misc/{ACKS,HISTORY,NEWS}
+
+       if use examples; then
+               docinto examples
+               dodoc -r 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-${PYVER}
+       newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
+       sed \
+               -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
+               -e "s:@PYDOC@:pydoc${PYVER}:" \
+               -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
+               "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
+
+       local -x EPYTHON=python${PYVER}
+       # if not using a cross-compiler, use the fresh binary
+       if ! tc-is-cross-compiler; then
+               local -x PYTHON=./python
+               local -x 
LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
+       else
+               local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
+       fi
+
+       echo "EPYTHON='${EPYTHON}'" > epython.py || die
+       python_domodule epython.py
+
+       # python-exec wrapping support
+       local pymajor=${PYVER%.*}
+       local scriptdir=${D}$(python_get_scriptdir)
+       mkdir -p "${scriptdir}" || die
+       # python and pythonX
+       ln -s "../../../bin/python${PYVER}" \
+               "${scriptdir}/python${pymajor}" || die
+       ln -s "python${pymajor}" "${scriptdir}/python" || die
+       # python-config and pythonX-config
+       ln -s "../../../bin/python${PYVER}-config" \
+               "${scriptdir}/python${pymajor}-config" || die
+       ln -s "python${pymajor}-config" \
+               "${scriptdir}/python-config" || die
+       # 2to3, pydoc, pyvenv
+       ln -s "../../../bin/2to3-${PYVER}" \
+               "${scriptdir}/2to3" || die
+       ln -s "../../../bin/pydoc${PYVER}" \
+               "${scriptdir}/pydoc" || die
+       # idle
+       if use tk; then
+               ln -s "../../../bin/idle${PYVER}" \
+                       "${scriptdir}/idle" || die
+       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
+}
+
+pkg_postrm() {
+       eselect_python_update
+}

Reply via email to