From 2e34d110f164bf74d55fced27fe0000201b3eec5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 1 Oct 2020 23:05:41 +0100 Subject: gentoo resync : 01.10.2020 --- dev-lang/python/Manifest | 1 + dev-lang/python/python-2.7.18-r4.ebuild | 369 ++++++++++++++++++++++++++++++++ 2 files changed, 370 insertions(+) create mode 100644 dev-lang/python/python-2.7.18-r4.ebuild (limited to 'dev-lang/python') diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 5cf76d366b3b..1205c3e4b7de 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -24,6 +24,7 @@ DIST python-gentoo-patches-3.9.0rc1.tar.xz 8856 BLAKE2B 7bd032dfd047640c6a53633b EBUILD python-2.7.18-r1.ebuild 10596 BLAKE2B 2aa1a8152a9fd960de4dbc37e3b959d412855e3901c946783b908feeaf25af6333a5d375a26eef50436b8c5167019c7c7b5e0610787850f73b57ee6a4814fe65 SHA512 cdc9dafd0fadd459a4a8d22c5dc7b89fc125ca13ee3ca45166416acc26628b7f97478b4efd9e976177e209b1e2fa592a5034c79f343096053f4ddd790424f0d7 EBUILD python-2.7.18-r2.ebuild 10598 BLAKE2B da6ce13402115486dac4e869dfec74cc3e8a0f25311d20769da2da4da8a48f7cc9741d16f25d2a957929523b50c410a57eb2d88f6a3ee0c835a6c76cf94067f4 SHA512 84785d05fa0266891e66b9bd6f86dd881260c70aceca425ade838e42ca932705b5fe0eb4380db7dd5405619f1a4d6ad0f0b1e2e27c5245c7910d4507eac89d12 EBUILD python-2.7.18-r3.ebuild 10605 BLAKE2B 5af92e3c7da419224fb25b8fb124b0457ce3028d0ca1a8a32b25c6ab077f38d2c3548d520c8901f784c2112832e250809b2a9bac40a3add84b72f229c570681b SHA512 65b49ac5c04c86b864652a98cbc3e27f7a9ee0a739538e38ccd150612662a158c94097e44abb0b71be4c1dab51df7dbcc4897e480414decad4c993f12c2ffb3c +EBUILD python-2.7.18-r4.ebuild 10633 BLAKE2B ae8a7ced3045c0cb79a7813b4550f6ec4d2554ad707137f4efb45561ead865e12137b34192d7720cc0b0ae433f12eb1cdeb1739656af099b8b2b016509b8e6e6 SHA512 648f8f20eebdacdb399ecb9a7412e0111559b84fb4c41ffbfe817dbd914f27ef5f67e0830da58bb401623b2fd62f28a99f335e21cf7321c363fe521352449d85 EBUILD python-3.6.11-r2.ebuild 10610 BLAKE2B d9074e767b11ed420c843665b87c466f0014713221c0db4a026fbd91a39debc69689a1674db8a0c0b80dc3eb8df7bc86fe92972918f4c95ef8a52da2936bf631 SHA512 693795866815e724267877e4f97e14d09eda9f321b5c2b481f54952fcefc0859072ab42306eb03b81bd8b3e0a2d71435367452330caabf6bfebbcd2062d1ced0 EBUILD python-3.6.12.ebuild 10610 BLAKE2B 727951cf6b52006f8f905d80bf8cae165e4c33ec5c6a423935d8d460c321528b6715d143232ad3f1e8c9ab7be38403df2e303771e08b88ae6e66f3ed37b665d4 SHA512 7b5c033176b6db3002c080cb058ae8bceea6db7bee005c73b8f2197b8acd04f46b698cde949ca88df242b926f23b0551e26f231038813c88e75c131f76da68e3 EBUILD python-3.7.8-r2.ebuild 10157 BLAKE2B 9d802985fd19463a82452e390a7c20144c839075e307c1ddcdcce9ee0aa923d35e39501af27274cc93d7478ce9beb03e30104dfdc5e464ed1923c1af76f4384e SHA512 7372df64cf7d230bf0e307b442b29c617d062f7bed9032e1e2179e576b788db0c3c8426eae39e654f5eaea6f632a35927e2bf2e32d9f6d247c7359adcb22d322 diff --git a/dev-lang/python/python-2.7.18-r4.ebuild b/dev-lang/python/python-2.7.18-r4.ebuild new file mode 100644 index 000000000000..456f56833cb3 --- /dev/null +++ b/dev-lang/python/python-2.7.18-r4.ebuild @@ -0,0 +1,369 @@ +# 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-r3" + +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 ) + !<=dev-lang/python-exec-2.4.6-r1" +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 scriptdir=${D}$(python_get_scriptdir) + mkdir -p "${scriptdir}" || die + # python + ln -s "../../../bin/python${PYVER}" \ + "${scriptdir}/python" || die + # python-config + ln -s "../../../bin/python${PYVER}-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 + + # python2* is no longer wrapped, so just symlink it + local pymajor=${PYVER%.*} + dosym "python${PYVER}" "/usr/bin/python${pymajor}" + dosym "python${PYVER}-config" "/usr/bin/python${pymajor}-config" +} + +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 +} -- cgit v1.2.3