summaryrefslogtreecommitdiff
path: root/dev-lang/python
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-08-09 02:15:09 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-08-09 02:15:09 +0100
commit3fd9d065ab109700e92fc1cea2a6519a39a5b007 (patch)
tree2666118c9404e846180636fbd2de92e3bd7870fd /dev-lang/python
parent11c791ab62dc711840a52676eef212362840fc17 (diff)
gentoo auto-resync : 09:08:2022 - 02:15:09
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/Manifest4
-rw-r--r--dev-lang/python/python-3.11.0_rc1.ebuild482
2 files changed, 486 insertions, 0 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 5fb06d81d86f..1735eec64491 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -10,6 +10,8 @@ DIST Python-3.11.0b4.tar.xz 19573532 BLAKE2B d28b85c4af39ea8c8b1448857698a7018c9
DIST Python-3.11.0b4.tar.xz.asc 833 BLAKE2B eaedd106d3599c7ee6974ff9eee33899b119fdb45ab5b760f5f02e51e12ba58b3161f6853464a32638385fd596ddd350097c28dde55e3efeacc6719f16275d84 SHA512 8f6c633911755767d351fc86e031df6cedd6091ca5ec0ef55331ac65d2ad532c71e568c173513a2bbb2235e5e3fc9dd77e1b7ed230df1f0d8bd6e23da470b1e2
DIST Python-3.11.0b5.tar.xz 19792136 BLAKE2B 574ed58b2d063b954931c39c1154e776f5d233fe6e3f0803e5a93b68f48aacef1d9df60a2839df952b631d8988d6c44fee073dae5486420b808866944a3025d5 SHA512 b1013e449c9a0e9b61df5a266b5f05458d284b3524c6c44d44d8a5007bcb95ff754f21296cd695f353111575c7cce71f8a2808a9adf8c573512bf97f691d2200
DIST Python-3.11.0b5.tar.xz.asc 833 BLAKE2B 80594608751a141a6e5ded035c4de1a73716d72442228fa2dfcffc10d1ccb9928b864591fad4b5fb3a55e20629a22ad92fcc4a40d8e294858a85088b26d545af SHA512 6f658c7623e7750c0c8c18b4a2fe86d6a2414f3b411487ca4d2dd9840165ae3e6eea8b3468b1376862181b7b58d3fe99681a00d290172a6986f0f2ead5d6c3bd
+DIST Python-3.11.0rc1.tar.xz 19815524 BLAKE2B 7dae240dbed052667b46927ccbb483a717b0fe0ba199721d526354d1b89a6dd2842ab0f6c3b078385e4acb7557d06f252d61aacb07d70c7f5598ed91567d2053 SHA512 2a72ea59277f8115e418ced671969fc0d5ba271c7740f70c665a4b450a59d7752278d061bd59f136dacfa608ed167f983c6589b214a973b1b63ea2115ea298bb
+DIST Python-3.11.0rc1.tar.xz.asc 833 BLAKE2B da46a0ab62ef3f2b7a7921294a0d775ca6ab254e3229338232b3d11107aa1d74adc21911678f08f44cc1cd9184beada00d4b60dde60722ef91a247367b13e191 SHA512 d4cffc90c2ed7b8ea7228a21f7ac902a92f27003f1420ad751b1691de950974ea174cb0471b6e19ed1548dc5382012fa9ad5fcf83c34646c7ea2d73c88799e38
DIST Python-3.8.13.tar.xz 19023016 BLAKE2B d3cb8624496e56d93d34f2aa5082746869a99210197529bc19e6a9d265f4ce246e0e83a3528a7602a28aac8855bf84e6bf6495b85e9202fcf04ef90600cb5e43 SHA512 5c732b5d21b189b99a0e9ccd3ae59466bed60a930d5d3f437a262d38f0797b776cecbf12a1852eaebcfb638a6f2e28e471cc2ebf94237cc728144be21842cb81
DIST Python-3.8.13.tar.xz.asc 833 BLAKE2B 918894777e1a783f2a7c7958a808610631cb7a6039df84675158e8d2fd66782f29921d44ab9b4625c4ca3821852e0d0e0005163b086c7d0c3d617e3a76cb7033 SHA512 6683c4ae6cf20a97a29165f96b9f5dd09d618892583650d803aa677240695968dfe344294fc33db68fd4669c82021afcc29a1f6afe49915be51fae281eeeedbe
DIST Python-3.9.13.tar.xz 19754368 BLAKE2B 4f583f66c28b791e19cd6d79695fe9eb815fd333542be22aec8bd73d1f4d3f17f2c4e9de198e7b16c1ca6362a613a8a02fb965c7dc7db3e510fd31de15ba2d19 SHA512 e9664e7f908092df11236b22465d217531d6f0378e88d889108d19fe77f28f46ffb629b8733f84b41409e255367321893a2b1bd64518930d9d8cae5d1b774d23
@@ -19,6 +21,7 @@ DIST python-gentoo-patches-3.10.5.tar.xz 8584 BLAKE2B d4a812a33e485b1eae5629e519
DIST python-gentoo-patches-3.10.6.tar.xz 8580 BLAKE2B 4ff3839be2f6bf172acdca22bbded702804809d6334e088190cee4ae4c61e25580a3bdc105bfe27b7f3c3b5f219d363cdca21ef895a3e91f13515afb348a77a0 SHA512 c58a85f7c48a4e822527411a6e0618be5408e1a82fe72b21a254dac77b4e5d4b01ac24cf70dc277cd16ccdc8499a9fa53b7cebae3b9f8facc9c978adcc8a2876
DIST python-gentoo-patches-3.11.0b4.tar.xz 4388 BLAKE2B 16b112f1ecdce86022ed64d7c7007fb323b7bd4497b5802a48bb0a86667c282d1a9150d744f44cefbe9321af4916d35941707c1259a0cf175c0161c8e1b17e97 SHA512 f9c8c7180da20e839a0862571b9077b2702dbee8a1acd55ebb11329912cf9f81862ba615be484b92d39461c3eb6c38890f8d58bcbce2c4722418a967faedc1f5
DIST python-gentoo-patches-3.11.0b5.tar.xz 4384 BLAKE2B b036e9103f8315d6e2bb6e85a2db12ec60f8e05ccff083183f24c0b4ba16c807a2eb1fa43b88f8d7a253d5bbeef0880b31d60e13b449f7de992156319753ef33 SHA512 af6315f97b0f2463d6c0f18a99a5ff5f96c3d18567ae0d73461f0fc82ca2173a8f6c3fedc2fada2b9460547a457d4264bc2acb90f1906599229afe85bcc2afde
+DIST python-gentoo-patches-3.11.0rc1.tar.xz 4384 BLAKE2B 31bcdc055bfaf3434dbb02543aaf66910eaccd01808d9a0e57bf7cb3b097fc0046c00ac44737d9c37e3b6d074c524f4dd3ab439a741e66d74a0425889ecaead5 SHA512 05b044e2d8f881c471528600ee300bfd9cf5160609dfb3d7cbdb8e43f47b681542582a85de97e28e6a3b89a3fb6c8d7398e029d31e20cea9c5a2a71700382d4e
DIST python-gentoo-patches-3.8.13_p2.tar.xz 18816 BLAKE2B 8612ca33e5569319c5d1a5a3fb1a81e860bd515bfde656b79f087ccf7020923fbd06b315178bef8630e4c36bb22c27299fe439aadc6a161f1ec93be8778314ee SHA512 be5668a0a4be0a03e61466436973125a3be4f33a61524e4a5c8d86745727cfcae59e5048477887c9f6bfc09727f3aef3652ad47a13a6bf0f1452d3172f1c34dc
DIST python-gentoo-patches-3.8.13_p4.tar.xz 23084 BLAKE2B 44be6b19275189bd04c9dcd3c4be4f4b8f92a0003710a12a12d60c0ab182942993a76d8d7f26b289cd0a4226eeeb9a39723822dfb896307fd6e75d6980c3898e SHA512 b78a39a15d361aed4ce887b4726c7967c09c0ee3add614f1dbca24b6f301bd20660fe074c03a58b325f8720ad853c109b334e41102de0b6cc362c467fb669feb
DIST python-gentoo-patches-3.9.13.tar.xz 12836 BLAKE2B ba687a3d6e00baf4d9640ab78a29c3e21bf1872b5019198991521cf37bb0780f592db742ee4fdfe6bfb1cab1c1f6587889dfdb024cae72766b6c83c2ffe319be SHA512 e393992ff92625771c6ffeb500637862f0163c689c685fd245a6e5bbdd3128154ce439ecab56eaf1359e67ea0d173dfb19f65a4098ea2266922bfb43aba517dc
@@ -28,6 +31,7 @@ EBUILD python-3.10.5.ebuild 11701 BLAKE2B e83015ffd3bdcbceab4271ed82f6ee54d8b794
EBUILD python-3.10.6.ebuild 11189 BLAKE2B b50f71bbb9b5a72724f52193aa114fc7ec4ceef3559649964899f9aec4911726503ab24ec4c07b53d2f15ba498844913d3618832763e9b3728d8f9303a97a3ea SHA512 2a09997fa8f451ab873bd039f47a7f4c1a146befb43c8b56467ea9fd93f61e7d55a90ef289804aa6d15c9e5ebc5fded62879eec8dccd528ab25e4df8d39e63a8
EBUILD python-3.11.0_beta4-r2.ebuild 13637 BLAKE2B 230701d089c7e42f80b0666a1ac6c5d48ff6fe8a5b7822ee3d4cd41adfe6e50143ecde143e228416f97cc0886910b22bc0fbb83ffad3ad19006aebcc382516fc SHA512 ec7a302106654abefb0672e25e1f189506d35111be4a983ae5b51281bd195a452fe1fb7170b77f8048c880563664f8b9b3624c434594a4f3b36306a203e299e9
EBUILD python-3.11.0_beta5-r1.ebuild 13385 BLAKE2B 00d7c1d17bd8ad3acebfde6907fc27f77abc91a25f3d3e576bb6895c46f7cae88a8cd6dcf883dc3d91d0fba36349f3b209a512fff70cf4ff950a7f52d3e7d548 SHA512 56442b0cd0b7789c30d180b07e2e77b3203720e66084340cc85923410d54ca2ff40ce9096af844cde217f44bbd4e95ed4f8e69f192130de45bf14883d5127982
+EBUILD python-3.11.0_rc1.ebuild 13384 BLAKE2B 7ac3f74190fafd1321f2ae9b478cb1b7381f13ce88d1839bbe2eea12a9abb0f14286f3e6036ca65c2d37ca6b07b62c14f557a7af080f6f05f119e7bbd77764cc SHA512 3b94a9e45017c0ec3d2bb2ca346d423a0e31d3b1f2c1fa098aa2c4f0af58e49f3626688dacde9740b2c1f44c63f143bf43ec305d0ce69c3e68de3ff6ae0a88c3
EBUILD python-3.8.13_p2.ebuild 10219 BLAKE2B c736d7417d2f7c8f8a6ee61182e1b2b9e22873343594a3779c83fc1af03103ae71f440f856d7dae7a661dc7190e70afa7c478dd7d8531d28637897c1ebd4106f SHA512 89f482e716b308565f41c4c6ce1db32f9a4023a41570070ddad4ac9d156f802d79f8ad7d2971b9ed02487482c50d8e4de64d212df092dd907d2c94838e6af921
EBUILD python-3.8.13_p4.ebuild 9739 BLAKE2B 7baa8adde29baaea89a9f126a3090fba2186bcb2734ca737705c97d1b3f8d3036341ab2b626dc6e4cd5ab7630e386ef7f3444bb5847b79abf41806e2607715a6 SHA512 80ee67adf3b1c7461edb6b3ba60f5f825d93d89cc68f4a11b1de2bf84f4cb428718cee8079e68b074044a8e7f00d2423c97fc0cc3bfaa0848b6154b9abc3d6c7
EBUILD python-3.9.13.ebuild 11462 BLAKE2B cfa217f58ee03528ce5dd467daa9023c67f89d4673def5a183eb7a0c2db6fe40527a78067803f7edcdcf32eef5dc72179b9be9d9a04f5766258945a4a16e3991 SHA512 4a7fbd6f6e7ae1fc1726a170879e26a6f7e74fe4fc2b52efacf5608350bd967ee52d63df4fb8d52aebe881bc003285e29d55fca5aedf74182cdb5f8b120ca8c4
diff --git a/dev-lang/python/python-3.11.0_rc1.ebuild b/dev-lang/python/python-3.11.0_rc1.ebuild
new file mode 100644
index 000000000000..77ad9301d29f
--- /dev/null
+++ b/dev-lang/python/python-3.11.0_rc1.ebuild
@@ -0,0 +1,482 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+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 +ensurepip examples gdbm hardened libedit lto
+ +ncurses pgo +readline +sqlite +ssl test tk
+"
+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:=
+ sys-apps/util-linux:=
+ >=sys-libs/zlib-1.1.3:=
+ virtual/libcrypt:=
+ virtual/libintl
+ ensurepip? ( dev-python/ensurepip-wheels )
+ gdbm? ( sys-libs/gdbm:=[berkdb] )
+ 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
+ )
+ !!<sys-apps/sandbox-2.21
+"
+# bluetooth requires headers from bluez
+DEPEND="
+ ${RDEPEND}
+ bluetooth? ( net-wireless/bluez )
+ test? ( app-arch/xz-utils[extra-filters(+)] )
+"
+# autoconf-archive needed to eautoreconf
+BDEPEND="
+ sys-devel/autoconf-archive
+ virtual/awk
+ virtual/pkgconfig
+ verify-sig? ( sec-keys/openpgp-keys-python )
+ !sys-devel/gcc[libffi(-)]
+"
+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}
+
+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.
+ rm -r Modules/expat || die
+ rm -r Modules/_ctypes/libffi* || die
+
+ local PATCHES=(
+ "${WORKDIR}/${PATCHSET}"
+ )
+
+ default
+
+ # https://bugs.gentoo.org/850151
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die
+
+ # force the correct number of jobs
+ # https://bugs.gentoo.org/737660
+ local jobs=$(makeopts_jobs)
+ sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || 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
+
+ # Fix implicit declarations on cross and prefix builds. Bug #674070.
+ if use ncurses; then
+ append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
+ fi
+
+ 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
+ -x test_gdb
+ -u-network
+
+ # 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
+ )
+
+ 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-system-ffi
+ --with-platlibdir=lib
+ --with-pkg-config=yes
+ --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
+
+ $(use_with lto)
+ $(use_enable pgo optimizations)
+ $(use_with readline readline "$(usex libedit editline readline)")
+ )
+
+ # disable implicit optimization/debugging flags
+ local -x OPT=
+ # 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=
+
+ if tc-is-cross-compiler ; then
+ # We need to build our own Python on CBUILD first, and feed it in.
+ # bug #847910
+ local myeconfargs_cbuild=(
+ "${myeconfargs[@]}"
+
+ # 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
+ ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
+
+ # Avoid as many dependencies as possible for the cross build.
+ cat >> Makefile <<-EOF || die
+ MODULE_NIS_STATE=disabled
+ MODULE__DBM_STATE=disabled
+ MODULE__GDBM_STATE=disabled
+ MODULE__DBM_STATE=disabled
+ MODULE__SQLITE3_STATE=disabled
+ MODULE__HASHLIB_STATE=disabled
+ MODULE__SSL_STATE=disabled
+ MODULE__CURSES_STATE=disabled
+ MODULE__CURSES_PANEL_STATE=disabled
+ MODULE_READLINE_STATE=disabled
+ MODULE__TKINTER_STATE=disabled
+ MODULE_PYEXPAT_STATE=disabled
+ MODULE_ZLIB_STATE=disabled
+ EOF
+
+ # 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
+
+ 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
+
+ # force-disable modules we don't want built
+ local disable_modules=( NIS )
+ use gdbm || disable_modules+=( _GDBM _DBM )
+ use sqlite || disable_modules+=( _SQLITE3 )
+ use ssl || disable_modules+=( _HASHLIB _SSL )
+ use ncurses || disable_modules+=( _CURSES _CURSES_PANEL )
+ use readline || disable_modules+=( READLINE )
+ use tk || disable_modules+=( _TKINTER )
+
+ local mod
+ for mod in "${disable_modules[@]}"; do
+ echo "MODULE_${mod}_STATE=disabled"
+ done >> Makefile || die
+
+ # 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
+ # Prevent using distutils bundled by setuptools.
+ # https://bugs.gentoo.org/823728
+ export SETUPTOOLS_USE_DISTUTILS=stdlib
+ 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/python3.11/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
+
+ # bug 660358
+ local -x COLUMNS=80
+ local -x PYTHONDONTWRITEBYTECODE=
+ # workaround https://bugs.gentoo.org/775416
+ addwrite /usr/lib/python3.11/site-packages
+
+ emake test EXTRATESTOPTS="${test_opts[*]}" \
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty || die "emake test failed"
+}
+
+src_install() {
+ local libdir=${ED}/usr/lib/python${PYVER}
+
+ # -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
+
+ 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
+}