summaryrefslogtreecommitdiff
path: root/dev-lang/python
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-22 19:52:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-22 19:52:05 +0000
commitb6a0f46f7d2e1e21df70fb32169f7d9de85445f7 (patch)
tree2f1b6f7c25e85d70d737cd66c68673ed58e1108e /dev-lang/python
parent9173f73d44f3cbc858477bd71e7680ede7d98e0d (diff)
gentoo auto-resync : 22:12:2023 - 19:52:05
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/Manifest2
-rw-r--r--dev-lang/python/python-3.12.1_p1.ebuild532
2 files changed, 534 insertions, 0 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 81eac40d889d..0b9ebab979c8 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -21,6 +21,7 @@ DIST python-gentoo-patches-3.10.13.tar.xz 13996 BLAKE2B 0123a18c8c39397ac03b1be1
DIST python-gentoo-patches-3.11.6.tar.xz 7568 BLAKE2B 7ff4b1f4f2549b2df46aeff875c20fb6de40778d88071c1aa054bf2e3494f718dbb39a42d9cb791c1e0db1a025ae8eb13b24f7bd712f08b3c00ca638100bb732 SHA512 57c655d9d0df4284e167f3ed9b4e0d1c4554e5fe08605c64db253c104ac2e64da2439c8500fe60460d2545683467f8689d7fee68214cfa414584d71434735473
DIST python-gentoo-patches-3.11.7.tar.xz 7560 BLAKE2B fa836508cc85c3fd5e9bfb61d4d214b0d23923e4d29b87d30afa7a5a4d8fa23d5abb8ae8e1d571e301318ce14707a5538228bf1f2bcc8dfdfd5788e4676c0c0c SHA512 e3f94281689f500b41cd707b2881613c0c6a1be3dad2fbe1fc64330b249bce173d50cdc6e2f656daa7920b06795b7a555c1b08982b889b48955356e66416836c
DIST python-gentoo-patches-3.12.1.tar.xz 5152 BLAKE2B bd1470dbdb4a3336f499534131d9f67329d6a1f6378b61592f6168d9a2500d9d9d65a77167065f80c38745fa1464a2073eac3e4bc0e5c096eefbbc8971a077b6 SHA512 2e608940f2f8c3a4be2699365acd1967d887c7895e71b173327dfe91ea41b6fb10a83d0845b2caa8b59884aa73ea73e49535d7805dc8b50f63b7fcdda67b438a
+DIST python-gentoo-patches-3.12.1_p1.tar.xz 6064 BLAKE2B 8238f10c1ebdd82fec4ca70cdc9ea59711dab06c687315044580c853502189eb8c00f14213eea507921659c9c6a6c14b4f432b6762fef5e10a62b866c27ac943 SHA512 44e6859a312cb5cc080ac5a2bc9c649fa5cd9a137b85c3e8dc312e0a0027cdc917e150c5c3ab4b4bd9836b6918b3e53a12e0d4406bdca124ede10d63e69e8ca2
DIST python-gentoo-patches-3.13.0a2.tar.xz 4360 BLAKE2B 1c55b3ae512a2c04bab00fb3a47faabd2726b6cd7a082d27b4c354ff334c22cb7296d9bf4ca531fc91e2d31be8b1f385de82081980272bca9163bc208b54fea4 SHA512 c7bd4dc3f8f698d65ffe54f46432903e3591687d997b1f6b7429bead461652d9de9dea3515cb0063a662d14ddcf7916199779d61edf888cc24c01d89f1fafbee
DIST python-gentoo-patches-3.8.18.tar.xz 32424 BLAKE2B 2e0b6e1c8e3df666934ba283214ca1577b01140dea00513f6420b0255650002e4bc4cb142076620227cd430bc2547123fd392883285886e543ef72ca466f8ea6 SHA512 b005f1054b726fc8c82a50b006309de64fb7858fe5c22cc7b160687d059a7859ec9388706b74a0e6c1f42301bed071dc639eb8cfae0d7c5eef2f565c63cc2d29
DIST python-gentoo-patches-3.9.18.tar.xz 25044 BLAKE2B 1d9ace5c5a0f1c15bc23595cc51d64b4c2b416552cdaaa960c3e34360aba3e7029a06e2a077212c68fa7aee4fd20f649a3b0926bd4ebb10e529e8350ab051e63 SHA512 bc180c3346dfae60a7db221d114146ee83409bc42092171eb05c83de528bf5f0e5654d1441f40ba839d0a98e866a5b43452fb7a72047c837497620a12097b8f5
@@ -29,6 +30,7 @@ EBUILD python-3.10.13.ebuild 14207 BLAKE2B 7d9f57dd82465e6d000b834e1b3a100551855
EBUILD python-3.11.6.ebuild 15105 BLAKE2B 4833298b9756cb8191488cd8a34eb9a8fb4817a1ccb4c95a1b02edd945d1cb27aada17c853d6927f943087c972771e8e2cf61d0e66ab9def73e12cf771958bfb SHA512 61fd0faf278d437f66da968253e1ccb161345b8bc2352a673605c6a708a0f41903adde5493d30c1bc2cf1baa88eb2a8d3865b67189a0c7808c0174f9e5eca6f7
EBUILD python-3.11.7.ebuild 15107 BLAKE2B 81b6b2507fdc9461493861e0ead1aa7a41579f37486db9b0028264a27e8ca1e4b21ee7819350231dfc6a3b7542573159b8e67b143cf8d0021ef30c840155ade8 SHA512 d440a1e0fdfabecf65c97662225389165ccb656f56d6ac401c1d426642ea0febcd462f0f8fd078bb8866d9eb266970211b7be54c45b8f3c6cb1bb67abe9b4dd0
EBUILD python-3.12.1.ebuild 14665 BLAKE2B 6f5d08274a07a921ff299191f193011b7b3af0166ee7ecaa85375cac97e7222588235ec0df89816e0de4a9843d037d7d935ca21097e2cf65171e2610dd64c62f SHA512 1388c9d7cf9391e127bee6c753bed1c722972d3e9c12b8dd4d423b7047e416c3364a6253e00d4e9073a7c5bca31a036ff43812a9a34db1ae26a53e0096d91932
+EBUILD python-3.12.1_p1.ebuild 14673 BLAKE2B 8cea6ceaa4a2b8ebe30d6d85f494e47a6b31ffcb89b1952daa7f26cb58f7bdf71d9f4eade3cac6a3c1d35990c1758d0e821ae5676cfbab38ba330c053cd6e761 SHA512 765454cde068682f67a8935c153240db5c0d456a49108a9f498d9ed958366725e8925878cd2563ae18ff8058c08c8c1c1294862ec0b58e5f7cf16629ebdadb53
EBUILD python-3.13.0_alpha2.ebuild 14501 BLAKE2B fc95f903c0197dc5fad73bb41e3d29907942d5f4aa51f1f17ab7704ce94631abd77cc947277460b5d3b4c4ea55fc7cf0310c30c4ef947fc6cd7601ab5988930e SHA512 06bdce88e16edfed6d25feed6653335baf65fe5cb6aa8ffc5896a2c7851ca589b20ea588ce4e1fc04c4fc7571b3d188ed35231b9ca7e8933616e5f3347cc60b2
EBUILD python-3.8.18.ebuild 12357 BLAKE2B 98c47b83e4b18bc3ed23ccf8a10a310b9d71c51c08cd8ada6050a5db32c820a059b3e3b96e07be09daa949fc93c5e12c94c3a2b0f6bede56f4a33714688e7cb2 SHA512 7ddc4c2cec2641098906583ffe1e7bb9f324ccf4e7fc348e9d291f1b9032655a992681ff464a01dce565bd3249cf44595a6ca617b21f2958205ed6473418c7ab
EBUILD python-3.9.18.ebuild 13858 BLAKE2B 935bd948e44404cf68d62a93c77998570dba12778bdac9932a04005c0ec741a48581a51d82879ddfd0042a0fcf22ebbd407eec175ff846525e8ccaa7c16d1317 SHA512 f2f9b54437a20a3565261c9dcf5f5c0b9a09f0bcf69713ef42b665cfbfde59f53d8a3a920193e2888e33db1383a8acbceaca4d01f100cea86cd685f2c3511e8e
diff --git a/dev-lang/python/python-3.12.1_p1.ebuild b/dev-lang/python/python-3.12.1_p1.ebuild
new file mode 100644
index 000000000000..df871bbf0ed2
--- /dev/null
+++ b/dev-lang/python/python-3.12.1_p1.ebuild
@@ -0,0 +1,532 @@
+# 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=/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
+}
+
+build_cbuild_python() {
+ # 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[@]}"
+
+ --prefix="${BROOT}"/usr
+ --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
+ )
+
+ 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
+}
+
+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
+ build_cbuild_python
+ myeconfargs+=(
+ # Point the imminent CHOST build to the Python we just
+ # built for CBUILD.
+ --with-build-python="${WORKDIR}"/${P}-${CBUILD}/python
+ )
+ 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
+}