public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/
Date: Sat, 12 Apr 2025 15:27:50 +0000 (UTC)	[thread overview]
Message-ID: <1744471371.af57796708ccf8eb4297c6f06e4ff8fa1a39864f.grobian@gentoo> (raw)

commit:     af57796708ccf8eb4297c6f06e4ff8fa1a39864f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 12 15:22:51 2025 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Apr 12 15:22:51 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=af577967

dev-lang/python-3.12.0: version bump 3.12.x branch

Preparation for 3.13.x branch to come.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-lang/python/Manifest              |  24 +-
 dev-lang/python/python-3.12.10.ebuild | 666 ++++++++++++++++++++++++++++++++++
 2 files changed, 670 insertions(+), 20 deletions(-)

diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 1f45842d37..19f69f70ec 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,28 +1,12 @@
-DIST Python-3.10.4.tar.xz 19342692 BLAKE2B c430ad9bed71729fda29433af0614b6c0110a85e23f4cb5cff3a9b501febe99b20094367a5428f256fb3aeef97f34d439ef677fc8ae4d596d52da7976b65ebb5 SHA512 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113
-DIST Python-3.10.4.tar.xz.asc 833 BLAKE2B 289f2e96bfc2b60c4ae94b1591779d604f203890c4f5db2ee16e305bf03c6ddb9c8d6da4471a06b5943e12888f37ca572ea30876e9a80382a26814f66b41b7bf SHA512 699e37bf09067083af159e3734b38c952bdc75432c8abfb7a7b8cce7ca975038da37490abeb5c13befd2dacb84a5341ad30de5d0a63d35af5c512215744f4d6d
-DIST Python-3.11.3.tar.xz 19906156 BLAKE2B c23815e09a0012b2af03f3e18471389382978ef0991cb081c4c6410e98613589d47d3ad782c0a06a48ddd86fc5df7f1d59e93dbab5871b89559e225084544248 SHA512 a3bba4b69322a47bfeefe42ba0fd7331b5b67fd2ab41441e2219d16ef8c6f307f1a48977afd073c18cfd24ec6cb1bfe0c4bb4b273031eb524dc7e9fb5fbcc3b6
-DIST Python-3.11.3.tar.xz.asc 833 BLAKE2B 1846858480428293047bfaf87a74f5a6cf28227f63dbc36e658ab68444a5b91c2178fca42f35a413591103a0ceeea3cd5f8b757fb2f42cbcad023c62970ab950 SHA512 34bfb6e74e2bbec15bf3f653e32a3d705961b5f724e3f4713cf9b6b530f9c9e7e94f5cf855798bdf9763235b97a60ec9ad554d24cdc793e21a0c39540b5818d8
 DIST Python-3.11.7.tar.xz 20074108 BLAKE2B 3414118d30076e4223571825b5c595c5795422244de20dc70d07389a03b2c2b03b98a9ff562a8fd164db8f776dd741a9d7beb1c2ae4087ec6af677619a9dfd80 SHA512 11e06f2ffe1f66888cb5b4e9f607de815294d6863a77eda6ec6d7c724ef158df9f51881f4a956d4a6fa973c2fb6fd031d495e3496e9b0bb53793fb1cc8434c63
 DIST Python-3.11.7.tar.xz.asc 833 BLAKE2B 32d6984631d7b4b064e2c2588835a89098842a0ecc3d8ccb893830c9946124a159123e2082e6da3abcdb97d27dde0fb68c1fd11e4ed2bf2e0641fa95191354bb SHA512 7b342990c6e32897047f8ba33c4d264f1be987b73843b61bd7db08bfa1a7280c616e9dcd96225f37602f876549d011ff82a4d79f1e32a5ab7d7cc22651bba44f
