diff options
Diffstat (limited to 'dev-lang')
17 files changed, 2084 insertions, 1252 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 13cb36defe..1f45842d37 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -1,20 +1,28 @@ -DIST Python-2.7.16.tar.xz 12752104 BLAKE2B 7d6b5b853f9974d44e04dd35ecdffaab87511e183b4b01dd4f8f4ee109c4b4ab208f045708f69717be9d3a706aa078b71438ed482c062c0b89c12730eae074ae SHA512 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0 -DIST Python-3.8.7.tar.xz 18261096 BLAKE2B 6ac20efef41e828cb796aabcb7808400d494b9b48759950c8c15ee90762394f6763163d8e37ab407c1c79ebb9cda09189eaa969a75f96c86a96ccee962443924 SHA512 6a27d8eab3076930df46b0cf127f9b664f8d4147349b2b98132f464deb7f69d87e0167e8ee8e6c64249125ad73760d965ecbc81c252b63a1e7aac95594c62b74 +DIST Python-3.10.4.tar.xz 19342692 BLAKE2B c430ad9bed71729fda29433af0614b6c0110a85e23f4cb5cff3a9b501febe99b20094367a5428f256fb3aeef97f34d439ef677fc8ae4d596d52da7976b65ebb5 SHA512 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113 +DIST Python-3.10.4.tar.xz.asc 833 BLAKE2B 289f2e96bfc2b60c4ae94b1591779d604f203890c4f5db2ee16e305bf03c6ddb9c8d6da4471a06b5943e12888f37ca572ea30876e9a80382a26814f66b41b7bf SHA512 699e37bf09067083af159e3734b38c952bdc75432c8abfb7a7b8cce7ca975038da37490abeb5c13befd2dacb84a5341ad30de5d0a63d35af5c512215744f4d6d +DIST Python-3.11.3.tar.xz 19906156 BLAKE2B c23815e09a0012b2af03f3e18471389382978ef0991cb081c4c6410e98613589d47d3ad782c0a06a48ddd86fc5df7f1d59e93dbab5871b89559e225084544248 SHA512 a3bba4b69322a47bfeefe42ba0fd7331b5b67fd2ab41441e2219d16ef8c6f307f1a48977afd073c18cfd24ec6cb1bfe0c4bb4b273031eb524dc7e9fb5fbcc3b6 +DIST Python-3.11.3.tar.xz.asc 833 BLAKE2B 1846858480428293047bfaf87a74f5a6cf28227f63dbc36e658ab68444a5b91c2178fca42f35a413591103a0ceeea3cd5f8b757fb2f42cbcad023c62970ab950 SHA512 34bfb6e74e2bbec15bf3f653e32a3d705961b5f724e3f4713cf9b6b530f9c9e7e94f5cf855798bdf9763235b97a60ec9ad554d24cdc793e21a0c39540b5818d8 +DIST Python-3.11.7.tar.xz 20074108 BLAKE2B 3414118d30076e4223571825b5c595c5795422244de20dc70d07389a03b2c2b03b98a9ff562a8fd164db8f776dd741a9d7beb1c2ae4087ec6af677619a9dfd80 SHA512 11e06f2ffe1f66888cb5b4e9f607de815294d6863a77eda6ec6d7c724ef158df9f51881f4a956d4a6fa973c2fb6fd031d495e3496e9b0bb53793fb1cc8434c63 +DIST Python-3.11.7.tar.xz.asc 833 BLAKE2B 32d6984631d7b4b064e2c2588835a89098842a0ecc3d8ccb893830c9946124a159123e2082e6da3abcdb97d27dde0fb68c1fd11e4ed2bf2e0641fa95191354bb SHA512 7b342990c6e32897047f8ba33c4d264f1be987b73843b61bd7db08bfa1a7280c616e9dcd96225f37602f876549d011ff82a4d79f1e32a5ab7d7cc22651bba44f +DIST Python-3.12.3.tar.xz 20625068 BLAKE2B fc4f57ae50183db4c8cb37d94c37a7e58da5d031e03866841a678b986f01bbb8afdefb38124ba82b0a4988445b647214be43338dea13b0f063d3c2bf81c48c0b SHA512 4a2213b108e7f1f1525baa8348e68b2a2336d925e60d0a59f0225fc470768a2c8031edafc0b8243f94dbae18afda335ee5adf2785328c2218fd64cbb439f13a4 +DIST Python-3.12.3.tar.xz.asc 963 BLAKE2B f9668dde210793f8da0e0bb026b8ec3e0b4bc3abc58e72732f8faf356b19ca88a59b9d89b4b10f77b3602d9a967f0f2f44a0f091d698bc28ba9bad8049e5e006 SHA512 c291ec5b5e4f8deba867cc517624dd9a174745f04061ef737e58f3d52b9b30318264aec350e339fe88ccb493809ca1a90a378e86d86b8ec4a4f578b1a5843624 DIST Python-3.8.8.tar.xz 18271736 BLAKE2B af0ff1acd919b365a58278e82678324ff884cc8120bcaf12e0e3afb1bd978e6469e256335df131935f51ff481fb83dda04e4b6f1cd1746611f9ec944db73d692 SHA512 64181db5aa48281284a3230436ebfb8cb91b645a9dec956fd48c0048334498477073fc4e14d6b426d0ef7fbcdcfd5d59cbf01a504e6c9014dc9529494b9309fb DIST Python-3.8.8.tar.xz.asc 833 BLAKE2B a11188f9f68c518259de1a4e271bf56409d7356a7eb3dd8cbea7bbb0b5bc1b43f9aeb85bda4add65bbae906bef65cb20a30bcc77da04c0d383cd5b527821fd85 SHA512 0e6f11a310c1796dd056d9a4b63b5e03aa8dbd290088966e04a590a78c00003887dbfd7a7029a6cf8c5626ecd6ca91c1c16433bb0a41bf1225b02b8db8541b95 -DIST Python-3.9.1.tar.xz 18897104 BLAKE2B bcbce176510e8e7c6ba6070588bedc52121c21c5271f59b3d629dfb542c51ee62622b2ca53a6e2041f1a51b2d089368cc4de9bb749e8ebad9a2c4eb4de83538e SHA512 b90029d6825751685983e9dcf0e0ec9e46f18e6c7d37b0dd7a245a94316f8c0090308ad7c2b2b49ed2514b0b909177231dd5bcad03031bf4624e37136fcf8019 -DIST Python-3.9.3.tar.xz 18899676 BLAKE2B c879fc55e7e654413fbcddb4d032cf10b061c39a273428cdf281a7bf3505ce6de885cc38f73095b02f20126f551d18f94662893d71be01b0da40768d5beaf427 SHA512 420b07c272b8da4b97f6edc21c3b51ef8ee1fffd291eebb032991ec2da4fc40ace3e9b608d7cea0c43ad3716792640c508e84a807c29cfa5a40f89d294f7b0ab -DIST Python-3.9.3.tar.xz.asc 833 BLAKE2B 04ad005c7a41e02478659e65cce79053e962144f2bb3d47ca798a3478cc72ca162d0e199a8d96fe681079456e6553dd76323235c727954e1e3e04e97c3549c6b SHA512 6cc9fc77450a8d3781b24c13163f813f32e177bc70163a0f42949353b559a296a79e4da7b45d63928285f7d852021bcdcede885909235532ee9128468788d6c9 +DIST Python-3.9.12.tar.xz 19740524 BLAKE2B 05f2469aa53ca36221ef4976b17bfde3e5b86afd5a8114e5a7fd899f975a8e55022555ef718d5352ab68de1b7b23865a0bf713768c9c2b30d591438c9a396d25 SHA512 081981901e14149748fd35228db0b3b1d96fef227ae7404f07b8bad0fda4b02649bf31c348c94aefdaf3327565d78f9489437c2c02f647b15d41376a27a23e97 +DIST Python-3.9.12.tar.xz.asc 833 BLAKE2B 33436d0404a643215a8fd2b967ffd216201da24f374941bf65b888159ccfabcbe79b751eca2dd489b06605604338c8bbaab74aa10abbe4bcffaa54236301228e SHA512 dddaa27f8a29034f458edb6739398a5455c87fe37b6349e161865a9deedca118ffe9cb82663cc75bbe60b3b556399c0c6855f5262aac1fe90d36a3694fca65b2 DIST Python-3.9.6.tar.xz 19051972 BLAKE2B 0d8586b2935088eeab7138cf2210c1a74f1bf7359359d25750af5f69de55eb39c92f518b887a8b749c772ed7d33e85b912928ae6d878514eb58d85ef210f54f0 SHA512 01c529e3207738d8771caeb5ed6217e10745c21aa39832fe3185e1c87fdb6aedead97ce38dbb11e02d873654028bd8071c3f345c18452769520723284efe9dc1 DIST Python-3.9.6.tar.xz.asc 833 BLAKE2B 41901bfb80a901f2f14e86769e6d08ded8f75656d347201345183162e180e61442da871a1067572a54da579551166a19bf5436e51581bb10cb78afc4d28773fc SHA512 0673c8833f302c829bfde97453c52744f6aa99b4a72520f4cc384d4aa9d6ffd28a1407ceafb0a1ec4462b3aa74b656bf39c67872c4e6a131429ea58c47ad0ecc -DIST python-gentoo-patches-2.7.16.tar.xz 13904 BLAKE2B 218b46f8656f4a792dcd47eabca6d59a1558276b77676544991ee75914cd76dda84c36f43e72e477b850dd4cb52374d289f20dccd244a3b52ae5debaf3363432 SHA512 83f90545231c663a34c6925352a357a2b15997ac0362578a1893304c5070b5251922585ae8bc1bafb68d306bcddd4cdba4b6406648d473bd3e980eef65fe3ecd -DIST python-gentoo-patches-3.8.7_p2.tar.xz 17708 BLAKE2B 495a24e0496be246d2beddfaaa8886049197ca5973dadccfcd26b3b2237e4b06b85f0e4d418db411d055ca3d0c1173e03dd5a62e29f64c133e8da6261b17c99b SHA512 c06f2fc1fe48be010e8230ac3d474b9c8386bba8f762dbe35d128ad63eaa1a4c2a5a991ec6044564331d0dec4f248a71e37959ebe666b0693d6ed41f460a67f7 +DIST python-gentoo-patches-3.10.4.tar.xz 8592 BLAKE2B 67fba3e1fedb17430e5cd93da995b4acaf714db512031b5a2f775a25f793f007941561663cfa413d645ccddc2e22d65d250a40fa166cafda8805488d877ff57d SHA512 3ed2b8ff8f1eb8febe7dcd4b5d13d6d54468be1d525f8f1118977d3bbc78f690a597b09383939d023b03380a306e4bff1693382e29ff562312d803305b1709b2 +DIST python-gentoo-patches-3.11.3.tar.xz 7776 BLAKE2B 78bf26f554c608c68826b9ea3c63a1df2b45bff755860f39f14306ebb63f17f5111b117519c4a9cb30452a62a14a3a7393798b8920c3d108ec8b6a30db88641e SHA512 64b79c90055fd940590b72ffd3744fe02ab9e46caf7b46f4aa1d074bf3e62d355e128bb2ac68c42f228f2e1bcdee2b0b114d9e2b9bf8427512083c1c5f8680e8 +DIST python-gentoo-patches-3.11.7_p1.tar.xz 8364 BLAKE2B 246da406e6d58d85ab2ef79dd3a018a134e473f90d42f8dd9274629f998a6129f3b03da228aa5e65c1b4508a71979ceb1f752a28066c356f813be21c30a40f70 SHA512 c5c1448a2e9b15b8084125e07cee288b667267779d89da8aab9df4b1d014739ba9af4d09e51b3cdc37e8942821d7aee0d1998e55820b67b83ef654d0a442767e +DIST python-gentoo-patches-3.12.3.tar.xz 6028 BLAKE2B 7953a48a1d95a6a33bd88060fbcac463a5469371aa0c882c3945f1fea64a63c4d45fca8451f51f4eaeea00a04267ad2e54e4cc720c95e8bb5a3477e00263b80a SHA512 4779bab2b24e59e4a77987ce3e9611d99e87c9c4d016309758c26a65fe2e11ef04d48d5af628c02b1552dc1f31b768f87448f8e19e716b4fe372941e6dacac3f DIST python-gentoo-patches-3.8.8_p1.tar.xz 15456 BLAKE2B 7d9f55f951f97ef7e08d0245dddd21f5b8d126735c1c392ba6326ad1c18023b477f62e9b6663d8e5b6f0362e442137d0b6ed3ea13b279cca6734d36dbe6e654f SHA512 7fff74d03a0c4cd4b5c977761179c2b9a0ed472847ee9544f54331cef7549557ac4d6b78e676058bd2b01c96ca59d84f04c55beca8ddc45f16b11ce349210eea -DIST python-gentoo-patches-3.9.1_p2.tar.xz 15556 BLAKE2B 5e265ef8edee70694d73c6df6eb908a747be34e1e89b900d2470d41e7e043d179408bc643a52ade6e54e61a210ee8850d02a2cb452a9336f3973345c1d027158 SHA512 eabfd304b39975258705f5e9b238f709196ce0cbd3803f157dc77d864631a3eea380084a3a4de180e3ba7e92239608ae369e810f8066c0f1ff9fa251bbc1816c -DIST python-gentoo-patches-3.9.3.tar.xz 8820 BLAKE2B e46d910e4f427ea4cd4f912c5e2864140137c9414998a30fcf79509c231003a55ed480a5fd3eaccb6281f54c0a4f4a6ef76502761c91e37947b17a7a80bb5a94 SHA512 2e4204ca273b6ff0e3b97a73d018bf262c08c40f7e94b7b99fbff5299a799bb806f1410b0ca960efc6f2001e098954ea8b55e604bce451b2ccacd691ffcbe9ce +DIST python-gentoo-patches-3.9.12.tar.xz 12848 BLAKE2B 5dd66fa94b136a463d2c4be3a5b7dfad770c3905467a1d81af02a35b2783ce7d614881c915ee8f8e764c1656963d6886d9c60c6e524f512e1bc496e42d01307b SHA512 07de63e47a8e547724099062239df8fcfd254f19d38be28131e6bbb094ffbab8483861fb6a5905e60d7fa7a1a5dc06785951fa31984ecad89516b0b742c47f91 DIST python-gentoo-patches-3.9.6_p1.tar.xz 12764 BLAKE2B 927718f1aadb5d5ef67e647a639a10bffdd48474bf01e50bd37ef1242bce57606b7b54c4823c1da3585ee76e737028163e38e9b4e19037585cc53f925e1c5fa7 SHA512 f06fb55786bd942e72e3225ee9ce218724aeee29f301279743588749007e991851a8f29db5b5dfd85435e3d763c00942947909a6fc60581bd0f3e8a6e913bff8 -DIST python-prefix-2.7.16-gentoo-patches-r0.tar.xz 14636 BLAKE2B 54320f5197bb7adeca1e7c97447253e6535a11f380b6d66bc2ce46fa671fe23697aced8fd5619633a00e3ea19ae9dbc3ffe2981173d83dcab6b447d514555c43 SHA512 5380d9b92eb81603ec4d60ff9c940a3a061c06bd6f593d5837e600da5d4417b529d20d98d758aa95cef18fac10bdb5c33f90fa943deb15fdaf048492cf286581 +DIST python-prefix-gentoo-3.10.4-patches-r0.tar.xz 6772 BLAKE2B b807ae02242926d99c3823b73ce33193926d55891d54b5d214b4bdf24d2213b4d7b248030146a01698ceadd255affffef8937d84fc11e6d587ffcc91286e81b2 SHA512 a8f16d12b785a4b9ca884e4235cb298e4155273534a7957e517a679f0c2d4b35dcca08e445bed3fe2a80e3a6441f04004eae955a362eb1091ac1f9e2b9a5448f +DIST python-prefix-gentoo-3.11.3-patches-r3.tar.xz 5404 BLAKE2B 7c76056854361a4dad879218d2e0f60f874d534ac354c6b47158b5b0de18e5c66a522e717efa8a0a8a0ca3c77dbe5e9297a2ea17b725cb9c7e59478defd951ae SHA512 1bfb1c5e9b53c0b2f5d5fbf112c1742cc91a5cc3f505dc0d8d54683b508063be3578e3e6b8ad617bb0ea0a311b9235d862867ec4e9ca3fbcefcda98613235c72 +DIST python-prefix-gentoo-3.11.7-patches-r1.tar.xz 5752 BLAKE2B 8d6ee07491b23d1947af748b0178fd5c81cce78e77e2153480425d38a6b9badeb3b42cd635d340ddf50a451f977f04f498ac25ad1a18250ddae851aac06b9a0d SHA512 c5687c97a41c2e1ed0eacac987a7ea4b38bb8b60b91a16d2ea36ce9aad2f3360d25295951c083386b791b33f18267e545bfcb8280172f878736fef57d7188d0f +DIST python-prefix-gentoo-3.12.3-patches-r0.tar.xz 3464 BLAKE2B 965ccf0cc82b26e58adc332a2bcaa346578dfbec7abc1bed5451e0b8ac7c1e7612a7abe3ce757777f0fd6e38d1e0c7682c2ac3b617fb03fd2849686593b10e27 SHA512 a5648e7a9fc6fdc20f868d53c121d2e63ee370719b1b84d253df1fd472306879ab4b32d4d0685c576562ba6a8c06d3ac2250a8cbd44bbe2c7a1dd832e0c19d6d DIST python-prefix-gentoo-3.8.7-patches-r2.tar.xz 8312 BLAKE2B 268f3cff62dc51d4f91994c3f6b05cea0e29edb1ccf39476ba52485fb94c3cad72b54ed5cd941c227bdad004a7ae0069d60ee6bbde5a30d16115263d0dc2a5c3 SHA512 e43ce1e9e851bebce968ee025f765fc9a558c8edc4ee2d51616043183fd12301ab3d5c7f92915238e53b5cf92f6c00617ab0fcf9859d4cebe0966271e6f64725 -DIST python-prefix-gentoo-3.9.1-patches-r2.tar.xz 6996 BLAKE2B 5de68537998c19d19cc1b2f630da73da3e70a88581c010028107cb7c9571c821637388022ab7659bd20992a8cf683199af22863cc5af25eb1030e2a5956e156d SHA512 c3d6998b3a00fb4bf7f84fe5fa6788b3f725120a73991075e7feb5762ff0186e27bfb455354365f3b84844ec28876792bf11baf124776a1ea3375ed2d0e1882e +DIST python-prefix-gentoo-3.9.12-patches-r1.tar.xz 7124 BLAKE2B afff1a574e13515084b0bee3aee1d0f0796ed885451086485f54f3c9a2498de6b4f403fdec1fe7fc5718a45fd89773720a4ef24d700b494337665b3f6d74e2de SHA512 4a12e8be1b38217d66e4a6374e09f93f956fdf4970130edcea2fedd6989c9a1af309fa939c213f8645676401c6d10b5e8789dbe902de9c03b8ea2b57c1632b72 DIST python-prefix-gentoo-3.9.6_p1-patches-r0.tar.xz 6984 BLAKE2B 8b032d3000fd2dfcb8e099ac071c1a911ba2a0e30343788f7191043800f9d0088307cd7007b2b3f6cc7d2f315fc22bbac5990fed81f0dd8d60dca0314bd59b88 SHA512 76c56895c99ee203bd266f475766d2572659939abaf478932e7c9c65ddc52cb5e012e23c9455dd0a4bf0281a07c70e23a2fea8337c693b8a4ac8abb534e21982 -DIST python2-cygwinports-7be648659ef46f33db6913ca0ca5a809219d5629.zip 9199 BLAKE2B 85803bc1677bd16650cb5fc4a2c54fdac0228326f25cfba4fcd098ac9d689312d3e0dde6fca57f720d5235361d6462461cf018325c23fda9139e0f1683055aff SHA512 cabc21d2d7379daf1f4bafe7ab00b70e5b4f707d3102496b96ff0dfdced26347097ad771c69e0b9488b7c54b1ef36f9bc019bee72f1ffcbb55dcd0e71095edfe diff --git a/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch b/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch deleted file mode 100644 index 38433de925..0000000000 --- a/dev-lang/python/files/python-2.7.10-cross-compile-warn-test.patch +++ /dev/null @@ -1,24 +0,0 @@ -https://bugs.python.org/issue25397 - -improve the cross-compile tests to be more focused - ---- a/configure.ac -+++ b/configure.ac -@@ -1339,7 +1339,7 @@ if test "$GCC" = "yes" - then - AC_MSG_CHECKING(whether gcc supports ParseTuple __format__) - save_CFLAGS=$CFLAGS -- CFLAGS="$CFLAGS -Werror -Wformat" -+ CFLAGS="$CFLAGS -Werror=format" - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]]) - ],[ -@@ -4458,7 +4458,7 @@ then - [ac_cv_have_long_long_format="cross -- assuming no" - if test x$GCC = xyes; then - save_CFLAGS=$CFLAGS -- CFLAGS="$CFLAGS -Werror -Wformat" -+ CFLAGS="$CFLAGS -Werror=format" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <stdio.h> - #include <stddef.h> diff --git a/dev-lang/python/files/python-2.7.10-system-libffi.patch b/dev-lang/python/files/python-2.7.10-system-libffi.patch deleted file mode 100644 index 0b49b794bd..0000000000 --- a/dev-lang/python/files/python-2.7.10-system-libffi.patch +++ /dev/null @@ -1,36 +0,0 @@ -make sure we respect the system libffi setting in our build config. -the compiler probing is fragile and can break in some situations. - ---- a/setup.py -+++ b/setup.py -@@ -2069,7 +2069,7 @@ class PyBuildExt(build_ext): - return True - - def detect_ctypes(self, inc_dirs, lib_dirs): -- self.use_system_libffi = False -+ self.use_system_libffi = ('--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")) - include_dirs = [] - extra_compile_args = [] - extra_link_args = [] -@@ -2113,7 +2113,7 @@ class PyBuildExt(build_ext): - sources=['_ctypes/_ctypes_test.c']) - self.extensions.extend([ext, ext_test]) - -- if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"): -+ if not self.use_system_libffi: - return - - if host_platform == 'darwin': -@@ -2141,10 +2141,10 @@ class PyBuildExt(build_ext): - ffi_lib = lib_name - break - -- if ffi_inc and ffi_lib: -+ if ffi_inc: - ext.include_dirs.extend(ffi_inc) -+ if ffi_lib: - ext.libraries.append(ffi_lib) -- self.use_system_libffi = True - - - class PyBuildInstall(install): diff --git a/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch deleted file mode 100644 index 85abb1b56b..0000000000 --- a/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -u -r Python-2.7.5-orig//configure.ac Python-2.7.5/configure.ac ---- Python-2.7.5-orig//configure.ac 2014-03-06 04:35:31.000000000 +0100 -+++ Python-2.7.5/configure.ac 2014-03-06 04:58:10.000000000 +0100 -@@ -2300,10 +2300,13 @@ - - if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then - LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`" -+ LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`" - else - LIBFFI_INCLUDEDIR="" -+ LIBFFI_LIB="" - fi - AC_SUBST(LIBFFI_INCLUDEDIR) -+AC_SUBST(LIBFFI_LIB) - - AC_MSG_RESULT($with_system_ffi) - -diff -u -r Python-2.7.5-orig//Makefile.pre.in Python-2.7.5/Makefile.pre.in ---- Python-2.7.5-orig//Makefile.pre.in 2014-03-06 04:35:31.000000000 +0100 -+++ Python-2.7.5/Makefile.pre.in 2014-03-06 05:03:59.000000000 +0100 -@@ -224,6 +224,7 @@ - - - LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ -+LIBFFI_LIB= @LIBFFI_LIB@ - - ########################################################################## - # Parser -diff -u -r Python-2.7.5-orig//setup.py Python-2.7.5/setup.py ---- Python-2.7.5-orig//setup.py 2014-03-06 04:35:31.000000000 +0100 -+++ Python-2.7.5/setup.py 2014-03-06 04:56:15.000000000 +0100 -@@ -1893,8 +1893,10 @@ - ffi_inc = None - print('Header file {} does not define LIBFFI_H or ' - 'ffi_wrapper_h'.format(ffi_h)) -- ffi_lib = None -- if ffi_inc is not None: -+ ffi_lib = sysconfig.get_config_var("LIBFFI_LIB") -+ if not ffi_lib or ffi_lib == '': -+ ffi_lib = None -+ if ffi_inc is not None and ffi_lib is None: - for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'): - if (self.compiler.find_library_file(lib_dirs, lib_name)): - ffi_lib = lib_name diff --git a/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch b/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch deleted file mode 100644 index a762dfb108..0000000000 --- a/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1000,12 +1000,12 @@ - $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ - $(DESTDIR)$(LIBDEST)/distutils/tests ; \ - fi -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ - -d $(LIBDEST) -f \ - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ - $(DESTDIR)$(LIBDEST) -- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ -+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ - -d $(LIBDEST) -f \ - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ diff --git a/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch b/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch deleted file mode 100644 index 38ce6f78b9..0000000000 --- a/dev-lang/python/files/python-2.7.9-ncurses-pkg-config.patch +++ /dev/null @@ -1,13 +0,0 @@ -do not hardcode /usr/include paths - ---- a/configure.ac -+++ b/configure.ac -@@ -4316,7 +4316,7 @@ fi - - # first curses configure check - ac_save_cppflags="$CPPFLAGS" --CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" -+CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags ncursesw`" - - AC_CHECK_HEADERS(curses.h ncurses.h) - diff --git a/dev-lang/python/files/python-3.4-pyfpe-dll.patch b/dev-lang/python/files/python-3.4-pyfpe-dll.patch deleted file mode 100644 index 401529d830..0000000000 --- a/dev-lang/python/files/python-3.4-pyfpe-dll.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- Python-3.4.3/Include/pyfpe.h -+++ Python-3.4.3/Include/pyfpe.h -@@ -129,9 +129,9 @@ - #include <signal.h> - #include <setjmp.h> - #include <math.h> --extern jmp_buf PyFPE_jbuf; --extern int PyFPE_counter; --extern double PyFPE_dummy(void *); -+PyAPI_DATA(jmp_buf) PyFPE_jbuf; -+PyAPI_DATA(int) PyFPE_counter; -+PyAPI_FUNC(double) PyFPE_dummy(void *); - - #define PyFPE_START_PROTECT(err_string, leave_stmt) \ - if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \ ---- Python-3.4.3/Python/pyfpe.c -+++ Python-3.4.3/Python/pyfpe.c -@@ -1,5 +1,4 @@ --#include "pyconfig.h" --#include "pyfpe.h" -+#include "Python.h" - /* - * The signal handler for SIGFPE is actually declared in an external - * module fpectl, or as preferred by the user. These variable diff --git a/dev-lang/python/metadata.xml b/dev-lang/python/metadata.xml index 6a4ebd8b87..54c2aa9734 100644 --- a/dev-lang/python/metadata.xml +++ b/dev-lang/python/metadata.xml @@ -1,13 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="project"> <email>python@gentoo.org</email> <name>Python</name> </maintainer> <use> - <flag name="threads">Enable threading support. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING)</flag> - <flag name="wide-unicode">Enable wide Unicode implementation which uses 4-byte Unicode characters. Switching of this USE flag changes ABI of Python and requires reinstallation of many Python modules. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING)</flag> + <flag name="bluetooth">Build Bluetooth protocol support in socket module</flag> + <flag name="libedit">Link readline extension against <pkg>dev-libs/libedit</pkg> instead of <pkg>sys-libs/readline</pkg>.</flag> + <flag name="pgo">Optimize the build using Profile Guided Optimization (PGO)</flag> + <flag name="lto">Optimize the build using Link Time Optimization (LTO)</flag> <flag name="wininst">Install Windows executables required to create an executable installer for MS Windows.</flag> </use> </pkgmetadata> diff --git a/dev-lang/python/python-2.7.16.ebuild b/dev-lang/python/python-2.7.16.ebuild deleted file mode 100644 index 155e466d96..0000000000 --- a/dev-lang/python/python-2.7.16.ebuild +++ /dev/null @@ -1,612 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" -WANT_LIBTOOL="none" - -inherit autotools eutils flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PATCHSET_VERSION="2.7.16" -PREFIX_PATCHREV="r0" -CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629" - -DESCRIPTION="An interpreted, interactive, object-oriented programming language" -HOMEPAGE="https://www.python.org/" -SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz - https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz" - -[[ -n ${CYGWINPORTS_GITREV} ]] && -SRC_URI+=" elibc_Cygwin? ( - https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip - -> python2-cygwinports-${CYGWINPORTS_GITREV}.zip )" - -LICENSE="PSF-2" -SLOT="2.7" -KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="aqua -berkdb bluetooth build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" - -# 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:0= - >=sys-libs/zlib-1.1.3:0= - virtual/libffi - virtual/libintl - berkdb? ( || ( - sys-libs/db:5.3 - sys-libs/db:5.1 - sys-libs/db:4.8 - sys-libs/db:4.7 - sys-libs/db:4.6 - sys-libs/db:4.5 - sys-libs/db:4.4 - sys-libs/db:4.3 - sys-libs/db:4.2 - ) ) - gdbm? ( sys-libs/gdbm:0=[berkdb] ) - ncurses? ( >=sys-libs/ncurses-5.2:0= ) - readline? ( >=sys-libs/readline-4.1:0= ) - sqlite? ( >=dev-db/sqlite-3.3.8:3= ) - ssl? ( dev-libs/openssl:0= ) - tk? ( - >=dev-lang/tcl-8.0:0= - >=dev-lang/tk-8.0:0=[-aqua] - dev-tcltk/blt:0= - dev-tcltk/tix - ) - xml? ( >=dev-libs/expat-2.1 ) - !!<sys-apps/portage-2.1.9" -# bluetooth requires headers from bluez -DEPEND="${RDEPEND} - bluetooth? ( net-wireless/bluez ) - virtual/pkgconfig - >=sys-devel/autoconf-2.65 - !sys-devel/gcc[libffi(-)]" -RDEPEND+=" !build? ( app-misc/mime-types ) - doc? ( dev-python/python-docs:${SLOT} )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -[[ -n ${CYGWINPORTS_GITREV} ]] && -DEPEND+=" elibc_Cygwin? ( app-arch/unzip )" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - if use berkdb; then - ewarn "'bsddb' module is out-of-date and no longer maintained inside" - ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally" - ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module" - ewarn "is provided by dev-python/bsddb3." - else - if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then - ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]" - ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." - ewarn "You might need to migrate your databases." - fi - fi -} - -src_prepare() { - # Ensure that internal copies of expat, libffi and zlib are not used. - rm -r Modules/expat || die - rm -r Modules/_ctypes/libffi* || die - rm -r Modules/zlib || die - - if tc-is-cross-compiler; then - rm "${WORKDIR}/patches/0006-Regenerate-platform-specific-modules.patch" || die - fi - - local PATCHES=( - "${WORKDIR}/patches" - # Fix for cross-compiling. - "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch" - "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch" - "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch" - "${FILESDIR}/python-2.7.10-system-libffi.patch" - ) - - default - - # Prefix' round of patches - EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \ - epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV} - epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl - # Make sure python doesn't use the host libffi. - use prefix && epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch" - - if use aqua ; then - # make sure we don't get a framework reference here - sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ - -e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \ - Makefile.pre.in || die - # Python upstream refuses to listen to configure arguments - sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \ - configure.ac configure || die - # we handle creation of symlinks in src_install - sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die - # build the Python framework without DESTDIR in install_name - sed -i -e '/-install_name/s/$(DESTDIR)//' Makefile.pre.in || die - fi - # don't try to do fancy things on Darwin - sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die - # fix header standards conflicts on Solaris - if [[ ${CHOST} == *-solaris* ]] ; then - # GCC5 switched the default from gnu89 to gnu11, a standards - # conflict arises from that, which can be solved by upgrading - # _XOPEN_SOURCE from 500 to 600, but since it is compiler - # version specific, just force the old standard onto the - # compiler. Python 3 properly detects this. - CC="$(tc-getCC) -std=gnu89" - fi - - if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then - local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}" - for p in $( - eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)" - echo ${PATCH_URI} - ); do - # dropped by 01_all_prefix-no-patch-invention.patch - [[ ${p} == *-tkinter-* ]] && continue - epatch "${d}/${p}" - done - fi - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - Lib/distutils/command/install.py \ - Lib/distutils/sysconfig.py \ - Lib/site.py \ - Lib/sysconfig.py \ - Lib/test/test_site.py \ - Makefile.pre.in \ - Modules/Setup.dist \ - Modules/getpath.c \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - eautoreconf -} - -src_configure() { - # dbm module can be linked against berkdb or gdbm. - # Defaults to gdbm when both are enabled, #204343. - local disable - use berkdb || use gdbm || disable+=" dbm" - use berkdb || disable+=" _bsddb" - # disable automagic bluetooth headers detection - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no - use gdbm || disable+=" gdbm" - use ncurses || disable+=" _curses _curses_panel" - use readline || disable+=" readline" - use sqlite || disable+=" _sqlite3" - use ssl || export PYTHON_DISABLE_SSL="1" - use tk || disable+=" _tkinter" - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. - [[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon - [[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs" - export PYTHON_DISABLE_MODULES="${disable}" - - if ! use xml; then - ewarn "You have configured Python without XML support." - ewarn "This is NOT a recommended configuration as you" - ewarn "may face problems parsing any XML documents." - fi - - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" - fi - - if [[ "$(gcc-major-version)" -ge 4 ]]; then - append-flags -fwrapv - fi - - filter-flags -malign-double - - # https://bugs.gentoo.org/show_bug.cgi?id=50309 - if is-flagq -O3; then - is-flagq -fstack-protector-all && replace-flags -O3 -O2 - use hardened && replace-flags -O3 -O2 - fi - - if tc-is-cross-compiler; then - # Force some tests that try to poke fs paths. - export ac_cv_file__dev_ptc=no - export ac_cv_file__dev_ptmx=yes - fi - - # http://bugs.gentoo.org/show_bug.cgi?id=302137 - if [[ ${CHOST} == powerpc-*-darwin* ]] && \ - ( is-flag "-mtune=*" || is-flag "-mcpu=*" ) || \ - [[ ${CHOST} == powerpc64-*-darwin* ]]; - then - replace-flags -O2 -O3 - replace-flags -Os -O3 # comment #14 - fi - - # Export CC so even AIX will use gcc instead of xlc_r. - # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. - tc-export CC CXX - # The configure script fails to use pkg-config correctly. - # http://bugs.python.org/issue15506 - export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) - - # Set LDFLAGS so we link modules with -lpython2.7 correctly. - # Needed on FreeBSD unless Python 2.7 is already installed. - # Please query BSD team before removing this! - # On AIX this is not needed, but would record '.' as runpath. - append-ldflags "-L." - - if use prefix ; then - # for Python's setup.py not to do false assumptions (only looking in - # host paths) we need to make explicit where Prefix stuff is - append-cppflags -I"${EPREFIX}"/usr/include - append-ldflags -L"${EPREFIX}"/$(get_libdir) - append-ldflags -L"${EPREFIX}"/usr/$(get_libdir) - # fix compilation on some Linux hosts, #381163, #473520 - if use elibc_glibc ; then - for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do - [[ -d ${hostlibdir} ]] || continue - append-ldflags -L${hostlibdir} - done - fi - # Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that - # local include paths - set in $(CPPFLAGS) - are searched first. - sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die - fi - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - if use berkdb; then - dbmliborder+="${dbmliborder:+:}bdb" - fi - - # we need this to get pythonw, the GUI version of python - # --enable-framework and --enable-shared are mutually exclusive: - # http://bugs.python.org/issue5809 - local myshared= - use aqua \ - && myshared="--enable-framework=${EPREFIX}/usr/lib" \ - || myshared="--enable-shared" - - # note: for a framework build we need to use ucs2 because macOS - # uses that internally too: - # http://bugs.python.org/issue763708 - local myeconfargs=( - --with-fpectl - ${myshared} - $(use_enable ipv6) - $(use_with threads) - $( (use wide-unicode && use !aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \ - --infodir='${prefix}/share/info' - --mandir='${prefix}/share/man' - --with-computed-gotos - --with-dbmliborder="${dbmliborder}" - --with-libc= - --enable-loadable-sqlite-extensions - --with-system-expat - --with-system-ffi - --without-ensurepip - ) - - # we need to build in a separate dir to avoid problems due to - # case-insensitivity on Darwin - BUILD_DIR="${WORKDIR}/${CHOST}" - mkdir -p "${BUILD_DIR}" || die - cd "${BUILD_DIR}" || die - - ECONF_SOURCE="${S}" OPT= econf "${myeconfargs[@]}" - - if use threads && 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 -} - -src_compile() { - # Avoid invoking pgen for cross-compiles. - touch Include/graminit.h Python/graminit.c - - cd "${BUILD_DIR}" || die - emake - - # 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 - - cd "${BUILD_DIR}" || die - - # Skip failing tests. - local skipped_tests="distutils gdb" - - for test in ${skipped_tests}; do - mv "${S}"/Lib/test/test_${test}.py "${T}" - done - - # bug 660358 - local -x COLUMNS=80 - - # Daylight saving time problem - # https://bugs.python.org/issue22067 - # https://bugs.gentoo.org/610628 - local -x TZ=UTC - - # Rerun failed tests in verbose mode (regrtest -w). - emake test EXTRATESTOPTS="-w" < /dev/tty - local result="$?" - - for test in ${skipped_tests}; do - mv "${T}/test_${test}.py" "${S}"/Lib/test - done - - elog "The following tests have been skipped:" - for test in ${skipped_tests}; do - elog "test_${test}.py" - done - - elog "If you would like to run them, you may:" - elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" - elog "and run the tests separately." - - if [[ "${result}" -ne 0 ]]; then - die "emake test failed" - fi -} - -src_install() { - local libdir=${ED}/usr/$(get_libdir)/python${SLOT} - - cd "${BUILD_DIR}" || die - if use aqua ; then - local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework - - # do not make multiple targets in parallel when there are broken - # sharedmods (during bootstrap), would build them twice in parallel. - - # Python_Launcher is kind of a wrapper, and we should fix it for - # Prefix (it uses /usr/bin/pythonw) so useless - # IDLE doesn't run, no idea, but definitely not used - sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \ - Mac/Makefile || die - - # let the makefiles do their thing - emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall - rmdir "${ED}"/Applications/Python* || die - rmdir "${ED}"/Applications || die - - # avoid framework incompatibility, degrade to a normal UNIX lib - mkdir -p "${ED}"/usr/$(get_libdir) - cp "${D}${fwdir}"/Versions/${SLOT}/Python \ - "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die - chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib - install_name_tool \ - -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ - "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib - chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib - cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die - - # rebuild python executable to be the non-pythonw (python wrapper) - # version so we don't get framework crap - rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861 - $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \ - -o "${ED}"/usr/bin/python${SLOT} \ - Modules/python.o || die - - # don't install the "Current" symlink, will always conflict - rm "${D}${fwdir}"/Versions/Current || die - # update whatever points to it, eselect-python sets them - rm "${D}${fwdir}"/{Headers,Python,Resources} || die - - # remove unversioned files (that are not made versioned below) - pushd "${ED}"/usr/bin > /dev/null - rm -f python python-config python${SLOT}-config - # python${SLOT} was created above - for f in pythonw smtpd${SLOT}.py pydoc idle ; do - rm -f ${f} ${f}${SLOT} - done - # pythonw needs to remain in the framework (that's the whole - # reason we go through this framework hassle) - ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die - # copy the scripts to we can fix their shebangs - for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do - # for some reason sometimes they already exist, bug #347321 - rm -f ${f} - cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die - sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \ - ${f} || die - done - # "fix" to have below collision fix not to bail - mv pydoc${SLOT} pydoc || die - mv idle${SLOT} idle || die - popd > /dev/null - - # basically we don't like the framework stuff at all, so just move - # stuff around or add some symlinks to make our life easier - mkdir -p "${ED}"/usr - mv "${D}${fwdir}"/Versions/${SLOT}/share \ - "${ED}"/usr/ || die "can't move share" - # get includes just UNIX style - mkdir -p "${ED}"/usr/include - mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \ - "${ED}"/usr/include/ || die "can't move include" - pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null - ln -s ../../../../../include/python${SLOT} || die - popd > /dev/null - rm -f "${ED}"/usr/share/man/man1/python{,2}.1 - - # same for libs - # NOTE: can't symlink the entire dir, because a real dir already exists - # on upgrade (site-packages), however since we h4x0rzed python to - # actually look into the UNIX-style dir, we just switch them around. - mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT} - mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \ - "${ED}"/usr/$(get_libdir)/python${SLOT}/ \ - || die "can't move python${SLOT}" - rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die - pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null - ln -s ../../../../python${SLOT} || die - popd > /dev/null - - # fix up Makefile - sed -i \ - -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \ - -e '/^LDFLAGS=/s/=.*$/=/' \ - -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \ - -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \ - -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \ - -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \ - -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \ - -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \ - "${libdir}"/config/Makefile || die - # and sysconfigdata likewise - sed -i \ - -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \ - -e "/'LDFLAGS'/s/:.*$/:'',/" \ - -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \ - -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \ - -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \ - -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \ - -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \ - -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \ - "${libdir}"/_sysconfigdata.py || die - - # add missing version.plist file - mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources - cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" -"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>BuildVersion</key> - <string>1</string> - <key>CFBundleShortVersionString</key> - <string>${PV}</string> - <key>CFBundleVersion</key> - <string>${PV}</string> - <key>ProjectName</key> - <string>Python</string> - <key>SourceVersion</key> - <string>${PV}</string> -</dict> -</plist> -EOF - else - emake DESTDIR="${D}" altinstall - fi - - sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" - - # Fix collisions between different slots of Python. - mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}" - mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}" - mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}" - rm -f "${ED}usr/bin/smtpd.py" - - # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec - # These #defines cause problems when building c99 compliant python modules - # http://bugs.python.org/issue1759169 - [[ ${CHOST} == *-solaris* ]] && sed -i -e \ - 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \ - "${ED}"/usr/include/python${SLOT}/pyconfig.h - - use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die - use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die - use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} - - use threads || rm -r "${libdir}/multiprocessing" || die - use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die - - dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} - - if use examples; then - insinto /usr/share/doc/${PF}/examples - doins -r "${S}"/Tools - fi - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 - local libname - if use aqua ; then - # we do framework, so the emake trick below returns a pathname - # since that won't work here, use a (cheap) trick instead - libname=libpython${SLOT} - else - libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - fi - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py - - newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} - newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} - sed \ - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ - -e "s:@PYDOC@:pydoc${SLOT}:" \ - -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" - - # for python-exec - local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) - - # if not using a cross-compiler, use the fresh binary - if ! tc-is-cross-compiler; then - local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile) - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD} - local -x DYLD_FRAMEWORK_PATH="${WORKDIR}/${CHOST}" - else - vars=( PYTHON "${vars[@]}" ) - fi - - python_export "python${SLOT}" "${vars[@]}" - echo "EPYTHON='${EPYTHON}'" > epython.py || die - python_domodule epython.py - - # python-exec wrapping support - local pymajor=${SLOT%.*} - mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die - # python and pythonX - ln -s "../../../bin/python${SLOT}" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die - ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die - # python-config and pythonX-config - ln -s "../../../bin/python${SLOT}-config" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die - ln -s "python${pymajor}-config" "${D}${PYTHON_SCRIPTDIR}/python-config" || die - # 2to3, pydoc, pyvenv - ln -s "../../../bin/2to3-${SLOT}" "${D}${PYTHON_SCRIPTDIR}/2to3" || die - ln -s "../../../bin/pydoc${SLOT}" "${D}${PYTHON_SCRIPTDIR}/pydoc" || die - # idle - if use tk; then - ln -s "../../../bin/idle${SLOT}" "${D}${PYTHON_SCRIPTDIR}/idle" || die - fi -} - -eselect_python_update() { - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then - eselect python update - fi - - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then - eselect python update --python${PV%%.*} - fi -} - -pkg_postinst() { - eselect_python_update -} - -pkg_postrm() { - eselect_python_update -} diff --git a/dev-lang/python/python-3.9.1_p2.ebuild b/dev-lang/python/python-3.10.4.ebuild index e3f0b02d15..fa646ffba1 100644 --- a/dev-lang/python/python-3.9.1_p2.ebuild +++ b/dev-lang/python/python-3.10.4.ebuild @@ -1,28 +1,34 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="7" WANT_LIBTOOL="none" inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \ - python-utils-r1 toolchain-funcs + python-utils-r1 toolchain-funcs verify-sig -MY_P="Python-${PV%_p*}" +MY_PV=${PV/_rc/rc} +MY_P="Python-${MY_PV%_p*}" PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-${PV}" -PREFIX_PATCHSET="python-prefix-gentoo-${PV%_p*}-patches-r2" +PATCHSET="python-gentoo-patches-${MY_PV}" +PREFIX_PATCHSET="python-prefix-gentoo-${MY_PV}-patches-r0" DESCRIPTION="An interpreted, interactive, object-oriented programming language" HOMEPAGE="https://www.python.org/" -SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz +SRC_URI=" + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz - https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz" + https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz + verify-sig? ( + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc + ) +" S="${WORKDIR}/${MY_P}" LICENSE="PSF-2" SLOT="${PYVER}" -KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="aqua bluetooth build examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl test tk +xml" +KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="aqua bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" # Do not add a dependency on dev-lang/python to this ebuild. @@ -30,8 +36,10 @@ RESTRICT="!test? ( test )" # run the bootstrap code on your dev box and include the results in the # patchset. See bug 447752. -RDEPEND="app-arch/bzip2:= +RDEPEND=" + app-arch/bzip2:= app-arch/xz-utils:= + dev-lang/python-exec[python_targets_python3_10(-)] dev-libs/libffi:= kernel_linux? ( sys-apps/util-linux:= ) >=sys-libs/zlib-1.1.3:= @@ -39,24 +47,40 @@ RDEPEND="app-arch/bzip2:= virtual/libintl gdbm? ( sys-libs/gdbm:=[berkdb] ) ncurses? ( >=sys-libs/ncurses-5.2:= ) - readline? ( >=sys-libs/readline-4.1:= ) + readline? ( + !libedit? ( >=sys-libs/readline-4.1:= ) + libedit? ( dev-libs/libedit:= ) + ) sqlite? ( >=dev-db/sqlite-3.3.8:3= ) - ssl? ( dev-libs/openssl:= ) + ssl? ( >=dev-libs/openssl-1.1.1:= ) tk? ( >=dev-lang/tcl-8.0:= >=dev-lang/tk-8.0:= dev-tcltk/blt:= dev-tcltk/tix ) - xml? ( >=dev-libs/expat-2.1:= )" + xml? ( >=dev-libs/expat-2.1:= ) + !!<sys-apps/sandbox-2.21 +" # bluetooth requires headers from bluez -DEPEND="${RDEPEND} +DEPEND=" + ${RDEPEND} bluetooth? ( net-wireless/bluez ) test? ( app-arch/xz-utils[extra-filters(+)] ) +" +# autoconf-archive needed to eautoreconf +BDEPEND=" + dev-build/autoconf-archive + app-alternatives/awk virtual/pkgconfig - !sys-devel/gcc[libffi(-)]" -RDEPEND+=" !build? ( app-misc/mime-types )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" + verify-sig? ( sec-keys/openpgp-keys-python ) + !sys-devel/gcc[libffi(-)] +" +RDEPEND+=" + build? ( app-misc/mime-types ) +" + +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 @@ -69,6 +93,13 @@ 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, libffi and zlib are not used. rm -fr Modules/expat || die @@ -109,6 +140,16 @@ src_prepare() { configure.ac configure || die fi + if [[ ${CHOST} == *-darwin19 ]] ; then + # HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH is set because + # _dyld_shared_cache_contains_path could be found, yet it cannot + # be resolved when dlopen()ing, so simply pretend it doesn't + # exist here + sed -i \ + -e 's/_dyld_shared_cache_contains_path/disabled&/' \ + configure.ac configure || die + fi + eautoreconf } @@ -155,11 +196,6 @@ src_configure() { # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. tc-export CXX - # Set LDFLAGS so we link modules with -lpython3.2 correctly. - # Needed on FreeBSD unless Python 3.2 is already installed. - # Please query BSD team before removing this! - append-ldflags "-L." - # Fix implicit declarations on cross and prefix builds. Bug #674070. use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw use prefix && append-ldflags -L"${ESYSROOT}"/lib -L"${ESYSROOT}"/usr/lib @@ -169,11 +205,19 @@ src_configure() { dbmliborder+="${dbmliborder:+:}gdbm" fi - if use aqua ; then - ECONF_SOURCE="${S}" OPT="" \ - econf \ - --enable-framework="${EPREFIX}" \ - --config-cache + if use pgo; then + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") + export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network" + + # All of these seem to occasionally hang for PGO inconsistently + # They'll even hang here but be fine in src_test sometimes. + # bug #828535 (and related: bug #788022) + PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc" + + if has_version "app-arch/rpm" ; then + # Avoid sandbox failure (attempts to write to /var/lib/rpm) + PROFILE_TASK+=" -x test_distutils" + fi fi # flock on 32-bits sparc Solaris is broken @@ -190,7 +234,8 @@ src_configure() { $(use aqua && echo --config-cache) --enable-shared - $(use_enable ipv6) + --without-static-libpython + --enable-ipv6 --infodir='${prefix}/share/info' --mandir='${prefix}/share/man' --with-computed-gotos @@ -200,20 +245,66 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + + $(use_with lto) + $(use_enable pgo optimizations) + $(use_with readline readline "$(usex libedit editline readline)") ) - OPT="" econf "${myeconfargs[@]}" + # disable implicit optimization/debugging flags + local -x OPT= + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + local -x CFLAGS_NODIST=${CFLAGS} + local -x LDFLAGS_NODIST=${LDFLAGS} + local -x CFLAGS= LDFLAGS= + + if use aqua ; then + ECONF_SOURCE="${S}" OPT="" \ + econf \ + --enable-framework="${EPREFIX}" \ + --config-cache + fi + + econf "${myeconfargs[@]}" + + if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then + eerror "configure has detected that the sem_open function is broken." + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." + die "Broken sem_open function (bug 496328)" + fi } src_compile() { # Ensure sed works as expected # https://bugs.gentoo.org/594768 local -x LC_ALL=C + # Prevent using distutils bundled by setuptools. + # https://bugs.gentoo.org/823728 + export SETUPTOOLS_USE_DISTUTILS=stdlib + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + addpredict /usr/lib/python3.10/site-packages + fi + + # also need to clear the flags explicitly here or they end up + # in _sysconfigdata* emake CPPFLAGS= CFLAGS= LDFLAGS= + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + # Work around bug 329499. See also bug 413751 and 457194. - if has_version dev-libs/libffi[pax_kernel]; then + if has_version dev-libs/libffi[pax-kernel]; then pax-mark E python else pax-mark m python @@ -230,6 +321,12 @@ src_test() { # Skip failing tests. local skipped_tests="gdb" + if use sparc ; then + # bug #788022 + skipped_tests+=" multiprocessing_fork" + skipped_tests+=" multiprocessing_forkserver" + fi + for test in ${skipped_tests}; do mv "${S}"/Lib/test/test_${test}.py "${T}" done @@ -237,6 +334,8 @@ src_test() { # bug 660358 local -x COLUMNS=80 local -x PYTHONDONTWRITEBYTECODE= + # workaround https://bugs.gentoo.org/775416 + addwrite /usr/lib/python3.10/site-packages local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") @@ -285,14 +384,6 @@ src_install() { "${ED}${fwdir}"/Python || die fi - # Remove static library - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die - - sed \ - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ - -e "s/\(PY_LDFLAGS=\).*/\1/" \ - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" - # Fix collisions between different slots of Python. rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die @@ -310,7 +401,7 @@ src_install() { # python seems to get rebuilt in src_install (bug 569908) # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then + if has_version dev-libs/libffi[pax-kernel]; then pax-mark E "${ED}/usr/bin/${abiver}" else pax-mark m "${ED}/usr/bin/${abiver}" diff --git a/dev-lang/python/python-3.11.3.ebuild b/dev-lang/python/python-3.11.3.ebuild new file mode 100644 index 0000000000..39522bf64c --- /dev/null +++ b/dev-lang/python/python-3.11.3.ebuild @@ -0,0 +1,601 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +WANT_LIBTOOL="none" + +inherit autotools check-reqs flag-o-matic multiprocessing pax-utils +inherit prefix python-utils-r1 toolchain-funcs verify-sig + +MY_PV=${PV/_rc/rc} +MY_P="Python-${MY_PV%_p*}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${MY_PV}" +PREFIX_PATCHSET="python-prefix-gentoo-${MY_PV}-patches-r3" + +DESCRIPTION="An interpreted, interactive, object-oriented programming language" +HOMEPAGE=" + https://www.python.org/ + https://github.com/python/cpython/ +" +SRC_URI=" + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz + https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz + verify-sig? ( + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc + ) +" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE=" + aqua + bluetooth build +ensurepip examples gdbm hardened libedit lto + +ncurses pgo +readline +sqlite +ssl test tk valgrind +" +RESTRICT="!test? ( test )" + +# Do not add a dependency on dev-lang/python to this ebuild. +# If you need to apply a patch which requires python for bootstrapping, please +# run the bootstrap code on your dev box and include the results in the +# patchset. See bug 447752. + +RDEPEND=" + app-arch/bzip2:= + app-arch/xz-utils:= + app-crypt/libb2 + >=dev-libs/expat-2.1:= + dev-libs/libffi:= + dev-python/gentoo-common + kernel_linux? ( sys-apps/util-linux:= ) + >=sys-libs/zlib-1.1.3:= + virtual/libcrypt:= + virtual/libintl + ensurepip? ( dev-python/ensurepip-wheels ) + gdbm? ( sys-libs/gdbm:=[berkdb] ) + ncurses? ( >=sys-libs/ncurses-5.2:= ) + readline? ( + !libedit? ( >=sys-libs/readline-4.1:= ) + libedit? ( dev-libs/libedit:= ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3= ) + ssl? ( >=dev-libs/openssl-1.1.1:= ) + tk? ( + >=dev-lang/tcl-8.0:= + >=dev-lang/tk-8.0:= + dev-tcltk/blt:= + dev-tcltk/tix + ) + !!<sys-apps/sandbox-2.21 + elibc_Darwin? ( sys-libs/native-uuid ) + elibc_SunOS? ( sys-libs/libuuid ) +" +# bluetooth requires headers from bluez +DEPEND=" + ${RDEPEND} + bluetooth? ( net-wireless/bluez ) + test? ( app-arch/xz-utils[extra-filters(+)] ) + valgrind? ( dev-util/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 ) +" +if [[ ${PV} != *_alpha* ]]; then + RDEPEND+=" + dev-lang/python-exec[python_targets_python${PYVER/./_}(-)] + " +fi + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc + +# large file tests involve a 2.5G file being copied (duplicated) +CHECKREQS_DISK_BUILD=5500M + +QA_PKGCONFIG_VERSION=${PYVER} +# false positives -- functions specific to *BSD +QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags ) + +pkg_pretend() { + use test && check-reqs_pkg_pretend +} + +pkg_setup() { + use test && check-reqs_pkg_setup +} + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} + fi + default +} + +src_prepare() { + # Ensure that internal copies of expat and libffi are not used. + rm -r Modules/expat || die + rm -r Modules/_ctypes/libffi* || die + + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + # Prefix' round of patches + "${WORKDIR}"/${PREFIX_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 + + # workaround a problem on ppc-macos with >=GCC-8 where dtoa gets + # miscompiled when optimisation is being used + if [[ ${CHOST} == powerpc*-darwin* ]] && \ + tc-is-gcc && [[ $(gcc-major-version) -ge 8 ]] ; + then + sed -i \ + -e '/^CFLAGS_ALIASING=/s/$/ -fno-tree-ter/' Makefile.pre.in || die + fi + + # Darwin 9's kqueue seems to act up (at least at this stage), so + # make Python's selectors resort to poll() or select() + if [[ ${CHOST} == powerpc*-darwin9 ]] ; then + sed -i \ + -e 's/KQUEUE/KQUEUE_DISABLED/' \ + configure.ac configure || die + fi + + if [[ ${CHOST} == *-darwin19 ]] ; then + # HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH is set because + # _dyld_shared_cache_contains_path could be found, yet it cannot + # be resolved when dlopen()ing, so simply pretend it doesn't + # exist here + sed -i \ + -e 's/_dyld_shared_cache_contains_path/disabled&/' \ + configure.ac configure || die + fi + + if [[ ${CHOST} == *-solaris* ]] ; then + # OpenIndiana/Solaris 11 defines inet_aton no longer in + # libresolv, so use hstrerror to check if we need -lresolv + sed -i -e '/AC_CHECK_LIB/s/inet_aton/hstrerror/' \ + configure.ac configure || die + fi + + eautoreconf +} + +src_configure() { + local disable + # disable automagic bluetooth headers detection + if ! use bluetooth; then + local -x ac_cv_header_bluetooth_bluetooth_h=no + fi + + append-flags -fwrapv + filter-flags -malign-double + + # https://bugs.gentoo.org/700012 + if is-flagq -flto || is-flagq '-flto=*'; then + append-cflags $(test-flags-CC -ffat-lto-objects) + fi + + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. + # PKG_CONFIG needed for cross. + tc-export CXX PKG_CONFIG + + local dbmliborder= + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + if use pgo; then + local profile_task_flags=( + -m test + "-j$(makeopts_jobs)" + --pgo-extended + -u-network + + # We use a timeout because of how often we've had hang issues + # here. It also matches the default upstream PROFILE_TASK. + --timeout 1200 + + -x test_gdb + + # All of these seem to occasionally hang for PGO inconsistently + # They'll even hang here but be fine in src_test sometimes. + # bug #828535 (and related: bug #788022) + -x test_asyncio + -x test_httpservers + -x test_logging + -x test_multiprocessing_fork + -x test_socket + -x test_xmlrpc + + # Hangs (actually runs indefinitely executing itself w/ many cpython builds) + # bug #900429 + -x test_tools + ) + + if has_version "app-arch/rpm" ; then + # Avoid sandbox failure (attempts to write to /var/lib/rpm) + profile_task_flags+=( + -x test_distutils + ) + fi + local -x PROFILE_TASK="${profile_task_flags[*]}" + fi + + # flock on 32-bits sparc Solaris is broken + [[ ${CHOST} == sparc-*-solaris* ]] && \ + export ac_cv_flock_decl=no + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + # except on non-glibc systems this breaks the build, so be + # conservative! + $(use elibc_glibc && echo ac_cv_header_stropts_h=no) + + $(use aqua && echo --config-cache) + --enable-shared + --without-static-libpython + --enable-ipv6 + --infodir='${prefix}/share/info' + --mandir='${prefix}/share/man' + --with-computed-gotos + --with-dbmliborder="${dbmliborder}" + --with-libc= + --enable-loadable-sqlite-extensions + --without-ensurepip + --with-system-expat + --with-system-ffi + --with-platlibdir=lib + --with-pkg-config=yes + --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip + + $(use_with lto) + $(use_enable pgo optimizations) + $(use_with readline readline "$(usex libedit editline readline)") + $(use_with valgrind) + ) + + # disable implicit optimization/debugging flags + local -x OPT= + + if tc-is-cross-compiler ; then + # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 + local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi) + + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD} + local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD} + local -x CFLAGS= LDFLAGS= + + # We need to build our own Python on CBUILD first, and feed it in. + # bug #847910 + 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 to satisfy --with-build-python. + --without-lto + --without-readline + --disable-optimizations + ) + + myeconfargs+=( + # Point the imminent CHOST build to the Python we just + # built for CBUILD. + --with-build-python="${WORKDIR}"/${P}-${CBUILD}/python + ) + + mkdir "${WORKDIR}"/${P}-${CBUILD} || die + pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die + # 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_STATE=disabled + MODULE__DBM_STATE=disabled + MODULE__GDBM_STATE=disabled + MODULE__DBM_STATE=disabled + MODULE__SQLITE3_STATE=disabled + MODULE__HASHLIB_STATE=disabled + MODULE__SSL_STATE=disabled + MODULE__CURSES_STATE=disabled + MODULE__CURSES_PANEL_STATE=disabled + MODULE_READLINE_STATE=disabled + MODULE__TKINTER_STATE=disabled + MODULE_PYEXPAT_STATE=disabled + MODULE_ZLIB_STATE=disabled + EOF + + # Unfortunately, we do have to build this immediately, and + # not in src_compile, because CHOST configure for Python + # will check the existence of the --with-build-python value + # immediately. + 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 + + if use aqua ; then + ECONF_SOURCE="${S}" OPT="" \ + econf \ + --enable-framework="${EPREFIX}" \ + --config-cache + 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 + + # 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 ) + use kernel_linux || disable_modules+=( OSSAUDIODEV ) + [[ ${CHOST} == *-apple-darwin* ]] && disable_modules+=( _SCPROXY ) + + local mod + for mod in "${disable_modules[@]}"; do + echo "MODULE_${mod}_STATE=disabled" + done >> Makefile || die + + # install epython.py as part of stdlib + echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die +} + +src_compile() { + # Ensure sed works as expected + # https://bugs.gentoo.org/594768 + local -x LC_ALL=C + # Prevent using distutils bundled by setuptools. + # https://bugs.gentoo.org/823728 + export SETUPTOOLS_USE_DISTUTILS=stdlib + export PYTHONSTRICTEXTENSIONBUILD=1 + + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + addpredict "/usr/lib/python${PYVER}/site-packages" + fi + + # also need to clear the flags explicitly here or they end up + # in _sysconfigdata* + emake CPPFLAGS= CFLAGS= LDFLAGS= + + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + + # Work around bug 329499. See also bug 413751 and 457194. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E python + else + pax-mark m python + fi +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + # this just happens to skip test_support.test_freeze that is broken + # without bundled expat + # TODO: get a proper skip for it upstream + local -x LOGNAME=buildbot + + local test_opts=( + -u-network + -j "$(makeopts_jobs)" + + # fails + -x test_gdb + ) + + if use sparc ; then + # bug #788022 + test_opts+=( + -x test_multiprocessing_fork + -x test_multiprocessing_forkserver + ) + fi + + # workaround docutils breaking tests + cat > Lib/docutils.py <<-EOF || die + raise ImportError("Thou shalt not import!") + EOF + + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + # workaround https://bugs.gentoo.org/775416 + addwrite "/usr/lib/python${PYVER}/site-packages" + + nonfatal emake test EXTRATESTOPTS="${test_opts[*]}" \ + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty + local ret=${?} + + rm Lib/docutils.py || die + + [[ ${ret} -eq 0 ]] || die "emake test failed" +} + +src_install() { + local libdir=${ED}/usr/lib/python${PYVER} + + # -j1 hack for now for bug #843458 + emake -j1 DESTDIR="${D}" altinstall + + if use aqua ; then + # avoid config.status to be triggered + find Mac -name "Makefile" -exec touch \{\} + || die + + # Python_Launcher is kind of a wrapper, and we should fix it for + # Prefix (it uses /usr/bin/pythonw) so useless + # IDLE doesn't run, no idea, but definitely not used + emake DESTDIR="${D}" -C Mac install_Python || die + rmdir "${ED}"/Applications/Python* || die + rmdir "${ED}"/Applications || die + + local fwdir=/Frameworks/Python.framework/Versions/${PYVER} + ln -s "${EPREFIX}"/usr/include/python${PYVER} \ + "${ED}${fwdir}"/Headers || die + ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \ + "${ED}${fwdir}"/Python || die + fi + + # Fix collisions between different slots of Python. + rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + rm -r "${libdir}"/ensurepip/_bundled || die + if ! use ensurepip; then + rm -r "${libdir}"/ensurepip || die + fi + if ! use sqlite; then + rm -r "${libdir}/"sqlite3 || die + fi + if ! use tk; then + rm -r "${ED}/usr/bin/idle${PYVER}" || die + rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die + fi + + ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die + + dodoc Misc/{ACKS,HISTORY,NEWS} + + if use examples; then + docinto examples + find Tools -name __pycache__ -exec rm -fr {} + || die + dodoc -r Tools + fi + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 + local libname=$( + printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | + emake --no-print-directory -s -f - 2>/dev/null + ) + newins Tools/gdb/libpython.py "${libname}"-gdb.py + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${PYVER}:" \ + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" + + # python-exec wrapping support + local pymajor=${PYVER%.*} + local EPYTHON=python${PYVER} + local scriptdir=${D}$(python_get_scriptdir) + mkdir -p "${scriptdir}" || die + # python and pythonX + ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die + ln -s "python${pymajor}" "${scriptdir}/python" || die + # python-config and pythonX-config + # note: we need to create a wrapper rather than symlinking it due + # to some random dirname(argv[0]) magic performed by python-config + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die + #!/bin/sh + exec "${abiver}-config" "\${@}" + EOF + chmod +x "${scriptdir}/python${pymajor}-config" || die + ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die + # 2to3, pydoc + ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die + fi +} + +pkg_postinst() { + local v + for v in ${REPLACING_VERSIONS}; do + if ver_test "${v}" -lt 3.11.0_beta4-r2; then + ewarn "Python 3.11.0b4 has changed its module ABI. The .pyc files" + ewarn "installed previously are no longer valid and will be regenerated" + ewarn "(or ignored) on the next import. This may cause sandbox failures" + ewarn "when installing some packages and checksum mismatches when removing" + ewarn "old versions. To actively prevent this, rebuild all packages" + ewarn "installing Python 3.11 modules, e.g. using:" + ewarn + ewarn " emerge -1v /usr/lib/python3.11/site-packages" + fi + done +} diff --git a/dev-lang/python/python-3.11.7.ebuild b/dev-lang/python/python-3.11.7.ebuild new file mode 100644 index 0000000000..6c8c839266 --- /dev/null +++ b/dev-lang/python/python-3.11.7.ebuild @@ -0,0 +1,606 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +WANT_LIBTOOL="none" + +inherit autotools check-reqs flag-o-matic multiprocessing pax-utils +inherit prefix python-utils-r1 toolchain-funcs verify-sig + +MY_PV=${PV/_rc/rc} +MY_P="Python-${MY_PV%_p*}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${MY_PV}_p1" +PREFIX_PATCHSET="python-prefix-gentoo-${MY_PV}-patches-r1" + +DESCRIPTION="An interpreted, interactive, object-oriented programming language" +HOMEPAGE=" + https://www.python.org/ + https://github.com/python/cpython/ +" +SRC_URI=" + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz + https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz + verify-sig? ( + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc + ) +" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE=" + aqua + bluetooth build debug +ensurepip examples gdbm libedit + +ncurses pgo +readline +sqlite +ssl test tk valgrind +" +RESTRICT="!test? ( test )" + +# Do not add a dependency on dev-lang/python to this ebuild. +# If you need to apply a patch which requires python for bootstrapping, please +# run the bootstrap code on your dev box and include the results in the +# patchset. See bug 447752. + +RDEPEND=" + app-arch/bzip2:= + app-arch/xz-utils:= + app-crypt/libb2 + >=dev-libs/expat-2.1:= + dev-libs/libffi:= + dev-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? ( + !libedit? ( >=sys-libs/readline-4.1:= ) + libedit? ( dev-libs/libedit:= ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3= ) + ssl? ( >=dev-libs/openssl-1.1.1:= ) + tk? ( + >=dev-lang/tcl-8.0:= + >=dev-lang/tk-8.0:= + dev-tcltk/blt:= + dev-tcltk/tix + ) + elibc_Darwin? ( sys-libs/native-uuid ) + elibc_SunOS? ( sys-libs/libuuid ) +" +# bluetooth requires headers from bluez +DEPEND=" + ${RDEPEND} + bluetooth? ( net-wireless/bluez ) + test? ( app-arch/xz-utils ) + 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 ) +" +if [[ ${PV} != *_alpha* ]]; then + RDEPEND+=" + dev-lang/python-exec[python_targets_python${PYVER/./_}(-)] + " +fi + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc + +# large file tests involve a 2.5G file being copied (duplicated) +CHECKREQS_DISK_BUILD=5500M + +QA_PKGCONFIG_VERSION=${PYVER} +# false positives -- functions specific to *BSD +QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags ) + +pkg_pretend() { + use test && check-reqs_pkg_pretend +} + +pkg_setup() { + use test && check-reqs_pkg_setup +} + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} + fi + default +} + +src_prepare() { + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + # Prefix' round of patches + "${WORKDIR}"/${PREFIX_PATCHSET} + ) + + default + + # https://bugs.gentoo.org/850151 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die + + # enable this to create a pre-patched (prefix bootstrap) tree + if [[ -n ${GENTOO_PREFIX_CREATE_TAR} ]] ; then + eautoreconf + tarfile="${T}"/Python-${PV}-gentoo-prefix-patched.tar.xz + tar --numeric-owner -Jcf "${tarfile}" -C .. Python-${PV} + die "${tarfile}" + fi + + # Ensure that internal copies of expat and libffi are not used. + rm -r Modules/expat || die + rm -r Modules/_ctypes/libffi* || 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 + + # workaround a problem on ppc-macos with >=GCC-8 where dtoa gets + # miscompiled when optimisation is being used + if [[ ${CHOST} == powerpc*-darwin* ]] && \ + tc-is-gcc && [[ $(gcc-major-version) -ge 8 ]] ; + then + sed -i \ + -e '/^CFLAGS_ALIASING=/s/$/ -fno-tree-ter/' Makefile.pre.in || die + fi + + if [[ ${CHOST} == *-solaris* ]] ; then + # OpenIndiana/Solaris 11 defines inet_aton no longer in + # libresolv, so use hstrerror to check if we need -lresolv + sed -i -e '/AC_CHECK_LIB/s/inet_aton/hstrerror/' \ + configure.ac configure || die + fi + + eautoreconf +} + +build_cbuild_python() { + # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 + local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi) + + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + # + # -fno-lto to avoid bug #700012 (not like it matters for mini-CBUILD Python anyway) + local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto" + local -x LDFLAGS_NODIST=${BUILD_LDFLAGS} + local -x CFLAGS= LDFLAGS= + local -x BUILD_CFLAGS="${CFLAGS_NODIST}" + local -x BUILD_LDFLAGS=${LDFLAGS_NODIST} + + # We need to build our own Python on CBUILD first, and feed it in. + # bug #847910 + local myeconfargs_cbuild=( + "${myeconfargs[@]}" + + --prefix="${BROOT}"/usr + --libdir="${cbuild_libdir:2}" + + # Avoid needing to load the right libpython.so. + --disable-shared + + # As minimal as possible for the mini CBUILD Python + # we build just for cross to satisfy --with-build-python. + --without-lto + --without-readline + --disable-optimizations + ) + + mkdir "${WORKDIR}"/${P}-${CBUILD} || die + pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die + # 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. + cat >> Makefile <<-EOF || die + MODULE_NIS_STATE=disabled + MODULE__DBM_STATE=disabled + MODULE__GDBM_STATE=disabled + MODULE__DBM_STATE=disabled + MODULE__SQLITE3_STATE=disabled + MODULE__HASHLIB_STATE=disabled + MODULE__SSL_STATE=disabled + MODULE__CURSES_STATE=disabled + MODULE__CURSES_PANEL_STATE=disabled + MODULE_READLINE_STATE=disabled + MODULE__TKINTER_STATE=disabled + MODULE_PYEXPAT_STATE=disabled + MODULE_ZLIB_STATE=disabled + EOF + + # Unfortunately, we do have to build this immediately, and + # not in src_compile, because CHOST configure for Python + # will check the existence of the --with-build-python value + # immediately. + PYTHON_DISABLE_MODULES+=" _ctypes _crypt" 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 + + if use pgo; then + local profile_task_flags=( + -m test + "-j$(makeopts_jobs)" + --pgo-extended + -u-network + + # We use a timeout because of how often we've had hang issues + # here. It also matches the default upstream PROFILE_TASK. + --timeout 1200 + + -x test_gdb + -x test_dtrace + + # All of these seem to occasionally hang for PGO inconsistently + # They'll even hang here but be fine in src_test sometimes. + # bug #828535 (and related: bug #788022) + -x test_asyncio + -x test_httpservers + -x test_logging + -x test_multiprocessing_fork + -x test_socket + -x test_xmlrpc + + # Hangs (actually runs indefinitely executing itself w/ many cpython builds) + # bug #900429 + -x test_tools + ) + + if has_version "app-arch/rpm" ; then + # Avoid sandbox failure (attempts to write to /var/lib/rpm) + profile_task_flags+=( + -x test_distutils + ) + fi + local -x PROFILE_TASK="${profile_task_flags[*]}" + fi + + # flock on 32-bits sparc Solaris is broken + [[ ${CHOST} == sparc-*-solaris* ]] && \ + export ac_cv_flock_decl=no + # Darwin 9's kqueue seems to act up (at least at this stage), so + # make Python's selectors resort to poll() or select() + [[ ${CHOST} == powerpc*-darwin9 ]] && \ + export ac_cv_func_kqueue=no + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + # except on non-glibc systems this breaks the build, so be + # conservative! + $(use elibc_glibc && echo ac_cv_header_stropts_h=no) + + $(use aqua && echo --config-cache) + --enable-shared + --without-static-libpython + --enable-ipv6 + --infodir='${prefix}/share/info' + --mandir='${prefix}/share/man' + --with-computed-gotos + --with-dbmliborder="${dbmliborder}" + --with-libc= + --enable-loadable-sqlite-extensions + --without-ensurepip + --without-lto + --with-system-expat + --with-system-ffi + --with-platlibdir=lib + --with-pkg-config=yes + --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip + + $(use_with debug assertions) + $(use_enable pgo optimizations) + $(use_with readline readline "$(usex libedit editline readline)") + $(use_with valgrind) + ) + + # 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 + build_cbuild_python + myeconfargs+=( + # Point the imminent CHOST build to the Python we just + # built for CBUILD. + --with-build-python="${WORKDIR}"/${P}-${CBUILD}/python + ) + fi + + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + local -x CFLAGS_NODIST=${CFLAGS} + local -x LDFLAGS_NODIST=${LDFLAGS} + local -x CFLAGS= LDFLAGS= + + # Fix implicit declarations on cross and prefix builds. Bug #674070. + if use ncurses; then + append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw + fi + + if use aqua ; then + ECONF_SOURCE="${S}" OPT="" \ + econf \ + --enable-framework="${EPREFIX}" \ + --config-cache + 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 + + # 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 ) + use kernel_linux || disable_modules+=( OSSAUDIODEV ) + [[ ${CHOST} == *-apple-darwin* ]] && disable_modules+=( _SCPROXY ) + + local mod + for mod in "${disable_modules[@]}"; do + echo "MODULE_${mod}_STATE=disabled" + done >> Makefile || die + + # install epython.py as part of stdlib + echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die +} + +src_compile() { + # Ensure sed works as expected + # https://bugs.gentoo.org/594768 + local -x LC_ALL=C + # Prevent using distutils bundled by setuptools. + # https://bugs.gentoo.org/823728 + export SETUPTOOLS_USE_DISTUTILS=stdlib + export PYTHONSTRICTEXTENSIONBUILD=1 + + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + addpredict "/usr/lib/python${PYVER}/site-packages" + fi + + # also need to clear the flags explicitly here or they end up + # in _sysconfigdata* + emake CPPFLAGS= CFLAGS= LDFLAGS= + + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + + # Work around bug 329499. See also bug 413751 and 457194. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E python + else + pax-mark m python + fi +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + # this just happens to skip test_support.test_freeze that is broken + # without bundled expat + # TODO: get a proper skip for it upstream + local -x LOGNAME=buildbot + + local test_opts=( + -u-network + -j "$(makeopts_jobs)" + + # fails + -x test_gdb + ) + + if use sparc ; then + # bug #788022 + test_opts+=( + -x test_multiprocessing_fork + -x test_multiprocessing_forkserver + ) + fi + + # workaround docutils breaking tests + cat > Lib/docutils.py <<-EOF || die + raise ImportError("Thou shalt not import!") + EOF + + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + # workaround https://bugs.gentoo.org/775416 + addwrite "/usr/lib/python${PYVER}/site-packages" + + nonfatal emake test EXTRATESTOPTS="${test_opts[*]}" \ + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty + local ret=${?} + + rm Lib/docutils.py || die + + [[ ${ret} -eq 0 ]] || die "emake test failed" +} + +src_install() { + local libdir=${ED}/usr/lib/python${PYVER} + + # -j1 hack for now for bug #843458 + emake -j1 DESTDIR="${D}" altinstall + + if use aqua ; then + # avoid config.status to be triggered + find Mac -name "Makefile" -exec touch \{\} + || die + + # Python_Launcher is kind of a wrapper, and we should fix it for + # Prefix (it uses /usr/bin/pythonw) so useless + # IDLE doesn't run, no idea, but definitely not used + emake DESTDIR="${D}" -C Mac install_Python || die + rmdir "${ED}"/Applications/Python* || die + rmdir "${ED}"/Applications || die + + local fwdir=/Frameworks/Python.framework/Versions/${PYVER} + ln -s "${EPREFIX}"/usr/include/python${PYVER} \ + "${ED}${fwdir}"/Headers || die + ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \ + "${ED}${fwdir}"/Python || die + fi + + # Fix collisions between different slots of Python. + rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + rm -r "${libdir}"/ensurepip/_bundled || die + if ! use ensurepip; then + rm -r "${libdir}"/ensurepip || die + fi + if ! use sqlite; then + rm -r "${libdir}/"sqlite3 || die + fi + if ! use tk; then + rm -r "${ED}/usr/bin/idle${PYVER}" || die + rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die + fi + + ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die + + dodoc Misc/{ACKS,HISTORY,NEWS} + + if use examples; then + docinto examples + find Tools -name __pycache__ -exec rm -fr {} + || die + dodoc -r Tools + fi + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 + local libname=$( + printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | + emake --no-print-directory -s -f - 2>/dev/null + ) + newins Tools/gdb/libpython.py "${libname}"-gdb.py + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${PYVER}:" \ + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" + + # python-exec wrapping support + local pymajor=${PYVER%.*} + local EPYTHON=python${PYVER} + local scriptdir=${D}$(python_get_scriptdir) + mkdir -p "${scriptdir}" || die + # python and pythonX + ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die + ln -s "python${pymajor}" "${scriptdir}/python" || die + # python-config and pythonX-config + # note: we need to create a wrapper rather than symlinking it due + # to some random dirname(argv[0]) magic performed by python-config + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die + #!/bin/sh + exec "${abiver}-config" "\${@}" + EOF + chmod +x "${scriptdir}/python${pymajor}-config" || die + ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die + # 2to3, pydoc + ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die + fi +} + +pkg_postinst() { + local v + for v in ${REPLACING_VERSIONS}; do + if ver_test "${v}" -lt 3.11.0_beta4-r2; then + ewarn "Python 3.11.0b4 has changed its module ABI. The .pyc files" + ewarn "installed previously are no longer valid and will be regenerated" + ewarn "(or ignored) on the next import. This may cause sandbox failures" + ewarn "when installing some packages and checksum mismatches when removing" + ewarn "old versions. To actively prevent this, rebuild all packages" + ewarn "installing Python 3.11 modules, e.g. using:" + ewarn + ewarn " emerge -1v /usr/lib/python3.11/site-packages" + fi + done +} diff --git a/dev-lang/python/python-3.12.3.ebuild b/dev-lang/python/python-3.12.3.ebuild new file mode 100644 index 0000000000..01e1834a66 --- /dev/null +++ b/dev-lang/python/python-3.12.3.ebuild @@ -0,0 +1,605 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" +WANT_LIBTOOL="none" + +inherit autotools check-reqs flag-o-matic multiprocessing pax-utils +inherit prefix python-utils-r1 toolchain-funcs verify-sig + +MY_PV=${PV/_rc/rc} +MY_P="Python-${MY_PV%_p*}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${MY_PV}" +PREFIX_PATCHSET="python-prefix-gentoo-${MY_PV%_p*}-patches-r0" + +DESCRIPTION="An interpreted, interactive, object-oriented programming language" +HOMEPAGE=" + https://www.python.org/ + https://github.com/python/cpython/ +" +SRC_URI=" + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz + https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz + verify-sig? ( + https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc + ) +" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE=" + aqua + bluetooth build debug +ensurepip examples gdbm libedit + +ncurses pgo +readline +sqlite +ssl test tk valgrind +" +RESTRICT="!test? ( test )" + +# Do not add a dependency on dev-lang/python to this ebuild. +# If you need to apply a patch which requires python for bootstrapping, please +# run the bootstrap code on your dev box and include the results in the +# patchset. See bug 447752. + +RDEPEND=" + app-arch/bzip2:= + app-arch/xz-utils:= + app-crypt/libb2 + >=dev-libs/expat-2.1:= + dev-libs/libffi:= + dev-python/gentoo-common + >=sys-libs/zlib-1.1.3:= + virtual/libcrypt:= + virtual/libintl + ensurepip? ( dev-python/ensurepip-pip ) + gdbm? ( sys-libs/gdbm:=[berkdb] ) + kernel_linux? ( sys-apps/util-linux:= ) + ncurses? ( >=sys-libs/ncurses-5.2:= ) + readline? ( + !libedit? ( >=sys-libs/readline-4.1:= ) + libedit? ( dev-libs/libedit:= ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3= ) + ssl? ( >=dev-libs/openssl-1.1.1:= ) + tk? ( + >=dev-lang/tcl-8.0:= + >=dev-lang/tk-8.0:= + dev-tcltk/blt:= + dev-tcltk/tix + ) + elibc_Darwin? ( sys-libs/native-uuid ) + elibc_SunOS? ( sys-libs/libuuid ) +" +# bluetooth requires headers from bluez +DEPEND=" + ${RDEPEND} + bluetooth? ( net-wireless/bluez ) + test? ( + app-arch/xz-utils + dev-python/ensurepip-pip + dev-python/ensurepip-setuptools + dev-python/ensurepip-wheel + ) + valgrind? ( dev-debug/valgrind ) +" +# autoconf-archive needed to eautoreconf +BDEPEND=" + dev-build/autoconf-archive + app-alternatives/awk + virtual/pkgconfig + verify-sig? ( >=sec-keys/openpgp-keys-python-20221025 ) +" +RDEPEND+=" + !build? ( app-misc/mime-types ) +" +if [[ ${PV} != *_alpha* ]]; then + RDEPEND+=" + dev-lang/python-exec[python_targets_python${PYVER/./_}(-)] + " +fi + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc + +# large file tests involve a 2.5G file being copied (duplicated) +CHECKREQS_DISK_BUILD=5500M + +QA_PKGCONFIG_VERSION=${PYVER} +# false positives -- functions specific to *BSD +QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags ) + +pkg_pretend() { + use test && check-reqs_pkg_pretend +} + +pkg_setup() { + use test && check-reqs_pkg_setup +} + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} + fi + default +} + +src_prepare() { + # Ensure that internal copies of expat and libffi are not used. + # TODO: Makefile has annoying deps on expat headers + #rm -r Modules/expat || die + + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + # Prefix' round of patches + "${WORKDIR}"/${PREFIX_PATCHSET} + ) + + default + + # enable this to create a pre-patched (prefix bootstrap) tree + if [[ -n ${GENTOO_PREFIX_CREATE_TAR} ]] ; then + eautoreconf + tarfile="${T}"/Python-${PV}-gentoo-prefix-patched.tar.xz + tar --numeric-owner -Jcf "${tarfile}" -C .. Python-${PV} + die "${tarfile}" + fi + + # force the correct number of jobs + # https://bugs.gentoo.org/737660 + sed -i -e "s:-j0:-j$(makeopts_jobs):" Makefile.pre.in || die + # workaround a problem on ppc-macos with >=GCC-8 where dtoa gets + # miscompiled when optimisation is being used + if [[ ${CHOST} == powerpc*-darwin* ]] && \ + tc-is-gcc && [[ $(gcc-major-version) -ge 8 ]] ; + then + sed -i \ + -e '/^CFLAGS_ALIASING=/s/$/ -fno-tree-ter/' Makefile.pre.in || die + fi + + if [[ ${CHOST} == *-solaris* ]] ; then + # OpenIndiana/Solaris 11 defines inet_aton no longer in + # libresolv, so use hstrerror to check if we need -lresolv + sed -i -e '/AC_CHECK_LIB/s/inet_aton/hstrerror/' \ + configure.ac configure || die + fi + + eautoreconf +} + +build_cbuild_python() { + # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 + local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi) + + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + # + # -fno-lto to avoid bug #700012 (not like it matters for mini-CBUILD Python anyway) + local -x CFLAGS_NODIST="${BUILD_CFLAGS} -fno-lto" + local -x LDFLAGS_NODIST=${BUILD_LDFLAGS} + local -x CFLAGS= LDFLAGS= + local -x BUILD_CFLAGS="${CFLAGS_NODIST}" + local -x BUILD_LDFLAGS=${LDFLAGS_NODIST} + + # We need to build our own Python on CBUILD first, and feed it in. + # bug #847910 + local myeconfargs_cbuild=( + "${myeconfargs[@]}" + + --prefix="${BROOT}"/usr + --libdir="${cbuild_libdir:2}" + + # Avoid needing to load the right libpython.so. + --disable-shared + + # As minimal as possible for the mini CBUILD Python + # we build just for cross to satisfy --with-build-python. + --without-lto + --without-readline + --disable-optimizations + ) + + mkdir "${WORKDIR}"/${P}-${CBUILD} || die + pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die + + # Avoid as many dependencies as possible for the cross build. + mkdir Modules || die + cat > Modules/Setup.local <<-EOF || die + *disabled* + nis + _dbm _gdbm + _sqlite3 + _hashlib _ssl + _curses _curses_panel + readline + _tkinter + pyexpat + zlib + # We disabled these for CBUILD because Python's setup.py can't handle locating + # libdir correctly for cross. This should be rechecked for the pure Makefile approach, + # and uncommented if needed. + #_ctypes _crypt + EOF + + ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}" + + # Unfortunately, we do have to build this immediately, and + # not in src_compile, because CHOST configure for Python + # will check the existence of the --with-build-python value + # immediately. + emake + popd &> /dev/null || die +} + +src_configure() { + # disable automagic bluetooth headers detection + if ! use bluetooth; then + local -x ac_cv_header_bluetooth_bluetooth_h=no + fi + + append-flags -fwrapv + filter-flags -malign-double + + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. + # PKG_CONFIG needed for cross. + tc-export CXX PKG_CONFIG + + local dbmliborder= + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + if use pgo; then + local profile_task_flags=( + -m test + "-j$(makeopts_jobs)" + --pgo-extended + -u-network + + # We use a timeout because of how often we've had hang issues + # here. It also matches the default upstream PROFILE_TASK. + --timeout 1200 + + -x test_gdb + -x test_dtrace + + # All of these seem to occasionally hang for PGO inconsistently + # They'll even hang here but be fine in src_test sometimes. + # bug #828535 (and related: bug #788022) + -x test_asyncio + -x test_concurrent_futures + -x test_httpservers + -x test_logging + -x test_multiprocessing_fork + -x test_socket + -x test_xmlrpc + + # Hangs (actually runs indefinitely executing itself w/ many cpython builds) + # bug #900429 + -x test_tools + ) + + 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 + + # flock on 32-bits sparc Solaris is broken + [[ ${CHOST} == sparc-*-solaris* ]] && \ + export ac_cv_flock_decl=no + # Darwin 9's kqueue seems to act up (at least at this stage), so + # make Python's selectors resort to poll() or select() + [[ ${CHOST} == powerpc*-darwin9 ]] && \ + export ac_cv_func_kqueue=no + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + # except on non-glibc systems this breaks the build, so be + # conservative! + $(use elibc_glibc && echo ac_cv_header_stropts_h=no) + + $(use aqua && echo --config-cache) + --enable-shared + --without-static-libpython + --enable-ipv6 + --infodir='${prefix}/share/info' + --mandir='${prefix}/share/man' + --with-computed-gotos + --with-dbmliborder="${dbmliborder}" + --with-libc= + --enable-loadable-sqlite-extensions + --without-ensurepip + --without-lto + --with-system-expat + --with-platlibdir=lib + --with-pkg-config=yes + --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip + + $(use_with debug assertions) + $(use_enable pgo optimizations) + $(use_with readline readline "$(usex libedit editline readline)") + $(use_with valgrind) + ) + + # https://bugs.gentoo.org/700012 + if tc-is-lto; then + append-cflags $(test-flags-CC -ffat-lto-objects) + myeconfargs+=( + --with-lto + ) + fi + + # Force-disable modules we don't want built. + # See Modules/Setup for docs on how this works. Setup.local contains our local deviations. + cat > Modules/Setup.local <<-EOF || die + *disabled* + nis + $(usev !gdbm '_gdbm _dbm') + $(usev !sqlite '_sqlite3') + $(usev !ssl '_hashlib _ssl') + $(usev !ncurses '_curses _curses_panel') + $(usev !readline 'readline') + $(usev !tk '_tkinter') + $([[ ${CHOST} == *-apple-darwin* ]] && echo '_scproxy') + $([[ ${CHOST} != *-linux-* ]] && echo 'ossaudiodev') + EOF + + # disable implicit optimization/debugging flags + local -x OPT= + + if tc-is-cross-compiler ; then + build_cbuild_python + myeconfargs+=( + # Point the imminent CHOST build to the Python we just + # built for CBUILD. + --with-build-python="${WORKDIR}"/${P}-${CBUILD}/python + ) + fi + + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + local -x CFLAGS_NODIST=${CFLAGS} + local -x LDFLAGS_NODIST=${LDFLAGS} + local -x CFLAGS= LDFLAGS= + + # Fix implicit declarations on cross and prefix builds. Bug #674070. + if use ncurses; then + append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw + fi + + if use aqua ; then + ECONF_SOURCE="${S}" OPT="" \ + econf \ + --enable-framework="${EPREFIX}" \ + --config-cache + fi + + econf "${myeconfargs[@]}" + + if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then + eerror "configure has detected that the sem_open function is broken." + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." + die "Broken sem_open function (bug 496328)" + fi + + # install epython.py as part of stdlib + echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die +} + +src_compile() { + # Ensure sed works as expected + # https://bugs.gentoo.org/594768 + local -x LC_ALL=C + export PYTHONSTRICTEXTENSIONBUILD=1 + + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + addpredict "/usr/lib/python${PYVER}/site-packages" + fi + + # also need to clear the flags explicitly here or they end up + # in _sysconfigdata* + emake CPPFLAGS= CFLAGS= LDFLAGS= + + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + + # Work around bug 329499. See also bug 413751 and 457194. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E python + else + pax-mark m python + fi +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + # this just happens to skip test_support.test_freeze that is broken + # without bundled expat + # TODO: get a proper skip for it upstream + local -x LOGNAME=buildbot + + local test_opts=( + -u-network + -j "$(makeopts_jobs)" + + # fails + -x test_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= + # workaround https://bugs.gentoo.org/775416 + addwrite "/usr/lib/python${PYVER}/site-packages" + + 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} + + # the Makefile rules are broken + # https://github.com/python/cpython/issues/100221 + mkdir -p "${libdir}"/lib-dynload || die + + # -j1 hack for now for bug #843458 + emake -j1 DESTDIR="${D}" altinstall + + if use aqua ; then + # avoid config.status to be triggered + find Mac -name "Makefile" -exec touch \{\} + || die + + # Python_Launcher is kind of a wrapper, and we should fix it for + # Prefix (it uses /usr/bin/pythonw) so useless + # IDLE doesn't run, no idea, but definitely not used + emake DESTDIR="${D}" -C Mac install_Python || die + rmdir "${ED}"/Applications/Python* || die + rmdir "${ED}"/Applications || die + + local fwdir=/Frameworks/Python.framework/Versions/${PYVER} + ln -s "${EPREFIX}"/usr/include/python${PYVER} \ + "${ED}${fwdir}"/Headers || die + ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \ + "${ED}${fwdir}"/Python || die + fi + + # Fix collisions between different slots of Python. + rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + rm -r "${libdir}"/ensurepip/_bundled || die + if ! use ensurepip; then + rm -r "${libdir}"/ensurepip || die + fi + if ! use sqlite; then + rm -r "${libdir}/"sqlite3 || die + fi + if ! use tk; then + rm -r "${ED}/usr/bin/idle${PYVER}" || die + rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die + fi + + ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die + + dodoc Misc/{ACKS,HISTORY,NEWS} + + if use examples; then + docinto examples + find Tools -name __pycache__ -exec rm -fr {} + || die + dodoc -r Tools + fi + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 + local libname=$( + printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | + emake --no-print-directory -s -f - 2>/dev/null + ) + newins Tools/gdb/libpython.py "${libname}"-gdb.py + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${PYVER}:" \ + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" + + # python-exec wrapping support + local pymajor=${PYVER%.*} + local EPYTHON=python${PYVER} + local scriptdir=${D}$(python_get_scriptdir) + mkdir -p "${scriptdir}" || die + # python and pythonX + ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die + ln -s "python${pymajor}" "${scriptdir}/python" || die + # python-config and pythonX-config + # note: we need to create a wrapper rather than symlinking it due + # to some random dirname(argv[0]) magic performed by python-config + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die + #!/bin/sh + exec "${abiver}-config" "\${@}" + EOF + chmod +x "${scriptdir}/python${pymajor}-config" || die + ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die + # 2to3, pydoc + ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die + fi +} + +pkg_postinst() { + local v + for v in ${REPLACING_VERSIONS}; do + if ver_test "${v}" -lt 3.11.0_beta4-r2; then + ewarn "Python 3.11.0b4 has changed its module ABI. The .pyc files" + ewarn "installed previously are no longer valid and will be regenerated" + ewarn "(or ignored) on the next import. This may cause sandbox failures" + ewarn "when installing some packages and checksum mismatches when removing" + ewarn "old versions. To actively prevent this, rebuild all packages" + ewarn "installing Python 3.11 modules, e.g. using:" + ewarn + ewarn " emerge -1v /usr/lib/python3.11/site-packages" + fi + done +} diff --git a/dev-lang/python/python-3.8.7_p2.ebuild b/dev-lang/python/python-3.8.7_p2.ebuild deleted file mode 100644 index 462873fb58..0000000000 --- a/dev-lang/python/python-3.8.7_p2.ebuild +++ /dev/null @@ -1,387 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic multiprocessing pax-utils \ - python-utils-r1 toolchain-funcs - -MY_P="Python-${PV%_p*}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-${PV}" -PREFIX_PATCHSET="python-prefix-gentoo-${PV%_p*}-patches-r2" - -DESCRIPTION="An interpreted, interactive, object-oriented programming language" -HOMEPAGE="https://www.python.org/" -SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz - https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}" -KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="aqua bluetooth build examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl test tk wininst +xml" -RESTRICT="!test? ( test )" - -# Do not add a dependency on dev-lang/python to this ebuild. -# If you need to apply a patch which requires python for bootstrapping, please -# run the bootstrap code on your dev box and include the results in the -# patchset. See bug 447752. - -RDEPEND="app-arch/bzip2:= - app-arch/xz-utils:= - dev-libs/libffi:= - kernel_linux? ( sys-apps/util-linux:= ) - >=sys-libs/zlib-1.1.3:= - virtual/libcrypt:= - virtual/libintl - gdbm? ( sys-libs/gdbm:=[berkdb] ) - ncurses? ( >=sys-libs/ncurses-5.2:= ) - readline? ( >=sys-libs/readline-4.1:= ) - sqlite? ( >=dev-db/sqlite-3.3.8:3= ) - ssl? ( dev-libs/openssl:= ) - tk? ( - >=dev-lang/tcl-8.0:= - >=dev-lang/tk-8.0:= - dev-tcltk/blt:= - dev-tcltk/tix - ) - xml? ( >=dev-libs/expat-2.1:= )" -# bluetooth requires headers from bluez -DEPEND="${RDEPEND} - bluetooth? ( net-wireless/bluez ) - test? ( app-arch/xz-utils[extra-filters(+)] ) - virtual/pkgconfig - !sys-devel/gcc[libffi(-)]" -RDEPEND+=" !build? ( app-misc/mime-types )" - -src_prepare() { - # Ensure that internal copies of expat, libffi and zlib are not used. - rm -fr Modules/expat || die - rm -fr Modules/_ctypes/libffi* || die - rm -fr Modules/zlib || die - - local PATCHES=( - "${WORKDIR}/${PATCHSET}" - # Prefix' round of patches - "${WORKDIR}"/${PREFIX_PATCHSET} - ) - - default - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - # force correct number of jobs - # https://bugs.gentoo.org/737660 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die - - # workaround a problem on ppc-macos with >=GCC-8 where dtoa gets - # miscompiled when optimisation is being used - if [[ ${CHOST} == powerpc*-darwin* ]] && \ - tc-is-gcc && [[ $(gcc-major-version) -ge 8 ]] ; - then - sed -i \ - -e '/^CFLAGS_ALIASING=/s/$/ -fno-tree-ter/' Makefile.pre.in || die - fi - - # Darwin 9's kqueue seems to act up (at least at this stage), so - # make Python's selectors resort to poll() or select() - if [[ ${CHOST} == powerpc*-darwin9 ]] ; then - sed -i \ - -e 's/KQUEUE/KQUEUE_DISABLED/' \ - configure.ac configure || die - fi - - # Python doesn't know about arm64-macos yet - if [[ ${CHOST} == arm64-*-darwin* ]] ; then - # Teach Python a new trick (arm64) - sed -i \ - -e "/Unexpected output of 'arch' on OSX/d" \ - configure.ac configure || die - fi - - eautoreconf -} - -src_configure() { - local disable - # disable automagic bluetooth headers detection - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no - use gdbm || disable+=" gdbm" - use ncurses || disable+=" _curses _curses_panel" - use readline || disable+=" readline" - use sqlite || disable+=" _sqlite3" - use ssl || export PYTHON_DISABLE_SSL="1" - use tk || disable+=" _tkinter" - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. - export PYTHON_DISABLE_MODULES="${disable}" - - if ! use xml; then - ewarn "You have configured Python without XML support." - ewarn "This is NOT a recommended configuration as you" - ewarn "may face problems parsing any XML documents." - fi - - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" - fi - - if [[ "$(gcc-major-version)" -ge 4 ]]; then - append-flags -fwrapv - fi - - filter-flags -malign-double - - # https://bugs.gentoo.org/show_bug.cgi?id=50309 - if is-flagq -O3; then - is-flagq -fstack-protector-all && replace-flags -O3 -O2 - use hardened && replace-flags -O3 -O2 - fi - - # https://bugs.gentoo.org/700012 - if is-flagq -flto || is-flagq '-flto=*'; then - append-cflags $(test-flags-CC -ffat-lto-objects) - fi - - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. - tc-export CXX - - # Set LDFLAGS so we link modules with -lpython3.2 correctly. - # Needed on FreeBSD unless Python 3.2 is already installed. - # Please query BSD team before removing this! - append-ldflags "-L." - - # Fix implicit declarations on cross and prefix builds. Bug #674070. - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw - use prefix && append-ldflags -L"${ESYSROOT}"/lib -L"${ESYSROOT}"/usr/lib - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - if use aqua ; then - ECONF_SOURCE="${S}" OPT="" \ - econf \ - --enable-framework="${EPREFIX}" \ - --config-cache - fi - - # flock on 32-bits sparc Solaris is broken - [[ ${CHOST} == sparc-*-solaris* ]] && \ - export ac_cv_flock_decl=no - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - # except on non-glibc systems this breaks the build, so be - # conservative! - $(use elibc_glibc && echo ac_cv_header_stropts_h=no) - - $(use aqua && echo --config-cache) - --enable-shared - $(use_enable ipv6) - --infodir='${prefix}/share/info' - --mandir='${prefix}/share/man' - --with-computed-gotos - --with-dbmliborder="${dbmliborder}" - --with-libc= - --enable-loadable-sqlite-extensions - --without-ensurepip - --with-system-expat - --with-system-ffi - ) - - OPT="" econf "${myeconfargs[@]}" -} - -src_compile() { - # Ensure sed works as expected - # https://bugs.gentoo.org/594768 - local -x LC_ALL=C - - 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 - - # Skip failing tests. - local skipped_tests="gdb" - - for test in ${skipped_tests}; do - mv "${S}"/Lib/test/test_${test}.py "${T}" - done - - # bug 660358 - local -x COLUMNS=80 - local -x PYTHONDONTWRITEBYTECODE= - - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") - - emake test EXTRATESTOPTS="-u-network -j${jobs}" \ - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty - local result=$? - - for test in ${skipped_tests}; do - mv "${T}/test_${test}.py" "${S}"/Lib/test - done - - elog "The following tests have been skipped:" - for test in ${skipped_tests}; do - elog "test_${test}.py" - done - - elog "If you would like to run them, you may:" - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" - elog "and run the tests separately." - - if [[ ${result} -ne 0 ]]; then - die "emake test failed" - fi -} - -src_install() { - local libdir=${ED}/usr/lib/python${PYVER} - - emake DESTDIR="${D}" altinstall - - if use aqua ; then - # avoid config.status to be triggered - find Mac -name "Makefile" -exec touch \{\} + || die - - # Python_Launcher is kind of a wrapper, and we should fix it for - # Prefix (it uses /usr/bin/pythonw) so useless - # IDLE doesn't run, no idea, but definitely not used - emake DESTDIR="${D}" -C Mac install_Python || die - rmdir "${ED}"/Applications/Python* || die - rmdir "${ED}"/Applications || die - - local fwdir=/Frameworks/Python.framework/Versions/${PYVER} - ln -s "${EPREFIX}"/usr/include/python${PYVER} \ - "${ED}${fwdir}"/Headers || die - ln -s "${EPREFIX}"/usr/lib/libpython${PYVER}.dylib \ - "${ED}${fwdir}"/Python || die - fi - - # Remove static library - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die - - sed \ - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ - -e "s/\(PY_LDFLAGS=\).*/\1/" \ - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" - - # Fix collisions between different slots of Python. - rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die - - use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || 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 - if use aqua ; then - # we do framework, so the emake trick below returns a pathname - # since that won't work here, use a (cheap) trick instead - local libname=libpython${PYVER} - else - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - fi - newins "${S}"/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" - - local -x EPYTHON=python${PYVER} - # if not using a cross-compiler, use the fresh binary - if ! tc-is-cross-compiler; then - local -x PYTHON=./python$(sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile) - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} - local -x DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${PWD} - else - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} - fi - - echo "EPYTHON='${EPYTHON}'" > epython.py || die - python_domodule epython.py - - # python-exec wrapping support - local pymajor=${PYVER%.*} - local scriptdir=${D}$(python_get_scriptdir) - mkdir -p "${scriptdir}" || die - # python and pythonX - ln -s "../../../bin/${abiver}" \ - "${scriptdir}/python${pymajor}" || die - ln -s "python${pymajor}" "${scriptdir}/python" || die - # python-config and pythonX-config - # note: we need to create a wrapper rather than symlinking it due - # to some random dirname(argv[0]) magic performed by python-config - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die - #!/bin/sh - exec "${abiver}-config" "\${@}" - EOF - chmod +x "${scriptdir}/python${pymajor}-config" || die - ln -s "python${pymajor}-config" \ - "${scriptdir}/python-config" || die - # 2to3, pydoc - ln -s "../../../bin/2to3-${PYVER}" \ - "${scriptdir}/2to3" || die - ln -s "../../../bin/pydoc${PYVER}" \ - "${scriptdir}/pydoc" || die - # idle - if use tk; then - ln -s "../../../bin/idle${PYVER}" \ - "${scriptdir}/idle" || die - fi -} diff --git a/dev-lang/python/python-3.8.8_p1.ebuild b/dev-lang/python/python-3.8.8_p1-r1.ebuild index 0dde20dafe..46e8ceda5d 100644 --- a/dev-lang/python/python-3.8.8_p1.ebuild +++ b/dev-lang/python/python-3.8.8_p1-r1.ebuild @@ -25,7 +25,7 @@ S="${WORKDIR}/${MY_P}" LICENSE="PSF-2" SLOT="${PYVER}" -KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" IUSE="aqua bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" @@ -37,6 +37,7 @@ RESTRICT="!test? ( test )" RDEPEND="app-arch/bzip2:= app-arch/xz-utils:= dev-libs/libffi:= + dev-lang/python-exec[python_targets_python3_8(-)] kernel_linux? ( sys-apps/util-linux:= ) >=sys-libs/zlib-1.1.3:= virtual/libcrypt:= @@ -59,8 +60,8 @@ DEPEND="${RDEPEND} test? ( app-arch/xz-utils[extra-filters(+)] )" BDEPEND=" virtual/pkgconfig - sys-devel/autoconf-archive - verify-sig? ( app-crypt/openpgp-keys-python ) + dev-build/autoconf-archive + verify-sig? ( sec-keys/openpgp-keys-python ) !sys-devel/gcc[libffi(-)]" PDEPEND="app-eselect/eselect-python" RDEPEND+=" !build? ( app-misc/mime-types )" @@ -228,6 +229,9 @@ 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 emake CPPFLAGS= CFLAGS= LDFLAGS= diff --git a/dev-lang/python/python-3.9.3.ebuild b/dev-lang/python/python-3.9.12.ebuild index 94dabce063..10c3b971fc 100644 --- a/dev-lang/python/python-3.9.3.ebuild +++ b/dev-lang/python/python-3.9.12.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="7" @@ -11,22 +11,24 @@ MY_PV=${PV/_rc/rc} MY_P="Python-${MY_PV%_p*}" PYVER=$(ver_cut 1-2) PATCHSET="python-gentoo-patches-${MY_PV}" -PREFIX_PATCHSET="python-prefix-gentoo-3.9.1-patches-r2" +PREFIX_PATCHSET="python-prefix-gentoo-${MY_PV}-patches-r1" DESCRIPTION="An interpreted, interactive, object-oriented programming language" HOMEPAGE="https://www.python.org/" -SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz +SRC_URI=" + https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz https://dev.gentoo.org/~grobian/distfiles/${PREFIX_PATCHSET}.tar.xz verify-sig? ( https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc - )" + ) +" S="${WORKDIR}/${MY_P}" LICENSE="PSF-2" SLOT="${PYVER}" -KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="aqua bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml" +KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="aqua bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" # Do not add a dependency on dev-lang/python to this ebuild. @@ -34,8 +36,10 @@ RESTRICT="!test? ( test )" # run the bootstrap code on your dev box and include the results in the # patchset. See bug 447752. -RDEPEND="app-arch/bzip2:= +RDEPEND=" + app-arch/bzip2:= app-arch/xz-utils:= + dev-lang/python-exec[python_targets_python3_9(-)] dev-libs/libffi:= kernel_linux? ( sys-apps/util-linux:= ) >=sys-libs/zlib-1.1.3:= @@ -45,31 +49,39 @@ RDEPEND="app-arch/bzip2:= ncurses? ( >=sys-libs/ncurses-5.2:= ) readline? ( >=sys-libs/readline-4.1:= ) sqlite? ( >=dev-db/sqlite-3.3.8:3= ) - ssl? ( dev-libs/openssl:= ) + ssl? ( >=dev-libs/openssl-1.1.1:= ) tk? ( >=dev-lang/tcl-8.0:= >=dev-lang/tk-8.0:= dev-tcltk/blt:= dev-tcltk/tix ) - xml? ( >=dev-libs/expat-2.1:= )" + xml? ( >=dev-libs/expat-2.1:= ) +" # bluetooth requires headers from bluez -DEPEND="${RDEPEND} +DEPEND=" + ${RDEPEND} bluetooth? ( net-wireless/bluez ) - test? ( app-arch/xz-utils[extra-filters(+)] )" + test? ( app-arch/xz-utils[extra-filters(+)] ) +" BDEPEND=" + app-alternatives/awk virtual/pkgconfig - sys-devel/autoconf-archive - verify-sig? ( app-crypt/openpgp-keys-python ) - !sys-devel/gcc[libffi(-)]" -RDEPEND+=" !build? ( app-misc/mime-types )" -PDEPEND="app-eselect/eselect-python" + dev-build/autoconf-archive + verify-sig? ( sec-keys/openpgp-keys-python ) + !sys-devel/gcc[libffi(-)] +" +RDEPEND+=" + !build? ( app-misc/mime-types ) +" 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} + pkg_pretend() { use test && check-reqs_pkg_pretend } @@ -125,6 +137,16 @@ src_prepare() { configure.ac configure || die fi + if [[ ${CHOST} == *-darwin19 ]] ; then + # HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH is set because + # _dyld_shared_cache_contains_path could be found, yet it cannot + # be resolved when dlopen()ing, so simply pretend it doesn't + # exist here + sed -i \ + -e 's/_dyld_shared_cache_contains_path/disabled&/' \ + configure.ac configure || die + fi + eautoreconf } @@ -173,18 +195,25 @@ src_configure() { # Fix implicit declarations on cross and prefix builds. Bug #674070. use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw - use prefix && append-ldflags -L"${ESYSROOT}"/lib -L"${ESYSROOT}"/usr/lib local dbmliborder if use gdbm; then dbmliborder+="${dbmliborder:+:}gdbm" fi - if use aqua ; then - ECONF_SOURCE="${S}" OPT="" \ - econf \ - --enable-framework="${EPREFIX}" \ - --config-cache + if use pgo; then + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") + export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network" + + # All of these seem to occasionally hang for PGO inconsistently + # They'll even hang here but be fine in src_test sometimes. + # bug #828535 (and related: bug #788022) + PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc" + + if has_version "app-arch/rpm" ; then + # Avoid sandbox failure (attempts to write to /var/lib/rpm) + PROFILE_TASK+=" -x test_distutils" + fi fi # flock on 32-bits sparc Solaris is broken @@ -201,7 +230,7 @@ src_configure() { $(use aqua && echo --config-cache) --enable-shared - $(use_enable ipv6) + --enable-ipv6 --infodir='${prefix}/share/info' --mandir='${prefix}/share/man' --with-computed-gotos @@ -211,9 +240,27 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + + $(use_with lto) + $(use_enable pgo optimizations) ) - OPT="" econf "${myeconfargs[@]}" + # disable implicit optimization/debugging flags + local -x OPT= + # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get + # propagated to sysconfig for built extensions + local -x CFLAGS_NODIST=${CFLAGS} + local -x LDFLAGS_NODIST=${LDFLAGS} + local -x CFLAGS= LDFLAGS= + + if use aqua ; then + ECONF_SOURCE="${S}" OPT="" \ + econf \ + --enable-framework="${EPREFIX}" \ + --config-cache + fi + + econf "${myeconfargs[@]}" if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then eerror "configure has detected that the sem_open function is broken." @@ -226,11 +273,32 @@ src_compile() { # Ensure sed works as expected # https://bugs.gentoo.org/594768 local -x LC_ALL=C + # Prevent using distutils bundled by setuptools. + # https://bugs.gentoo.org/823728 + export SETUPTOOLS_USE_DISTUTILS=stdlib + + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + addpredict /usr/lib/python3.9/site-packages + fi + + # also need to clear the flags explicitly here or they end up + # in _sysconfigdata* emake CPPFLAGS= CFLAGS= LDFLAGS= + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + # Work around bug 329499. See also bug 413751 and 457194. - if has_version dev-libs/libffi[pax_kernel]; then + if has_version dev-libs/libffi[pax-kernel]; then pax-mark E python else pax-mark m python @@ -247,6 +315,12 @@ src_test() { # Skip failing tests. local skipped_tests="gdb" + if use sparc ; then + # bug #788022 + skipped_tests+=" multiprocessing_fork" + skipped_tests+=" multiprocessing_forkserver" + fi + for test in ${skipped_tests}; do mv "${S}"/Lib/test/test_${test}.py "${T}" done @@ -305,12 +379,7 @@ src_install() { # Remove static library rm "${ED}"/usr/$(get_libdir)/libpython*.a || die - sed \ - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ - -e "s/\(PY_LDFLAGS=\).*/\1/" \ - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" - - # Fix collisions between different slots of Python. + # Fix collisions between different slots of Python. (if it exists, Darwin) rm -f "${ED}/usr/$(get_libdir)/libpython3$(get_libname)" || die # Cheap hack to get version with ABIFLAGS @@ -327,7 +396,7 @@ src_install() { # python seems to get rebuilt in src_install (bug 569908) # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then + if has_version dev-libs/libffi[pax-kernel]; then pax-mark E "${ED}/usr/bin/${abiver}" else pax-mark m "${ED}/usr/bin/${abiver}" diff --git a/dev-lang/python/python-3.9.6_p1.ebuild b/dev-lang/python/python-3.9.6_p1-r1.ebuild index 844cd297c2..4c2c3f1d02 100644 --- a/dev-lang/python/python-3.9.6_p1.ebuild +++ b/dev-lang/python/python-3.9.6_p1-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="7" @@ -25,7 +25,7 @@ S="${WORKDIR}/${MY_P}" LICENSE="PSF-2" SLOT="${PYVER}" -KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" IUSE="aqua bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" @@ -36,6 +36,7 @@ RESTRICT="!test? ( test )" RDEPEND="app-arch/bzip2:= app-arch/xz-utils:= + dev-lang/python-exec[python_targets_python3_9(-)] dev-libs/libffi:= kernel_linux? ( sys-apps/util-linux:= ) >=sys-libs/zlib-1.1.3:= @@ -59,12 +60,12 @@ DEPEND="${RDEPEND} test? ( app-arch/xz-utils[extra-filters(+)] )" BDEPEND=" virtual/pkgconfig - sys-devel/autoconf-archive - verify-sig? ( app-crypt/openpgp-keys-python ) + dev-build/autoconf-archive + verify-sig? ( sec-keys/openpgp-keys-python ) !sys-devel/gcc[libffi(-)]" RDEPEND+=" !build? ( app-misc/mime-types )" -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc +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 @@ -235,6 +236,9 @@ 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 emake CPPFLAGS= CFLAGS= LDFLAGS= |