From 86500c00c3e1ad35d5cf8b619310d7243deb80d5 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Thu, 3 May 2018 11:20:56 +0200 Subject: dev-lang/python: sync python 2.7 Package-Manager: Portage-2.3.18-prefix, Repoman-2.3.6 --- dev-lang/python/Manifest | 3 - dev-lang/python/files/2.7-disable-nis.patch | 21 + .../files/python-2.7-libressl-compatibility.patch | 92 +++ dev-lang/python/python-2.7.12.ebuild | 629 -------------------- dev-lang/python/python-2.7.14-r2.ebuild | 641 +++++++++++++++++++++ dev-lang/python/python-2.7.14.ebuild | 637 -------------------- 6 files changed, 754 insertions(+), 1269 deletions(-) create mode 100644 dev-lang/python/files/2.7-disable-nis.patch create mode 100644 dev-lang/python/files/python-2.7-libressl-compatibility.patch delete mode 100644 dev-lang/python/python-2.7.12.ebuild create mode 100644 dev-lang/python/python-2.7.14-r2.ebuild delete mode 100644 dev-lang/python/python-2.7.14.ebuild diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 67805c47ab..274b181cfb 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -1,16 +1,13 @@ DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 BLAKE2B 85803bc1677bd16650cb5fc4a2c54fdac0228326f25cfba4fcd098ac9d689312d3e0dde6fca57f720d5235361d6462461cf018325c23fda9139e0f1683055aff SHA512 cabc21d2d7379daf1f4bafe7ab00b70e5b4f707d3102496b96ff0dfdced26347097ad771c69e0b9488b7c54b1ef36f9bc019bee72f1ffcbb55dcd0e71095edfe DIST 8ee84829be03c2a1aa74f0f095c994c1f43f4688.zip 14239 BLAKE2B 3dd91f83e5886cb9ba5c1fd9f3da38ab521db70645fa187752cd784919d523d9bf59b61223ea1a455b6d9002ba88dac5bd834c8e943b121db84e30bbb0f65204 SHA512 2f3ada7ff2bd97f90e3b972b681624ddf45c6d1db8d5e89f1313b4693db240a3c4e27c84bd2cf8ff71d5fb276b381ca6a3b8a6945f8db53ff3496cc4cc0b1d62 -DIST Python-2.7.12.tar.xz 12390820 BLAKE2B 97446bca10005277cf1a92ce7fc9e847d5df93f656a6a3b66e9f064d1c2ba35d5a8b420aaa64b92247d6a3fcd3852876450faebc466c7a8e841fd0c2e62fd306 SHA512 6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f DIST Python-2.7.14.tar.xz 12576112 BLAKE2B e03c4134cfdd88678acc26f383130a598ce4de908ab6bb9ee00e9235de3e0fcb9e653fec86f39db64fb895ef797d33736524655c5b94fab2cde2544b966b2cfb SHA512 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9 DIST Python-3.4.5.tar.xz 14516820 BLAKE2B f9ddabd2df2241089d07756d3a8ba1c70096bee60d7cdef84041edbb20c488c3a573762441a4b7f543dbc0ce403ce84ff7d02e7d25699917bd014ab96deead85 SHA512 b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304ef6222dc45380b66d380b092e547d54206d56ca68563b95036f445f97f72bb0ef1d48f81a74a3d4c DIST Python-3.5.4.tar.xz 15332320 BLAKE2B 1fc3ba4eb1ed949062961c13fd1f9851c7f9cbeb4916c06a0389349ee2d4872b2b1c2d30138822e6329b6a715f35a66df704b7a04aa4adeb95b685b8d6e45d61 SHA512 dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff DIST Python-3.6.3.tar.xz 16974296 BLAKE2B 8220fc0c2eaa315d3972085b0f531f169adb6cfad57023ad2c115603b5a484573ea3540eb3216edd0f4514256c8edb07469cf38d17727d69cdc15cdf1f601623 SHA512 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b -DIST python-gentoo-patches-2.7.12-0.tar.xz 13576 BLAKE2B 6ae9fc3e8d3e7dca2e8f5fa6ec9709be9e41982bcd8ca71764766c1a21e596c42d389afd65379c65c469dbbe53918cfa5a23ec7ca7e825f35bc462ff3110f949 SHA512 8bf530fca15c47fa5d9bc958e433b35943a12c98e4172806a45aa60dc85ec92f8ab6ffcd90f752dc5bf8ffc711414894c15820c4b6ef72dbcedc2808119fb1f6 DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 BLAKE2B 0048e48ddaaa4bef08451354fde95a123042880f26dddc9267c7f9a90fd8abb40955e26ee8c9dfc5a1165556bb3e11585b27288e635d42a4000dd3d7654c41ad SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1 DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 BLAKE2B 7fb3cc7dcd987debd5aa263d8e26b21aad439d8e3177c06c3683406a53bbda9652175673b09b6300f6a5b62148190cd8a75c9b65a5de04d770866733fcc0ebcb SHA512 108a4845667ecdf4001fcbeffab0cfbbac87439a449a7351428b0f3e2f159e3848ee0c0dfa45c9fba893b9f9584b33722fc8bb0bd7485a1d0909c3a35ede6ed8 DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed10748348484d314183c3de3ec950d5ca5ce7048bb322c470f3f5bff2d63eb7f2ed99c0fe75c621df050273d9d118681b28926061d SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec DIST python-gentoo-patches-3.6.2-0.tar.xz 10744 BLAKE2B 3075754627617ac2ceee879eaf1a0e6564505655cdbdff380233a09df701a6188d64fe1f6a8c642b1fb05ef3c460a07042b6a362d655cd02717d6d9ba47983a1 SHA512 2aac1700c541202aa4f43bff4cb521b996d52ab350133318abaddb43f4b6e20548f37de472ace8024ef325ebf63fdfff0d43f8aa1f717d3c56f974b7aa1764e3 -DIST python-prefix-2.7.12-gentoo-patches-r0.tar.xz 17380 BLAKE2B 566c47624d054cd251ea4350bf57735ad63057a6ef7968dbe572a02156a03c080303ba2aa6c26e10077070507317b22eb7665595aaf903b4ffd4a45104fbfa31 SHA512 ef17c8e8083da0ed0e6a63c96f59cc1243b0376fc6d4d7fcecb165e557403c54ae87625ed6dfe4d7d73693f8220ec98ef8a3f16124d8022dbac6a3a9d5514d9c DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 BLAKE2B 75422fc7390f559d9864f6e22a0b85982ccbdb07d5f2507db8e528285e56d1f11d4bc0b21a0b78d5340eafd562220d2f1b9d0a78b1f7c811c5689a426a81f9f3 SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8 DIST python-prefix-3.4.5-gentoo-patches-r0.tar.xz 12932 BLAKE2B 228cea390cd16f68579896ccec06025446d6378ee164090a7f8ab8174d28e73e35b0e311b95ab78be7a54b21eefce7c01238e3cb31fae1f49a1706476c5abda5 SHA512 e32556c63e48d8dacd86218945147d1bbbc5777a6bb3441373827da47771a8eb387f26885acd35343cc598c719c9feec63007144fc1fdd1aca253a2ec1a19825 DIST python-prefix-3.5.4-gentoo-patches-r0.tar.xz 12768 BLAKE2B ab0cbc5430e9588f71cfd7b001a07f9a77097262f17e1f980e3945e39855e1c9437117bf4eb2d424dadf701d37d025e09627d7efdbb9f8867714039f62f261a7 SHA512 334cd8990483f973386cc6bbc962d2843449c493f7d33349fcc8f68120e246c52ea80236c99685555974e439fa877b537b32ef7d181198f58950f5e9b835b1c5 diff --git a/dev-lang/python/files/2.7-disable-nis.patch b/dev-lang/python/files/2.7-disable-nis.patch new file mode 100644 index 0000000000..5a6cb3e403 --- /dev/null +++ b/dev-lang/python/files/2.7-disable-nis.patch @@ -0,0 +1,21 @@ +--- a/setup.py ++++ b/setup.py +@@ -1346,17 +1346,7 @@ class PyBuildExt(build_ext): + else: + missing.append('resource') + +- # Sun yellow pages. Some systems have the functions in libc. +- if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and +- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): +- if (self.compiler.find_library_file(lib_dirs, 'nsl')): +- libs = ['nsl'] +- else: +- libs = [] +- exts.append( Extension('nis', ['nismodule.c'], +- libraries = libs) ) +- else: +- missing.append('nis') ++ missing.append('nis') + else: + missing.extend(['nis', 'resource', 'termios']) + diff --git a/dev-lang/python/files/python-2.7-libressl-compatibility.patch b/dev-lang/python/files/python-2.7-libressl-compatibility.patch new file mode 100644 index 0000000000..c9e7a8458e --- /dev/null +++ b/dev-lang/python/files/python-2.7-libressl-compatibility.patch @@ -0,0 +1,92 @@ +# From https://github.com/python/cpython/pull/6215 + +# LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects +# LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and +# LibreSSL < 2.7. + +# Documentation updates and fixes for failing tests will be provided in +# another patch set. + +# Signed-off-by: Christian Heimes christian@python.org. +# (cherry picked from commit 4ca0739) + +#Co-authored-by: Christian Heimes christian@python.org + +--- a/Modules/_ssl.c 2017-09-16 17:38:35.000000000 +0000 ++++ b/Modules/_ssl.c 2018-04-13 15:55:10.919424126 +0000 +@@ -97,6 +102,12 @@ + + #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + # define OPENSSL_VERSION_1_1 1 ++# define PY_OPENSSL_1_1_API 1 ++#endif ++ ++/* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */ ++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL ++# define PY_OPENSSL_1_1_API 1 + #endif + + /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1 +@@ -118,24 +129,44 @@ + #endif + + /* ALPN added in OpenSSL 1.0.2 */ +-#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x1000200fL && !defined(OPENSSL_NO_TLSEXT) +-# define HAVE_ALPN ++#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation ++# define HAVE_ALPN 1 ++#else ++# define HAVE_ALPN 0 ++#endif ++ ++/* We cannot rely on OPENSSL_NO_NEXTPROTONEG because LibreSSL 2.6.1 dropped ++ * NPN support but did not set OPENSSL_NO_NEXTPROTONEG for compatibility ++ * reasons. The check for TLSEXT_TYPE_next_proto_neg works with ++ * OpenSSL 1.0.1+ and LibreSSL. ++ * OpenSSL 1.1.1-pre1 dropped NPN but still has TLSEXT_TYPE_next_proto_neg. ++ */ ++#ifdef OPENSSL_NO_NEXTPROTONEG ++# define HAVE_NPN 0 ++#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER) ++# define HAVE_NPN 0 ++#elif defined(TLSEXT_TYPE_next_proto_neg) ++# define HAVE_NPN 1 ++#else ++# define HAVE_NPN 0 + #endif + + #ifndef INVALID_SOCKET /* MS defines this */ + #define INVALID_SOCKET (-1) + #endif + +-#ifdef OPENSSL_VERSION_1_1 +-/* OpenSSL 1.1.0+ */ +-#ifndef OPENSSL_NO_SSL2 +-#define OPENSSL_NO_SSL2 +-#endif +-#else /* OpenSSL < 1.1.0 */ +-#if defined(WITH_THREAD) ++/* OpenSSL 1.0.2 and LibreSSL needs extra code for locking */ ++#if !defined(OPENSSL_VERSION_1_1) && defined(WITH_THREAD) + #define HAVE_OPENSSL_CRYPTO_LOCK + #endif + ++#if defined(OPENSSL_VERSION_1_1) && !defined(OPENSSL_NO_SSL2) ++#define OPENSSL_NO_SSL2 ++#endif ++ ++#ifndef PY_OPENSSL_1_1_API ++/* OpenSSL 1.1 API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7.0 */ ++ + #define TLS_method SSLv23_method + + static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne) +@@ -178,7 +209,7 @@ + { + return store->param; + } +-#endif /* OpenSSL < 1.1.0 or LibreSSL */ ++#endif /* OpenSSL < 1.1.0 or LibreSSL < 2.7.0 */ + + + enum py_ssl_error { diff --git a/dev-lang/python/python-2.7.12.ebuild b/dev-lang/python/python-2.7.12.ebuild deleted file mode 100644 index f038c4b118..0000000000 --- a/dev-lang/python/python-2.7.12.ebuild +++ /dev/null @@ -1,629 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI="5" -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.12-0" -PREFIX_PATCHREV="r0" -CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629" - -DESCRIPTION="An interpreted, interactive, object-oriented programming language" -HOMEPAGE="http://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 - https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz" - -[[ -n ${CYGWINPORTS_GITREV} ]] && -SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip )" - -LICENSE="PSF-2" -SLOT="2.7" -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="aqua -berkdb build doc 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:0= - >=sys-libs/zlib-1.1.3:0= - !m68k-mint? ( virtual/libffi ) - virtual/libintl - 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:0=[berkdb] ) - ncurses? ( - >=sys-libs/ncurses-5.2:0= - 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:= ) - ) - tk? ( - >=dev-lang/tcl-8.0:0= - >=dev-lang/tk-8.0:0=[-aqua] - dev-tcltk/blt:0= - dev-tcltk/tix - ) - xml? ( >=dev-libs/expat-2.1 ) - !! /dev/null - rm -f python python-config python${SLOT}-config - # python${SLOT} was created above - for f in pythonw smtpd${SLOT}.py pydoc idle ; do - rm -f ${f} ${f}${SLOT} - done - # pythonw needs to remain in the framework (that's the whole - # reason we go through this framework hassle) - ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die - # copy the scripts to we can fix their shebangs - for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do - # for some reason sometimes they already exist, bug #347321 - rm -f ${f} - cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die - sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \ - ${f} || die - done - # "fix" to have below collision fix not to bail - mv pydoc${SLOT} pydoc || die - mv idle${SLOT} idle || die - popd > /dev/null - - # basically we don't like the framework stuff at all, so just move - # stuff around or add some symlinks to make our life easier - mkdir -p "${ED}"/usr - mv "${D}${fwdir}"/Versions/${SLOT}/share \ - "${ED}"/usr/ || die "can't move share" - # get includes just UNIX style - mkdir -p "${ED}"/usr/include - mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \ - "${ED}"/usr/include/ || die "can't move include" - pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null - ln -s ../../../../../include/python${SLOT} || die - popd > /dev/null - rm -f "${ED}"/usr/share/man/man1/python{,2}.1 - - # same for libs - # NOTE: can't symlink the entire dir, because a real dir already exists - # on upgrade (site-packages), however since we h4x0rzed python to - # actually look into the UNIX-style dir, we just switch them around. - mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT} - mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \ - "${ED}"/usr/$(get_libdir)/python${SLOT}/ \ - || die "can't move python${SLOT}" - rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die - pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null - ln -s ../../../../python${SLOT} || die - popd > /dev/null - - # fix up Makefile - sed -i \ - -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \ - -e '/^LDFLAGS=/s/=.*$/=/' \ - -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \ - -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \ - -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \ - -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \ - -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \ - -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \ - "${libdir}"/config/Makefile || die - # and sysconfigdata likewise - sed -i \ - -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \ - -e "/'LDFLAGS'/s/:.*$/:'',/" \ - -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \ - -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \ - -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \ - -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \ - -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \ - -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \ - "${libdir}"/_sysconfigdata.py || die - - # add missing version.plist file - mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources - cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF - - - - - BuildVersion - 1 - CFBundleShortVersionString - ${PV} - CFBundleVersion - ${PV} - ProjectName - Python - SourceVersion - ${PV} - - -EOF - else - emake DESTDIR="${D}" altinstall - fi - - sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" - if [[ ${CHOST} == *-aix* ]]; then - # fix upstream bugs with quite large proposed diffs still to be sorted out: - # http://bugs.python.org/issue13493 - # http://bugs.python.org/issue14150 - # http://bugs.python.org/issue15590 - # http://bugs.python.org/issue16189 - sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \ - -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed" - sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \ - -e 's| -bI:| -Wl,-bI:|g' \ - -e '/LINKFORSHARED/s|-bE:|-bI:|g' \ - -e '/LINKFORSHARED/s| -lld||g' \ - -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed" - fi - - # 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" - - # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec - # These #defines cause problems when building c99 compliant python modules - # http://bugs.python.org/issue1759169 - [[ ${CHOST} == *-solaris* ]] && sed -i -e \ - 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \ - "${ED}"/usr/include/python${SLOT}/pyconfig.h - - 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} - - 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 - if use aqua ; then - # we do framework, so the emake trick below returns a pathname - # since that won't work here, use a (cheap) trick instead - libname=libpython${SLOT} - else - libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - fi - 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 - 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$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile) - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}. - else - vars=( PYTHON "${vars[@]}" ) - fi - - python_export "python${SLOT}" "${vars[@]}" - echo "EPYTHON='${EPYTHON}'" > epython.py || die - python_domodule epython.py - - # python-exec wrapping support - local pymajor=${SLOT%.*} - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die - # python and pythonX - ln -s "../../../bin/python${SLOT}" \ - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die - ln -s "python${pymajor}" \ - "${D}${PYTHON_SCRIPTDIR}/python" || die - # python-config and pythonX-config - ln -s "../../../bin/python${SLOT}-config" \ - "${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-${SLOT}" \ - "${D}${PYTHON_SCRIPTDIR}/2to3" || die - ln -s "../../../bin/pydoc${SLOT}" \ - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die - # idle - if use tk; then - ln -s "../../../bin/idle${SLOT}" \ - "${D}${PYTHON_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 -} diff --git a/dev-lang/python/python-2.7.14-r2.ebuild b/dev-lang/python/python-2.7.14-r2.ebuild new file mode 100644 index 0000000000..494beb6780 --- /dev/null +++ b/dev-lang/python/python-2.7.14-r2.ebuild @@ -0,0 +1,641 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" +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.14-0" +PREFIX_PATCHREV="r0" +CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629" + +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 + https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz" + +[[ -n ${CYGWINPORTS_GITREV} ]] && +SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip )" + +LICENSE="PSF-2" +SLOT="2.7" +KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="aqua -berkdb bluetooth build doc 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:0= + >=sys-libs/zlib-1.1.3:0= + !m68k-mint? ( virtual/libffi ) + virtual/libintl + 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:0=[berkdb] ) + ncurses? ( >=sys-libs/ncurses-5.2:0= ) + 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=[-aqua] + dev-tcltk/blt:0= + dev-tcltk/tix + ) + xml? ( >=dev-libs/expat-2.1 ) + !! /dev/null + rm -f python python-config python${SLOT}-config + # python${SLOT} was created above + for f in pythonw smtpd${SLOT}.py pydoc idle ; do + rm -f ${f} ${f}${SLOT} + done + # pythonw needs to remain in the framework (that's the whole + # reason we go through this framework hassle) + ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die + # copy the scripts to we can fix their shebangs + for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do + # for some reason sometimes they already exist, bug #347321 + rm -f ${f} + cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die + sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \ + ${f} || die + done + # "fix" to have below collision fix not to bail + mv pydoc${SLOT} pydoc || die + mv idle${SLOT} idle || die + popd > /dev/null + + # basically we don't like the framework stuff at all, so just move + # stuff around or add some symlinks to make our life easier + mkdir -p "${ED}"/usr + mv "${D}${fwdir}"/Versions/${SLOT}/share \ + "${ED}"/usr/ || die "can't move share" + # get includes just UNIX style + mkdir -p "${ED}"/usr/include + mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \ + "${ED}"/usr/include/ || die "can't move include" + pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null + ln -s ../../../../../include/python${SLOT} || die + popd > /dev/null + rm -f "${ED}"/usr/share/man/man1/python{,2}.1 + + # same for libs + # NOTE: can't symlink the entire dir, because a real dir already exists + # on upgrade (site-packages), however since we h4x0rzed python to + # actually look into the UNIX-style dir, we just switch them around. + mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT} + mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \ + "${ED}"/usr/$(get_libdir)/python${SLOT}/ \ + || die "can't move python${SLOT}" + rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die + pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null + ln -s ../../../../python${SLOT} || die + popd > /dev/null + + # fix up Makefile + sed -i \ + -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \ + -e '/^LDFLAGS=/s/=.*$/=/' \ + -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \ + -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \ + -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \ + -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \ + -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \ + -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \ + "${libdir}"/config/Makefile || die + # and sysconfigdata likewise + sed -i \ + -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \ + -e "/'LDFLAGS'/s/:.*$/:'',/" \ + -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \ + -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \ + -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \ + -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \ + -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \ + -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \ + "${libdir}"/_sysconfigdata.py || die + + # add missing version.plist file + mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources + cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF + + + + + BuildVersion + 1 + CFBundleShortVersionString + ${PV} + CFBundleVersion + ${PV} + ProjectName + Python + SourceVersion + ${PV} + + +EOF + else + emake DESTDIR="${D}" altinstall + fi + + sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" + if [[ ${CHOST} == *-aix* ]]; then + # fix upstream bugs with quite large proposed diffs still to be sorted out: + # http://bugs.python.org/issue13493 + # http://bugs.python.org/issue14150 + # http://bugs.python.org/issue15590 + # http://bugs.python.org/issue16189 + sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \ + -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed" + sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \ + -e 's| -bI:| -Wl,-bI:|g' \ + -e '/LINKFORSHARED/s|-bE:|-bI:|g' \ + -e '/LINKFORSHARED/s| -lld||g' \ + -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed" + fi + + # 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" + + # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec + # These #defines cause problems when building c99 compliant python modules + # http://bugs.python.org/issue1759169 + [[ ${CHOST} == *-solaris* ]] && sed -i -e \ + 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \ + "${ED}"/usr/include/python${SLOT}/pyconfig.h + + 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} + + 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 + if use aqua ; then + # we do framework, so the emake trick below returns a pathname + # since that won't work here, use a (cheap) trick instead + libname=libpython${SLOT} + else + libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + fi + 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 + 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$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile) + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} + local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD} + local -x DYLD_FRAMEWORK_PATH="${WORKDIR}/${CHOST}" + else + vars=( PYTHON "${vars[@]}" ) + fi + + python_export "python${SLOT}" "${vars[@]}" + echo "EPYTHON='${EPYTHON}'" > epython.py || die + python_domodule epython.py + + # python-exec wrapping support + local pymajor=${SLOT%.*} + mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die + # python and pythonX + ln -s "../../../bin/python${SLOT}" \ + "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die + ln -s "python${pymajor}" \ + "${D}${PYTHON_SCRIPTDIR}/python" || die + # python-config and pythonX-config + ln -s "../../../bin/python${SLOT}-config" \ + "${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-${SLOT}" \ + "${D}${PYTHON_SCRIPTDIR}/2to3" || die + ln -s "../../../bin/pydoc${SLOT}" \ + "${D}${PYTHON_SCRIPTDIR}/pydoc" || die + # idle + if use tk; then + ln -s "../../../bin/idle${SLOT}" \ + "${D}${PYTHON_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 +} diff --git a/dev-lang/python/python-2.7.14.ebuild b/dev-lang/python/python-2.7.14.ebuild deleted file mode 100644 index 2650b651f0..0000000000 --- a/dev-lang/python/python-2.7.14.ebuild +++ /dev/null @@ -1,637 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="5" -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.14-0" -PREFIX_PATCHREV="r0" -CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629" - -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 - https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz" - -[[ -n ${CYGWINPORTS_GITREV} ]] && -SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip )" - -LICENSE="PSF-2" -SLOT="2.7" -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="aqua -berkdb build doc 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:0= - >=sys-libs/zlib-1.1.3:0= - !m68k-mint? ( virtual/libffi ) - virtual/libintl - 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:0=[berkdb] ) - ncurses? ( - >=sys-libs/ncurses-5.2:0= - 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:= ) - ) - tk? ( - >=dev-lang/tcl-8.0:0= - >=dev-lang/tk-8.0:0=[-aqua] - dev-tcltk/blt:0= - dev-tcltk/tix - ) - xml? ( >=dev-libs/expat-2.1 ) - !! /dev/null - rm -f python python-config python${SLOT}-config - # python${SLOT} was created above - for f in pythonw smtpd${SLOT}.py pydoc idle ; do - rm -f ${f} ${f}${SLOT} - done - # pythonw needs to remain in the framework (that's the whole - # reason we go through this framework hassle) - ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die - # copy the scripts to we can fix their shebangs - for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do - # for some reason sometimes they already exist, bug #347321 - rm -f ${f} - cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die - sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \ - ${f} || die - done - # "fix" to have below collision fix not to bail - mv pydoc${SLOT} pydoc || die - mv idle${SLOT} idle || die - popd > /dev/null - - # basically we don't like the framework stuff at all, so just move - # stuff around or add some symlinks to make our life easier - mkdir -p "${ED}"/usr - mv "${D}${fwdir}"/Versions/${SLOT}/share \ - "${ED}"/usr/ || die "can't move share" - # get includes just UNIX style - mkdir -p "${ED}"/usr/include - mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \ - "${ED}"/usr/include/ || die "can't move include" - pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null - ln -s ../../../../../include/python${SLOT} || die - popd > /dev/null - rm -f "${ED}"/usr/share/man/man1/python{,2}.1 - - # same for libs - # NOTE: can't symlink the entire dir, because a real dir already exists - # on upgrade (site-packages), however since we h4x0rzed python to - # actually look into the UNIX-style dir, we just switch them around. - mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT} - mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \ - "${ED}"/usr/$(get_libdir)/python${SLOT}/ \ - || die "can't move python${SLOT}" - rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die - pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null - ln -s ../../../../python${SLOT} || die - popd > /dev/null - - # fix up Makefile - sed -i \ - -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \ - -e '/^LDFLAGS=/s/=.*$/=/' \ - -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \ - -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \ - -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \ - -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \ - -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \ - -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \ - "${libdir}"/config/Makefile || die - # and sysconfigdata likewise - sed -i \ - -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \ - -e "/'LDFLAGS'/s/:.*$/:'',/" \ - -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \ - -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \ - -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \ - -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \ - -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \ - -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \ - "${libdir}"/_sysconfigdata.py || die - - # add missing version.plist file - mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources - cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF - - - - - BuildVersion - 1 - CFBundleShortVersionString - ${PV} - CFBundleVersion - ${PV} - ProjectName - Python - SourceVersion - ${PV} - - -EOF - else - emake DESTDIR="${D}" altinstall - fi - - sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" - if [[ ${CHOST} == *-aix* ]]; then - # fix upstream bugs with quite large proposed diffs still to be sorted out: - # http://bugs.python.org/issue13493 - # http://bugs.python.org/issue14150 - # http://bugs.python.org/issue15590 - # http://bugs.python.org/issue16189 - sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \ - -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed" - sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \ - -e 's| -bI:| -Wl,-bI:|g' \ - -e '/LINKFORSHARED/s|-bE:|-bI:|g' \ - -e '/LINKFORSHARED/s| -lld||g' \ - -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed" - fi - - # 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" - - # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec - # These #defines cause problems when building c99 compliant python modules - # http://bugs.python.org/issue1759169 - [[ ${CHOST} == *-solaris* ]] && sed -i -e \ - 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \ - "${ED}"/usr/include/python${SLOT}/pyconfig.h - - 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} - - 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 - if use aqua ; then - # we do framework, so the emake trick below returns a pathname - # since that won't work here, use a (cheap) trick instead - libname=libpython${SLOT} - else - libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - fi - 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 - 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$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile) - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}. - local -x DYLD_FRAMEWORK_PATH="${WORKDIR}/${CHOST}" - else - vars=( PYTHON "${vars[@]}" ) - fi - - python_export "python${SLOT}" "${vars[@]}" - echo "EPYTHON='${EPYTHON}'" > epython.py || die - python_domodule epython.py - - # python-exec wrapping support - local pymajor=${SLOT%.*} - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die - # python and pythonX - ln -s "../../../bin/python${SLOT}" \ - "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die - ln -s "python${pymajor}" \ - "${D}${PYTHON_SCRIPTDIR}/python" || die - # python-config and pythonX-config - ln -s "../../../bin/python${SLOT}-config" \ - "${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-${SLOT}" \ - "${D}${PYTHON_SCRIPTDIR}/2to3" || die - ln -s "../../../bin/pydoc${SLOT}" \ - "${D}${PYTHON_SCRIPTDIR}/pydoc" || die - # idle - if use tk; then - ln -s "../../../bin/idle${SLOT}" \ - "${D}${PYTHON_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 -} -- cgit v1.2.3