+DIST Python-3.12.10.tar.xz 20520960 BLAKE2B f05805da36958e3ebb68c69353e8119b20ee4c1a123f4492e9bf614e7faa856180ef2017f2a698bcacf19cac01d89329ed5ee45e00c98b255d4854090a2e6926 SHA512 520c30e3958d0be3c127e5dbb1c52bb3bfc404b5b3c7eb56525e25b9b59af9b21b53bee192f323f470e1df806f6cb2dd3411eb90cbc1c4b7d9b6b0777c29e644
+DIST Python-3.12.10.tar.xz.asc 963 BLAKE2B 45e1ec67311d1ac5679cb5a05b92e61f3e5e6e9d3ffa5462c09c2aa066fda7ea915df13f6e5ad33aa924f6ce1f18e2d78a31af15412a10c093fc8a5b536c5133 SHA512 7edfa6fd816cf2a052abdb775d464e2f389105ed3e782cacf90805613aaca54bf71308504a5336ee1204e872e7db28df32413fb10b057056b0d5cb3c7a20a9f1
 DIST Python-3.12.3.tar.xz 20625068 BLAKE2B fc4f57ae50183db4c8cb37d94c37a7e58da5d031e03866841a678b986f01bbb8afdefb38124ba82b0a4988445b647214be43338dea13b0f063d3c2bf81c48c0b SHA512 4a2213b108e7f1f1525baa8348e68b2a2336d925e60d0a59f0225fc470768a2c8031edafc0b8243f94dbae18afda335ee5adf2785328c2218fd64cbb439f13a4
 DIST Python-3.12.3.tar.xz.asc 963 BLAKE2B f9668dde210793f8da0e0bb026b8ec3e0b4bc3abc58e72732f8faf356b19ca88a59b9d89b4b10f77b3602d9a967f0f2f44a0f091d698bc28ba9bad8049e5e006 SHA512 c291ec5b5e4f8deba867cc517624dd9a174745f04061ef737e58f3d52b9b30318264aec350e339fe88ccb493809ca1a90a378e86d86b8ec4a4f578b1a5843624
