mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
dev-lang/python: Sync with Gentoo
It's from Gentoo commit 82a86ba11a7b8a20166eef5dd779d23ef691636d.
This commit is contained in:
parent
bbb3e3b75e
commit
f46d46f13e
@ -10,14 +10,6 @@ DIST Python-3.12.4.tar.xz 20659356 BLAKE2B 4255171ef8ee1777bab829be7bbaf28a9d507
|
|||||||
DIST Python-3.12.4.tar.xz.asc 963 BLAKE2B d4f62dca1de5f4e4b2581fc49ca55b1d87abe7c4ceb2c9087efe4b92d9e9b3bdd25949bbf82fd771b4b60bc3690be982c2f25b810d87592665f0728fbe08be9d SHA512 1102b17f395e0ec5de5368d04a4dceb8cc98dd408b68b53998071cf129eb9a6c259316a416128f1dfa37a739f86e599507502a98430348da2272442ce1b7059e
|
DIST Python-3.12.4.tar.xz.asc 963 BLAKE2B d4f62dca1de5f4e4b2581fc49ca55b1d87abe7c4ceb2c9087efe4b92d9e9b3bdd25949bbf82fd771b4b60bc3690be982c2f25b810d87592665f0728fbe08be9d SHA512 1102b17f395e0ec5de5368d04a4dceb8cc98dd408b68b53998071cf129eb9a6c259316a416128f1dfa37a739f86e599507502a98430348da2272442ce1b7059e
|
||||||
DIST Python-3.12.5.tar.xz 20422396 BLAKE2B f127d1e12d12be84d5837282757787be8a0cf702adce29b93622f91f45ba2d8cc0f5db2e8277c86b098623951b302015febd28bdabaff66b30cb06a5ef2b4a24 SHA512 7a1c30d798434fe24697bc253f6010d75145e7650f66803328425c8525331b9fa6b63d12a652687582db205f8d4c8279c8f73c338168592481517b063351c921
|
DIST Python-3.12.5.tar.xz 20422396 BLAKE2B f127d1e12d12be84d5837282757787be8a0cf702adce29b93622f91f45ba2d8cc0f5db2e8277c86b098623951b302015febd28bdabaff66b30cb06a5ef2b4a24 SHA512 7a1c30d798434fe24697bc253f6010d75145e7650f66803328425c8525331b9fa6b63d12a652687582db205f8d4c8279c8f73c338168592481517b063351c921
|
||||||
DIST Python-3.12.5.tar.xz.asc 963 BLAKE2B 238167f6b4012136bc4274eee0dd4d958c4ee02d2505f9f64e5bcad15e84a9e9e12a9fc907651083543f1fce93579b752d4ccdf60c8cc421cb43e9034877bf1c SHA512 65ce92272a38cc6bf8bf56fa2a99a830cf5b33b811b1788508e7b6f8b5d3e93e0b143412f829271be40cbb4e7c154f84499239b3e8ab63b2ccf0a5a22d2f84ee
|
DIST Python-3.12.5.tar.xz.asc 963 BLAKE2B 238167f6b4012136bc4274eee0dd4d958c4ee02d2505f9f64e5bcad15e84a9e9e12a9fc907651083543f1fce93579b752d4ccdf60c8cc421cb43e9034877bf1c SHA512 65ce92272a38cc6bf8bf56fa2a99a830cf5b33b811b1788508e7b6f8b5d3e93e0b143412f829271be40cbb4e7c154f84499239b3e8ab63b2ccf0a5a22d2f84ee
|
||||||
DIST Python-3.13.0b1.tar.xz 21054240 BLAKE2B fba108b2971fe188a05340753a48379c9a829ce680f13dc50d95d889ef5ee833b82be157d1b011ba841c149d633e8eb64b07098bf03a2adcf711b3f688465050 SHA512 81cc1d8691bfcc8f8bb232ea15c18039d0df036f5cbc1667fec3b6c34cdf198bed97418ec775c037778c250b7bc4f35bd5fb938dd478cc17fc48c74b8a2b2d19
|
|
||||||
DIST Python-3.13.0b1.tar.xz.asc 963 BLAKE2B 1b038d2b73fdbe11a1ada18ceab4a174ae52aab68ae9c3a9952ee60a16ce3e08e54c13e0c47264442415f70bd39a06c2b0f97c3cef31330f51102dad6d4a837b SHA512 c10832b5016ad9a9588b7efd29a35272c1c07b444df116c397fed82d66f30150687d68a6853637094be2fe1d8ed0928a9cd151617c91d9eb9938ba1385bd7143
|
|
||||||
DIST Python-3.13.0b2.tar.xz 21089692 BLAKE2B 3cc77e9b7abcd8c9797a40b2a1f5ff6562a1841dd44c4785a57941b1eb4d70d20a3dc5bcf8cbfe3d1b2c7f846d7da7fd89758e113542820945da996d2c6a68af SHA512 3a37c8137958a6ebaf06f5a03b28c7817f359f346d820a9989932b1a716478647e8d1b94c1a08197bcabf68cd90443a08ab9454af9151eace52401d8b60d0c35
|
|
||||||
DIST Python-3.13.0b2.tar.xz.asc 963 BLAKE2B 2acab01cd8b2b5072e87f0c697767e9cec6a73cd6afae38f066a3bfa14798d10e01c03e806a1a90d1db3e5d91dea090d9dd37d1884bef3291783e6163e3d8906 SHA512 17091aba45ebd8c8feb3e9c54854e20dcd44fec4a1c08c9c0c4593166c407c4ad2b245a0e0893afc83a43e8b461a557fa1d6691c87a6a5ebc97ea448a9201c87
|
|
||||||
DIST Python-3.13.0b3.tar.xz 20841504 BLAKE2B 92760124355483da082ac9fdc7a72eb6739e99acd97521a8c9a60bb73a25e26bcb8bdc9e911ee91667244320b742a9572c1e12229eb1c0d97ef5794493abac0f SHA512 1f0ef2d6f5d450664ad4104b92193b5a2dbe9c79add0a79c35ad9508f9fc7f1a5561efd5e4367defddf45457291524d353705d9a60b3550065920e204c77357d
|
|
||||||
DIST Python-3.13.0b3.tar.xz.asc 963 BLAKE2B 784df664961ea36cb570d685c0cf6e8fe7159161c38103f217303bc0264c73a9904021cca297a180c7dd712d4e7fcee161d741919bee49eff962a25d14568d41 SHA512 3d8bdc8c26441a12518940d264e93a8897042e297ccf9cd2ddec725716a58486475be9462582ee489bd189a4d028b43504f979298174c1b008d521b7ab5fbf1b
|
|
||||||
DIST Python-3.13.0b4.tar.xz 20876136 BLAKE2B b3a7b42b03320df618af18844a8b0f1c4b88b9bcd581cacd2d40d3ecec7d0f11aac36e54913f64541a2287d7a5052aa69f8e8d0379d6bbb4fba78600bf484f75 SHA512 e556f7a4e54b688d0424b0bd84f9849b52f4f7e04c68d4d5b877d86b4f9ded92c9efaa2b7ab33f345235f35e8d544833542f7a4cb100d0ff15b7d98b8367b935
|
|
||||||
DIST Python-3.13.0b4.tar.xz.asc 963 BLAKE2B 0d9c7baa1eedce684e73359682f63c2aa6e7abc7cc77ee7fcf6d9658e93221c02412aa55f22d16337b72a680f10c70520742292da1138228f9257f81bc57d328 SHA512 243637efff94965aa4d997fe26c91a7c1aa7dcfdf7f78d35d6f4fc408b654dfa9d075d1c73bc5a90d145f6e5029ee395a86faf7e027c24a55fabfea6ca20fbd4
|
|
||||||
DIST Python-3.13.0rc1.tar.xz 20881016 BLAKE2B 3971a233e9c3c782973e0276740f00f8f2072eeda914663cdf7fa6c5de2437c60c441184344a64e25cab5c71a02c47cf4602dd08f127f310c885386cd887fec4 SHA512 fce7664f3298cfd191a7dc20b7b47acafdc50d058a2814312c94c30b65291395957d701e4661b9bb760417942acb5d27e5b8bb479bcda9a82cf29f53772a2daf
|
DIST Python-3.13.0rc1.tar.xz 20881016 BLAKE2B 3971a233e9c3c782973e0276740f00f8f2072eeda914663cdf7fa6c5de2437c60c441184344a64e25cab5c71a02c47cf4602dd08f127f310c885386cd887fec4 SHA512 fce7664f3298cfd191a7dc20b7b47acafdc50d058a2814312c94c30b65291395957d701e4661b9bb760417942acb5d27e5b8bb479bcda9a82cf29f53772a2daf
|
||||||
DIST Python-3.13.0rc1.tar.xz.asc 963 BLAKE2B 1c292362cd133dbbb1df1e0cf440e8adde2bc8db9174e550d5b76a09e80d0dbc11a0250e6f041e54fe58f25dc05f071c7af1aa910ae56ece5eb430502a2ba67c SHA512 3613829d9631f46b1b1ce11bfe5bb7fbfa49d97b639bb883c86737ea6ae8d15c24c526083cafb916011bd6d0b3b5fab2b17afd367edbdce99b32e0b4b845fd22
|
DIST Python-3.13.0rc1.tar.xz.asc 963 BLAKE2B 1c292362cd133dbbb1df1e0cf440e8adde2bc8db9174e550d5b76a09e80d0dbc11a0250e6f041e54fe58f25dc05f071c7af1aa910ae56ece5eb430502a2ba67c SHA512 3613829d9631f46b1b1ce11bfe5bb7fbfa49d97b639bb883c86737ea6ae8d15c24c526083cafb916011bd6d0b3b5fab2b17afd367edbdce99b32e0b4b845fd22
|
||||||
DIST Python-3.8.19.tar.xz 18975156 BLAKE2B 57b241aeb8f99a8c30590dcb9402abbcf573f00d06e807846bc9135c0a8a4af896c4d772d34abc3c292339953f4974a203bff61a78641d91b1826770226cd7e9 SHA512 1d2a57fa15ccdaec8cdca508ba2ffb01e1ae053a3446ac709bc334480f8e913070899f01ed680cce6dc7ddfddcb27ef402fe206562249fa4c4e87be21ece0625
|
DIST Python-3.8.19.tar.xz 18975156 BLAKE2B 57b241aeb8f99a8c30590dcb9402abbcf573f00d06e807846bc9135c0a8a4af896c4d772d34abc3c292339953f4974a203bff61a78641d91b1826770226cd7e9 SHA512 1d2a57fa15ccdaec8cdca508ba2ffb01e1ae053a3446ac709bc334480f8e913070899f01ed680cce6dc7ddfddcb27ef402fe206562249fa4c4e87be21ece0625
|
||||||
@ -27,22 +19,19 @@ DIST Python-3.9.19.tar.xz.asc 833 BLAKE2B b48b58b8ccf4d6ba8d0d7120f04bebf59f843f
|
|||||||
DIST python-gentoo-patches-2.7.18_p16.tar.xz 35448 BLAKE2B 0139c0944f62f9cdd236f6a8557e0ed19704c7d72869af1cb7d8bd3e646a746cd4a0201e1b44232a5e78ef49f254db20b0d0271bf744fbfd4fe0f1e99b8f3e6c SHA512 810be590d0e06fab4b2165e6852ca49662f09dcd7e20b47a29f613ad7653252c8dfac3f0eb228d77c8a914efa7c08788b2fbd552a4b47504f5fd0ec17450c48f
|
DIST python-gentoo-patches-2.7.18_p16.tar.xz 35448 BLAKE2B 0139c0944f62f9cdd236f6a8557e0ed19704c7d72869af1cb7d8bd3e646a746cd4a0201e1b44232a5e78ef49f254db20b0d0271bf744fbfd4fe0f1e99b8f3e6c SHA512 810be590d0e06fab4b2165e6852ca49662f09dcd7e20b47a29f613ad7653252c8dfac3f0eb228d77c8a914efa7c08788b2fbd552a4b47504f5fd0ec17450c48f
|
||||||
DIST python-gentoo-patches-3.10.14_p1.tar.xz 15836 BLAKE2B a850e4ad4f025fa9d38ccba937f1b3ee8443ed186c22ede58b4c7324a8541cf724590686671a9aa9194662303ce75bc80aac8ee6f9da34b793876817b6f593ff SHA512 5d969f5e5126ee675a062924a5f403de142fc5bfe4a931fd3576bcc6298a855419d305d4b1ffedacb429783a05324b36eef4c45c861c47bada0bdd840de2bca3
|
DIST python-gentoo-patches-3.10.14_p1.tar.xz 15836 BLAKE2B a850e4ad4f025fa9d38ccba937f1b3ee8443ed186c22ede58b4c7324a8541cf724590686671a9aa9194662303ce75bc80aac8ee6f9da34b793876817b6f593ff SHA512 5d969f5e5126ee675a062924a5f403de142fc5bfe4a931fd3576bcc6298a855419d305d4b1ffedacb429783a05324b36eef4c45c861c47bada0bdd840de2bca3
|
||||||
DIST python-gentoo-patches-3.10.14_p2.tar.xz 19564 BLAKE2B 2ad1398e0679e73028a0614e8c4ef6bc76928f6c1d0e93c39c3bf2c23201904ee677377abb120444995154bda4251cb8f0aabafca5e6c82601a6270d0e62bf67 SHA512 6d4194b85a176a1a0f7acc3eab48829d504e66381f3008821a9a433e63f5188b444321192ad536d8219a1c3ca56dbdb5c39439401cbbb30f35a606e2b6617624
|
DIST python-gentoo-patches-3.10.14_p2.tar.xz 19564 BLAKE2B 2ad1398e0679e73028a0614e8c4ef6bc76928f6c1d0e93c39c3bf2c23201904ee677377abb120444995154bda4251cb8f0aabafca5e6c82601a6270d0e62bf67 SHA512 6d4194b85a176a1a0f7acc3eab48829d504e66381f3008821a9a433e63f5188b444321192ad536d8219a1c3ca56dbdb5c39439401cbbb30f35a606e2b6617624
|
||||||
|
DIST python-gentoo-patches-3.10.14_p3.tar.xz 22080 BLAKE2B f45ebe4df3dc39a842c93d741ef66fd0f9f7d1c6453d499d59b62eda41f01bc17e109205fedc506963d1f21eb3fbf9478564ff5e1a11c10336f855069a642ceb SHA512 db268f1482e5c46a71ce3aef2c2ab6d458cc5263aec360e61c6aff97f119f4f100becefbb575156b1b0239e591a496cb62a136597fadae8a5b630c7233c0040a
|
||||||
DIST python-gentoo-patches-3.11.9.tar.xz 8456 BLAKE2B 4e62837f17c1d056460df417b056a79ad78dbcdd3454761c7cda68ffe6faf8f4d4f04d5539e0ba94332fe19a751f7d5ff2c35ff969a6aa09a2c72d2ce5efbff1 SHA512 a288aa8d1d15e906e0f1762602a2122f9dc91bbd6b72123ac5d00ce55b3af324a4e8280b600fc0fb630e489e57ee1547d7595a4ede7a70e4b26d6686a8414997
|
DIST python-gentoo-patches-3.11.9.tar.xz 8456 BLAKE2B 4e62837f17c1d056460df417b056a79ad78dbcdd3454761c7cda68ffe6faf8f4d4f04d5539e0ba94332fe19a751f7d5ff2c35ff969a6aa09a2c72d2ce5efbff1 SHA512 a288aa8d1d15e906e0f1762602a2122f9dc91bbd6b72123ac5d00ce55b3af324a4e8280b600fc0fb630e489e57ee1547d7595a4ede7a70e4b26d6686a8414997
|
||||||
DIST python-gentoo-patches-3.11.9_p1.tar.xz 12348 BLAKE2B 885c18eb52d299c8da43fe48106a2464ce594822e8ed362150c98f749065447b7438741cacf82a71db102434a5b2a2e91778aca8609fd7ede7898f9e57a82d49 SHA512 2ed8a97692a8980e565038ad095dad8ed3daf1f8c5c5e042a0bc278c320e099962ad13b5ff919ae334674a4828c5e8f3b9c3af6b3c37e93a42374284f5ea2243
|
DIST python-gentoo-patches-3.11.9_p1.tar.xz 12348 BLAKE2B 885c18eb52d299c8da43fe48106a2464ce594822e8ed362150c98f749065447b7438741cacf82a71db102434a5b2a2e91778aca8609fd7ede7898f9e57a82d49 SHA512 2ed8a97692a8980e565038ad095dad8ed3daf1f8c5c5e042a0bc278c320e099962ad13b5ff919ae334674a4828c5e8f3b9c3af6b3c37e93a42374284f5ea2243
|
||||||
|
DIST python-gentoo-patches-3.11.9_p2.tar.xz 14916 BLAKE2B a910eae412fc1ce3657272c3c2ea9ef95b8d5711ed4c85b93a35f4ab757b1134bff0f8c8a0071e8e06aac784d0b51e36cd9271f892098cba272da4a4e73317d1 SHA512 5c055186b3a8376f4f602ec5d1f8e7bf0f067bc67295c1cdaa68ce1fb6fb21cda75e22705b8a5a2a6525af67f3b36a82fde5ba6ae9b097a5914ab79a2f1a0fad
|
||||||
DIST python-gentoo-patches-3.12.3.tar.xz 6028 BLAKE2B 7953a48a1d95a6a33bd88060fbcac463a5469371aa0c882c3945f1fea64a63c4d45fca8451f51f4eaeea00a04267ad2e54e4cc720c95e8bb5a3477e00263b80a SHA512 4779bab2b24e59e4a77987ce3e9611d99e87c9c4d016309758c26a65fe2e11ef04d48d5af628c02b1552dc1f31b768f87448f8e19e716b4fe372941e6dacac3f
|
DIST python-gentoo-patches-3.12.3.tar.xz 6028 BLAKE2B 7953a48a1d95a6a33bd88060fbcac463a5469371aa0c882c3945f1fea64a63c4d45fca8451f51f4eaeea00a04267ad2e54e4cc720c95e8bb5a3477e00263b80a SHA512 4779bab2b24e59e4a77987ce3e9611d99e87c9c4d016309758c26a65fe2e11ef04d48d5af628c02b1552dc1f31b768f87448f8e19e716b4fe372941e6dacac3f
|
||||||
DIST python-gentoo-patches-3.12.4_p1.tar.xz 7088 BLAKE2B 450b95539aaf7c8c052ca1bbcab3b1a8f1c33e8007b6c66cc290c33d88cac8bad346e13cf96508834599a59ccb6548e6dd8cbfb1e24d84539f502101b04299d0 SHA512 df874cb1d8d0f5df60fca82daa2a59cbcfeba6be72b021101a753306a09bb19ee268681b3fdb39659be923d868c727bf7aabbe8173cfd48a329c66f4727353c7
|
|
||||||
DIST python-gentoo-patches-3.12.4_p2.tar.xz 11124 BLAKE2B 8e49af60b1e514de9b77c562a8df5ae7d6caf0045e631fcf85a8f91335cf18f1df2ac611ea73d26e5b70c2537beb423a9303dcce41c2c2e2b049ee9f1e537b53 SHA512 df1d49e60d23f5f09144c57034c86f81f8d185f65c3a93bbb2b386977638bd525b45fe1dff8c7202d60ca3a5fdf96b94a492b076072713565e7449b679fde7b5
|
|
||||||
DIST python-gentoo-patches-3.12.4_p3.tar.xz 14796 BLAKE2B 68f5235ef434f9db16e7bc635ff51b6607cfb9be713fdc3c0ef624ec0f513345f6e02e27b8ebc2b3c8a5fcd4f4f5161024407ae364bdffd3b22a7a9d3a509b30 SHA512 8e337a7234b8ad64dd82435dcda0ef4e90c21214bd7b13a83fe9ba700d5b07ce11fb33b7d34d808132120b4a077fde26278b87116bb02ccef50470c046a66d2b
|
DIST python-gentoo-patches-3.12.4_p3.tar.xz 14796 BLAKE2B 68f5235ef434f9db16e7bc635ff51b6607cfb9be713fdc3c0ef624ec0f513345f6e02e27b8ebc2b3c8a5fcd4f4f5161024407ae364bdffd3b22a7a9d3a509b30 SHA512 8e337a7234b8ad64dd82435dcda0ef4e90c21214bd7b13a83fe9ba700d5b07ce11fb33b7d34d808132120b4a077fde26278b87116bb02ccef50470c046a66d2b
|
||||||
DIST python-gentoo-patches-3.12.5.tar.xz 6056 BLAKE2B d9b85d98a75f6365c63ddabb8f25db3be11e7e4de22ec9426bb24160efcca25c75e3e19beec9fc2f8f8fe273c145f825c6f27ece2fca83d44cf2dbdfacae918d SHA512 72949ae8a1c796cb57e8b43d259037a723482b5a3849823c1cdc58acc012177a0ec836a4dd6ad656fe57ee1d84491c03ed9109667a953aa52bf5df7640de969f
|
DIST python-gentoo-patches-3.12.5.tar.xz 6056 BLAKE2B d9b85d98a75f6365c63ddabb8f25db3be11e7e4de22ec9426bb24160efcca25c75e3e19beec9fc2f8f8fe273c145f825c6f27ece2fca83d44cf2dbdfacae918d SHA512 72949ae8a1c796cb57e8b43d259037a723482b5a3849823c1cdc58acc012177a0ec836a4dd6ad656fe57ee1d84491c03ed9109667a953aa52bf5df7640de969f
|
||||||
DIST python-gentoo-patches-3.13.0b1_p3.tar.xz 11056 BLAKE2B ef932bac59d2316ee8fe638a3d34ce247ff587915546038627674cd4c03179998a58336f8ebae45f1fcc94c8059d61ff6f22693f25ace1462bce275f50bfb48f SHA512 956e3da7376d60d7a593af50fff9842016a3b193180e93ab8298756c9eedfb2aaf8c1287bb75111e6340b5bac20a12dcb00ef51ecf0e12ef9ae5c98202fb071b
|
DIST python-gentoo-patches-3.12.5_p1.tar.xz 8632 BLAKE2B 13570bb465002cea3590b06d055b936ac0fcc68f6f258aca99a67f02f0b1cd28396424b686c5e080f593a74a744ff449e7220f51f167a858b2313be4c8b64b19 SHA512 eb9fb2d48236a9f7941fb8938310cc32d216eb01e19277175223b8b1fe1bfd606bde9a3c8bc66ad2e494fb87ce23b0d1acd359c375e4a11a5caae25450c11360
|
||||||
DIST python-gentoo-patches-3.13.0b2_p9.tar.xz 11288 BLAKE2B e46bac845ce54e32446316b8a5e055905f023e88ad7fb9cfed101f0fccf6c0fef2fb9fd5b7dc4b15ec1e6c075ceaa9f07777c3cfede0f88412871beac0a54e47 SHA512 4148342d649acd98cce1f3d3c7bdbf4adad069ba555624882ddb69f00ee0e64641014086b5e60d97eac809ccb1e3e782a112eb58d7bb83bcfa3222811cbb8682
|
|
||||||
DIST python-gentoo-patches-3.13.0b3.tar.xz 5704 BLAKE2B 665f60d0a440c63ca6bbc1615333e01e0b9d3c5cd8c871157866dd70146a9afb71aecdb6f72f75de2fd8c163d011c8df538c8b278ad6a91079f3300bd05fead3 SHA512 959826aaf467235c8a144a2b94137113b273f79febd30fee0556b718132bb89b5ba97bc01a3718771cade099777f131b322682f336dfaabe18cd5838a75318fa
|
|
||||||
DIST python-gentoo-patches-3.13.0b3_p1.tar.xz 8716 BLAKE2B 25b2d9f059c6f31a354b19833a3dfaab446a43ca00bbaa415e38c3ede6c4a738046469ca4ef6e184a5d7df33a8a1c5209271a1eb0728c3791e6630953bcd798f SHA512 57bbe0470e3356cef3b1880cedd18d4e84d6f64d1f398ce3e3e729744ac5f7a4dc4144333e2355f9ecf41c58382ab5708e7dbf7d480dbf797caa460862aee3bd
|
|
||||||
DIST python-gentoo-patches-3.13.0b4.tar.xz 5700 BLAKE2B cc3e6d899dc51dc4a0f4b57fb5a891a61e5ba5a943edd31b55b6540f1d52a61f2a80f8ac1cdbc36ce155a83ab3942b8991fad0e83baab4c0a1080e62b30e16df SHA512 bf236ed221512a032a057f8b89b29a28e84cfaba56f58c2eaacee846db636089b2ae4534dc55ff3389cfbf1a4485e1cc2049a5cdb98ec1cd31eef71de60596c1
|
|
||||||
DIST python-gentoo-patches-3.13.0rc1.tar.xz 5696 BLAKE2B c34beb06ea6052b297e1bc5ec790f712a6d8acfa23b16b44dd8a7fc2788a4ba266da21cc2f463e79f10749e2f4752ae34c7074a0e588e84614020e6acd86403b SHA512 a6a2e8dc2a35a76b265788658cd8ecf2f5b7f466701cf4599df300eb8914435198f26789dafa309a7dc4c23e0da2aeb905c8175611f6fa50f622e70016212202
|
|
||||||
DIST python-gentoo-patches-3.13.0rc1_p1.tar.xz 9840 BLAKE2B f8f52be8fde89793e5692a4693c030980a32651626cc6184f962d7d9dc9209ce6593f127ff279b71fda4fafeec148af80971bdb6dcaf129f63cc52238a34630f SHA512 e0d3aaf528ffeed8335f98dd4bfd43da8274757b0ae9f6a473134e9b57eafe12b870e41e1aafa52c2bd96de1b7ab9b9f225ddf8e87eec51f088b5484b3c92852
|
|
||||||
DIST python-gentoo-patches-3.13.0rc1_p2.tar.xz 12748 BLAKE2B 851d16e16d2a98fde62c38054d9bedf3538d88a59e19dcfd8ee7d86f3f67a3b66105664da9181dbfb9ad16aa0042815ccf469225348fb0ba8854337b0a736d33 SHA512 8264aa65bf71e97a4afe47a9fba58815163bc950ea70ff708c5f265722c5b4b8af19fbbe8a9c3673957a6de3af8307a9ba0ed9f4e42472ca24c5ed930682a038
|
DIST python-gentoo-patches-3.13.0rc1_p2.tar.xz 12748 BLAKE2B 851d16e16d2a98fde62c38054d9bedf3538d88a59e19dcfd8ee7d86f3f67a3b66105664da9181dbfb9ad16aa0042815ccf469225348fb0ba8854337b0a736d33 SHA512 8264aa65bf71e97a4afe47a9fba58815163bc950ea70ff708c5f265722c5b4b8af19fbbe8a9c3673957a6de3af8307a9ba0ed9f4e42472ca24c5ed930682a038
|
||||||
|
DIST python-gentoo-patches-3.13.0rc1_p3.tar.xz 15148 BLAKE2B 668060644372e8ddf2d9686796ec304ae7689f5c10ecbc6862f054f96504c418b0e4df28675e4fbb610889f9a665a7a54f23633036b0df35f19f40ef8e6bab32 SHA512 c0cbdf9e0fe2ad29175302e548ebfda1d2af42af0ffeb363eb8b0dc53e1059f5abd7dcd02fd8e9eb9ba7bef2b34b7693633f0a62dc1ab933f43077feacf00fbc
|
||||||
DIST python-gentoo-patches-3.8.19_p2.tar.xz 35524 BLAKE2B a6b81e6ae907b60eea676cb65a9c693e62453dc44616baaadb294c5782a195c20eff6c2869b38ea110fe06e9e511468f4ab0c3d1811b16e0ab2833f9dc09b25b SHA512 9944c330b6062c2ac6e13fcfbc1c8835dfd078f6744cdfbc03ba787ae97c08bdae559cefadafe9dfe9be9c31f8c15ee895599b266d870f73c06a2f4b15c78dc3
|
DIST python-gentoo-patches-3.8.19_p2.tar.xz 35524 BLAKE2B a6b81e6ae907b60eea676cb65a9c693e62453dc44616baaadb294c5782a195c20eff6c2869b38ea110fe06e9e511468f4ab0c3d1811b16e0ab2833f9dc09b25b SHA512 9944c330b6062c2ac6e13fcfbc1c8835dfd078f6744cdfbc03ba787ae97c08bdae559cefadafe9dfe9be9c31f8c15ee895599b266d870f73c06a2f4b15c78dc3
|
||||||
DIST python-gentoo-patches-3.8.19_p3.tar.xz 39392 BLAKE2B 451765c7546831c35f52e2772b8b43b6515f66cace2d13ed473228bf2d2b18f49b938a61d4cdf1be0fecbebfac1fc8d3d95f7597eb9d877c0b2ce495e8d419c1 SHA512 76e405ddfd3ee98dbd077f6ec83ae93d0506ddbc3b2b8884a0f38c6269ea982b635b0eb7820f6f9b2f81eb0ef514b93a5eb10437414cde4de2bfb7ea37764b3c
|
DIST python-gentoo-patches-3.8.19_p3.tar.xz 39392 BLAKE2B 451765c7546831c35f52e2772b8b43b6515f66cace2d13ed473228bf2d2b18f49b938a61d4cdf1be0fecbebfac1fc8d3d95f7597eb9d877c0b2ce495e8d419c1 SHA512 76e405ddfd3ee98dbd077f6ec83ae93d0506ddbc3b2b8884a0f38c6269ea982b635b0eb7820f6f9b2f81eb0ef514b93a5eb10437414cde4de2bfb7ea37764b3c
|
||||||
|
DIST python-gentoo-patches-3.8.19_p4.tar.xz 41888 BLAKE2B 8f5fcf8b6d925c9f668a1f8ac22d4b8c2ff7b4d90103606afc37eef735d5ed0fe7288469fb18e08bc31165c16c9877977610e5a6af9e385518028baed34fde2f SHA512 4440725419af3bc5c4f1719dd39605df28e2bca625c3a822082e4541db9479dc6fcf8c2d6fc777292b75f70669ab7e010df105b2b580865a442df76c0f83ebbc
|
||||||
DIST python-gentoo-patches-3.9.19_p3.tar.xz 28240 BLAKE2B 35c70b1f9a590abe9a74795f478ab788cd72c96e9d84f2756685e61324dc4203148e71b00a236bb4af8fb8315e3582ecec255b39749a653e0511d4a9f9fef725 SHA512 6b8f4dab4aa7d4d646ee4091b5cf76bbc8896d4299a3623660a2c5fec06c0cf56c0a50ac87604885cd155141bc85e0e80acdbedb7b34a813901aad021b9b8ab2
|
DIST python-gentoo-patches-3.9.19_p3.tar.xz 28240 BLAKE2B 35c70b1f9a590abe9a74795f478ab788cd72c96e9d84f2756685e61324dc4203148e71b00a236bb4af8fb8315e3582ecec255b39749a653e0511d4a9f9fef725 SHA512 6b8f4dab4aa7d4d646ee4091b5cf76bbc8896d4299a3623660a2c5fec06c0cf56c0a50ac87604885cd155141bc85e0e80acdbedb7b34a813901aad021b9b8ab2
|
||||||
DIST python-gentoo-patches-3.9.19_p4.tar.xz 32048 BLAKE2B 9595d508304baf36a2c8daa2ae15d3596fdfb5fed5c531fc379ee347d5b165885ade1842f094184fb7bd81a6385e45f9b77ba7bfa4334ea30292c0bc59b373e2 SHA512 5713c69ee3745246a570e0f05ac8f45baa8f9fa8a2154c930f1ddcf827a2a790cb5e308f5ff9452d3ffda5d60c167a02429af773eebf13dcb6463793cd448500
|
DIST python-gentoo-patches-3.9.19_p4.tar.xz 32048 BLAKE2B 9595d508304baf36a2c8daa2ae15d3596fdfb5fed5c531fc379ee347d5b165885ade1842f094184fb7bd81a6385e45f9b77ba7bfa4334ea30292c0bc59b373e2 SHA512 5713c69ee3745246a570e0f05ac8f45baa8f9fa8a2154c930f1ddcf827a2a790cb5e308f5ff9452d3ffda5d60c167a02429af773eebf13dcb6463793cd448500
|
||||||
|
DIST python-gentoo-patches-3.9.19_p5.tar.xz 34548 BLAKE2B 6ad49bba626932b3ba1b781fe5762882aa90b552bedc0f1b8fe0921c7e4ad1bd67ddbc2c11c969fae53fd2b6189dd1b1506da87c123c055ec3df023950bd1938 SHA512 d66a2d6012d98edde4a9eb52cd8a06f0338a25f44e299713abd970884c7b1d457c6a09a1e27035841eae3a4844bbec1b4d2a4b691bbf519867a6ed58f251e633
|
||||||
|
@ -5,7 +5,7 @@ EAPI="8"
|
|||||||
WANT_LIBTOOL="none"
|
WANT_LIBTOOL="none"
|
||||||
|
|
||||||
inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
|
inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
|
||||||
inherit python-utils-r1 toolchain-funcs verify-sig
|
inherit prefix python-utils-r1 toolchain-funcs verify-sig
|
||||||
|
|
||||||
MY_PV=${PV/_rc/rc}
|
MY_PV=${PV/_rc/rc}
|
||||||
MY_P="Python-${MY_PV%_p*}"
|
MY_P="Python-${MY_PV%_p*}"
|
||||||
@ -28,7 +28,7 @@ S="${WORKDIR}/${MY_P}"
|
|||||||
|
|
||||||
LICENSE="PSF-2"
|
LICENSE="PSF-2"
|
||||||
SLOT="${PYVER}"
|
SLOT="${PYVER}"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc ~x86"
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||||
IUSE="
|
IUSE="
|
||||||
bluetooth build debug +ensurepip examples gdbm libedit
|
bluetooth build debug +ensurepip examples gdbm libedit
|
||||||
+ncurses pgo +readline +sqlite +ssl test tk valgrind
|
+ncurses pgo +readline +sqlite +ssl test tk valgrind
|
||||||
@ -43,7 +43,6 @@ RESTRICT="!test? ( test )"
|
|||||||
RDEPEND="
|
RDEPEND="
|
||||||
app-arch/bzip2:=
|
app-arch/bzip2:=
|
||||||
app-arch/xz-utils:=
|
app-arch/xz-utils:=
|
||||||
app-crypt/libb2
|
|
||||||
>=dev-libs/expat-2.1:=
|
>=dev-libs/expat-2.1:=
|
||||||
dev-libs/libffi:=
|
dev-libs/libffi:=
|
||||||
dev-libs/mpdecimal:=
|
dev-libs/mpdecimal:=
|
||||||
@ -51,7 +50,7 @@ RDEPEND="
|
|||||||
>=sys-libs/zlib-1.1.3:=
|
>=sys-libs/zlib-1.1.3:=
|
||||||
virtual/libcrypt:=
|
virtual/libcrypt:=
|
||||||
virtual/libintl
|
virtual/libintl
|
||||||
ensurepip? ( dev-python/ensurepip-pip )
|
ensurepip? ( dev-python/ensurepip-wheels )
|
||||||
gdbm? ( sys-libs/gdbm:=[berkdb] )
|
gdbm? ( sys-libs/gdbm:=[berkdb] )
|
||||||
kernel_linux? ( sys-apps/util-linux:= )
|
kernel_linux? ( sys-apps/util-linux:= )
|
||||||
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
||||||
@ -72,20 +71,15 @@ RDEPEND="
|
|||||||
DEPEND="
|
DEPEND="
|
||||||
${RDEPEND}
|
${RDEPEND}
|
||||||
bluetooth? ( net-wireless/bluez )
|
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 )
|
valgrind? ( dev-debug/valgrind )
|
||||||
|
test? ( app-arch/xz-utils )
|
||||||
"
|
"
|
||||||
# autoconf-archive needed to eautoreconf
|
# autoconf-archive needed to eautoreconf
|
||||||
BDEPEND="
|
BDEPEND="
|
||||||
dev-build/autoconf-archive
|
dev-build/autoconf-archive
|
||||||
app-alternatives/awk
|
app-alternatives/awk
|
||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
verify-sig? ( >=sec-keys/openpgp-keys-python-20221025 )
|
verify-sig? ( sec-keys/openpgp-keys-python )
|
||||||
"
|
"
|
||||||
RDEPEND+="
|
RDEPEND+="
|
||||||
!build? ( app-misc/mime-types )
|
!build? ( app-misc/mime-types )
|
||||||
@ -122,8 +116,8 @@ src_unpack() {
|
|||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
# Ensure that internal copies of expat and libffi are not used.
|
# Ensure that internal copies of expat and libffi are not used.
|
||||||
# TODO: Makefile has annoying deps on expat headers
|
rm -r Modules/expat || die
|
||||||
#rm -r Modules/expat || die
|
rm -r Modules/_ctypes/libffi* || die
|
||||||
|
|
||||||
local PATCHES=(
|
local PATCHES=(
|
||||||
"${WORKDIR}/${PATCHSET}"
|
"${WORKDIR}/${PATCHSET}"
|
||||||
@ -131,12 +125,14 @@ src_prepare() {
|
|||||||
|
|
||||||
default
|
default
|
||||||
|
|
||||||
|
# https://bugs.gentoo.org/850151
|
||||||
|
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die
|
||||||
|
|
||||||
# force the correct number of jobs
|
# force the correct number of jobs
|
||||||
# https://bugs.gentoo.org/737660
|
# https://bugs.gentoo.org/737660
|
||||||
sed -i -e "s:-j0:-j$(makeopts_jobs):" Makefile.pre.in || die
|
local jobs=$(makeopts_jobs)
|
||||||
|
sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
|
||||||
# breaks tests when using --with-wheel-pkg-dir
|
sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
|
||||||
rm -r Lib/test/wheeldata || die
|
|
||||||
|
|
||||||
eautoreconf
|
eautoreconf
|
||||||
}
|
}
|
||||||
@ -156,7 +152,7 @@ build_cbuild_python() {
|
|||||||
local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
|
local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
|
||||||
|
|
||||||
# We need to build our own Python on CBUILD first, and feed it in.
|
# We need to build our own Python on CBUILD first, and feed it in.
|
||||||
# bug #847910
|
# bug #847910 and bug #864911.
|
||||||
local myeconfargs_cbuild=(
|
local myeconfargs_cbuild=(
|
||||||
"${myeconfargs[@]}"
|
"${myeconfargs[@]}"
|
||||||
|
|
||||||
@ -167,41 +163,40 @@ build_cbuild_python() {
|
|||||||
--disable-shared
|
--disable-shared
|
||||||
|
|
||||||
# As minimal as possible for the mini CBUILD Python
|
# As minimal as possible for the mini CBUILD Python
|
||||||
# we build just for cross to satisfy --with-build-python.
|
# we build just for cross.
|
||||||
--without-lto
|
--without-lto
|
||||||
--without-readline
|
|
||||||
--disable-optimizations
|
--disable-optimizations
|
||||||
)
|
)
|
||||||
|
|
||||||
mkdir "${WORKDIR}"/${P}-${CBUILD} || die
|
mkdir "${WORKDIR}"/${P}-${CBUILD} || die
|
||||||
pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || 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+=" _ctypes _crypt" \
|
||||||
|
ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
|
||||||
|
|
||||||
# Avoid as many dependencies as possible for the cross build.
|
# Avoid as many dependencies as possible for the cross build.
|
||||||
mkdir Modules || die
|
cat >> Makefile <<-EOF || die
|
||||||
cat > Modules/Setup.local <<-EOF || die
|
MODULE_NIS=disabled
|
||||||
*disabled*
|
MODULE__DBM=disabled
|
||||||
nis
|
MODULE__GDBM=disabled
|
||||||
_dbm _gdbm
|
MODULE__DBM=disabled
|
||||||
_sqlite3
|
MODULE__SQLITE3=disabled
|
||||||
_hashlib _ssl
|
MODULE__HASHLIB=disabled
|
||||||
_curses _curses_panel
|
MODULE__SSL=disabled
|
||||||
readline
|
MODULE__CURSES=disabled
|
||||||
_tkinter
|
MODULE__CURSES_PANEL=disabled
|
||||||
pyexpat
|
MODULE_READLINE=disabled
|
||||||
zlib
|
MODULE__TKINTER=disabled
|
||||||
# We disabled these for CBUILD because Python's setup.py can't handle locating
|
MODULE_PYEXPAT=disabled
|
||||||
# libdir correctly for cross. This should be rechecked for the pure Makefile approach,
|
MODULE_ZLIB=disabled
|
||||||
# and uncommented if needed.
|
|
||||||
#_ctypes _crypt
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
|
|
||||||
|
|
||||||
# Unfortunately, we do have to build this immediately, and
|
# Unfortunately, we do have to build this immediately, and
|
||||||
# not in src_compile, because CHOST configure for Python
|
# not in src_compile, because CHOST configure for Python
|
||||||
# will check the existence of the --with-build-python value
|
# will check the existence of the Python it was pointed to
|
||||||
# immediately.
|
# immediately.
|
||||||
emake
|
PYTHON_DISABLE_MODULES+=" _ctypes _crypt" emake
|
||||||
popd &> /dev/null || die
|
popd &> /dev/null || die
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,6 +205,18 @@ src_configure() {
|
|||||||
if ! use bluetooth; then
|
if ! use bluetooth; then
|
||||||
local -x ac_cv_header_bluetooth_bluetooth_h=no
|
local -x ac_cv_header_bluetooth_bluetooth_h=no
|
||||||
fi
|
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"
|
||||||
|
export PYTHON_DISABLE_MODULES="${disable}"
|
||||||
|
|
||||||
|
if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
|
||||||
|
einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
|
||||||
|
fi
|
||||||
|
|
||||||
append-flags -fwrapv
|
append-flags -fwrapv
|
||||||
filter-flags -malign-double
|
filter-flags -malign-double
|
||||||
@ -296,9 +303,8 @@ src_configure() {
|
|||||||
--without-ensurepip
|
--without-ensurepip
|
||||||
--without-lto
|
--without-lto
|
||||||
--with-system-expat
|
--with-system-expat
|
||||||
|
--with-system-ffi
|
||||||
--with-system-libmpdec
|
--with-system-libmpdec
|
||||||
--with-platlibdir=lib
|
|
||||||
--with-pkg-config=yes
|
|
||||||
--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
|
--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
|
||||||
|
|
||||||
$(use_with debug assertions)
|
$(use_with debug assertions)
|
||||||
@ -307,6 +313,9 @@ src_configure() {
|
|||||||
$(use_with valgrind)
|
$(use_with valgrind)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# disable implicit optimization/debugging flags
|
||||||
|
local -x OPT=
|
||||||
|
|
||||||
# https://bugs.gentoo.org/700012
|
# https://bugs.gentoo.org/700012
|
||||||
if tc-is-lto; then
|
if tc-is-lto; then
|
||||||
append-cflags $(test-flags-CC -ffat-lto-objects)
|
append-cflags $(test-flags-CC -ffat-lto-objects)
|
||||||
@ -315,29 +324,11 @@ src_configure() {
|
|||||||
)
|
)
|
||||||
fi
|
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')
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# disable implicit optimization/debugging flags
|
|
||||||
local -x OPT=
|
|
||||||
|
|
||||||
if tc-is-cross-compiler ; then
|
if tc-is-cross-compiler ; then
|
||||||
build_cbuild_python
|
build_cbuild_python
|
||||||
myeconfargs+=(
|
# Point the imminent CHOST build to the Python we just
|
||||||
# Point the imminent CHOST build to the Python we just
|
# built for CBUILD.
|
||||||
# built for CBUILD.
|
export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}"
|
||||||
--with-build-python="${WORKDIR}"/${P}-${CBUILD}/python
|
|
||||||
)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
|
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
|
||||||
@ -351,6 +342,7 @@ src_configure() {
|
|||||||
append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
|
append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
hprefixify setup.py
|
||||||
econf "${myeconfargs[@]}"
|
econf "${myeconfargs[@]}"
|
||||||
|
|
||||||
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
|
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
|
||||||
@ -367,7 +359,9 @@ src_compile() {
|
|||||||
# Ensure sed works as expected
|
# Ensure sed works as expected
|
||||||
# https://bugs.gentoo.org/594768
|
# https://bugs.gentoo.org/594768
|
||||||
local -x LC_ALL=C
|
local -x LC_ALL=C
|
||||||
export PYTHONSTRICTEXTENSIONBUILD=1
|
# Prevent using distutils bundled by setuptools.
|
||||||
|
# https://bugs.gentoo.org/823728
|
||||||
|
export SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||||
|
|
||||||
# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
|
# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
|
||||||
# end up writing bytecode & violating sandbox.
|
# end up writing bytecode & violating sandbox.
|
||||||
@ -404,11 +398,6 @@ src_test() {
|
|||||||
return
|
return
|
||||||
fi
|
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=(
|
local test_opts=(
|
||||||
-u-network
|
-u-network
|
||||||
-j "$(makeopts_jobs)"
|
-j "$(makeopts_jobs)"
|
||||||
@ -465,12 +454,7 @@ src_test() {
|
|||||||
src_install() {
|
src_install() {
|
||||||
local libdir=${ED}/usr/lib/python${PYVER}
|
local libdir=${ED}/usr/lib/python${PYVER}
|
||||||
|
|
||||||
# the Makefile rules are broken
|
emake DESTDIR="${D}" altinstall
|
||||||
# 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.
|
# Fix collisions between different slots of Python.
|
||||||
rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
|
rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
|
||||||
@ -500,7 +484,7 @@ src_install() {
|
|||||||
rm -r "${libdir}"/ensurepip || die
|
rm -r "${libdir}"/ensurepip || die
|
||||||
fi
|
fi
|
||||||
if ! use sqlite; then
|
if ! use sqlite; then
|
||||||
rm -r "${libdir}/"sqlite3 || die
|
rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
|
||||||
fi
|
fi
|
||||||
if ! use tk; then
|
if ! use tk; then
|
||||||
rm -r "${ED}/usr/bin/idle${PYVER}" || die
|
rm -r "${ED}/usr/bin/idle${PYVER}" || die
|
@ -2,15 +2,12 @@
|
|||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI="8"
|
EAPI="8"
|
||||||
|
|
||||||
LLVM_COMPAT=( 18 )
|
|
||||||
LLVM_OPTIONAL=1
|
|
||||||
WANT_LIBTOOL="none"
|
WANT_LIBTOOL="none"
|
||||||
|
|
||||||
inherit autotools check-reqs flag-o-matic llvm-r1 multiprocessing
|
inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
|
||||||
inherit pax-utils python-utils-r1 toolchain-funcs verify-sig
|
inherit prefix python-utils-r1 toolchain-funcs verify-sig
|
||||||
|
|
||||||
MY_PV=${PV/_beta/b}
|
MY_PV=${PV/_rc/rc}
|
||||||
MY_P="Python-${MY_PV%_p*}"
|
MY_P="Python-${MY_PV%_p*}"
|
||||||
PYVER=$(ver_cut 1-2)
|
PYVER=$(ver_cut 1-2)
|
||||||
PATCHSET="python-gentoo-patches-${MY_PV}"
|
PATCHSET="python-gentoo-patches-${MY_PV}"
|
||||||
@ -31,12 +28,11 @@ S="${WORKDIR}/${MY_P}"
|
|||||||
|
|
||||||
LICENSE="PSF-2"
|
LICENSE="PSF-2"
|
||||||
SLOT="${PYVER}"
|
SLOT="${PYVER}"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||||
IUSE="
|
IUSE="
|
||||||
bluetooth build +debug +ensurepip examples gdbm +gil jit
|
bluetooth build debug +ensurepip examples gdbm libedit
|
||||||
libedit +ncurses pgo +readline +sqlite +ssl test tk valgrind
|
+ncurses pgo +readline +sqlite +ssl test tk valgrind
|
||||||
"
|
"
|
||||||
REQUIRED_USE="jit? ( ${LLVM_REQUIRED_USE} )"
|
|
||||||
RESTRICT="!test? ( test )"
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
# Do not add a dependency on dev-lang/python to this ebuild.
|
# Do not add a dependency on dev-lang/python to this ebuild.
|
||||||
@ -55,7 +51,7 @@ RDEPEND="
|
|||||||
>=sys-libs/zlib-1.1.3:=
|
>=sys-libs/zlib-1.1.3:=
|
||||||
virtual/libcrypt:=
|
virtual/libcrypt:=
|
||||||
virtual/libintl
|
virtual/libintl
|
||||||
ensurepip? ( dev-python/ensurepip-pip )
|
ensurepip? ( dev-python/ensurepip-wheels )
|
||||||
gdbm? ( sys-libs/gdbm:=[berkdb] )
|
gdbm? ( sys-libs/gdbm:=[berkdb] )
|
||||||
kernel_linux? ( sys-apps/util-linux:= )
|
kernel_linux? ( sys-apps/util-linux:= )
|
||||||
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
||||||
@ -76,12 +72,7 @@ RDEPEND="
|
|||||||
DEPEND="
|
DEPEND="
|
||||||
${RDEPEND}
|
${RDEPEND}
|
||||||
bluetooth? ( net-wireless/bluez )
|
bluetooth? ( net-wireless/bluez )
|
||||||
test? (
|
test? ( app-arch/xz-utils )
|
||||||
app-arch/xz-utils
|
|
||||||
dev-python/ensurepip-pip
|
|
||||||
dev-python/ensurepip-setuptools
|
|
||||||
dev-python/ensurepip-wheel
|
|
||||||
)
|
|
||||||
valgrind? ( dev-debug/valgrind )
|
valgrind? ( dev-debug/valgrind )
|
||||||
"
|
"
|
||||||
# autoconf-archive needed to eautoreconf
|
# autoconf-archive needed to eautoreconf
|
||||||
@ -89,13 +80,7 @@ BDEPEND="
|
|||||||
dev-build/autoconf-archive
|
dev-build/autoconf-archive
|
||||||
app-alternatives/awk
|
app-alternatives/awk
|
||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
jit? (
|
verify-sig? ( sec-keys/openpgp-keys-python )
|
||||||
$(llvm_gen_dep '
|
|
||||||
sys-devel/clang:${LLVM_SLOT}
|
|
||||||
sys-devel/llvm:${LLVM_SLOT}
|
|
||||||
')
|
|
||||||
)
|
|
||||||
verify-sig? ( >=sec-keys/openpgp-keys-python-20221025 )
|
|
||||||
"
|
"
|
||||||
RDEPEND+="
|
RDEPEND+="
|
||||||
!build? ( app-misc/mime-types )
|
!build? ( app-misc/mime-types )
|
||||||
@ -117,18 +102,9 @@ QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags )
|
|||||||
|
|
||||||
pkg_pretend() {
|
pkg_pretend() {
|
||||||
use test && check-reqs_pkg_pretend
|
use test && check-reqs_pkg_pretend
|
||||||
|
|
||||||
if ! use gil || use jit; then
|
|
||||||
ewarn "USE=-gil and USE=jit flags are considered experimental upstream. Using"
|
|
||||||
ewarn "them could lead to unexpected breakage, including race conditions"
|
|
||||||
ewarn "and crashes, respectively. Please do not file Gentoo bugs, unless"
|
|
||||||
ewarn "you can reproduce the problem with dev-lang/python[gil,-jit]. Instead,"
|
|
||||||
ewarn "please consider reporting freethreading / JIT problems upstream."
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_setup() {
|
pkg_setup() {
|
||||||
use jit && llvm-r1_pkg_setup
|
|
||||||
use test && check-reqs_pkg_setup
|
use test && check-reqs_pkg_setup
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +117,8 @@ src_unpack() {
|
|||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
# Ensure that internal copies of expat and libffi are not used.
|
# Ensure that internal copies of expat and libffi are not used.
|
||||||
# TODO: Makefile has annoying deps on expat headers
|
rm -r Modules/expat || die
|
||||||
#rm -r Modules/expat || die
|
rm -r Modules/_ctypes/libffi* || die
|
||||||
|
|
||||||
local PATCHES=(
|
local PATCHES=(
|
||||||
"${WORKDIR}/${PATCHSET}"
|
"${WORKDIR}/${PATCHSET}"
|
||||||
@ -150,12 +126,14 @@ src_prepare() {
|
|||||||
|
|
||||||
default
|
default
|
||||||
|
|
||||||
|
# https://bugs.gentoo.org/850151
|
||||||
|
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die
|
||||||
|
|
||||||
# force the correct number of jobs
|
# force the correct number of jobs
|
||||||
# https://bugs.gentoo.org/737660
|
# https://bugs.gentoo.org/737660
|
||||||
sed -i -e "s:-j0:-j$(makeopts_jobs):" Makefile.pre.in || die
|
local jobs=$(makeopts_jobs)
|
||||||
|
sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
|
||||||
# breaks tests when using --with-wheel-pkg-dir
|
sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
|
||||||
rm -r Lib/test/wheeldata || die
|
|
||||||
|
|
||||||
eautoreconf
|
eautoreconf
|
||||||
}
|
}
|
||||||
@ -194,33 +172,33 @@ build_cbuild_python() {
|
|||||||
|
|
||||||
mkdir "${WORKDIR}"/${P}-${CBUILD} || die
|
mkdir "${WORKDIR}"/${P}-${CBUILD} || die
|
||||||
pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || 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+=" _ctypes _crypt" \
|
||||||
|
ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
|
||||||
|
|
||||||
# Avoid as many dependencies as possible for the cross build.
|
# Avoid as many dependencies as possible for the cross build.
|
||||||
mkdir Modules || die
|
cat >> Makefile <<-EOF || die
|
||||||
cat > Modules/Setup.local <<-EOF || die
|
MODULE_NIS_STATE=disabled
|
||||||
*disabled*
|
MODULE__DBM_STATE=disabled
|
||||||
nis
|
MODULE__GDBM_STATE=disabled
|
||||||
_dbm _gdbm
|
MODULE__DBM_STATE=disabled
|
||||||
_sqlite3
|
MODULE__SQLITE3_STATE=disabled
|
||||||
_hashlib _ssl
|
MODULE__HASHLIB_STATE=disabled
|
||||||
_curses _curses_panel
|
MODULE__SSL_STATE=disabled
|
||||||
readline
|
MODULE__CURSES_STATE=disabled
|
||||||
_tkinter
|
MODULE__CURSES_PANEL_STATE=disabled
|
||||||
pyexpat
|
MODULE_READLINE_STATE=disabled
|
||||||
zlib
|
MODULE__TKINTER_STATE=disabled
|
||||||
# We disabled these for CBUILD because Python's setup.py can't handle locating
|
MODULE_PYEXPAT_STATE=disabled
|
||||||
# libdir correctly for cross. This should be rechecked for the pure Makefile approach,
|
MODULE_ZLIB_STATE=disabled
|
||||||
# and uncommented if needed.
|
|
||||||
#_ctypes _crypt
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}"
|
|
||||||
|
|
||||||
# Unfortunately, we do have to build this immediately, and
|
# Unfortunately, we do have to build this immediately, and
|
||||||
# not in src_compile, because CHOST configure for Python
|
# not in src_compile, because CHOST configure for Python
|
||||||
# will check the existence of the --with-build-python value
|
# will check the existence of the --with-build-python value
|
||||||
# immediately.
|
# immediately.
|
||||||
emake
|
PYTHON_DISABLE_MODULES+=" _ctypes _crypt" emake
|
||||||
popd &> /dev/null || die
|
popd &> /dev/null || die
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,105 +220,25 @@ src_configure() {
|
|||||||
dbmliborder+="${dbmliborder:+:}gdbm"
|
dbmliborder+="${dbmliborder:+:}gdbm"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set baseline test skip flags.
|
|
||||||
COMMON_TEST_SKIPS=(
|
|
||||||
# failures
|
|
||||||
-x test_concurrent_futures
|
|
||||||
-x test_gdb
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
mips*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
-x test_statistics
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
powerpc64-*) # big endian
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_descr
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
riscv*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_urllib2
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
sparc*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
# bug 788022
|
|
||||||
-x test_multiprocessing_fork
|
|
||||||
-x test_multiprocessing_forkserver
|
|
||||||
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_descr
|
|
||||||
# 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
|
if use pgo; then
|
||||||
local profile_task_flags=(
|
local profile_task_flags=(
|
||||||
-m test
|
-m test
|
||||||
"-j$(makeopts_jobs)"
|
"-j$(makeopts_jobs)"
|
||||||
--pgo-extended
|
--pgo-extended
|
||||||
--verbose3
|
|
||||||
-u-network
|
-u-network
|
||||||
|
|
||||||
# We use a timeout because of how often we've had hang issues
|
# We use a timeout because of how often we've had hang issues
|
||||||
# here. It also matches the default upstream PROFILE_TASK.
|
# here. It also matches the default upstream PROFILE_TASK.
|
||||||
--timeout 1200
|
--timeout 1200
|
||||||
|
|
||||||
"${COMMON_TEST_SKIPS[@]}"
|
-x test_gdb
|
||||||
|
|
||||||
-x test_dtrace
|
-x test_dtrace
|
||||||
|
|
||||||
# All of these seem to occasionally hang for PGO inconsistently
|
# All of these seem to occasionally hang for PGO inconsistently
|
||||||
# They'll even hang here but be fine in src_test sometimes.
|
# They'll even hang here but be fine in src_test sometimes.
|
||||||
# bug #828535 (and related: bug #788022)
|
# bug #828535 (and related: bug #788022)
|
||||||
-x test_asyncio
|
-x test_asyncio
|
||||||
|
-x test_concurrent_futures
|
||||||
-x test_httpservers
|
-x test_httpservers
|
||||||
-x test_logging
|
-x test_logging
|
||||||
-x test_multiprocessing_fork
|
-x test_multiprocessing_fork
|
||||||
@ -350,43 +248,23 @@ src_configure() {
|
|||||||
# Hangs (actually runs indefinitely executing itself w/ many cpython builds)
|
# Hangs (actually runs indefinitely executing itself w/ many cpython builds)
|
||||||
# bug #900429
|
# bug #900429
|
||||||
-x test_tools
|
-x test_tools
|
||||||
|
|
||||||
# Fails in profiling run, passes in src_test().
|
|
||||||
-x test_capi
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Arch-specific skips. See #931888 for a collection of these.
|
# musl-specific skips
|
||||||
case ${CHOST} in
|
use elibc_musl && profile_task_flags+=(
|
||||||
alpha*)
|
# various musl locale deficiencies
|
||||||
profile_task_flags+=(
|
-x test__locale
|
||||||
-x test_os
|
-x test_c_locale_coercion
|
||||||
)
|
-x test_locale
|
||||||
;;
|
-x test_re
|
||||||
hppa*)
|
|
||||||
profile_task_flags+=(
|
# known issues with find_library on musl
|
||||||
-x test_descr
|
# https://bugs.python.org/issue21622
|
||||||
# bug 931908
|
-x test_ctypes
|
||||||
-x test_exceptions
|
|
||||||
-x test_os
|
# fpathconf, ttyname errno values
|
||||||
)
|
-x test_os
|
||||||
;;
|
)
|
||||||
ia64*)
|
|
||||||
profile_task_flags+=(
|
|
||||||
-x test_signal
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
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
|
if has_version "app-arch/rpm" ; then
|
||||||
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
|
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
|
||||||
@ -415,19 +293,21 @@ src_configure() {
|
|||||||
--without-ensurepip
|
--without-ensurepip
|
||||||
--without-lto
|
--without-lto
|
||||||
--with-system-expat
|
--with-system-expat
|
||||||
|
--with-system-ffi
|
||||||
--with-system-libmpdec
|
--with-system-libmpdec
|
||||||
--with-platlibdir=lib
|
--with-platlibdir=lib
|
||||||
--with-pkg-config=yes
|
--with-pkg-config=yes
|
||||||
--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
|
--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
|
||||||
|
|
||||||
$(use_with debug assertions)
|
$(use_with debug assertions)
|
||||||
$(use_enable gil)
|
|
||||||
$(use_enable jit experimental-jit)
|
|
||||||
$(use_enable pgo optimizations)
|
$(use_enable pgo optimizations)
|
||||||
$(use_with readline readline "$(usex libedit editline readline)")
|
$(use_with readline readline "$(usex libedit editline readline)")
|
||||||
$(use_with valgrind)
|
$(use_with valgrind)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# disable implicit optimization/debugging flags
|
||||||
|
local -x OPT=
|
||||||
|
|
||||||
# https://bugs.gentoo.org/700012
|
# https://bugs.gentoo.org/700012
|
||||||
if tc-is-lto; then
|
if tc-is-lto; then
|
||||||
append-cflags $(test-flags-CC -ffat-lto-objects)
|
append-cflags $(test-flags-CC -ffat-lto-objects)
|
||||||
@ -436,22 +316,6 @@ src_configure() {
|
|||||||
)
|
)
|
||||||
fi
|
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')
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# disable implicit optimization/debugging flags
|
|
||||||
local -x OPT=
|
|
||||||
|
|
||||||
if tc-is-cross-compiler ; then
|
if tc-is-cross-compiler ; then
|
||||||
build_cbuild_python
|
build_cbuild_python
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
@ -472,6 +336,7 @@ src_configure() {
|
|||||||
append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
|
append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
hprefixify setup.py
|
||||||
econf "${myeconfargs[@]}"
|
econf "${myeconfargs[@]}"
|
||||||
|
|
||||||
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
|
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
|
||||||
@ -480,6 +345,20 @@ src_configure() {
|
|||||||
die "Broken sem_open function (bug 496328)"
|
die "Broken sem_open function (bug 496328)"
|
||||||
fi
|
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
|
# install epython.py as part of stdlib
|
||||||
echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die
|
echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die
|
||||||
}
|
}
|
||||||
@ -488,6 +367,9 @@ src_compile() {
|
|||||||
# Ensure sed works as expected
|
# Ensure sed works as expected
|
||||||
# https://bugs.gentoo.org/594768
|
# https://bugs.gentoo.org/594768
|
||||||
local -x LC_ALL=C
|
local -x LC_ALL=C
|
||||||
|
# Prevent using distutils bundled by setuptools.
|
||||||
|
# https://bugs.gentoo.org/823728
|
||||||
|
export SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||||
export PYTHONSTRICTEXTENSIONBUILD=1
|
export PYTHONSTRICTEXTENSIONBUILD=1
|
||||||
|
|
||||||
# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
|
# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
|
||||||
@ -500,7 +382,7 @@ src_compile() {
|
|||||||
local -x COLUMNS=80
|
local -x COLUMNS=80
|
||||||
local -x PYTHONDONTWRITEBYTECODE=
|
local -x PYTHONDONTWRITEBYTECODE=
|
||||||
|
|
||||||
addwrite "/usr/lib/python${PYVER}/site-packages"
|
addpredict "/usr/lib/python${PYVER}/site-packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# also need to clear the flags explicitly here or they end up
|
# also need to clear the flags explicitly here or they end up
|
||||||
@ -531,10 +413,36 @@ src_test() {
|
|||||||
local -x LOGNAME=buildbot
|
local -x LOGNAME=buildbot
|
||||||
|
|
||||||
local test_opts=(
|
local test_opts=(
|
||||||
--verbose3
|
|
||||||
-u-network
|
-u-network
|
||||||
-j "$(makeopts_jobs)"
|
-j "$(makeopts_jobs)"
|
||||||
"${COMMON_TEST_SKIPS[@]}"
|
|
||||||
|
# fails
|
||||||
|
-x test_concurrent_futures
|
||||||
|
-x test_gdb
|
||||||
|
)
|
||||||
|
|
||||||
|
if use sparc ; then
|
||||||
|
# bug #788022
|
||||||
|
test_opts+=(
|
||||||
|
-x test_multiprocessing_fork
|
||||||
|
-x test_multiprocessing_forkserver
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# musl-specific skips
|
||||||
|
use elibc_musl && test_opts+=(
|
||||||
|
# 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
|
||||||
)
|
)
|
||||||
|
|
||||||
# workaround docutils breaking tests
|
# workaround docutils breaking tests
|
||||||
@ -560,10 +468,6 @@ src_test() {
|
|||||||
src_install() {
|
src_install() {
|
||||||
local libdir=${ED}/usr/lib/python${PYVER}
|
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
|
# -j1 hack for now for bug #843458
|
||||||
emake -j1 DESTDIR="${D}" altinstall
|
emake -j1 DESTDIR="${D}" altinstall
|
||||||
|
|
||||||
@ -643,7 +547,8 @@ src_install() {
|
|||||||
EOF
|
EOF
|
||||||
chmod +x "${scriptdir}/python${pymajor}-config" || die
|
chmod +x "${scriptdir}/python${pymajor}-config" || die
|
||||||
ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die
|
ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die
|
||||||
# pydoc
|
# 2to3, pydoc
|
||||||
|
ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die
|
||||||
ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die
|
ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die
|
||||||
# idle
|
# idle
|
||||||
if use tk; then
|
if use tk; then
|
@ -28,7 +28,7 @@ S="${WORKDIR}/${MY_P}"
|
|||||||
|
|
||||||
LICENSE="PSF-2"
|
LICENSE="PSF-2"
|
||||||
SLOT="${PYVER}"
|
SLOT="${PYVER}"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc ~x86"
|
KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||||
IUSE="
|
IUSE="
|
||||||
bluetooth build debug +ensurepip examples gdbm libedit
|
bluetooth build debug +ensurepip examples gdbm libedit
|
||||||
+ncurses pgo +readline +sqlite +ssl test tk valgrind
|
+ncurses pgo +readline +sqlite +ssl test tk valgrind
|
@ -1,659 +0,0 @@
|
|||||||
# Copyright 1999-2024 Gentoo Authors
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="8"
|
|
||||||
|
|
||||||
LLVM_COMPAT=( 18 )
|
|
||||||
LLVM_OPTIONAL=1
|
|
||||||
WANT_LIBTOOL="none"
|
|
||||||
|
|
||||||
inherit autotools check-reqs flag-o-matic llvm-r1 multiprocessing
|
|
||||||
inherit pax-utils python-utils-r1 toolchain-funcs verify-sig
|
|
||||||
|
|
||||||
MY_PV=${PV/_beta/b}
|
|
||||||
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 +gil jit
|
|
||||||
libedit +ncurses pgo +readline +sqlite +ssl test tk valgrind
|
|
||||||
"
|
|
||||||
REQUIRED_USE="jit? ( ${LLVM_REQUIRED_USE} )"
|
|
||||||
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
|
|
||||||
)
|
|
||||||
"
|
|
||||||
# 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
|
|
||||||
jit? (
|
|
||||||
$(llvm_gen_dep '
|
|
||||||
sys-devel/clang:${LLVM_SLOT}
|
|
||||||
sys-devel/llvm:${LLVM_SLOT}
|
|
||||||
')
|
|
||||||
)
|
|
||||||
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
|
|
||||||
|
|
||||||
if ! use gil || use jit; then
|
|
||||||
ewarn "USE=-gil and USE=jit flags are considered experimental upstream. Using"
|
|
||||||
ewarn "them could lead to unexpected breakage, including race conditions"
|
|
||||||
ewarn "and crashes, respectively. Please do not file Gentoo bugs, unless"
|
|
||||||
ewarn "you can reproduce the problem with dev-lang/python[gil,-jit]. Instead,"
|
|
||||||
ewarn "please consider reporting freethreading / JIT problems upstream."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
use jit && llvm-r1_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
|
|
||||||
|
|
||||||
# breaks tests when using --with-wheel-pkg-dir
|
|
||||||
rm -r Lib/test/wheeldata || 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() {
|
|
||||||
# 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=(
|
|
||||||
# failures
|
|
||||||
-x test_concurrent_futures
|
|
||||||
-x test_gdb
|
|
||||||
# test_asyncio_repl_is_ok is flaky
|
|
||||||
# https://github.com/python/cpython/issues/119909
|
|
||||||
-x test_repl
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
mips*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
-x test_statistics
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
powerpc64-*) # big endian
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_descr
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
riscv*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_urllib2
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
sparc*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
# bug 788022
|
|
||||||
-x test_multiprocessing_fork
|
|
||||||
-x test_multiprocessing_forkserver
|
|
||||||
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_descr
|
|
||||||
# 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
|
|
||||||
--verbose3
|
|
||||||
-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_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
|
|
||||||
|
|
||||||
# Fails in profiling run, passes in src_test().
|
|
||||||
-x test_capi
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
profile_task_flags+=(
|
|
||||||
-x test_signal
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
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
|
|
||||||
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
|
|
||||||
--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 gil)
|
|
||||||
$(use_enable jit experimental-jit)
|
|
||||||
$(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')
|
|
||||||
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}
|
|
||||||
|
|
||||||
# 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=
|
|
||||||
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=
|
|
||||||
|
|
||||||
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}
|
|
||||||
|
|
||||||
# -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
|
|
||||||
# pydoc
|
|
||||||
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.13.0_beta2; then
|
|
||||||
ewarn "Python 3.13.0b2 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.13 modules, e.g. using:"
|
|
||||||
ewarn
|
|
||||||
ewarn " emerge -1v /usr/lib/python3.13/site-packages"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
@ -1,659 +0,0 @@
|
|||||||
# Copyright 1999-2024 Gentoo Authors
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="8"
|
|
||||||
|
|
||||||
LLVM_COMPAT=( 18 )
|
|
||||||
LLVM_OPTIONAL=1
|
|
||||||
WANT_LIBTOOL="none"
|
|
||||||
|
|
||||||
inherit autotools check-reqs flag-o-matic llvm-r1 multiprocessing
|
|
||||||
inherit pax-utils python-utils-r1 toolchain-funcs verify-sig
|
|
||||||
|
|
||||||
MY_PV=${PV/_beta/b}
|
|
||||||
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 +gil jit
|
|
||||||
libedit +ncurses pgo +readline +sqlite +ssl test tk valgrind
|
|
||||||
"
|
|
||||||
REQUIRED_USE="jit? ( ${LLVM_REQUIRED_USE} )"
|
|
||||||
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
|
|
||||||
)
|
|
||||||
"
|
|
||||||
# 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
|
|
||||||
jit? (
|
|
||||||
$(llvm_gen_dep '
|
|
||||||
sys-devel/clang:${LLVM_SLOT}
|
|
||||||
sys-devel/llvm:${LLVM_SLOT}
|
|
||||||
')
|
|
||||||
)
|
|
||||||
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
|
|
||||||
|
|
||||||
if ! use gil || use jit; then
|
|
||||||
ewarn "USE=-gil and USE=jit flags are considered experimental upstream. Using"
|
|
||||||
ewarn "them could lead to unexpected breakage, including race conditions"
|
|
||||||
ewarn "and crashes, respectively. Please do not file Gentoo bugs, unless"
|
|
||||||
ewarn "you can reproduce the problem with dev-lang/python[gil,-jit]. Instead,"
|
|
||||||
ewarn "please consider reporting freethreading / JIT problems upstream."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
use jit && llvm-r1_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
|
|
||||||
|
|
||||||
# breaks tests when using --with-wheel-pkg-dir
|
|
||||||
rm -r Lib/test/wheeldata || 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() {
|
|
||||||
# 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=(
|
|
||||||
# failures
|
|
||||||
-x test_concurrent_futures
|
|
||||||
-x test_gdb
|
|
||||||
# test_asyncio_repl_is_ok is flaky
|
|
||||||
# https://github.com/python/cpython/issues/119909
|
|
||||||
-x test_repl
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
mips*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
-x test_statistics
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
powerpc64-*) # big endian
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_descr
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
riscv*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_urllib2
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
sparc*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
# bug 788022
|
|
||||||
-x test_multiprocessing_fork
|
|
||||||
-x test_multiprocessing_forkserver
|
|
||||||
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_descr
|
|
||||||
# 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
|
|
||||||
--verbose3
|
|
||||||
-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_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
|
|
||||||
|
|
||||||
# Fails in profiling run, passes in src_test().
|
|
||||||
-x test_capi
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
profile_task_flags+=(
|
|
||||||
-x test_signal
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
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
|
|
||||||
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
|
|
||||||
--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 gil)
|
|
||||||
$(use_enable jit experimental-jit)
|
|
||||||
$(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')
|
|
||||||
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}
|
|
||||||
|
|
||||||
# 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=
|
|
||||||
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=
|
|
||||||
|
|
||||||
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}
|
|
||||||
|
|
||||||
# -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
|
|
||||||
# pydoc
|
|
||||||
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.13.0_beta2; then
|
|
||||||
ewarn "Python 3.13.0b2 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.13 modules, e.g. using:"
|
|
||||||
ewarn
|
|
||||||
ewarn " emerge -1v /usr/lib/python3.13/site-packages"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
@ -1,659 +0,0 @@
|
|||||||
# Copyright 1999-2024 Gentoo Authors
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="8"
|
|
||||||
|
|
||||||
LLVM_COMPAT=( 18 )
|
|
||||||
LLVM_OPTIONAL=1
|
|
||||||
WANT_LIBTOOL="none"
|
|
||||||
|
|
||||||
inherit autotools check-reqs flag-o-matic llvm-r1 multiprocessing
|
|
||||||
inherit pax-utils python-utils-r1 toolchain-funcs verify-sig
|
|
||||||
|
|
||||||
MY_PV=${PV/_beta/b}
|
|
||||||
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 +gil jit
|
|
||||||
libedit +ncurses pgo +readline +sqlite +ssl test tk valgrind
|
|
||||||
"
|
|
||||||
REQUIRED_USE="jit? ( ${LLVM_REQUIRED_USE} )"
|
|
||||||
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
|
|
||||||
)
|
|
||||||
"
|
|
||||||
# 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
|
|
||||||
jit? (
|
|
||||||
$(llvm_gen_dep '
|
|
||||||
sys-devel/clang:${LLVM_SLOT}
|
|
||||||
sys-devel/llvm:${LLVM_SLOT}
|
|
||||||
')
|
|
||||||
)
|
|
||||||
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
|
|
||||||
|
|
||||||
if ! use gil || use jit; then
|
|
||||||
ewarn "USE=-gil and USE=jit flags are considered experimental upstream. Using"
|
|
||||||
ewarn "them could lead to unexpected breakage, including race conditions"
|
|
||||||
ewarn "and crashes, respectively. Please do not file Gentoo bugs, unless"
|
|
||||||
ewarn "you can reproduce the problem with dev-lang/python[gil,-jit]. Instead,"
|
|
||||||
ewarn "please consider reporting freethreading / JIT problems upstream."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
use jit && llvm-r1_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
|
|
||||||
|
|
||||||
# breaks tests when using --with-wheel-pkg-dir
|
|
||||||
rm -r Lib/test/wheeldata || 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() {
|
|
||||||
# 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=(
|
|
||||||
# failures
|
|
||||||
-x test_concurrent_futures
|
|
||||||
-x test_gdb
|
|
||||||
# test_asyncio_repl_is_ok is flaky
|
|
||||||
# https://github.com/python/cpython/issues/119909
|
|
||||||
-x test_repl
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
mips*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
-x test_statistics
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
powerpc64-*) # big endian
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_descr
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
riscv*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_urllib2
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
sparc*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
# bug 788022
|
|
||||||
-x test_multiprocessing_fork
|
|
||||||
-x test_multiprocessing_forkserver
|
|
||||||
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_descr
|
|
||||||
# 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
|
|
||||||
--verbose3
|
|
||||||
-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_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
|
|
||||||
|
|
||||||
# Fails in profiling run, passes in src_test().
|
|
||||||
-x test_capi
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
profile_task_flags+=(
|
|
||||||
-x test_signal
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
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
|
|
||||||
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
|
|
||||||
--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 gil)
|
|
||||||
$(use_enable jit experimental-jit)
|
|
||||||
$(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')
|
|
||||||
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}
|
|
||||||
|
|
||||||
# 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=
|
|
||||||
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=
|
|
||||||
|
|
||||||
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}
|
|
||||||
|
|
||||||
# -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
|
|
||||||
# pydoc
|
|
||||||
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.13.0_beta2; then
|
|
||||||
ewarn "Python 3.13.0b2 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.13 modules, e.g. using:"
|
|
||||||
ewarn
|
|
||||||
ewarn " emerge -1v /usr/lib/python3.13/site-packages"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
@ -1,658 +0,0 @@
|
|||||||
# Copyright 1999-2024 Gentoo Authors
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="8"
|
|
||||||
|
|
||||||
LLVM_COMPAT=( 18 )
|
|
||||||
LLVM_OPTIONAL=1
|
|
||||||
WANT_LIBTOOL="none"
|
|
||||||
|
|
||||||
inherit autotools check-reqs flag-o-matic llvm-r1 multiprocessing
|
|
||||||
inherit pax-utils python-utils-r1 toolchain-funcs verify-sig
|
|
||||||
|
|
||||||
MY_PV=${PV/_beta/b}
|
|
||||||
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 +gil jit
|
|
||||||
libedit +ncurses pgo +readline +sqlite +ssl test tk valgrind
|
|
||||||
"
|
|
||||||
REQUIRED_USE="jit? ( ${LLVM_REQUIRED_USE} )"
|
|
||||||
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
|
|
||||||
)
|
|
||||||
"
|
|
||||||
# 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
|
|
||||||
jit? (
|
|
||||||
$(llvm_gen_dep '
|
|
||||||
sys-devel/clang:${LLVM_SLOT}
|
|
||||||
sys-devel/llvm:${LLVM_SLOT}
|
|
||||||
')
|
|
||||||
)
|
|
||||||
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
|
|
||||||
|
|
||||||
if ! use gil || use jit; then
|
|
||||||
ewarn "USE=-gil and USE=jit flags are considered experimental upstream. Using"
|
|
||||||
ewarn "them could lead to unexpected breakage, including race conditions"
|
|
||||||
ewarn "and crashes, respectively. Please do not file Gentoo bugs, unless"
|
|
||||||
ewarn "you can reproduce the problem with dev-lang/python[gil,-jit]. Instead,"
|
|
||||||
ewarn "please consider reporting freethreading / JIT problems upstream."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
use jit && llvm-r1_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
|
|
||||||
|
|
||||||
# breaks tests when using --with-wheel-pkg-dir
|
|
||||||
rm -r Lib/test/wheeldata || 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() {
|
|
||||||
# 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=(
|
|
||||||
# failures
|
|
||||||
-x test_concurrent_futures
|
|
||||||
-x test_gdb
|
|
||||||
# flaky: https://github.com/python/cpython/issues/121973
|
|
||||||
-x test_pyrepl
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
mips*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
-x test_statistics
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
powerpc64-*) # big endian
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_descr
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
riscv*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_urllib2
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
sparc*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
# bug 788022
|
|
||||||
-x test_multiprocessing_fork
|
|
||||||
-x test_multiprocessing_forkserver
|
|
||||||
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_descr
|
|
||||||
# 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
|
|
||||||
--verbose3
|
|
||||||
-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_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
|
|
||||||
|
|
||||||
# Fails in profiling run, passes in src_test().
|
|
||||||
-x test_capi
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
profile_task_flags+=(
|
|
||||||
-x test_signal
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
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
|
|
||||||
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
|
|
||||||
--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 gil)
|
|
||||||
$(use_enable jit experimental-jit)
|
|
||||||
$(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')
|
|
||||||
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}
|
|
||||||
|
|
||||||
# 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=
|
|
||||||
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=
|
|
||||||
|
|
||||||
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}
|
|
||||||
|
|
||||||
# -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
|
|
||||||
# pydoc
|
|
||||||
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.13.0_beta2; then
|
|
||||||
ewarn "Python 3.13.0b2 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.13 modules, e.g. using:"
|
|
||||||
ewarn
|
|
||||||
ewarn " emerge -1v /usr/lib/python3.13/site-packages"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
432
sdk_container/src/third_party/portage-stable/dev-lang/python/python-3.8.19_p4.ebuild
vendored
Normal file
432
sdk_container/src/third_party/portage-stable/dev-lang/python/python-3.8.19_p4.ebuild
vendored
Normal file
@ -0,0 +1,432 @@
|
|||||||
|
# Copyright 1999-2024 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
EAPI="8"
|
||||||
|
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 +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:=
|
||||||
|
>=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-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
|
||||||
|
)
|
||||||
|
"
|
||||||
|
# bluetooth requires headers from bluez
|
||||||
|
DEPEND="
|
||||||
|
${RDEPEND}
|
||||||
|
bluetooth? ( net-wireless/bluez )
|
||||||
|
test? ( app-arch/xz-utils )
|
||||||
|
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 )
|
||||||
|
"
|
||||||
|
RDEPEND+="
|
||||||
|
!build? ( app-misc/mime-types )
|
||||||
|
"
|
||||||
|
|
||||||
|
VERIFY_SIG_OPENPGP_KEY_PATH=/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
|
||||||
|
|
||||||
|
rm Lib/distutils/command/wininst*.exe || 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"
|
||||||
|
export PYTHON_DISABLE_MODULES="${disable}"
|
||||||
|
|
||||||
|
if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
|
||||||
|
einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
--without-lto
|
||||||
|
--with-system-expat
|
||||||
|
--with-system-ffi
|
||||||
|
--with-system-libmpdec
|
||||||
|
--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
|
||||||
|
|
||||||
|
$(use_with debug assertions)
|
||||||
|
$(use_with valgrind)
|
||||||
|
)
|
||||||
|
|
||||||
|
# disable implicit optimization/debugging flags
|
||||||
|
local -x OPT=
|
||||||
|
|
||||||
|
# https://bugs.gentoo.org/700012
|
||||||
|
if tc-is-lto; then
|
||||||
|
append-cflags $(test-flags-CC -ffat-lto-objects)
|
||||||
|
myeconfargs+=(
|
||||||
|
--with-lto
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if tc-is-cross-compiler ; then
|
||||||
|
# Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
|
||||||
|
local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi)
|
||||||
|
|
||||||
|
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
|
||||||
|
# propagated to sysconfig for built extensions
|
||||||
|
#
|
||||||
|
# -fno-lto to avoid bug #700012 (not like it matters for mini-CBUILD Python anyway)
|
||||||
|
local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto"
|
||||||
|
local -x LDFLAGS_NODIST=${BUILD_LDFLAGS}
|
||||||
|
local -x CFLAGS= LDFLAGS=
|
||||||
|
local -x BUILD_CFLAGS="${CFLAGS_NODIST}"
|
||||||
|
local -x BUILD_LDFLAGS=${LDFLAGS_NODIST}
|
||||||
|
|
||||||
|
# We need to build our own Python on CBUILD first, and feed it in.
|
||||||
|
# bug #847910 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_concurrent_futures
|
||||||
|
-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 -Onone 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
|
||||||
|
}
|
@ -2,15 +2,12 @@
|
|||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI="8"
|
EAPI="8"
|
||||||
|
|
||||||
LLVM_COMPAT=( 18 )
|
|
||||||
LLVM_OPTIONAL=1
|
|
||||||
WANT_LIBTOOL="none"
|
WANT_LIBTOOL="none"
|
||||||
|
|
||||||
inherit autotools check-reqs flag-o-matic llvm-r1 multiprocessing
|
inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
|
||||||
inherit pax-utils python-utils-r1 toolchain-funcs verify-sig
|
inherit prefix python-utils-r1 toolchain-funcs verify-sig
|
||||||
|
|
||||||
MY_PV=${PV/_}
|
MY_PV=${PV/_rc/rc}
|
||||||
MY_P="Python-${MY_PV%_p*}"
|
MY_P="Python-${MY_PV%_p*}"
|
||||||
PYVER=$(ver_cut 1-2)
|
PYVER=$(ver_cut 1-2)
|
||||||
PATCHSET="python-gentoo-patches-${MY_PV}"
|
PATCHSET="python-gentoo-patches-${MY_PV}"
|
||||||
@ -33,10 +30,9 @@ LICENSE="PSF-2"
|
|||||||
SLOT="${PYVER}"
|
SLOT="${PYVER}"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||||
IUSE="
|
IUSE="
|
||||||
bluetooth build +debug +ensurepip examples gdbm +gil jit
|
bluetooth build debug +ensurepip examples gdbm +ncurses pgo
|
||||||
libedit +ncurses pgo +readline +sqlite +ssl test tk valgrind
|
+readline +sqlite +ssl test tk valgrind
|
||||||
"
|
"
|
||||||
REQUIRED_USE="jit? ( ${LLVM_REQUIRED_USE} )"
|
|
||||||
RESTRICT="!test? ( test )"
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
# Do not add a dependency on dev-lang/python to this ebuild.
|
# Do not add a dependency on dev-lang/python to this ebuild.
|
||||||
@ -47,7 +43,6 @@ RESTRICT="!test? ( test )"
|
|||||||
RDEPEND="
|
RDEPEND="
|
||||||
app-arch/bzip2:=
|
app-arch/bzip2:=
|
||||||
app-arch/xz-utils:=
|
app-arch/xz-utils:=
|
||||||
app-crypt/libb2
|
|
||||||
>=dev-libs/expat-2.1:=
|
>=dev-libs/expat-2.1:=
|
||||||
dev-libs/libffi:=
|
dev-libs/libffi:=
|
||||||
dev-libs/mpdecimal:=
|
dev-libs/mpdecimal:=
|
||||||
@ -55,14 +50,11 @@ RDEPEND="
|
|||||||
>=sys-libs/zlib-1.1.3:=
|
>=sys-libs/zlib-1.1.3:=
|
||||||
virtual/libcrypt:=
|
virtual/libcrypt:=
|
||||||
virtual/libintl
|
virtual/libintl
|
||||||
ensurepip? ( dev-python/ensurepip-pip )
|
ensurepip? ( dev-python/ensurepip-wheels )
|
||||||
gdbm? ( sys-libs/gdbm:=[berkdb] )
|
gdbm? ( sys-libs/gdbm:=[berkdb] )
|
||||||
kernel_linux? ( sys-apps/util-linux:= )
|
kernel_linux? ( sys-apps/util-linux:= )
|
||||||
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
||||||
readline? (
|
readline? ( >=sys-libs/readline-4.1:= )
|
||||||
!libedit? ( >=sys-libs/readline-4.1:= )
|
|
||||||
libedit? ( dev-libs/libedit:= )
|
|
||||||
)
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.3.8:3= )
|
sqlite? ( >=dev-db/sqlite-3.3.8:3= )
|
||||||
ssl? ( >=dev-libs/openssl-1.1.1:= )
|
ssl? ( >=dev-libs/openssl-1.1.1:= )
|
||||||
tk? (
|
tk? (
|
||||||
@ -76,12 +68,7 @@ RDEPEND="
|
|||||||
DEPEND="
|
DEPEND="
|
||||||
${RDEPEND}
|
${RDEPEND}
|
||||||
bluetooth? ( net-wireless/bluez )
|
bluetooth? ( net-wireless/bluez )
|
||||||
test? (
|
test? ( app-arch/xz-utils )
|
||||||
app-arch/xz-utils
|
|
||||||
dev-python/ensurepip-pip
|
|
||||||
dev-python/ensurepip-setuptools
|
|
||||||
dev-python/ensurepip-wheel
|
|
||||||
)
|
|
||||||
valgrind? ( dev-debug/valgrind )
|
valgrind? ( dev-debug/valgrind )
|
||||||
"
|
"
|
||||||
# autoconf-archive needed to eautoreconf
|
# autoconf-archive needed to eautoreconf
|
||||||
@ -89,22 +76,11 @@ BDEPEND="
|
|||||||
dev-build/autoconf-archive
|
dev-build/autoconf-archive
|
||||||
app-alternatives/awk
|
app-alternatives/awk
|
||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
jit? (
|
verify-sig? ( sec-keys/openpgp-keys-python )
|
||||||
$(llvm_gen_dep '
|
|
||||||
sys-devel/clang:${LLVM_SLOT}
|
|
||||||
sys-devel/llvm:${LLVM_SLOT}
|
|
||||||
')
|
|
||||||
)
|
|
||||||
verify-sig? ( >=sec-keys/openpgp-keys-python-20221025 )
|
|
||||||
"
|
"
|
||||||
RDEPEND+="
|
RDEPEND+="
|
||||||
!build? ( app-misc/mime-types )
|
!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
|
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc
|
||||||
|
|
||||||
@ -117,18 +93,9 @@ QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags )
|
|||||||
|
|
||||||
pkg_pretend() {
|
pkg_pretend() {
|
||||||
use test && check-reqs_pkg_pretend
|
use test && check-reqs_pkg_pretend
|
||||||
|
|
||||||
if ! use gil || use jit; then
|
|
||||||
ewarn "USE=-gil and USE=jit flags are considered experimental upstream. Using"
|
|
||||||
ewarn "them could lead to unexpected breakage, including race conditions"
|
|
||||||
ewarn "and crashes, respectively. Please do not file Gentoo bugs, unless"
|
|
||||||
ewarn "you can reproduce the problem with dev-lang/python[gil,-jit]. Instead,"
|
|
||||||
ewarn "please consider reporting freethreading / JIT problems upstream."
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_setup() {
|
pkg_setup() {
|
||||||
use jit && llvm-r1_pkg_setup
|
|
||||||
use test && check-reqs_pkg_setup
|
use test && check-reqs_pkg_setup
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +108,8 @@ src_unpack() {
|
|||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
# Ensure that internal copies of expat and libffi are not used.
|
# Ensure that internal copies of expat and libffi are not used.
|
||||||
# TODO: Makefile has annoying deps on expat headers
|
rm -r Modules/expat || die
|
||||||
#rm -r Modules/expat || die
|
rm -r Modules/_ctypes/libffi* || die
|
||||||
|
|
||||||
local PATCHES=(
|
local PATCHES=(
|
||||||
"${WORKDIR}/${PATCHSET}"
|
"${WORKDIR}/${PATCHSET}"
|
||||||
@ -150,85 +117,35 @@ src_prepare() {
|
|||||||
|
|
||||||
default
|
default
|
||||||
|
|
||||||
|
# https://bugs.gentoo.org/850151
|
||||||
|
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die
|
||||||
|
|
||||||
# force the correct number of jobs
|
# force the correct number of jobs
|
||||||
# https://bugs.gentoo.org/737660
|
# https://bugs.gentoo.org/737660
|
||||||
sed -i -e "s:-j0:-j$(makeopts_jobs):" Makefile.pre.in || die
|
local jobs=$(makeopts_jobs)
|
||||||
|
sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
|
||||||
# breaks tests when using --with-wheel-pkg-dir
|
sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
|
||||||
rm -r Lib/test/wheeldata || die
|
|
||||||
|
|
||||||
eautoreconf
|
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() {
|
src_configure() {
|
||||||
# disable automagic bluetooth headers detection
|
# disable automagic bluetooth headers detection
|
||||||
if ! use bluetooth; then
|
if ! use bluetooth; then
|
||||||
local -x ac_cv_header_bluetooth_bluetooth_h=no
|
local -x ac_cv_header_bluetooth_bluetooth_h=no
|
||||||
fi
|
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"
|
||||||
|
export PYTHON_DISABLE_MODULES="${disable}"
|
||||||
|
|
||||||
|
if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
|
||||||
|
einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
|
||||||
|
fi
|
||||||
|
|
||||||
append-flags -fwrapv
|
append-flags -fwrapv
|
||||||
filter-flags -malign-double
|
filter-flags -malign-double
|
||||||
@ -242,107 +159,20 @@ src_configure() {
|
|||||||
dbmliborder+="${dbmliborder:+:}gdbm"
|
dbmliborder+="${dbmliborder:+:}gdbm"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set baseline test skip flags.
|
|
||||||
COMMON_TEST_SKIPS=(
|
|
||||||
# failures
|
|
||||||
-x test_concurrent_futures
|
|
||||||
-x test_gdb
|
|
||||||
# flaky: https://github.com/python/cpython/issues/121973
|
|
||||||
-x test_pyrepl
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
mips*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_external_inspection
|
|
||||||
-x test_statistics
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
powerpc64-*) # big endian
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_descr
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
riscv*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
-x test_urllib2
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
sparc*)
|
|
||||||
COMMON_TEST_SKIPS+=(
|
|
||||||
# bug 788022
|
|
||||||
-x test_multiprocessing_fork
|
|
||||||
-x test_multiprocessing_forkserver
|
|
||||||
|
|
||||||
-x test_ctypes
|
|
||||||
-x test_descr
|
|
||||||
# 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
|
if use pgo; then
|
||||||
local profile_task_flags=(
|
local profile_task_flags=(
|
||||||
-m test
|
-m test
|
||||||
"-j$(makeopts_jobs)"
|
"-j$(makeopts_jobs)"
|
||||||
--pgo-extended
|
--pgo-extended
|
||||||
--verbose3
|
-x test_gdb
|
||||||
-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
|
-x test_dtrace
|
||||||
|
-u-network
|
||||||
|
|
||||||
# All of these seem to occasionally hang for PGO inconsistently
|
# All of these seem to occasionally hang for PGO inconsistently
|
||||||
# They'll even hang here but be fine in src_test sometimes.
|
# They'll even hang here but be fine in src_test sometimes.
|
||||||
# bug #828535 (and related: bug #788022)
|
# bug #828535 (and related: bug #788022)
|
||||||
-x test_asyncio
|
-x test_asyncio
|
||||||
|
-x test_concurrent_futures
|
||||||
-x test_httpservers
|
-x test_httpservers
|
||||||
-x test_logging
|
-x test_logging
|
||||||
-x test_multiprocessing_fork
|
-x test_multiprocessing_fork
|
||||||
@ -352,44 +182,8 @@ src_configure() {
|
|||||||
# Hangs (actually runs indefinitely executing itself w/ many cpython builds)
|
# Hangs (actually runs indefinitely executing itself w/ many cpython builds)
|
||||||
# bug #900429
|
# bug #900429
|
||||||
-x test_tools
|
-x test_tools
|
||||||
|
|
||||||
# Fails in profiling run, passes in src_test().
|
|
||||||
-x test_capi
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# 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
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
ia64*)
|
|
||||||
profile_task_flags+=(
|
|
||||||
-x test_signal
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
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
|
if has_version "app-arch/rpm" ; then
|
||||||
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
|
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
|
||||||
profile_task_flags+=(
|
profile_task_flags+=(
|
||||||
@ -406,7 +200,6 @@ src_configure() {
|
|||||||
ac_cv_header_stropts_h=no
|
ac_cv_header_stropts_h=no
|
||||||
|
|
||||||
--enable-shared
|
--enable-shared
|
||||||
--without-static-libpython
|
|
||||||
--enable-ipv6
|
--enable-ipv6
|
||||||
--infodir='${prefix}/share/info'
|
--infodir='${prefix}/share/info'
|
||||||
--mandir='${prefix}/share/man'
|
--mandir='${prefix}/share/man'
|
||||||
@ -417,19 +210,18 @@ src_configure() {
|
|||||||
--without-ensurepip
|
--without-ensurepip
|
||||||
--without-lto
|
--without-lto
|
||||||
--with-system-expat
|
--with-system-expat
|
||||||
|
--with-system-ffi
|
||||||
--with-system-libmpdec
|
--with-system-libmpdec
|
||||||
--with-platlibdir=lib
|
|
||||||
--with-pkg-config=yes
|
|
||||||
--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
|
--with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
|
||||||
|
|
||||||
$(use_with debug assertions)
|
$(use_with debug assertions)
|
||||||
$(use_enable gil)
|
|
||||||
$(use_enable jit experimental-jit)
|
|
||||||
$(use_enable pgo optimizations)
|
$(use_enable pgo optimizations)
|
||||||
$(use_with readline readline "$(usex libedit editline readline)")
|
|
||||||
$(use_with valgrind)
|
$(use_with valgrind)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# disable implicit optimization/debugging flags
|
||||||
|
local -x OPT=
|
||||||
|
|
||||||
# https://bugs.gentoo.org/700012
|
# https://bugs.gentoo.org/700012
|
||||||
if tc-is-lto; then
|
if tc-is-lto; then
|
||||||
append-cflags $(test-flags-CC -ffat-lto-objects)
|
append-cflags $(test-flags-CC -ffat-lto-objects)
|
||||||
@ -438,29 +230,70 @@ src_configure() {
|
|||||||
)
|
)
|
||||||
fi
|
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')
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# disable implicit optimization/debugging flags
|
|
||||||
local -x OPT=
|
|
||||||
|
|
||||||
if tc-is-cross-compiler ; then
|
if tc-is-cross-compiler ; then
|
||||||
build_cbuild_python
|
# Hack to workaround get_libdir not being able to handle CBUILD, bug #794181
|
||||||
myeconfargs+=(
|
local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi)
|
||||||
# Point the imminent CHOST build to the Python we just
|
|
||||||
# built for CBUILD.
|
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
|
||||||
--with-build-python="${WORKDIR}"/${P}-${CBUILD}/python
|
# 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 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
|
fi
|
||||||
|
|
||||||
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
|
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
|
||||||
@ -474,6 +307,7 @@ src_configure() {
|
|||||||
append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
|
append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
hprefixify setup.py
|
||||||
econf "${myeconfargs[@]}"
|
econf "${myeconfargs[@]}"
|
||||||
|
|
||||||
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
|
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
|
||||||
@ -490,20 +324,21 @@ src_compile() {
|
|||||||
# Ensure sed works as expected
|
# Ensure sed works as expected
|
||||||
# https://bugs.gentoo.org/594768
|
# https://bugs.gentoo.org/594768
|
||||||
local -x LC_ALL=C
|
local -x LC_ALL=C
|
||||||
export PYTHONSTRICTEXTENSIONBUILD=1
|
# Prevent using distutils bundled by setuptools.
|
||||||
|
# https://bugs.gentoo.org/823728
|
||||||
|
export SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||||
|
|
||||||
# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
|
# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
|
||||||
# end up writing bytecode & violating sandbox.
|
# end up writing bytecode & violating sandbox.
|
||||||
# bug #831897
|
# bug #831897
|
||||||
local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
|
local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
|
||||||
|
|
||||||
# Gentoo hack to disable accessing system site-packages
|
|
||||||
export GENTOO_CPYTHON_BUILD=1
|
|
||||||
|
|
||||||
if use pgo ; then
|
if use pgo ; then
|
||||||
# bug 660358
|
# bug 660358
|
||||||
local -x COLUMNS=80
|
local -x COLUMNS=80
|
||||||
local -x PYTHONDONTWRITEBYTECODE=
|
local -x PYTHONDONTWRITEBYTECODE=
|
||||||
|
|
||||||
|
addpredict "/usr/lib/python${PYVER}/site-packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# also need to clear the flags explicitly here or they end up
|
# also need to clear the flags explicitly here or they end up
|
||||||
@ -528,18 +363,28 @@ src_test() {
|
|||||||
return
|
return
|
||||||
fi
|
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=(
|
local test_opts=(
|
||||||
--verbose3
|
|
||||||
-u-network
|
-u-network
|
||||||
-j "$(makeopts_jobs)"
|
-j "$(makeopts_jobs)"
|
||||||
"${COMMON_TEST_SKIPS[@]}"
|
|
||||||
|
# fails
|
||||||
|
-x test_concurrent_futures
|
||||||
|
-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
|
# bug 660358
|
||||||
local -x COLUMNS=80
|
local -x COLUMNS=80
|
||||||
local -x PYTHONDONTWRITEBYTECODE=
|
local -x PYTHONDONTWRITEBYTECODE=
|
||||||
@ -548,14 +393,18 @@ src_test() {
|
|||||||
CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
|
CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
|
||||||
local ret=${?}
|
local ret=${?}
|
||||||
|
|
||||||
|
rm Lib/docutils.py || die
|
||||||
|
|
||||||
[[ ${ret} -eq 0 ]] || die "emake test failed"
|
[[ ${ret} -eq 0 ]] || die "emake test failed"
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
local libdir=${ED}/usr/lib/python${PYVER}
|
local libdir=${ED}/usr/lib/python${PYVER}
|
||||||
|
|
||||||
# -j1 hack for now for bug #843458
|
emake DESTDIR="${D}" altinstall
|
||||||
emake -j1 DESTDIR="${D}" altinstall
|
|
||||||
|
# Remove static library
|
||||||
|
rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
|
||||||
|
|
||||||
# Fix collisions between different slots of Python.
|
# Fix collisions between different slots of Python.
|
||||||
rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
|
rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
|
||||||
@ -585,7 +434,7 @@ src_install() {
|
|||||||
rm -r "${libdir}"/ensurepip || die
|
rm -r "${libdir}"/ensurepip || die
|
||||||
fi
|
fi
|
||||||
if ! use sqlite; then
|
if ! use sqlite; then
|
||||||
rm -r "${libdir}/"sqlite3 || die
|
rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
|
||||||
fi
|
fi
|
||||||
if ! use tk; then
|
if ! use tk; then
|
||||||
rm -r "${ED}/usr/bin/idle${PYVER}" || die
|
rm -r "${ED}/usr/bin/idle${PYVER}" || die
|
||||||
@ -633,26 +482,11 @@ src_install() {
|
|||||||
EOF
|
EOF
|
||||||
chmod +x "${scriptdir}/python${pymajor}-config" || die
|
chmod +x "${scriptdir}/python${pymajor}-config" || die
|
||||||
ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die
|
ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die
|
||||||
# pydoc
|
# 2to3, pydoc
|
||||||
|
ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die
|
||||||
ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die
|
ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die
|
||||||
# idle
|
# idle
|
||||||
if use tk; then
|
if use tk; then
|
||||||
ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die
|
ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
local v
|
|
||||||
for v in ${REPLACING_VERSIONS}; do
|
|
||||||
if ver_test "${v}" -lt 3.13.0_beta2; then
|
|
||||||
ewarn "Python 3.13.0b2 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.13 modules, e.g. using:"
|
|
||||||
ewarn
|
|
||||||
ewarn " emerge -1v /usr/lib/python3.13/site-packages"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user