From ba4d796e84b6acdce92d9ab30512ad806db3831e Mon Sep 17 00:00:00 2001 From: Martin Väth Date: Sun, 29 Sep 2019 08:38:20 +0200 Subject: dev-lang/python-3.6.9: Add to fix https://bugs.gentoo.org/692128 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Väth --- dev-lang/python/Manifest | 2 + dev-lang/python/files/curses_tinfo.patch | 13 ++ dev-lang/python/files/pydoc.conf | 6 + dev-lang/python/files/pydoc.init | 24 +++ dev-lang/python/python-3.6.9.ebuild | 350 +++++++++++++++++++++++++++++++ 5 files changed, 395 insertions(+) create mode 100644 dev-lang/python/Manifest create mode 100644 dev-lang/python/files/curses_tinfo.patch create mode 100644 dev-lang/python/files/pydoc.conf create mode 100644 dev-lang/python/files/pydoc.init create mode 100644 dev-lang/python/python-3.6.9.ebuild (limited to 'dev-lang/python') diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest new file mode 100644 index 00000000..aea2b593 --- /dev/null +++ b/dev-lang/python/Manifest @@ -0,0 +1,2 @@ +DIST Python-3.6.9.tar.xz 17212164 SHA512 05de9c6f44d96a52bfce10ede4312de892573edaf8bece65926d19973a3a800d65eed7a857af945f69efcfb25efa3788e7a54016b03d80b611eb51c3ea074819 +DIST python-gentoo-patches-3.6.8.tar.xz 11224 SHA512 89e700663db25d6d78eee1d4bfdab686c5341a794062f3a63df3485ac0b58deb4b4885d24701f3ae138d06ca783be92e310e1100c6d633910c33732f3cb0d7df diff --git a/dev-lang/python/files/curses_tinfo.patch b/dev-lang/python/files/curses_tinfo.patch new file mode 100644 index 00000000..6048f8cf --- /dev/null +++ b/dev-lang/python/files/curses_tinfo.patch @@ -0,0 +1,13 @@ +# https://bugs.gentoo.org/457530 +# https://bugs.gentoo.org/692128 +--- 1/setup.py ++++ 1/setup.py +@@ -1396,7 +1396,7 @@ + curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1')) + + if curses_library.startswith('ncurses'): +- curses_libs = [curses_library] ++ curses_libs = [curses_library, 'tinfo'] + exts.append( Extension('_curses', ['_cursesmodule.c'], + include_dirs=curses_includes, + define_macros=curses_defines, diff --git a/dev-lang/python/files/pydoc.conf b/dev-lang/python/files/pydoc.conf new file mode 100644 index 00000000..3c6920cc --- /dev/null +++ b/dev-lang/python/files/pydoc.conf @@ -0,0 +1,6 @@ +# /etc/init.d/pydoc.conf + +# This file contains the configuration for pydoc's internal webserver. + +# Default port for Python's pydoc server. +@PYDOC_PORT_VARIABLE@="7464" diff --git a/dev-lang/python/files/pydoc.init b/dev-lang/python/files/pydoc.init new file mode 100644 index 00000000..f8e05636 --- /dev/null +++ b/dev-lang/python/files/pydoc.init @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public Licence v2 + +start() { + local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}" + + if [ -z "${pydoc_port}" ]; then + eerror "Port not set" + return 1 + fi + + ebegin "Starting pydoc server on port ${pydoc_port}" + start-stop-daemon --start --background --make-pidfile \ + --pidfile /var/run/@PYDOC@.pid \ + --exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}" + eend $? +} + +stop() { + ebegin "Stopping pydoc server" + start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid + eend $? +} diff --git a/dev-lang/python/python-3.6.9.ebuild b/dev-lang/python/python-3.6.9.ebuild new file mode 100644 index 00000000..1790fafb --- /dev/null +++ b/dev-lang/python/python-3.6.9.ebuild @@ -0,0 +1,350 @@ +# Copyright 1999-2019 Gentoo Authors and Martin V\"ath +# 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}" +PATCHSET_VERSION="3.6.8" + +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/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz" + +LICENSE="PSF-2" +SLOT="3.6/3.6m" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tinfo tk wininst +xml" +RESTRICT="!test? ( test )" + +# 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:0= + app-arch/xz-utils:0= + >=sys-libs/zlib-1.1.3:0= + virtual/libffi:= + virtual/libintl + gdbm? ( sys-libs/gdbm:0=[berkdb] ) + ncurses? ( >=sys-libs/ncurses-5.2:0=[tinfo?] ) + readline? ( >=sys-libs/readline-4.1:0= ) + sqlite? ( >=dev-db/sqlite-3.3.8:3= ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + tk? ( + >=dev-lang/tcl-8.0:0= + >=dev-lang/tk-8.0:0= + dev-tcltk/blt:0= + dev-tcltk/tix + ) + xml? ( >=dev-libs/expat-2.1:0= ) + !!/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" + + # for python-exec + local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) + + # 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 + vars=( PYTHON "${vars[@]}" ) + fi + + python_export "python${PYVER}" "${vars[@]}" + echo "EPYTHON='${EPYTHON}'" > epython.py || die + python_domodule epython.py + + # python-exec wrapping support + local pymajor=${PYVER%.*} + mkdir -p "${D}/${PYTHON_SCRIPTDIR}" || die + # python and pythonX + ln -s "../../../bin/${abiver}" \ + "${D}/${PYTHON_SCRIPTDIR}/python${pymajor}" || die + ln -s "python${pymajor}" \ + "${D}/${PYTHON_SCRIPTDIR}/python" || die + # python-config and pythonX-config + # note: we need to create a wrapper rather than symlinking it due + # to some random dirname(argv[0]) magic performed by python-config + cat > "${D}/${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die + #!/bin/sh + exec "${abiver}-config" "\${@}" + EOF + chmod +x "${D}/${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die + ln -s "python${pymajor}-config" \ + "${D}/${PYTHON_SCRIPTDIR}/python-config" || die + # 2to3, pydoc, pyvenv + ln -s "../../../bin/2to3-${PYVER}" \ + "${D}/${PYTHON_SCRIPTDIR}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" \ + "${D}/${PYTHON_SCRIPTDIR}/pydoc" || die + ln -s "../../../bin/pyvenv-${PYVER}" \ + "${D}/${PYTHON_SCRIPTDIR}/pyvenv" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" \ + "${D}/${PYTHON_SCRIPTDIR}/idle" || die + fi +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_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 + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} -- cgit v1.2.3-65-gdbad