-DIST Python-3.8.8.tar.xz 18271736 BLAKE2B af0ff1acd919b365a58278e82678324ff884cc8120bcaf12e0e3afb1bd978e6469e256335df131935f51ff481fb83dda04e4b6f1cd1746611f9ec944db73d692 SHA512 64181db5aa48281284a3230436ebfb8cb91b645a9dec956fd48c0048334498477073fc4e14d6b426d0ef7fbcdcfd5d59cbf01a504e6c9014dc9529494b9309fb
-DIST Python-3.8.8.tar.xz.asc 833 BLAKE2B a11188f9f68c518259de1a4e271bf56409d7356a7eb3dd8cbea7bbb0b5bc1b43f9aeb85bda4add65bbae906bef65cb20a30bcc77da04c0d383cd5b527821fd85 SHA512 0e6f11a310c1796dd056d9a4b63b5e03aa8dbd290088966e04a590a78c00003887dbfd7a7029a6cf8c5626ecd6ca91c1c16433bb0a41bf1225b02b8db8541b95
-DIST Python-3.9.12.tar.xz 19740524 BLAKE2B 05f2469aa53ca36221ef4976b17bfde3e5b86afd5a8114e5a7fd899f975a8e55022555ef718d5352ab68de1b7b23865a0bf713768c9c2b30d591438c9a396d25 SHA512 081981901e14149748fd35228db0b3b1d96fef227ae7404f07b8bad0fda4b02649bf31c348c94aefdaf3327565d78f9489437c2c02f647b15d41376a27a23e97
-DIST Python-3.9.12.tar.xz.asc 833 BLAKE2B 33436d0404a643215a8fd2b967ffd216201da24f374941bf65b888159ccfabcbe79b751eca2dd489b06605604338c8bbaab74aa10abbe4bcffaa54236301228e SHA512 dddaa27f8a29034f458edb6739398a5455c87fe37b6349e161865a9deedca118ffe9cb82663cc75bbe60b3b556399c0c6855f5262aac1fe90d36a3694fca65b2
-DIST Python-3.9.6.tar.xz 19051972 BLAKE2B 0d8586b2935088eeab7138cf2210c1a74f1bf7359359d25750af5f69de55eb39c92f518b887a8b749c772ed7d33e85b912928ae6d878514eb58d85ef210f54f0 SHA512 01c529e3207738d8771caeb5ed6217e10745c21aa39832fe3185e1c87fdb6aedead97ce38dbb11e02d873654028bd8071c3f345c18452769520723284efe9dc1
-DIST Python-3.9.6.tar.xz.asc 833 BLAKE2B 41901bfb80a901f2f14e86769e6d08ded8f75656d347201345183162e180e61442da871a1067572a54da579551166a19bf5436e51581bb10cb78afc4d28773fc SHA512 0673c8833f302c829bfde97453c52744f6aa99b4a72520f4cc384d4aa9d6ffd28a1407ceafb0a1ec4462b3aa74b656bf39c67872c4e6a131429ea58c47ad0ecc
-DIST python-gentoo-patches-3.10.4.tar.xz 8592 BLAKE2B 67fba3e1fedb17430e5cd93da995b4acaf714db512031b5a2f775a25f793f007941561663cfa413d645ccddc2e22d65d250a40fa166cafda8805488d877ff57d SHA512 3ed2b8ff8f1eb8febe7dcd4b5d13d6d54468be1d525f8f1118977d3bbc78f690a597b09383939d023b03380a306e4bff1693382e29ff562312d803305b1709b2
-DIST python-gentoo-patches-3.11.3.tar.xz 7776 BLAKE2B 78bf26f554c608c68826b9ea3c63a1df2b45bff755860f39f14306ebb63f17f5111b117519c4a9cb30452a62a14a3a7393798b8920c3d108ec8b6a30db88641e SHA512 64b79c90055fd940590b72ffd3744fe02ab9e46caf7b46f4aa1d074bf3e62d355e128bb2ac68c42f228f2e1bcdee2b0b114d9e2b9bf8427512083c1c5f8680e8
 DIST python-gentoo-patches-3.11.7_p1.tar.xz 8364 BLAKE2B 246da406e6d58d85ab2ef79dd3a018a134e473f90d42f8dd9274629f998a6129f3b03da228aa5e65c1b4508a71979ceb1f752a28066c356f813be21c30a40f70 SHA512 c5c1448a2e9b15b8084125e07cee288b667267779d89da8aab9df4b1d014739ba9af4d09e51b3cdc37e8942821d7aee0d1998e55820b67b83ef654d0a442767e
+DIST python-gentoo-patches-3.12.10.tar.xz 10744 BLAKE2B 2abf4874018156d6735cf8604c410dc4726ac9365bc7500abe6b82472aad100aac7268957256692f4275b02965773e58178519ed8038e121f1ffa3c53770d238 SHA512 62066405aa00f46f9645e9c747d53bb93bf510fc791d14d49e00edfd79981778e6c8e07bfa7bac88d76407a0ffd8f7321dea89f81d90b01dbf13f4d381b6a1a3
 DIST python-gentoo-patches-3.12.3.tar.xz 6028 BLAKE2B 7953a48a1d95a6a33bd88060fbcac463a5469371aa0c882c3945f1fea64a63c4d45fca8451f51f4eaeea00a04267ad2e54e4cc720c95e8bb5a3477e00263b80a SHA512 4779bab2b24e59e4a77987ce3e9611d99e87c9c4d016309758c26a65fe2e11ef04d48d5af628c02b1552dc1f31b768f87448f8e19e716b4fe372941e6dacac3f
