summaryrefslogtreecommitdiff
path: root/dev-lang/python
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-06-06 21:40:28 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-06-06 21:40:28 +0100
commit10e3aabd0e3e0accfc5cba9e7b06bf694512625f (patch)
tree7282f9514e821f650373f8dde70a36af84e8913b /dev-lang/python
parenta52a3a626c1d57fc0b3dbf58e79a23e88c3dd4ff (diff)
gentoo auto-resync : 06:06:2023 - 21:40:28
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/Manifest8
-rw-r--r--dev-lang/python/python-3.8.17.ebuild428
-rw-r--r--dev-lang/python/python-3.9.17.ebuild487
3 files changed, 923 insertions, 0 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 9722d506d4d6..c5bdd900d07f 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -10,8 +10,12 @@ DIST Python-3.12.0b1.tar.xz 20053428 BLAKE2B b5b0df040de6cff181689f7c53e09407ef3
DIST Python-3.12.0b1.tar.xz.asc 963 BLAKE2B e80cbc9cf93756b6efbce3037dfcd4fec310ce17a3db36f33ac617dae63a8c2abc8efb3cfd5ec42299b9e4c2bdd06a3405c50b5550869564ae5f6a6d79d596c9 SHA512 cea449f05ae66c28aeb4ffd99b5748ba4c09bfb2a6889a771744ea81ca2afc2420648d4ca92592d32ddb26660804e73912e6fb8d906674e9e1895ba613904b26
DIST Python-3.8.16.tar.xz 19046724 BLAKE2B cbdeec7961d39cb9ab4960760b5d4c7ae71675c174156aa9f6fca55ee92a93a937ef39defe86e423237a25e0e24703233ce4b91dc97005b6ffc1f342ddd9e22c SHA512 d206e80806409410c00ef8acd8c3d90e3cc9553f996d0a57faa63802f2415e9d7591542b2e84b5e8e79245f40f6478790b5ba2acf1da98ebbc9495999183f7fd
DIST Python-3.8.16.tar.xz.asc 833 BLAKE2B 678dabc558d013b104bf9e65d4319076c4730a67093a66fefc073b429c640d4facb31a0d6b7238deb08b265586a0cfb2c345051fe4df7bf5001d7317e6c06c9b SHA512 e93c394c0c5afcaaab625a3bd540dcc8e0ab946803d212343b8d1d6d5e6b89b09b6a20607bab0d858b30389a03305d57e14548605a65277d053c7817f32f4546
+DIST Python-3.8.17.tar.xz 20696584 BLAKE2B 07be197f7d753775b039ca200864e6d40cbb0115538604d0b214a5404beecd38e3ef416c1941f7871e2e92913d09faba48745bb9df141cf8e5ca77c7de6f0a24 SHA512 bc7e02acfebba86e4394f02195993500fac9347a52c7b49727eb0cdda38786ae917234272872d75effaddb042810d9682ef5627b0cc199f8aa0d5d3e315ddc0e
+DIST Python-3.8.17.tar.xz.asc 833 BLAKE2B c1eb893e8005c59c918528d676f06679182cf45ae256f9929d2daf56577dd2dcb3aff264e9ca47b605ecba2a1c00fabf282c59a231e67cec2324c33c6b3ca7f6 SHA512 bb017e2b17a3ca8ed568d2589285a87365bcca6a677e06fab5184d03e251ace6276117a160f59201e6a1c597e32d79ee109ffc7083266e6e2105b7afaaac3876
DIST Python-3.9.16.tar.xz 19738796 BLAKE2B 70dedeb70d9d8f27e4f6db5106623e087c61d451c7a04639cf8d3503ad02d4d43f1b36d0cdf1131aefc9bf6e677e561227dd4baef2c2c3d2dbf6d3e7dc36bd94 SHA512 b5fd0afe131c82bbce6ddf887c59eef6945910d6a9a2bc87c0927f4e4a096bf9ca4d25bcb729c40f6ebb8a65fbe8bf7b0b97a7c4a8c9e551240eb4f34b878653
DIST Python-3.9.16.tar.xz.asc 833 BLAKE2B 416b4a4be06e101c5971c12a6f21229c425bcabaea58487e0d1b24d6dea318c58806ee43892fc704df8252670451bd6a4a2610c25672d3983ddb081fed34b92d SHA512 468959c36a3ec6136f57a39475fff4745a25be0cb5d3d58cf3e5faf0b9ce2d2a8b89f1f9fea1479c4c6ad12ac49e97c1cfd4291c978bb3d30df5a582ec315210
+DIST Python-3.9.17.tar.xz 19647312 BLAKE2B eae9d1c0b9a6cd9ce84af75e58899bcd127163c90434d2bc879047706adb087721aa5ac9425e6906e6238296b2695ea0304a2b93288627cee3560ee85f450062 SHA512 994d92346e563a4635411808744eac8207c68e6fc9c1db1c2eb4103dad8553aaad4a8116e38c61f28cb17905a12cc46dccdde985e1c45882bf1815081b88b6be
+DIST Python-3.9.17.tar.xz.asc 833 BLAKE2B ff3dc342e89149b89b060d0bd8d2a147cc901bc64c1e97d3c21ca8ff2165cd4959ca76ae1df9dbc76039b43d75e8108382ad2d8954e4ae892d174f6eb3aaeb44 SHA512 948196f104539b2e05b17fb5ef2387be392c515222213def7ab6f5b0f490d60e472e8df2dc6ec1df1d293a34d8c26a761412c93aabbdefd3390ee8bdef95a5d8
DIST python-gentoo-patches-2.7.18_p16.tar.xz 35448 BLAKE2B 0139c0944f62f9cdd236f6a8557e0ed19704c7d72869af1cb7d8bd3e646a746cd4a0201e1b44232a5e78ef49f254db20b0d0271bf744fbfd4fe0f1e99b8f3e6c SHA512 810be590d0e06fab4b2165e6852ca49662f09dcd7e20b47a29f613ad7653252c8dfac3f0eb228d77c8a914efa7c08788b2fbd552a4b47504f5fd0ec17450c48f
DIST python-gentoo-patches-3.10.11.tar.xz 13984 BLAKE2B 00c682609876756f61d41f637d0354538823dd713c81f8a3a168d217c515d4559d24e1988c1796b2b920f3962f56e023758b292175d29d5348a87bd8b422f6e7 SHA512 f819113908bc689bb522d2cbe749c658a6b29e7f627718954b12797461a13781352b01f798e2f42b3741a0a0489049bf03405ead4ac8103a025dac11e72b0888
DIST python-gentoo-patches-3.11.3.tar.xz 7776 BLAKE2B 78bf26f554c608c68826b9ea3c63a1df2b45bff755860f39f14306ebb63f17f5111b117519c4a9cb30452a62a14a3a7393798b8920c3d108ec8b6a30db88641e SHA512 64b79c90055fd940590b72ffd3744fe02ab9e46caf7b46f4aa1d074bf3e62d355e128bb2ac68c42f228f2e1bcdee2b0b114d9e2b9bf8427512083c1c5f8680e8
@@ -20,7 +24,9 @@ DIST python-gentoo-patches-3.12.0b1_p1.tar.xz 73068 BLAKE2B 6728a4dcc102cc73e0e3
DIST python-gentoo-patches-3.12.0b1_p3.tar.xz 127756 BLAKE2B b2e0d60cedaf2cfd798387a06e0ea16285b880526639f5050ce285482008bd034c4ee3463f396c96d7b7d6834d4e5f79a4bf441e92b0fe257369c9519d904bf5 SHA512 8e5da370301104f6520c364696b41ce9d1d2561abca096dfb626118d87ac14f8a15fb7a195903aa4aaf6a91189f3dbb9e3833c389fcabb1c9b19720c68228874
DIST python-gentoo-patches-3.12.0b1_p4.tar.xz 127836 BLAKE2B 188fac1b90925b6f80666fd102832909490d82452bb1655c91657d6bf716fca6b4185c34e774387559234a68713ac14d0b5de21a4110ffb3fef200ba8b5379e0 SHA512 07d9dff9e8f53a8b6e79603f2a6b61f5448cf3eb83cdcd184b3131611a7f8bcb975a0ad41bd194256617696df138cff79fbf7626b29f2407435fb0f55175cc72
DIST python-gentoo-patches-3.8.16_p4.tar.xz 32436 BLAKE2B 76984bbc04e5cf32d70853891967a33366dd28ca2cd47f3538ed1e9f4d39008d04c90f616d92112f5ec3468c42119089d195ee4d936536f8da4a772164aae221 SHA512 ad6d653fec3cce1f73db4b192f7e95b35ae2cf70aa8782d7b69f9d48eee240ef1cc32257a42bbb57f3952720df68b9976164a0b2748e36600332fba488383016
+DIST python-gentoo-patches-3.8.17.tar.xz 32424 BLAKE2B d992f6b1c971583000086175d07198d367e4504dea8829b35742a3daf2279ba1fbade8c37f00018bda97fa9080d1d40087c236486bbcd369c2d1c850de47a976 SHA512 d309da6805a72742cf8d1bb170a777edd7b7aa936d6e9967e96bed4427285180cd9935f202f899f3aa54632a31a5a94c5b7c20a343b1a714d8aa5fc6f8e9f371
DIST python-gentoo-patches-3.9.16_p3.tar.xz 27160 BLAKE2B 5a41a6ff135c3aca02b19cf9a61f554ca224173854274b872ce85e8c71f25c678604e50b87bae40d4b5ac082731c143338fcc6ef47acebad2b59ce0b1d600f5d SHA512 1ace0a9e929769c29082fdec6845a476c07c13fbbff8726a7a592fda09da8b50c996638b4e4e40acccb15630a796074329adbcc9a004c4305952fa5b0dc4146c
+DIST python-gentoo-patches-3.9.17.tar.xz 25048 BLAKE2B da19105dfa2fda7b422ac368f85c97d7541be74a6f9b9170a19ceac901e026ab39baef83c610172ecba1f70cce6e2832e956c2e4c87387b0e21c79c2c633b116 SHA512 ce9d3c62c675bceccaac21fd467c54322a55a1c8af9be3a6dcfd7a892c03b39b38dc35ba570e3dd9fc984a5f3eeabb3cc564ba2d7f935dbf6df829264cb32b2f
EBUILD python-2.7.18_p16-r1.ebuild 8612 BLAKE2B f6c315dcdc3df5d88b456823a2f18cc5fb9e63d8e7b3686a25a814e6222a0787a0b0e1a9373297b14eea9706aa68b6fa36c49a3a4ecf42d3967bf09ca4ca872a SHA512 8234c63e15aa33327bf9cf86f08621b319ba0d7e0826c1159a53b030eab02cf64cd13f1ddce4c250c291eca7a853e0cc420bb549085fd2d11a4dabc0a9d61543
EBUILD python-3.10.11.ebuild 14078 BLAKE2B 3de1a751782976b1adfc4950658e0f012e48076d91edb6f28bf4f9287931c98c3e9a27b6675f8d30e6a24e49b5c3fa5080c9bb2c2e25b4580bf1bd5fd7c7a5f2 SHA512 6d40f5d4b2e892d120e9449a77ba64f31254f5598b4b97556108f42dfc9a1408e472a3b6a67cc0a136cb8a514deb704a043a86dbc09c80b2a5f80a6ab6255acf
EBUILD python-3.11.3.ebuild 14977 BLAKE2B 612ba968eb676969985c92cf764ba2a112fa17d0dda437439b2c4c3f0f79712c1328039ddee1d5e6c75be23556459c2bcb66a976612887e1f1ebc0d535e5cd36 SHA512 3d506ec64d0d17921db1a81f7606633b38f5aabc06d01b10cdbdd2022eb830d3985c75079314846a52ebf4e62bd26b2c0cd2d59b23dd2c75a4f9a7ccc1a54a58
@@ -29,5 +35,7 @@ EBUILD python-3.12.0_beta1_p1.ebuild 14786 BLAKE2B c21bd83543ce5c9c518e3f4ec1217
EBUILD python-3.12.0_beta1_p3.ebuild 14786 BLAKE2B c21bd83543ce5c9c518e3f4ec121713b4b9765b747a403723237ad8652ad589a29c3f54a04b5929038fa9670a1d55d3cd77e33b8f1f5c0707385df59bd30fc98 SHA512 f0a6c86de64676b3db36e2b11f3e145dc52f6245644260d3c6b16601fe5c8e12410c2d2fd0bfb6a93a9fad59b4b5780136444d8902fedd7bc2ff7c9ac149cc2e
EBUILD python-3.12.0_beta1_p4.ebuild 14786 BLAKE2B c21bd83543ce5c9c518e3f4ec121713b4b9765b747a403723237ad8652ad589a29c3f54a04b5929038fa9670a1d55d3cd77e33b8f1f5c0707385df59bd30fc98 SHA512 f0a6c86de64676b3db36e2b11f3e145dc52f6245644260d3c6b16601fe5c8e12410c2d2fd0bfb6a93a9fad59b4b5780136444d8902fedd7bc2ff7c9ac149cc2e
EBUILD python-3.8.16_p4.ebuild 12195 BLAKE2B 7dcc6fb88eb5a36747eeca7bffb25ca8924969e1c024704f18159d9bb02e24a8ba95caa9a0e001c1e01f3953ffcf6f5414ee86d3f9e8666ccb317c26c045f150 SHA512 884acc58a6b77594ac0aa11d79d0d09c8dfbd317834f11ca1b2041eea5a4c1d0a5cc7710e6902b8e83ec3cba858beed5f7a82563eba5af6243fcf1583c6cac7f
+EBUILD python-3.8.17.ebuild 12203 BLAKE2B 46ae1d5f589e4e3d2df0ae702dd93c38ebd49c84301b7fa2b8881c24cd56807cb0af5283665a6af7c2829ecb345ac2c9d62b3f7a0bbae9ded2f103af4116ab03 SHA512 1ebc2ca205caeb262a3f31eeb84358d4135323fd62e7cb9f32d2cf314efae50065e9d9ac8a160c3d020ab2e308e83acefa560945bcffa09c5fb34676878da0dc
EBUILD python-3.9.16_p3-r1.ebuild 13678 BLAKE2B 9a072504fe4fdd3c2fc1a92a2378b81d2edc3e02bac9059a1ef493c01306182c49cce813f8570935872fc8dd552899f236f18eadc8dd4643583812177e611a89 SHA512 09a31e35ab91f5ad3445e982b8b2c71a0fbb74b91d53513ea461d5e22c374fe16984664b216f4428730a9839c728f8925a1e1145fe999874693dcd795eeaf12d
+EBUILD python-3.9.17.ebuild 13686 BLAKE2B f89a5caf928d50b88e96250646dbc94efb2fd6edf6653970e584619afc91ca64f15de9f3447182b10f78b9e5224611477c9332804bfc37408f0df95843f1ae10 SHA512 c3044cacd9b1f25e2473714273179244860333fc08058384b6264ab3c64ba2840e44560d8e66ab8a21d49e2f7f79e48a6f14f59e6c59d082d0b371eb99507933
MISC metadata.xml 1436 BLAKE2B fd5ebcef153bc74aae02f8930dba67736ce44b1dd23418448e7d5bd22391845f5edf0ba8cdf3f43af9254c68734b95fbac9ee891f09c4584c9272ac4233eede6 SHA512 124a1e743cef7236f7936aa843d3aae739a420b1b6173f02c2ef787745616891142724446320d887aeecb95fac09e3620a9666e8e3e32085d79019fe71ff7da5
diff --git a/dev-lang/python/python-3.8.17.ebuild b/dev-lang/python/python-3.8.17.ebuild
new file mode 100644
index 000000000000..1f0455cf092d
--- /dev/null
+++ b/dev-lang/python/python-3.8.17.ebuild
@@ -0,0 +1,428 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+WANT_LIBTOOL="none"
+
+inherit autotools flag-o-matic multiprocessing pax-utils
+inherit prefix 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 hardened lto +ncurses pgo
+ +readline +sqlite +ssl test tk valgrind wininst +xml
+"
+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:=
+ dev-libs/libffi:=
+ >=sys-libs/zlib-1.1.3:=
+ virtual/libcrypt:=
+ virtual/libintl
+ ensurepip? ( dev-python/ensurepip-wheels )
+ gdbm? ( sys-libs/gdbm:=[berkdb] )
+ kernel_linux? ( sys-apps/util-linux:= )
+ ncurses? ( >=sys-libs/ncurses-5.2:= )
+ readline? ( >=sys-libs/readline-4.1:= )
+ 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
+ )
+ xml? ( >=dev-libs/expat-2.1:= )
+"
+# bluetooth requires headers from bluez
+DEPEND="
+ ${RDEPEND}
+ bluetooth? ( net-wireless/bluez )
+ test? ( app-arch/xz-utils[extra-filters(+)] )
+ 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 )
+"
+RDEPEND+="
+ !build? ( app-misc/mime-types )
+"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
+
+QA_PKGCONFIG_VERSION=${PYVER}
+# false positives -- functions specific to *BSD
+QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags )
+
+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
+
+ if ! use wininst; then
+ rm Lib/distutils/command/wininst*.exe || die
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ # disable automagic bluetooth headers detection
+ if ! use bluetooth; then
+ local -x ac_cv_header_bluetooth_bluetooth_h=no
+ fi
+ local disable
+ use gdbm || disable+=" gdbm"
+ use ncurses || disable+=" _curses _curses_panel"
+ use readline || disable+=" readline"
+ use sqlite || disable+=" _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL="1"
+ use tk || disable+=" _tkinter"
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+ export PYTHON_DISABLE_MODULES="${disable}"
+
+ if ! use xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+ fi
+
+ 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
+
+ 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
+ --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-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
+
+ $(use_with debug assertions)
+ $(use_with valgrind)
+ )
+
+ # 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
+ local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
+ local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+ local -x CFLAGS= LDFLAGS=
+
+ # We need to build our own Python on CBUILD first, and feed it in.
+ # bug #847910 and bug #864911.
+ 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.
+ --without-lto
+ --disable-optimizations
+ )
+
+ # Point the imminent CHOST build to the Python we just
+ # built for CBUILD.
+ export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}"
+
+ mkdir "${WORKDIR}"/${P}-${CBUILD} || die
+ pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die
+ # We disable _ctypes and _crypt for CBUILD because Python's setup.py can't handle locating
+ # libdir correctly for cross.
+ PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" \
+ ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
+
+ # Avoid as many dependencies as possible for the cross build.
+ cat >> Makefile <<-EOF || die
+ MODULE_NIS=disabled
+ MODULE__DBM=disabled
+ MODULE__GDBM=disabled
+ MODULE__DBM=disabled
+ MODULE__SQLITE3=disabled
+ MODULE__HASHLIB=disabled
+ MODULE__SSL=disabled
+ MODULE__CURSES=disabled
+ MODULE__CURSES_PANEL=disabled
+ MODULE_READLINE=disabled
+ MODULE__TKINTER=disabled
+ MODULE_PYEXPAT=disabled
+ MODULE_ZLIB=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 Python it was pointed to
+ # immediately.
+ PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" 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
+
+ hprefixify setup.py
+ 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
+ # Prevent using distutils bundled by setuptools.
+ # https://bugs.gentoo.org/823728
+ export SETUPTOOLS_USE_DISTUTILS=stdlib
+
+ # also need to clear the flags explicitly here or they end up
+ # in _sysconfigdata*
+ emake CPPFLAGS= CFLAGS= LDFLAGS=
+
+ # 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
+
+ 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=
+
+ 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}
+
+ emake DESTDIR="${D}" altinstall
+
+ # Remove static library
+ rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
+
+ # 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,test/test_sqlite*} || 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
+}
diff --git a/dev-lang/python/python-3.9.17.ebuild b/dev-lang/python/python-3.9.17.ebuild
new file mode 100644
index 000000000000..482f0341de08
--- /dev/null
+++ b/dev-lang/python/python-3.9.17.ebuild
@@ -0,0 +1,487 @@
+# Copyright 1999-2023 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 prefix 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 hardened lto +ncurses pgo
+ +readline +sqlite +ssl test tk valgrind +xml
+"
+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:=
+ dev-libs/libffi:=
+ dev-python/gentoo-common
+ >=sys-libs/zlib-1.1.3:=
+ virtual/libcrypt:=
+ virtual/libintl
+ ensurepip? ( dev-python/ensurepip-wheels )
+ gdbm? ( sys-libs/gdbm:=[berkdb] )
+ kernel_linux? ( sys-apps/util-linux:= )
+ ncurses? ( >=sys-libs/ncurses-5.2:= )
+ readline? ( >=sys-libs/readline-4.1:= )
+ 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
+ )
+ xml? ( >=dev-libs/expat-2.1:= )
+"
+# bluetooth requires headers from bluez
+DEPEND="
+ ${RDEPEND}
+ bluetooth? ( net-wireless/bluez )
+ test? ( app-arch/xz-utils[extra-filters(+)] )
+ 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 )
+"
+RDEPEND+="
+ !build? ( app-misc/mime-types )
+"
+
+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.
+ 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() {
+ # disable automagic bluetooth headers detection
+ if ! use bluetooth; then
+ local -x ac_cv_header_bluetooth_bluetooth_h=no
+ fi
+ local disable
+ use gdbm || disable+=" gdbm"
+ use ncurses || disable+=" _curses _curses_panel"
+ use readline || disable+=" readline"
+ use sqlite || disable+=" _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL="1"
+ use tk || disable+=" _tkinter"
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+ export PYTHON_DISABLE_MODULES="${disable}"
+
+ if ! use xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+ fi
+
+ 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
+ -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
+
+ # 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
+ --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-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
+
+ $(use_with debug assertions)
+ $(use_with lto)
+ $(use_enable pgo optimizations)
+ $(use_with valgrind)
+ )
+
+ # 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
+ local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD}
+ local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD}
+ local -x CFLAGS= LDFLAGS=
+
+ # We need to build our own Python on CBUILD first, and feed it in.
+ # bug #847910 and bug #864911.
+ 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.
+ --without-lto
+ --disable-optimizations
+ )
+
+ # Point the imminent CHOST build to the Python we just
+ # built for CBUILD.
+ export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}"
+
+ mkdir "${WORKDIR}"/${P}-${CBUILD} || die
+ pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die
+ # We disable _ctypes and _crypt for CBUILD because Python's setup.py can't handle locating
+ # libdir correctly for cross.
+ PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" \
+ ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
+
+ # Avoid as many dependencies as possible for the cross build.
+ cat >> Makefile <<-EOF || die
+ MODULE_NIS=disabled
+ MODULE__DBM=disabled
+ MODULE__GDBM=disabled
+ MODULE__DBM=disabled
+ MODULE__SQLITE3=disabled
+ MODULE__HASHLIB=disabled
+ MODULE__SSL=disabled
+ MODULE__CURSES=disabled
+ MODULE__CURSES_PANEL=disabled
+ MODULE_READLINE=disabled
+ MODULE__TKINTER=disabled
+ MODULE_PYEXPAT=disabled
+ MODULE_ZLIB=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 Python it was pointed to
+ # immediately.
+ PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" 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
+
+ hprefixify setup.py
+ 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
+ # Prevent using distutils bundled by setuptools.
+ # https://bugs.gentoo.org/823728
+ export SETUPTOOLS_USE_DISTUTILS=stdlib
+
+ # 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
+
+ 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=
+
+ 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}
+
+ emake DESTDIR="${D}" altinstall
+
+ # Remove static library
+ rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
+
+ # 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,test/test_sqlite*} || 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
+}