diff options
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/Manifest.gz | bin | 19861 -> 19857 bytes | |||
-rw-r--r-- | dev-lang/go/Manifest | 4 | ||||
-rw-r--r-- | dev-lang/go/go-1.20.8.ebuild | 2 | ||||
-rw-r--r-- | dev-lang/go/go-1.21.1.ebuild | 2 | ||||
-rw-r--r-- | dev-lang/polyml/Manifest | 2 | ||||
-rw-r--r-- | dev-lang/polyml/polyml-5.9-r2.ebuild (renamed from dev-lang/polyml/polyml-5.9-r1.ebuild) | 9 | ||||
-rw-r--r-- | dev-lang/python/Manifest | 1 | ||||
-rw-r--r-- | dev-lang/python/python-3.12.0_rc2_p1-r1.ebuild | 528 |
8 files changed, 542 insertions, 6 deletions
diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz Binary files differindex ed327b4fcb64..af54e16d3643 100644 --- a/dev-lang/Manifest.gz +++ b/dev-lang/Manifest.gz diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest index 049f52a54344..d6252f6ef62f 100644 --- a/dev-lang/go/Manifest +++ b/dev-lang/go/Manifest @@ -4,7 +4,7 @@ DIST go1.20.7.src.tar.gz 26192928 BLAKE2B 89a1b2bde472c22534e63585cd8fcff6076a16 DIST go1.20.8.src.tar.gz 26197375 BLAKE2B 1d6c5eb4da9f2f892b30013427b54039feeaf0bc41e1928a82da56e1c96689a796828758989a85a2d156f0547826eb0d408c324a93e02894dbb0a6c7b73b6b67 SHA512 858d0289b3cd709e71e14aed9a36fd3d462fb3aa72cc1108eef0c70ab583742ab2eff99a24f8bfd72d42d1cc741adc1d3619073fbed943f8aea20e453ed479d3 DIST go1.21.1.src.tar.gz 26974429 BLAKE2B 716f7c94d29dedd2e69f33a6d9d3cab9d7b02635915bfeab00dcadcc10a40812cd8fe76c1388f0eb8cbfa3cf84e2fd2d2595eab6d2c8782b3ea760e154be21d5 SHA512 b6bee4a461ed91958c334b2f8b78e8f0c45f07409ba6968ae393b34d9cd21a9b1a29df357d191144e99f8ea73f491926ea0027ecbcfcaa198349e67fa33e0e3c EBUILD go-1.20.7.ebuild 5385 BLAKE2B 161e5bcf4c08a899a90237983cfdd35724057f933ca12d171d0a2b036ff8770ed25f52da4b403299203e6de1ac6bcd876651f8569f55f1ef93bbe7920c107ae5 SHA512 65cab89cd5e8a26020b6d55bcc1e98ec1bda8d7f1f964cde416d77a531c2b46ca797e9893e7d8811750e0b3e2129698aa830ca6d0b49e8ab2a8cbcbd283adf5e -EBUILD go-1.20.8.ebuild 5388 BLAKE2B e87d5f9408ad1e51ce372a81525c0ae10c7b76e7c72df07185bebacb387d738f74a7d52879338279afe2200f7cbde52ed6a33a76bd6e406d5f55256efa7db847 SHA512 e1c140f4f724d66ab996243bc21163c8c1cc81330dd8b8bae98f44718bfaa807789d4a116e5996424b8eb1f11698a08265154ea98cb83596bb0b38efe37e9ba9 -EBUILD go-1.21.1.ebuild 5206 BLAKE2B 7c144b1e30bf171fc83d43b99213537538dd843718da6b8768df7f9a56afe49496e9ad2053bf9ce77fd04c4e4c1bbf458fea140c8d8b9625f2cac687007a55c7 SHA512 8cd347824c984e76313e77e08dc77d5ca148b86378e33d28761a598f02643ef846edd8783cf1aa8b4ac375a17180beffc5418bcb95b69c7dda079f526566e2a1 +EBUILD go-1.20.8.ebuild 5387 BLAKE2B dd5ab008bfa013637657123ff661eb49013aef219a0ea4d2ae1ab004a880b788f3a70c9f5ed8bb61dc19b6c2742452beff3148c6dad1fb1514ddac45cc6c4ca5 SHA512 76445badfa0da69c9c635ca6d3ce1a72cc830c2e8aa2903f31a6f75ddad412c799097c0b976f237aa3d480d23f9c5aa39a4ad8a696ee9397ec68eec8eb9111e7 +EBUILD go-1.21.1.ebuild 5205 BLAKE2B 80cf561c98bc3e3c069e1a3a3f0e363c11a8ad27be7ff2581729d8fe82cc3b38004a054da659deb64cf87d75d1e2774765fb57241361807c902b9fd993d113ea SHA512 486895ae757076615126529855b0ac8fbf482b3286838d7e367920fdd9c917514c21fcb302c76a6e69de21c0eb0c191a4796c38d8b8cc15ad07dfef3853ded97 EBUILD go-9999.ebuild 5274 BLAKE2B 1e74a60e9de0b342e779bea1907c7c83c0a3ffe4ecab199d1467898afaf16dbbdcb52655907c8e89e0680a18161a0be7135363c31124ca4ccb24521390df6740 SHA512 511bb883ddec424909084425de81a5524ffc25f6b6b3ac207b7d531e6fa7350a1d8e88dd624f42632fc186a16bcc43f562da3f5d00e1c2adad4ea4ced48360c7 MISC metadata.xml 590 BLAKE2B 56da63bdc350df5c6ef3b511a386627f4020f655027ca88da6a83ecb09581d3c3055c836eb8fe98a383412b3d431a77a9935ad753fe2d8392afa37cd613c15b0 SHA512 5d78adbae30c3a805194567bbb1af2ad59b78487819e7841a040d2a4d5db02f5b5d1d58f7cfc7a37f39e5e9bcf332dda4d336456e33e36c33caef792ac45d48b diff --git a/dev-lang/go/go-1.20.8.ebuild b/dev-lang/go/go-1.20.8.ebuild index acb8c0a69d23..908e325e45e5 100644 --- a/dev-lang/go/go-1.20.8.ebuild +++ b/dev-lang/go/go-1.20.8.ebuild @@ -23,7 +23,7 @@ case ${PV} in case ${PV} in *_beta*|*_rc*) ;; *) - KEYWORDS="-* amd64 arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" + KEYWORDS="-* amd64 arm ~arm64 ~loong ~mips ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" ;; esac esac diff --git a/dev-lang/go/go-1.21.1.ebuild b/dev-lang/go/go-1.21.1.ebuild index 4b224ef5c625..ac8fac538b15 100644 --- a/dev-lang/go/go-1.21.1.ebuild +++ b/dev-lang/go/go-1.21.1.ebuild @@ -23,7 +23,7 @@ case ${PV} in case ${PV} in *_beta*|*_rc*) ;; *) - KEYWORDS="-* amd64 arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" + KEYWORDS="-* amd64 arm ~arm64 ~loong ~mips ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" ;; esac esac diff --git a/dev-lang/polyml/Manifest b/dev-lang/polyml/Manifest index 017eebf7c280..981434988a59 100644 --- a/dev-lang/polyml/Manifest +++ b/dev-lang/polyml/Manifest @@ -1,5 +1,5 @@ AUX polyml-5.8.2-configure.patch 512 BLAKE2B dec4df5f79271e680d0bd1533f1dec32b6360cebb0cfeae10987e7ba5f92be961529d85471412d575bd7dddcc1a447304b5bf77d814ac54f4500913e57032f50 SHA512 c4730ee4550c0ff9eb6c8d9efbb8eb3a30d1a96a93be990a7f38f9adbc6944d51f03c449f2f8af3c8cef2c42519ce9f01df8e2b54a8a03b40f9748d09a238437 AUX polyml-5.9-c++11.patch 433 BLAKE2B bee8c1a67e7d8a6d63a076d39cdcc086e23a20b3e4579fbc20db78e14c54b90d017b84d819ab4f8b68831b8a63600e37ca919944e47bcc4120d5a6530a552d83 SHA512 399af1a93527350d610670b6369c2a54c6c54624e622882efbf027b494cdf851d7c1f07e5360ba1a326e1242a18bf15eb08ba9ee60f77a66427b12ec30863cba DIST polyml-5.9.tar.gz 3764115 BLAKE2B ae0ca0dcac2c1b5b54e4e4c4c7362a9ba99846ff7a1358a2332a8b887eb9c21e83851c9ecde44df3bebeef5cdfe3d4b73c09776a08cfc2db6ec70024ffedc50d SHA512 e996cbe820216e854a50ba214f2a2a0291ee3279eb35be4126b6558bc1582732a236156fb8d0f548b31fca4a496db62ece83d902b6f5e72de64507fdef602e45 -EBUILD polyml-5.9-r1.ebuild 907 BLAKE2B 0142c3e8cc8b3eb661d17ff25c6ec07157ac484567d2bb2b2a9ecd1e16fe55d16acba5726024a22e706b30957ef9386be5f8363db340857955ba1ad92fc2cfb8 SHA512 dd970dc007d1dcd35922a55123d671b3972269e1159d4185127b4e3fb9ee5e7d4f77df98949f566502830807f6f793ff5d0047221f6b339f08548635127fad9c +EBUILD polyml-5.9-r2.ebuild 1101 BLAKE2B fbbda6b42c9f2d5619623a266bf5fff095531d81ff98c9cbb150748362d2230dfc6815b417e98e99a0fb0b8adfaac22dbfd9b8f18159379c3a2aa87e5d2774c6 SHA512 60e9a3bd8f9b359c3067ed1c094c88eb9b807f5d165ef4825563393b3c611d12d50a6f2218ba1c5f3baa6df11f057d9511f7facf82f921c05187acfba733c9f7 MISC metadata.xml 476 BLAKE2B 1ae157cea19be5c640cddb49ed167f4bd2f3f76b224f42ad1eec260cf4a10418e90cf0d9cd7deae8710910aa141a7dcea912533dfc3aba51b587a8babde0f1e5 SHA512 93c0da7fa36a0ff2215f22a114b995c0f3cbb8762807090203e25e011236324585dc7af1246a881cdd5d2b41b6d69a00c9965507f8b467481e65679bbf87dd59 diff --git a/dev-lang/polyml/polyml-5.9-r1.ebuild b/dev-lang/polyml/polyml-5.9-r2.ebuild index 76dcf8e4fdec..2c5e1ec69299 100644 --- a/dev-lang/polyml/polyml-5.9-r1.ebuild +++ b/dev-lang/polyml/polyml-5.9-r2.ebuild @@ -48,5 +48,12 @@ src_test() { src_install() { default - rm "${D}"/usr/lib*/libpolyml.la || die + + if [[ -f "${ED}"/usr/$(get_libdir)/libpolymain.la ]] ; then + rm "${ED}"/usr/$(get_libdir)/libpolymain.la || die + fi + + if [[ -f "${ED}"/usr/$(get_libdir)/libpolyml.la ]] ; then + rm "${ED}"/usr/$(get_libdir)/libpolyml.la || die + fi } diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index b75e278b24c9..c81bbd87f9f2 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -31,6 +31,7 @@ EBUILD python-3.11.5.ebuild 15139 BLAKE2B b9b350d3a56a158ddf14ce56571440bdcc0f35 EBUILD python-3.12.0_beta4_p2.ebuild 15038 BLAKE2B f228f611b0294effb0f8fda97c48c1c322c224feea5d3e1e71e55bf1335085d266e0858c88f5be407eede13df39e6b1f920e017c7dca2257f4f12eb60ea7590c SHA512 78c08885e6b8dfd25e88abbaafdbc4d0c73594945852fd7e124dce3521dc09ee959d9a1d2e23222c63bb5b7aec2b925a74c0b1650649775e87b3afbec037cfd9 EBUILD python-3.12.0_rc1_p5.ebuild 15037 BLAKE2B 0a12685727c7b54f442e6f5bad91a7f154b6c00efb9784516109add90f69fc0b975a5c797148bba1a30385b982e8448b6fc1bfb4d2fef16c6bf76e6349ef0169 SHA512 b683086fab83c08f6667656d133703c4941d1fdf6569c84951a66437f59d335b7ad727ce1e6b5cdf91c2d429eba84e13658b4831b4cc75f0c14126be446b3e41 EBUILD python-3.12.0_rc1_p6.ebuild 15037 BLAKE2B 0a12685727c7b54f442e6f5bad91a7f154b6c00efb9784516109add90f69fc0b975a5c797148bba1a30385b982e8448b6fc1bfb4d2fef16c6bf76e6349ef0169 SHA512 b683086fab83c08f6667656d133703c4941d1fdf6569c84951a66437f59d335b7ad727ce1e6b5cdf91c2d429eba84e13658b4831b4cc75f0c14126be446b3e41 +EBUILD python-3.12.0_rc2_p1-r1.ebuild 14658 BLAKE2B 847cd395de911f9eb3a20aeb3deb0e50348594db1ca10866fe4ba70eef355fe55f1c159cf3a9d5c5312323895b43e2f7aea7c11ccb29b914b3c4892534d4077b SHA512 b7dd2b0f33d67f8233d3dac8c0f1b60ffe05701fd152024a23f37f56c66eee93ed86561af5dd20956658b28065857ffd9d2042a7b83f3a835cf97171e0c54def EBUILD python-3.12.0_rc2_p1.ebuild 15037 BLAKE2B 0a12685727c7b54f442e6f5bad91a7f154b6c00efb9784516109add90f69fc0b975a5c797148bba1a30385b982e8448b6fc1bfb4d2fef16c6bf76e6349ef0169 SHA512 b683086fab83c08f6667656d133703c4941d1fdf6569c84951a66437f59d335b7ad727ce1e6b5cdf91c2d429eba84e13658b4831b4cc75f0c14126be446b3e41 EBUILD python-3.8.18.ebuild 12365 BLAKE2B f186fea669f32e250e044d575690418ba81dc0f9389c9c1c61a91ce09261277028042a80daefdc5b4946d88fbf4ea159d68896d27d1d981502f8a32fb76b010d SHA512 4b7cc3ab54d43c0eebfa72b3e7b41755d391b6d9076fd56a155dd28b18f8e8c5d67a6472d03913e1b766f030152ae158e40edab1dc2a4a6c9f8251d7e44fc8c9 EBUILD python-3.9.18.ebuild 13866 BLAKE2B 06ebd3752ef075f85633b74c8237537bdc551de1e6fa20ffe5a914cedfd5186678b4e9bd3d5e46539607c317e18f3e03e671a19ffb065767a7d32811d9c543fe SHA512 886622cf89cc87ad7490a94775e01d02305953be1caf3de5c771fb7d926db33a69961c1048428f8c07dde7670d1be05dbd81822cc50ad348ad07a5ebfb005deb diff --git a/dev-lang/python/python-3.12.0_rc2_p1-r1.ebuild b/dev-lang/python/python-3.12.0_rc2_p1-r1.ebuild new file mode 100644 index 000000000000..07d09f165320 --- /dev/null +++ b/dev-lang/python/python-3.12.0_rc2_p1-r1.ebuild @@ -0,0 +1,528 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" +WANT_LIBTOOL="none" + +inherit autotools check-reqs flag-o-matic multiprocessing pax-utils +inherit python-utils-r1 toolchain-funcs verify-sig + +MY_PV=${PV/_rc/rc} +MY_P="Python-${MY_PV%_p*}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${MY_PV}" + +DESCRIPTION="An interpreted, interactive, object-oriented programming language" +HOMEPAGE=" + https://www.python.org/ + https://github.com/python/cpython/ +" +SRC_URI=" + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz + verify-sig? ( + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc + ) +" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE=" + bluetooth build debug +ensurepip examples gdbm libedit lto + +ncurses pgo +readline +sqlite +ssl test tk valgrind +" +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:= + app-arch/xz-utils:= + app-crypt/libb2 + >=dev-libs/expat-2.1:= + dev-libs/libffi:= + dev-python/gentoo-common + >=sys-libs/zlib-1.1.3:= + virtual/libcrypt:= + virtual/libintl + ensurepip? ( dev-python/ensurepip-pip ) + gdbm? ( sys-libs/gdbm:=[berkdb] ) + kernel_linux? ( sys-apps/util-linux:= ) + ncurses? ( >=sys-libs/ncurses-5.2:= ) + readline? ( + !libedit? ( >=sys-libs/readline-4.1:= ) + libedit? ( dev-libs/libedit:= ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3= ) + ssl? ( >=dev-libs/openssl-1.1.1:= ) + tk? ( + >=dev-lang/tcl-8.0:= + >=dev-lang/tk-8.0:= + dev-tcltk/blt:= + dev-tcltk/tix + ) +" +# bluetooth requires headers from bluez +DEPEND=" + ${RDEPEND} + bluetooth? ( net-wireless/bluez ) + test? ( + app-arch/xz-utils[extra-filters(+)] + dev-python/ensurepip-pip + dev-python/ensurepip-setuptools + dev-python/ensurepip-wheel + ) + valgrind? ( dev-util/valgrind ) +" +# autoconf-archive needed to eautoreconf +BDEPEND=" + sys-devel/autoconf-archive + app-alternatives/awk + virtual/pkgconfig + verify-sig? ( >=sec-keys/openpgp-keys-python-20221025 ) +" +RDEPEND+=" + !build? ( app-misc/mime-types ) +" +if [[ ${PV} != *_alpha* ]]; then + RDEPEND+=" + dev-lang/python-exec[python_targets_python${PYVER/./_}(-)] + " +fi + +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc + +# large file tests involve a 2.5G file being copied (duplicated) +CHECKREQS_DISK_BUILD=5500M + +QA_PKGCONFIG_VERSION=${PYVER} +# false positives -- functions specific to *BSD +QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags ) + +pkg_pretend() { + use test && check-reqs_pkg_pretend +} + +pkg_setup() { + use test && check-reqs_pkg_setup +} + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} + fi + default +} + +src_prepare() { + # Ensure that internal copies of expat and libffi are not used. + # TODO: Makefile has annoying deps on expat headers + #rm -r Modules/expat || die + + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + ) + + default + + # force the correct number of jobs + # https://bugs.gentoo.org/737660 + sed -i -e "s:-j0:-j$(makeopts_jobs):" Makefile.pre.in || die + + eautoreconf +} + +src_configure() { + local disable + # disable automagic bluetooth headers detection + if ! use bluetooth; then + local -x ac_cv_header_bluetooth_bluetooth_h=no + fi + + append-flags -fwrapv + filter-flags -malign-double + + # https://bugs.gentoo.org/700012 + if is-flagq -flto || is-flagq '-flto=*'; then + append-cflags $(test-flags-CC -ffat-lto-objects) + fi + + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. + # PKG_CONFIG needed for cross. + tc-export CXX PKG_CONFIG + + local dbmliborder= + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + if use pgo; then + local profile_task_flags=( + -m test + "-j$(makeopts_jobs)" + --pgo-extended + -u-network + + # We use a timeout because of how often we've had hang issues + # here. It also matches the default upstream PROFILE_TASK. + --timeout 1200 + + -x test_gdb + -x test_dtrace + + # All of these seem to occasionally hang for PGO inconsistently + # They'll even hang here but be fine in src_test sometimes. + # bug #828535 (and related: bug #788022) + -x test_asyncio + -x test_httpservers + -x test_logging + -x test_multiprocessing_fork + -x test_socket + -x test_xmlrpc + + # Hangs (actually runs indefinitely executing itself w/ many cpython builds) + # bug #900429 + -x test_tools + ) + + if has_version "app-arch/rpm" ; then + # Avoid sandbox failure (attempts to write to /var/lib/rpm) + profile_task_flags+=( + -x test_distutils + ) + fi + local -x PROFILE_TASK="${profile_task_flags[*]}" + fi + + local myeconfargs=( + # 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 + + --enable-shared + --without-static-libpython + --enable-ipv6 + --infodir='${prefix}/share/info' + --mandir='${prefix}/share/man' + --with-computed-gotos + --with-dbmliborder="${dbmliborder}" + --with-libc= + --enable-loadable-sqlite-extensions + --without-ensurepip + --with-system-expat + --with-platlibdir=lib + --with-pkg-config=yes + --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip + + $(use_with debug assertions) + $(use_with lto) + $(use_enable pgo optimizations) + $(use_with readline readline "$(usex libedit editline readline)") + $(use_with valgrind) + ) + # Force-disable modules we don't want built. + # See Modules/Setup for docs on how this works. Setup.local contains our local deviations. + cat > Modules/Setup.local <<-EOF || die + *disabled* + nis + $(usev !gdbm '_gdbm _dbm') + $(usev !sqlite '_sqlite3') + $(usev !ssl '_hashlib _ssl') + $(usev !ncurses '_curses _curses_panel') + $(usev !readline 'readline') + $(usev !tk '_tkinter') + EOF + + # disable implicit optimization/debugging flags + local -x OPT= + + if tc-is-cross-compiler ; then + # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 + local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi) + + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + # + # -fno-lto to avoid bug #700012 (not like it matters for mini-CBUILD Python anyway) + local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto" + local -x LDFLAGS_NODIST=${BUILD_LDFLAGS} + local -x CFLAGS= LDFLAGS= + local -x BUILD_CFLAGS="${CFLAGS_NODIST}" + local -x BUILD_LDFLAGS=${LDFLAGS_NODIST} + + # We need to build our own Python on CBUILD first, and feed it in. + # bug #847910 + local myeconfargs_cbuild=( + "${myeconfargs[@]}" + + --libdir="${cbuild_libdir:2}" + + # Avoid needing to load the right libpython.so. + --disable-shared + + # As minimal as possible for the mini CBUILD Python + # we build just for cross to satisfy --with-build-python. + --without-lto + --without-readline + --disable-optimizations + ) + + myeconfargs+=( + # Point the imminent CHOST build to the Python we just + # built for CBUILD. + --with-build-python="${WORKDIR}"/${P}-${CBUILD}/python + ) + + mkdir "${WORKDIR}"/${P}-${CBUILD} || die + pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die + + # Avoid as many dependencies as possible for the cross build. + mkdir Modules || die + cat > Modules/Setup.local <<-EOF || die + *disabled* + nis + _dbm _gdbm + _sqlite3 + _hashlib _ssl + _curses _curses_panel + readline + _tkinter + pyexpat + zlib + # We disabled these for CBUILD because Python's setup.py can't handle locating + # libdir correctly for cross. This should be rechecked for the pure Makefile approach, + # and uncommented if needed. + #_ctypes _crypt + EOF + + ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}" + + # Unfortunately, we do have to build this immediately, and + # not in src_compile, because CHOST configure for Python + # will check the existence of the --with-build-python value + # immediately. + emake + popd &> /dev/null || die + fi + + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + local -x CFLAGS_NODIST=${CFLAGS} + local -x LDFLAGS_NODIST=${LDFLAGS} + local -x CFLAGS= LDFLAGS= + + # Fix implicit declarations on cross and prefix builds. Bug #674070. + if use ncurses; then + append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw + fi + + econf "${myeconfargs[@]}" + + if 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 + + # install epython.py as part of stdlib + echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die +} + +src_compile() { + # Ensure sed works as expected + # https://bugs.gentoo.org/594768 + local -x LC_ALL=C + export PYTHONSTRICTEXTENSIONBUILD=1 + + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + addpredict "/usr/lib/python${PYVER}/site-packages" + fi + + # also need to clear the flags explicitly here or they end up + # in _sysconfigdata* + emake CPPFLAGS= CFLAGS= LDFLAGS= + + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + + # 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 + + # this just happens to skip test_support.test_freeze that is broken + # without bundled expat + # TODO: get a proper skip for it upstream + local -x LOGNAME=buildbot + + local test_opts=( + -u-network + -j "$(makeopts_jobs)" + + # fails + -x test_gdb + ) + + if use sparc ; then + # bug #788022 + test_opts+=( + -x test_multiprocessing_fork + -x test_multiprocessing_forkserver + ) + fi + + # workaround docutils breaking tests + cat > Lib/docutils.py <<-EOF || die + raise ImportError("Thou shalt not import!") + EOF + + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + # workaround https://bugs.gentoo.org/775416 + addwrite "/usr/lib/python${PYVER}/site-packages" + + nonfatal emake test EXTRATESTOPTS="${test_opts[*]}" \ + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty + local ret=${?} + + rm Lib/docutils.py || die + + [[ ${ret} -eq 0 ]] || die "emake test failed" +} + +src_install() { + local libdir=${ED}/usr/lib/python${PYVER} + + # the Makefile rules are broken + # https://github.com/python/cpython/issues/100221 + mkdir -p "${libdir}"/lib-dynload || die + + # -j1 hack for now for bug #843458 + emake -j1 DESTDIR="${D}" altinstall + + # Fix collisions between different slots of Python. + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + rm -r "${libdir}"/ensurepip/_bundled || die + if ! use ensurepip; then + rm -r "${libdir}"/ensurepip || die + fi + if ! use sqlite; then + rm -r "${libdir}/"sqlite3 || die + fi + if ! use tk; then + rm -r "${ED}/usr/bin/idle${PYVER}" || die + rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die + fi + + ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die + + dodoc Misc/{ACKS,HISTORY,NEWS} + + if use examples; then + docinto examples + find Tools -name __pycache__ -exec rm -fr {} + || die + 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 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" + + # python-exec wrapping support + local pymajor=${PYVER%.*} + local EPYTHON=python${PYVER} + local scriptdir=${D}$(python_get_scriptdir) + mkdir -p "${scriptdir}" || die + # python and pythonX + ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die + ln -s "python${pymajor}" "${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 > "${scriptdir}/python${pymajor}-config" <<-EOF || die + #!/bin/sh + exec "${abiver}-config" "\${@}" + EOF + chmod +x "${scriptdir}/python${pymajor}-config" || die + ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die + # 2to3, pydoc + 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 +} + +pkg_postinst() { + local v + for v in ${REPLACING_VERSIONS}; do + if ver_test "${v}" -lt 3.11.0_beta4-r2; then + ewarn "Python 3.11.0b4 has changed its module ABI. The .pyc files" + ewarn "installed previously are no longer valid and will be regenerated" + ewarn "(or ignored) on the next import. This may cause sandbox failures" + ewarn "when installing some packages and checksum mismatches when removing" + ewarn "old versions. To actively prevent this, rebuild all packages" + ewarn "installing Python 3.11 modules, e.g. using:" + ewarn + ewarn " emerge -1v /usr/lib/python3.11/site-packages" + fi + done +} |