-DIST python-gentoo-patches-3.8.8_p1.tar.xz 15456 BLAKE2B 7d9f55f951f97ef7e08d0245dddd21f5b8d126735c1c392ba6326ad1c18023b477f62e9b6663d8e5b6f0362e442137d0b6ed3ea13b279cca6734d36dbe6e654f SHA512 7fff74d03a0c4cd4b5c977761179c2b9a0ed472847ee9544f54331cef7549557ac4d6b78e676058bd2b01c96ca59d84f04c55beca8ddc45f16b11ce349210eea
-DIST python-gentoo-patches-3.9.12.tar.xz 12848 BLAKE2B 5dd66fa94b136a463d2c4be3a5b7dfad770c3905467a1d81af02a35b2783ce7d614881c915ee8f8e764c1656963d6886d9c60c6e524f512e1bc496e42d01307b SHA512 07de63e47a8e547724099062239df8fcfd254f19d38be28131e6bbb094ffbab8483861fb6a5905e60d7fa7a1a5dc06785951fa31984ecad89516b0b742c47f91
-DIST python-gentoo-patches-3.9.6_p1.tar.xz 12764 BLAKE2B 927718f1aadb5d5ef67e647a639a10bffdd48474bf01e50bd37ef1242bce57606b7b54c4823c1da3585ee76e737028163e38e9b4e19037585cc53f925e1c5fa7 SHA512 f06fb55786bd942e72e3225ee9ce218724aeee29f301279743588749007e991851a8f29db5b5dfd85435e3d763c00942947909a6fc60581bd0f3e8a6e913bff8
-DIST python-prefix-gentoo-3.10.4-patches-r0.tar.xz 6772 BLAKE2B b807ae02242926d99c3823b73ce33193926d55891d54b5d214b4bdf24d2213b4d7b248030146a01698ceadd255affffef8937d84fc11e6d587ffcc91286e81b2 SHA512 a8f16d12b785a4b9ca884e4235cb298e4155273534a7957e517a679f0c2d4b35dcca08e445bed3fe2a80e3a6441f04004eae955a362eb1091ac1f9e2b9a5448f
-DIST python-prefix-gentoo-3.11.3-patches-r3.tar.xz 5404 BLAKE2B 7c76056854361a4dad879218d2e0f60f874d534ac354c6b47158b5b0de18e5c66a522e717efa8a0a8a0ca3c77dbe5e9297a2ea17b725cb9c7e59478defd951ae SHA512 1bfb1c5e9b53c0b2f5d5fbf112c1742cc91a5cc3f505dc0d8d54683b508063be3578e3e6b8ad617bb0ea0a311b9235d862867ec4e9ca3fbcefcda98613235c72
 DIST python-prefix-gentoo-3.11.7-patches-r1.tar.xz 5752 BLAKE2B 8d6ee07491b23d1947af748b0178fd5c81cce78e77e2153480425d38a6b9badeb3b42cd635d340ddf50a451f977f04f498ac25ad1a18250ddae851aac06b9a0d SHA512 c5687c97a41c2e1ed0eacac987a7ea4b38bb8b60b91a16d2ea36ce9aad2f3360d25295951c083386b791b33f18267e545bfcb8280172f878736fef57d7188d0f
+DIST python-prefix-gentoo-3.12.10-patches-r0.tar.xz 2484 BLAKE2B 422ae62f1bf9780d7252e912aed95319474ec0fc06c2896bfa607e6165b814a3253968872df5c06a71184244bfae8252a2c8c0753b7d46bccaa728d3e61f7dd5 SHA512 66d7a2d89f196d83e3cc8be0ac7c028c114defed473bb4f9b7b468af8be6d6d47deed3dce98651f8ab8a39532da6e838330f47241128e306f58c9b9291b5d822
 DIST python-prefix-gentoo-3.12.3-patches-r0.tar.xz 3464 BLAKE2B 965ccf0cc82b26e58adc332a2bcaa346578dfbec7abc1bed5451e0b8ac7c1e7612a7abe3ce757777f0fd6e38d1e0c7682c2ac3b617fb03fd2849686593b10e27 SHA512 a5648e7a9fc6fdc20f868d53c121d2e63ee370719b1b84d253df1fd472306879ab4b32d4d0685c576562ba6a8c06d3ac2250a8cbd44bbe2c7a1dd832e0c19d6d
-DIST python-prefix-gentoo-3.8.7-patches-r2.tar.xz 8312 BLAKE2B 268f3cff62dc51d4f91994c3f6b05cea0e29edb1ccf39476ba52485fb94c3cad72b54ed5cd941c227bdad004a7ae0069d60ee6bbde5a30d16115263d0dc2a5c3 SHA512 e43ce1e9e851bebce968ee025f765fc9a558c8edc4ee2d51616043183fd12301ab3d5c7f92915238e53b5cf92f6c00617ab0fcf9859d4cebe0966271e6f64725
-DIST python-prefix-gentoo-3.9.12-patches-r1.tar.xz 7124 BLAKE2B afff1a574e13515084b0bee3aee1d0f0796ed885451086485f54f3c9a2498de6b4f403fdec1fe7fc5718a45fd89773720a4ef24d700b494337665b3f6d74e2de SHA512 4a12e8be1b38217d66e4a6374e09f93f956fdf4970130edcea2fedd6989c9a1af309fa939c213f8645676401c6d10b5e8789dbe902de9c03b8ea2b57c1632b72
-DIST python-prefix-gentoo-3.9.6_p1-patches-r0.tar.xz 6984 BLAKE2B 8b032d3000fd2dfcb8e099ac071c1a911ba2a0e30343788f7191043800f9d0088307cd7007b2b3f6cc7d2f315fc22bbac5990fed81f0dd8d60dca0314bd59b88 SHA512 76c56895c99ee203bd266f475766d2572659939abaf478932e7c9c65ddc52cb5e012e23c9455dd0a4bf0281a07c70e23a2fea8337c693b8a4ac8abb534e21982

diff --git a/dev-lang/python/python-3.12.10.ebuild b/dev-lang/python/python-3.12.10.ebuild
new file mode 100644
index 0000000000..16d8f452b0
--- /dev/null
+++ b/dev-lang/python/python-3.12.10.ebuild
@@ -0,0 +1,666 @@
+# Copyright 1999-2025 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 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}"
+PREFIX_PATCHSET="python-prefix-gentoo-${MY_PV%_p*}-patches-r0"
+
+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
+	https://dev.gentoo.org/~grobian/distfiles/${PREFIX_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="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="
+	bluetooth build debug +ensurepip examples gdbm libedit
+	+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-libs/mpdecimal:=
+	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
+	)
+	elibc_Darwin? ( sys-libs/native-uuid )
+	elibc_SunOS? ( sys-libs/libuuid )
+"
+# bluetooth requires headers from bluez
+DEPEND="
+	${RDEPEND}
+	bluetooth? ( net-wireless/bluez )
+	test? (
+		app-arch/xz-utils
+		dev-python/ensurepip-pip
+		dev-python/ensurepip-setuptools
+		dev-python/ensurepip-wheel
+	)
+	valgrind? ( dev-debug/valgrind )
+"
+# autoconf-archive needed to eautoreconf
+BDEPEND="
+	dev-build/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}"
+		# Prefix' round of patches
+		"${WORKDIR}"/${PREFIX_PATCHSET}
+	)
+
+	default
+
+	# libmpdecimal uses MPD_ prefix for all symbols since 2.5.1, but
+	# Python upstream didn't get that note (or never upgraded beyond
+	# 2.5.0)
+	sed -i -e 's/\bCONFIG_\(32\|64\)\b/MPD_CONFIG_\1/g' \
+		Modules/_decimal/_decimal.c || die
+
+	# enable this to create a pre-patched (prefix bootstrap) tree
+	if [[ -n ${GENTOO_PREFIX_CREATE_TAR} ]] ; then
+		eautoreconf
+		tarfile="${T}"/Python-${PV}-gentoo-prefix-patched.tar.xz
+		tar --numeric-owner -Jcf "${tarfile}" -C .. Python-${PV}
+		die "${tarfile}"
+	fi
+
+	# force the correct number of jobs
+	# https://bugs.gentoo.org/737660
+	sed -i -e "s:-j0:-j$(makeopts_jobs):" Makefile.pre.in || die
+
+	# breaks tests when using --with-wheel-pkg-dir
+	rm -r Lib/test/wheeldata || die
+
+	if [[ ${CHOST} == *-solaris* ]] ; then
+		# OpenIndiana/Solaris 11 defines inet_aton no longer in
+		# libresolv, so use hstrerror to check if we need -lresolv
+		sed -i -e '/AC_CHECK_LIB/s/inet_aton/hstrerror/' \
+			configure.ac configure || die
+	fi
+
+	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() {
+	# 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
+
+	# 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
+
+	# Set baseline test skip flags.
+	COMMON_TEST_SKIPS=(
+		# this is actually test_gdb.test_pretty_print
+		-x test_pretty_print
+	)
+
+	# Arch-specific skips.  See #931888 for a collection of these.
+	case ${CHOST} in
+		alpha*)
+			COMMON_TEST_SKIPS+=(
+				-x test_builtin
+				-x test_capi
+				-x test_cmath
+				-x test_float
+				# timeout
+				-x test_free_threading
+				-x test_math
+				-x test_numeric_tower
+				-x test_random
+				-x test_statistics
+				# bug 653850
+				-x test_resource
+				-x test_strtod
+			)
+			;;
+		mips*)
+			COMMON_TEST_SKIPS+=(
+				-x test_ctypes
+				-x test_external_inspection
+				-x test_statistics
+			)
+			;;
+		powerpc64-*) # big endian
+			COMMON_TEST_SKIPS+=(
+				-x test_gdb
+			)
+			;;
+		riscv*)
+			COMMON_TEST_SKIPS+=(
+				-x test_urllib2
+			)
+			;;
+		sparc*)
+			COMMON_TEST_SKIPS+=(
+				# bug 788022
+				-x test_multiprocessing_fork
+				-x test_multiprocessing_forkserver
+				-x test_multiprocessing_spawn
+
+				-x test_ctypes
+				-x test_gdb
+				# bug 931908
+				-x test_exceptions
+			)
+			;;
+	esac
+
+	# musl-specific skips
+	use elibc_musl && COMMON_TEST_SKIPS+=(
+		# various musl locale deficiencies
+		-x test__locale
+		-x test_c_locale_coercion
+		-x test_locale
+		-x test_re
+
+		# known issues with find_library on musl
+		# https://bugs.python.org/issue21622
+		-x test_ctypes
+
+		# fpathconf, ttyname errno values
+		-x test_os
+	)
+
+	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
+
+			"${COMMON_TEST_SKIPS[@]}"
+
+			-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_concurrent_futures
+			-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
+		)
+
+		# Arch-specific skips.  See #931888 for a collection of these.
+		case ${CHOST} in
+			alpha*)
+				profile_task_flags+=(
+					-x test_os
+				)
+				;;
+			hppa*)
+				profile_task_flags+=(
+					-x test_descr
+					# bug 931908
+					-x test_exceptions
+					-x test_os
+				)
+				;;
+			powerpc64-*) # big endian
+				profile_task_flags+=(
+					# bug 931908
+					-x test_exceptions
+				)
+				;;
+			riscv*)
+				profile_task_flags+=(
+					-x test_statistics
+				)
+				;;
+		esac
+
+		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
+		# except on non-glibc systems this breaks the build, so be
+		# conservative!
+		$(use elibc_glibc && echo ac_cv_header_stropts_h=no)
+
+		$([[ ${CHOST} == *-darwin* ]] && echo --config-cache)
+		--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
+		--without-lto
+		--with-system-expat
+		--with-system-libmpdec
+		--with-platlibdir=lib
+		--with-pkg-config=yes
+		--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
+
+		$(use_with debug assertions)
+		$(use_enable pgo optimizations)
+		$(use_with readline readline "$(usex libedit editline readline)")
+		$(use_with valgrind)
+	)
+
+	# https://bugs.gentoo.org/700012
+	if tc-is-lto; then
+		append-cflags $(test-flags-CC -ffat-lto-objects)
+		myeconfargs+=(
+			--with-lto
+		)
+	fi
+
+	# 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')
+		$([[ ${CHOST} == *-apple-darwin* ]] && echo '_scproxy')
+		$([[ ${CHOST} != *-linux-* ]] && echo 'ossaudiodev')
+	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
+
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		ECONF_SOURCE="${S}" OPT="" \
+			econf \
+			--enable-framework="${EPREFIX}" \
+			--config-cache
+	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}
+
+	# Gentoo hack to disable accessing system site-packages
+	export GENTOO_CPYTHON_BUILD=1
+
+	if use pgo ; then
+		# bug 660358
+		local -x COLUMNS=80
+		local -x PYTHONDONTWRITEBYTECODE=
+		local -x TMPDIR="${T}"
+	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=(
+		--verbose3
+		-u-network
+		-j "$(makeopts_jobs)"
+		"${COMMON_TEST_SKIPS[@]}"
+	)
+
+	# bug 660358
+	local -x COLUMNS=80
+	local -x PYTHONDONTWRITEBYTECODE=
+	local -x TMPDIR="${T}"
+
+	nonfatal emake -Onone test EXTRATESTOPTS="${test_opts[*]}" \
+		CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
+	local ret=${?}
+
+	[[ ${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}" TEST_MODULES=no altinstall
+
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		# avoid config.status to be triggered
+		find Mac -name "Makefile" -exec touch \{\} + || die
+
+		# Python_Launcher is kind of a wrapper, and we should fix it for
+		# Prefix (it uses /usr/bin/pythonw) so useless
+		# IDLE doesn't run, no idea, but definitely not used
+		emake DESTDIR="${D}" -C Mac install_Python || die
+		rmdir "${ED}"/Applications/Python* || die
+		rmdir "${ED}"/Applications || die
+
+		local fwdir=/Frameworks/Python.framework/Versions/${PYVER}
+		ln -s "${EPREFIX}"/usr/include/python${PYVER} \
+			"${ED}${fwdir}"/Headers || die
+		ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \
+			"${ED}${fwdir}"/Python || die
+	fi
+
+	# Fix collisions between different slots of Python.
+	rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || 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 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} || 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
+}


             reply	other threads:[~2025-04-12 15:27 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-12 15:27 Fabian Groffen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-12 18:22 [gentoo-commits] repo/proj/prefix:master commit in: dev-lang/python/ Fabian Groffen
2025-04-12 15:27 Fabian Groffen
2024-04-11 11:31 Fabian Groffen
2024-04-09 14:41 Fabian Groffen
2024-04-09 11:03 Fabian Groffen
2024-04-06 20:09 Fabian Groffen
2024-01-23  8:31 Fabian Groffen
2024-01-23  8:06 Fabian Groffen
2024-01-21 13:40 Fabian Groffen
2024-01-21 12:02 Fabian Groffen
2024-01-15 16:34 Sam James
2023-06-28  6:27 Fabian Groffen
2023-06-01  6:41 Fabian Groffen
2023-05-05  7:05 Fabian Groffen
2023-05-04 17:10 Fabian Groffen
2023-05-04  7:34 Fabian Groffen
2023-05-03  7:11 Fabian Groffen
2023-05-03  6:20 Fabian Groffen
2023-05-02 18:47 Fabian Groffen
2023-01-05  9:32 Fabian Groffen
2022-06-08 11:04 Fabian Groffen
2022-05-12 17:10 Fabian Groffen
2022-05-11 20:18 Fabian Groffen
2022-04-14 17:05 Fabian Groffen
2022-01-23  1:38 Sam James
2022-01-23  1:38 Sam James
2022-01-23  1:21 Sam James
2021-08-22 12:42 Fabian Groffen
2021-08-15 11:00 Fabian Groffen
2021-08-15 11:00 Fabian Groffen
2021-04-10 14:53 Fabian Groffen
2021-04-04  8:42 Fabian Groffen
2021-02-18  8:00 Fabian Groffen
2021-01-21 11:15 Fabian Groffen
2021-01-08 15:23 Fabian Groffen
2021-01-06 11:57 Fabian Groffen
2021-01-04 10:53 Fabian Groffen
2021-01-02 14:19 Fabian Groffen
2021-01-02  9:54 Fabian Groffen
2021-01-01 20:37 Fabian Groffen
2021-01-01 17:46 Fabian Groffen
2020-12-31 21:06 Fabian Groffen
2020-12-26 19:16 Fabian Groffen
2020-12-26 13:05 Fabian Groffen
2020-12-16  7:21 Fabian Groffen
2020-12-15 19:43 Fabian Groffen
2020-12-11 14:31 Fabian Groffen
2020-11-23 20:08 Fabian Groffen
2020-08-02 11:14 Fabian Groffen
2020-06-23 18:34 Fabian Groffen
2020-06-04 13:33 Fabian Groffen
2020-06-04 12:39 Fabian Groffen
2020-05-31 17:13 Fabian Groffen
2020-05-31 12:04 Fabian Groffen
2020-05-30 16:34 Fabian Groffen
2019-06-18 14:01 Fabian Groffen
2019-03-25  6:02 Fabian Groffen
2019-03-24 20:44 Fabian Groffen
2019-03-22 13:37 Fabian Groffen
2019-03-22 13:37 Fabian Groffen
2019-03-22 13:08 Fabian Groffen
2019-03-22 10:38 Fabian Groffen
2019-03-22  9:55 Fabian Groffen
2019-02-25  9:58 Michael Haubenwallner
2019-02-19 12:00 Fabian Groffen
2019-02-18 14:51 Michael Haubenwallner
2019-02-14 17:00 Michael Haubenwallner
2019-02-14 11:38 Michael Haubenwallner
2018-06-01 20:02 Fabian Groffen
2018-05-03 12:05 Fabian Groffen
2018-05-03 12:05 Fabian Groffen
2018-04-07 14:03 Fabian Groffen
2018-04-04 18:14 Fabian Groffen
2018-01-22 15:38 Michael Haubenwallner
2017-12-29 22:35 Michael Haubenwallner
2017-12-29 22:25 Michael Haubenwallner
2017-12-29 13:25 Fabian Groffen
2017-12-27 18:35 Fabian Groffen
2017-10-30 16:53 Fabian Groffen
2017-08-24 19:07 Fabian Groffen
2017-08-20  8:49 Fabian Groffen
2016-07-01 15:50 Fabian Groffen
2016-07-01 15:50 Fabian Groffen
2016-07-01 14:31 Fabian Groffen
2016-05-12 13:41 Michael Haubenwallner
2016-02-18 17:28 Fabian Groffen
2016-02-02 20:06 Fabian Groffen
2016-02-01 19:08 Fabian Groffen
2016-01-24 13:30 Fabian Groffen
2016-01-24 13:21 Fabian Groffen
2016-01-24 13:21 Fabian Groffen
2016-01-24 13:21 Fabian Groffen
2016-01-24 13:21 Fabian Groffen
2016-01-24 13:21 Fabian Groffen
2016-01-14 12:07 Fabian Groffen
2015-12-21 15:22 Fabian Groffen
2015-12-18 10:53 Fabian Groffen
2015-12-16  7:44 Fabian Groffen
2015-12-14 20:39 Fabian Groffen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1744471371.af57796708ccf8eb4297c6f06e4ff8fa1a39864f.grobian@gentoo \
    --to=grobian@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox