From 3cf7c3ef441822c889356fd1812ebf2944a59851 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 25 Aug 2020 10:45:55 +0100 Subject: gentoo resync : 25.08.2020 --- dev-lang/python/Manifest | 44 ++-- dev-lang/python/python-2.7.18-r1.ebuild | 366 ++++++++++++++++++++++++++++++ dev-lang/python/python-2.7.18.ebuild | 366 ------------------------------ dev-lang/python/python-3.6.10-r2.ebuild | 357 ----------------------------- dev-lang/python/python-3.6.11-r2.ebuild | 365 +++++++++++++++++++++++++++++ dev-lang/python/python-3.6.11.ebuild | 357 ----------------------------- dev-lang/python/python-3.6.12.ebuild | 365 +++++++++++++++++++++++++++++ dev-lang/python/python-3.7.7-r2.ebuild | 343 ---------------------------- dev-lang/python/python-3.7.8-r2.ebuild | 351 ++++++++++++++++++++++++++++ dev-lang/python/python-3.7.8.ebuild | 343 ---------------------------- dev-lang/python/python-3.7.9.ebuild | 351 ++++++++++++++++++++++++++++ dev-lang/python/python-3.8.2-r2.ebuild | 346 ---------------------------- dev-lang/python/python-3.8.3.ebuild | 346 ---------------------------- dev-lang/python/python-3.8.4-r1.ebuild | 346 ++++++++++++++++++++++++++++ dev-lang/python/python-3.8.5.ebuild | 355 +++++++++++++++++++++++++++++ dev-lang/python/python-3.9.0_beta3.ebuild | 323 -------------------------- dev-lang/python/python-3.9.0_beta4.ebuild | 323 -------------------------- dev-lang/python/python-3.9.0_rc1.ebuild | 331 +++++++++++++++++++++++++++ 18 files changed, 2851 insertions(+), 3127 deletions(-) create mode 100644 dev-lang/python/python-2.7.18-r1.ebuild delete mode 100644 dev-lang/python/python-2.7.18.ebuild delete mode 100644 dev-lang/python/python-3.6.10-r2.ebuild create mode 100644 dev-lang/python/python-3.6.11-r2.ebuild delete mode 100644 dev-lang/python/python-3.6.11.ebuild create mode 100644 dev-lang/python/python-3.6.12.ebuild delete mode 100644 dev-lang/python/python-3.7.7-r2.ebuild create mode 100644 dev-lang/python/python-3.7.8-r2.ebuild delete mode 100644 dev-lang/python/python-3.7.8.ebuild create mode 100644 dev-lang/python/python-3.7.9.ebuild delete mode 100644 dev-lang/python/python-3.8.2-r2.ebuild delete mode 100644 dev-lang/python/python-3.8.3.ebuild create mode 100644 dev-lang/python/python-3.8.4-r1.ebuild create mode 100644 dev-lang/python/python-3.8.5.ebuild delete mode 100644 dev-lang/python/python-3.9.0_beta3.ebuild delete mode 100644 dev-lang/python/python-3.9.0_beta4.ebuild create mode 100644 dev-lang/python/python-3.9.0_rc1.ebuild (limited to 'dev-lang/python') diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index 9ad613422914..5cf42182eb59 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -1,29 +1,27 @@ AUX pydoc.conf 169 BLAKE2B ce40bb3d5f858bd7a8d9ef5bf215a8ab592568a724f0e08aea219da014dac12fdfcbcf5fb168bb9aa57be110f74d656aed46179ffe11e3c992d84a647e442b7b SHA512 30d0776a4004cd641e6f283658c3c24915a21ea15fe40e506ff2c3a5f95936aa00c9490b04ab25f29e9b7ac65cd88fd54ca0b08e000e73820b13c7c57c0bf5b2 AUX pydoc.init 600 BLAKE2B fb8775a6663483e5112ec283627610b746020d88494e772b92bb718a9493a52606e565c6c2fa4917a5cb963f166283d09883bd26903f2f3ced6c240d4e292a7f SHA512 9e71ad53486b6882a8441b24225c602195ee33d29dd1b60df27febbc6b752e79929be356152a489f893dcfb11f9c066b999787bc27a8ac61062c86e67a69e87a DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381998256a1a002d316b38288349884d5960de35c49352d03129ed0bae599e641ec2225898158ebce50a7a2fd74d2c SHA512 a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c -DIST Python-3.6.10.tar.xz 17212220 BLAKE2B 822e231cf2755e6477e49e9128a983185a4f1e30e9d6c221f1b5720891c0de345e8c5402af458d3627eba124e75fea4b5daa94e01b0eaddc116dc3281263ecbe SHA512 26147099e1f1a0ffc85febad26e18e991f019599a150887ea0b925e34663fad8e03b3c2a941e2770c1a63960695e173ef32709572c9361e7f2cb862ccf75b28a DIST Python-3.6.11.tar.xz 17213036 BLAKE2B 4dae9d9c5eb7e97a8990b0b5739d40ba8a85081c7e03adc22a3305e713d39b3a98ff66c17b395b9d45355e124307eed87803211378d14360e8b3455f7146a1ba SHA512 c76969a6602e095641ba5fd0999a47cf0187eb26559ba9a6e80fe401b8928f6cd9eabd963f615f7c667e48f56603f2508d2b5692c83ea8da1e21292131fb11d6 -DIST Python-3.7.7.tar.xz 17268888 BLAKE2B 5f16c9559249470a9e6c0aa686965e7d78ce0f7364b5d03fc9590613c7a5456f92835340e49bf9becbec18b18d1e5a6fc318b6e30f2349da3246a918cf8b05ff SHA512 ddc838a7b0c442c2e465616f20231f2b703ed6b69ed2dc17858aac8760814fdf7cff43d350d359300e47b6bb1f0bd38c31126b855e423a3a65ed06a8fa16d136 +DIST Python-3.6.12.tar.xz 17202980 BLAKE2B c8d22e4d57bcaffe77cd902cda3a473e73adf2b74ab104c23b4d846f19632a24cc0c478af84079b16d784bd1c0956824c06c1f6134fd24f54e58aaab0fe96bb6 SHA512 1462801f3f6626a853097d34ccdca9838c4c5bd81ecc3abc751003f5f2f8d36eecdaa4130ef4218de351c5586093c11669639a34492668fbc5a2a4a241f4a070 DIST Python-3.7.8.tar.xz 17399552 BLAKE2B 4bf6c47b1132b6d31a79232002c4d38e2cd123ac05d52b21d6bfba5a4e19ec9130b8df8698d5ce6627e4297c4cf756643f036e694e36364c235306c72ef34bf8 SHA512 d2ba299e3cf8ed0f8fed9317f42bcd8d9af7e0e6175939b4be1be289c1658418bed17899e2608d762ffb15575021956cf6bf2054d7863c04b3bd7642f5b8c7ea -DIST Python-3.8.2.tar.xz 17869888 BLAKE2B f42b35bea5e65f1f0a3fa6f1fd3d749fba3fa46d958608a314c1a98d0e3ca890e856da4d40ee489fe546fc02ce0fc9fa2daaaba96a8928d92ae7eb3d2dda3fe4 SHA512 ca37ad0e7c5845f5f228566aa8ff654a8f428c7d4a5aaabff29baebb0ca3219b31ba8bb2607f89e37cf3fc564f023b8407e53a4f2c47bd99122c1cc222613e37 -DIST Python-3.8.3.tar.xz 17912964 BLAKE2B 9c415823f70bad97936e0472fc53a1b7650cbf0082da714266095dec74e0cd4a48c9477ad03fbb75fdc2cd8e41ef3aa5839e38fc69751720f5cb5c7fc77cce17 SHA512 3103bd8d944f3905eee3a2b52fd1f5c7dee380f9c5a99ad35a401fcba5a9117c3860ecec5cb47a92712c6549442fd2fa553a15c5657241dd09f5d00b9ed4f0f4 -DIST Python-3.9.0b3.tar.xz 18518204 BLAKE2B fa1707f0d55a83e739e9ad51979f8aff9720588a8a77b7ce8beb9ecf599955677758dec1551a0549b010f86c1f8fbc5915cef34d63097534d1c512c92fad5bd1 SHA512 c06a6b874fbce93ec37402034158a7bab44cab775d6da467eaddc1eb402663415f9d788e657a204f17dffe5fa6f379379f9215b5198ec5071565486b6f0e4a2a -DIST Python-3.9.0b4.tar.xz 18602256 BLAKE2B 9f260f2b3c6380745c343d2883db430dda1b76b120050df16e53c1021e5a746c7e4a6aa8e83c746c3705c6872e83369a649c48ffdaef972a7049c44f7bc3030b SHA512 1c9bac850159352effb163b41590b3e9c05100b449798b5615f7a51a59a3877fe9558d593bb47c24915226637e3394e7864a1b1555cd6c5b5e5e308972208ecf -DIST python-gentoo-patches-2.7.18.tar.xz 15012 BLAKE2B f691e231c793bb8f11fb64c89b90e022af8e0fe0e28839822c2ae6214fdab6c6fd9c07466c4b5797d3964b7db09fd979597774fb7872dc674e8df59321b6bf95 SHA512 a2952b27bfc0a52f322b2f3e177cbe09fa288c9ca5967c13fb9c2d45d3e81033407e30e86bdaaaa258f0b3cfa2cef6eda5502bddb6390f9512a493d145d34e03 -DIST python-gentoo-patches-3.6.10-r1.tar.xz 15556 BLAKE2B 3d4755a083172fc878d3454797a4a7fa809c7767b7f2ba0919b95076b8ecba62ac604a7db349d8dd71f83aa44d4580d0c433ae6cd2027078e7779cec79185ba2 SHA512 b361ff3fe9545bb59a7e85f179a094d58219be35d20cef83db02672d0a9a58fccfda62fbe8c2bf64250c4043b8517cbc2091380611c5f1e63bfac9ca7c4e47b0 -DIST python-gentoo-patches-3.6.11.tar.xz 11180 BLAKE2B ac4be3da8510d64efcd902ea1408e9c2530e6f1cb5f4ab74ef3280bc3d4d554a04cfcebf417297586e2992af91ff5da511b3e371ac88237218d6e837714e2fec SHA512 b29aec6ac02b71dec4884a8b2b24f929fa3c8709d985c8b134d3ab835be78fd4e9da4f9006d491382442a19895e748b806b7f27d30c6970cf42982bd16fa1946 -DIST python-gentoo-patches-3.7.7.tar.xz 14644 BLAKE2B 1a377eac945310082ec9fa257bcb406c7eaf24b5e80469dd49e82a1bc0554b75394678609cae447cb0fc7a19059b29166bf110b6ed99a89a9919b3a56a323f87 SHA512 2c7fbcefd6f4d1674b78f3b67f2be3f1b168e08c318fefe8d4757f2d30c22477f5010ad6f2c0abb265d819ee667617f21f93e002242e216b4ee570200b0ddf74 -DIST python-gentoo-patches-3.7.8.tar.xz 10304 BLAKE2B dc1bff35bdf3f7e97d15fbd0af4c3278ea54b43cb204641f666293dec507431987445fe6ecb991814842b8c58c65a6185b4c24e3ae08d682ef98916263af7cd4 SHA512 5871121e514dd6af4d9298550a5e01ee114950fd6db58bb8bdb879ede602a228f64d7bf8f6e04317ababc42a502b1192f4a010122745d5a8bc7a40866106479a -DIST python-gentoo-patches-3.8.2-r1.tar.xz 16112 BLAKE2B 9ae197a56bbd96afa11c4312c68ac030138773df22dedc3a3e6fb9e81b366d6522fb2c147946eb604a87d749cbea7e5e5eed8ae0e737294c0949a8c2791dd327 SHA512 00f31c3b7227dd443f05234fbb7744338ce687e1ea4d236a6b1d386d76082acb34259f59442018c9ace54e0004dea9ac822ae2a4470159b83d00112e258baff0 -DIST python-gentoo-patches-3.8.3.tar.xz 10704 BLAKE2B 6fdd13139b1132313153af2de774abeca7c1fe9acb34a87e5d96875a4cbe8c22c201acbb11c15eeaf828493c32f6acd89e3b5d4012fa2c9d216da556aadb9f01 SHA512 6f67d77e8240983c0dd749620e5df81df5816b831032e190c82c8d73ea8a995daf2631640234a1350e483bd13276466457d110176612bfde3281d1b6a8bf97bb -DIST python-gentoo-patches-3.9.0b3.tar.xz 8592 BLAKE2B 261dc9a5c7b370eb3f693f5bfb15562a5ee8b24b038db1b16571f096ff0d451ef8830c7f51db53366ebcf6e378dfab57e186f1789dc3ecc95e65595708f4428e SHA512 4c630b1b15e752ae154bfc9d0f5c8a17ac02127f96ccf114469bb92d02fe7d2ac13acd2415bfe6af0169c823b4aec09e2d6886c031df8e8c809ccb94efa60b62 -EBUILD python-2.7.18.ebuild 10593 BLAKE2B 8e0f4c58a44ffe10533a7e534bb28a642e258468a4d546a77e39075d1c8ff63d2b3e9d99858eb1d93f84b40101f9cdc2b1db0e45ab6755167da486e5f9468e59 SHA512 5f880a3e0a47efb13d0f9f7f9e7ad01f78c46d772d9de999c3bb67b68adca05a1e01dc2fff8b21b8daaba9e0b9cdb44642c35e04a98217b04d5e2ee3fda2719e -EBUILD python-3.6.10-r2.ebuild 10333 BLAKE2B 550cfb681267f867d7454097faabf278517f6dbd93b64b879d08251ca5d018456baa4097c632be29885ed6f89de82482c282b15f9777cfc21ec5b342a25e6836 SHA512 568baa3112199ef0d3beab20ab37fa7e7c54e25b91285b86f27665a987f3303258ff78fe2682b67c22cabdd3db0724387a9d85f6284b1c059ec709c113194e1f -EBUILD python-3.6.11.ebuild 10339 BLAKE2B dc9b943a81912964afa1104bfb2d1dc5665e2357b3108f43cef528d3cc79a59c3f1f9430b9081c134e8f9b0cbd844798ebffd8a47f08aa4db8d130e330be4e9b SHA512 979dd02f98e577034bdbbc8dd85c7ccc42cc6e1ec747d096f4237916e3546776e8bbe12371c112ec185f2d2dc7c3a5319f9a4b5f944120af713a8c7a0160247a -EBUILD python-3.7.7-r2.ebuild 9877 BLAKE2B 182391402d72a38090801f4ea95ddcc26385bfb6174d7fffe6d0acb45fc735ca62d561ba64b324f2e6d64761f51ec18dfc1c4f04abe131138ebe8985b927fd2d SHA512 39fed5b175cf581371ae4150c539e4a2d1a3d5f7f247d92147c49fd8cd7eb231688d7507b1efb10194683834b37697c5f4e6721bffd592ca8698355fe9670a58 -EBUILD python-3.7.8.ebuild 9886 BLAKE2B 24803229a1282b90ed018ad5edf685fab787d09afbd7af2caf66d3e8f23f40ecafbd740a848fae5fe572edf7e38671071eb8b02ea3d800a4df48def5d50a421d SHA512 ea2b32238af895a4f7e89c7df500aecbbfb2b79f13fe88e73340e4187c8b52033510d744138bc69b4e8a79eb2ad41406ebabc394c59bb344a5f86b93c40e08c0 -EBUILD python-3.8.2-r2.ebuild 9928 BLAKE2B e131852b497fd24ecf3768cfaff2188e499a0ca0700443a146b26a0b2e38c1c83a0438455f22afa45f7eaeb96e744bdce9a1530ad831fe929ed561f3f0cc84a5 SHA512 b43d77bf74b18d4d758df5b6399cc38e5edfd52d1652f5b5c0d6083f22ebd5f880e4e5a12244895300aebd284863e77d0318c053b0e87e7e6572e88ec6b5c15b -EBUILD python-3.8.3.ebuild 9934 BLAKE2B 9319fd3f2283fb848d28e153b25bb771f2f060fa5348a7b6ccbad0c3a706713bc9f05abb1acf928df4df8b00dd77562e814dd6c610bab33a19b738f57c38ee9b SHA512 9a3ff67e6b8105790fe72f9359aa6fedcfb06860d4b67ff3c5bc50c8d84ed5324dc2d581d39c6867bf103414c4db2a2657730a48ff58e85b7665ef5d0dd55a0e -EBUILD python-3.9.0_beta3.ebuild 9219 BLAKE2B 7901178a271e7e6bcb8cdc8d7dfa39475fe1f77c298d6222e0aa1a9dc32f999b49691c14102ebb755bf9fef85717fefe1a10b5bf6d2988f8783b6944cb56c989 SHA512 7d05c62b192e2df79c0ed74ca13054f45ddd9c0f2fa77aea0c0ad805cf70274678f8282a6fe7d7f890cae52a07971497c471510e1f1fb1555ee7177b93ccdefe -EBUILD python-3.9.0_beta4.ebuild 9219 BLAKE2B 7901178a271e7e6bcb8cdc8d7dfa39475fe1f77c298d6222e0aa1a9dc32f999b49691c14102ebb755bf9fef85717fefe1a10b5bf6d2988f8783b6944cb56c989 SHA512 7d05c62b192e2df79c0ed74ca13054f45ddd9c0f2fa77aea0c0ad805cf70274678f8282a6fe7d7f890cae52a07971497c471510e1f1fb1555ee7177b93ccdefe +DIST Python-3.7.9.tar.xz 17389636 BLAKE2B 484833aa2aa4e29051a02969294f72099ff6f1a47d944b1a0dd15f8e6c22a0406d551bcbcd1048cf89defedaccf060733211e34b38e31fd8391dd823eaa35bc0 SHA512 e4217b25529b5336e43b63d17f3758a8177a58184564cf02bd92a312f58dba9e096485c9e3cb3544f966e847ea15b3ab30ed065d28a6ca52a6d7e0faddf7d9f9 +DIST Python-3.8.4.tar.xz 18020412 BLAKE2B cfcfb293c413b25fc3ca48116cf8ffaba7bee18e9af9accf26be9b4373a0c62dd8e9da70e5a8a38ba6da4d1afbdbd589ae5ea4b618b65130ae061698b445908c SHA512 37a36d014a8372742be9d0bd9dd3a275e100dc21b1515c145bc62425d4d157327b6e63ad99bc888c0b36c1da4c05676c40eb086e75072d1906e3210ec3043dcb +DIST Python-3.8.5.tar.xz 18019640 BLAKE2B bb3e0566afe28759e4ab129ad0986a0fc5103514f2e2b22ff4aa3973c3173ebdd24d4267fbaf903841814a611fd9ea122673e5a1918934366e5c0efaef9d7517 SHA512 460cee65d7df7150694590575502d7f22e548ebfc99c8f8b363eef8bf30ee72e58d8ffacb1d607824f877f880eb9fd6775a508388029583e1e1df3380f3f9587 +DIST Python-3.9.0rc1.tar.xz 18798364 BLAKE2B 2ebf669720bcc057f7e1056aca6ff42686a8e567a5ea10304f19e53ae80ba6ba60b9157ae401427be4afa1ec296d97bb81a2b55c60a4df3dba39ae545484e0fc SHA512 8fddf940600bdd4096c0144f689fb9e803bdc7a1ee00f46ccfde3566342ed465c7ac6806613e4f61440fb65f8f83057204bd0dc432ac379759cd4d410c151eef +DIST python-gentoo-patches-2.7.18-r1.tar.xz 15500 BLAKE2B 7008b29827dbbd80d4ab8f010ccf9efced99c6b4b9109e4430c0ba269ce53529cb6fedd832502c8d2d3aa21938749cc3591c2545b21c0a59a6e60f8598e84ccc SHA512 e656ab07281fd932b92165674619bbf55ecf410d2937ae4ae771d490b4532540498cc731d30d19c1e8aafd1f64df8a406bbfbb46ea985b3dcd8edb89a0b7f20f +DIST python-gentoo-patches-3.6.11-r3.tar.xz 14064 BLAKE2B 416780c15ee12cfc06bfd1397d510dd42fea61abcaafd9cf54f27d843342debf0caa93c9700686feb14f04239ad4ea8f20ce8736029638abe7d7b9c57b9d659d SHA512 de6a4a5bec89e6149b85b383991c99bd9460a8f59f52a700d54edd0154557727ccc79daaa90336dff434b222657c3f28dda1228d2d474002d0a28f31c9ed0b10 +DIST python-gentoo-patches-3.6.12.tar.xz 11448 BLAKE2B a7fb7153ca6fd353649f9dc23f2d777e84ff144d67984d8c3d292619a4f671e3a71d8022bcc334b55f9f1f416ceeca113fb116da805e4bc45d8a67cbc098ead8 SHA512 7efb97abd3e058e4532b89205c99794836ba094079de2a6d7846fd2673ea8cc31e68573b83fd9f82453151653fb0ed9bc40b7961b41efdfe703b64cbed2576bf +DIST python-gentoo-patches-3.7.8-r3.tar.xz 13232 BLAKE2B 9df47b1f61d08f62a80221bc48d73ec27cd74a9ade8219912c5b02eaea919b70d91b1154837cd03c0129a5839186e9c970167ca3398129c044c25c7853f1f920 SHA512 e1477d425cb6125ca2286d816f4aa4e9e3c789d6a4f4907bd7b78549598356cae5766f642e2cad9e7c3abe2e82c12cf3cb7db3513be68aa213cb64cc0abc678a +DIST python-gentoo-patches-3.7.9.tar.xz 10588 BLAKE2B f60c8500671e7e3977412474c838905846e0609a7fdac787f2c6a8bfa53c887dcfd3466c5276772ffb8c20205e8b3f207f7d148c04524f19d095964b519da62d SHA512 11f411eb2d59fd45fbd80bdb1d1a83d413770779244045006942c5cb84837cba606673bcde102ae03b1d4579f526b551c93a64d39dba530b4584ba8dd8e9f13e +DIST python-gentoo-patches-3.8.4-r2.tar.xz 12660 BLAKE2B 3197edc6beb2b1be05399f268ff9b337ed67f699e3867160fea8e50f763a62b184ddd7adcdfa55dafc8c14f91e020b409461027361d04858db667992794b1168 SHA512 c56adbec04bfb950f7fb65f38cc0b78eaae9783800c755b7ac934b07725fcf4d69bbc2c29f7d1255acd6e88559a216dc8a6088042a479aa0d453b706e318c0cf +DIST python-gentoo-patches-3.8.5.tar.xz 11280 BLAKE2B 163c577da75f4ec0ebe86b5a08bea96d5ae406020bd211439b1405c0f8a5dddc9422a9ea5b16eed195433cbec010d9def3126a578d3f9716325482216b9e4d62 SHA512 6b7f72b8deb87fb7a169e97391185823984b5e9c99ec5232504c670843fbe0ca76afe32fc3fbe1f850ec6c42e9325cf4697022f36f7b00a4028b324069dd4d5b +DIST python-gentoo-patches-3.9.0rc1.tar.xz 8856 BLAKE2B 7bd032dfd047640c6a53633b5b9ee7b24199106b985230f772dda978d3b79fe0406eea64c4a842603a20afb71a90469befa7ec59a5ef1f793e4c901aa85952d1 SHA512 85a7d4397abf2a0f3c3d07a94a3e184ba3dcb347f3b70ee2cb77e81aac63846b01323a0228afd0fd1d32b3cafb64b18f82e6f5bfd88e4d564261ddae11e747eb +EBUILD python-2.7.18-r1.ebuild 10596 BLAKE2B 2aa1a8152a9fd960de4dbc37e3b959d412855e3901c946783b908feeaf25af6333a5d375a26eef50436b8c5167019c7c7b5e0610787850f73b57ee6a4814fe65 SHA512 cdc9dafd0fadd459a4a8d22c5dc7b89fc125ca13ee3ca45166416acc26628b7f97478b4efd9e976177e209b1e2fa592a5034c79f343096053f4ddd790424f0d7 +EBUILD python-3.6.11-r2.ebuild 10610 BLAKE2B d9074e767b11ed420c843665b87c466f0014713221c0db4a026fbd91a39debc69689a1674db8a0c0b80dc3eb8df7bc86fe92972918f4c95ef8a52da2936bf631 SHA512 693795866815e724267877e4f97e14d09eda9f321b5c2b481f54952fcefc0859072ab42306eb03b81bd8b3e0a2d71435367452330caabf6bfebbcd2062d1ced0 +EBUILD python-3.6.12.ebuild 10615 BLAKE2B 7aebcadf3a22ebba8601bad7d3d701d24a78788bdc4e727375a7583d5c29522aec77802a30adbd0b0855c464edbf18d40aea2ee2df80184d8d08c1dac6843474 SHA512 40c4a643756e7b7a1b640fc23cbf65cab24615766b9aac538ff32a0684738e715007a659a48a7f0dbd6cb6783026856e0591700f57be4438112d1018739575a6 +EBUILD python-3.7.8-r2.ebuild 10157 BLAKE2B 9d802985fd19463a82452e390a7c20144c839075e307c1ddcdcce9ee0aa923d35e39501af27274cc93d7478ce9beb03e30104dfdc5e464ed1923c1af76f4384e SHA512 7372df64cf7d230bf0e307b442b29c617d062f7bed9032e1e2179e576b788db0c3c8426eae39e654f5eaea6f632a35927e2bf2e32d9f6d247c7359adcb22d322 +EBUILD python-3.7.9.ebuild 10163 BLAKE2B 6b9298cd3d854ab216ffa42c2f6ef36dbd6fadb4b432cfdcbefd7d6a50e62ecf2e9c08e9aa7dadabc6528e2f7e6cc683cc857e131e74204191b97e69ec09bbe3 SHA512 87d3c0947b89b49e76e0366b8b71fc18e0a718ea3fdc1dc270cacaf651de1ec4709bea7fa10a1e6629d639c9c39b1eb5ae048d4014a12f1a7c8683548fff5eef +EBUILD python-3.8.4-r1.ebuild 9928 BLAKE2B 9ebf074bef412756a79b6a9995f8eebdb92239e0558101b873e5d81a3ce74ef8bdcd0fcfb12f93a5d684d919b840912f91213351ef2db4e634feb00e3071ca81 SHA512 c3f9125df55adada570e75a521017e503e095335f98ef899b9d932ac731af8e21487e0710a70572c2766193ed02cc1e32f2350b457add36519762607c131a629 +EBUILD python-3.8.5.ebuild 10258 BLAKE2B 499ca6e4af5eff7f1ecf0956262b5cd9d3a7b1b4832abcc2041e79e8617cda438f685e4e227dfd475f54c02a2132ebd26c6ddaa97662c1e3fe821586ae089e87 SHA512 31eb14cd5dab778578c0460f7fec610c20d54bed51407c4eec22cac1dd35730fe46c7b0ff2beea3fe925d4972831e61d58431ed62116914bf1428cacb909600e +EBUILD python-3.9.0_rc1.ebuild 9542 BLAKE2B 8185c40c749ce46f8bcadccf0da4f6f67d7b134cf3c145d5d7aecde49bbe1fd3aef035362b6d96c1cae596d91df58daeb2d504713cce5ab93a4b02f650bdf438 SHA512 5ac13c9dbb331b6eb50314770623ca29c7bb1fff15177845b0d2a67c82795062b6fc02d274364d9ecd58a5e9d4caf23350df414b46d7c483a90e178916c9bce9 MISC metadata.xml 819 BLAKE2B 120c7c65d77488e726c5a0f4aa19469867ea6900e747169fae2f9cf8f14ec2936089d5edfe1935ce610bec26387273e261b1cc4b023680c8c4b229f2141a7223 SHA512 08f45707e5490067a21951b9d37c8ae67064ab67cccc5b8d8c204eab8d4a004fb910627b62989c67b849b89d301618f8f8f7996e99e1ef5bab38a239c49c124d diff --git a/dev-lang/python/python-2.7.18-r1.ebuild b/dev-lang/python/python-2.7.18-r1.ebuild new file mode 100644 index 000000000000..146b0a7e20e4 --- /dev/null +++ b/dev-lang/python/python-2.7.18-r1.ebuild @@ -0,0 +1,366 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +WANT_LIBTOOL="none" + +inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs + +MY_P="Python-${PV}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-2.7.18-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 + https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86" +IUSE="-berkdb bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +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:= + dev-libs/libffi:= + >=sys-libs/zlib-1.1.3:= + virtual/libcrypt:= + 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:=[berkdb] ) + ncurses? ( >=sys-libs/ncurses-5.2:= ) + readline? ( >=sys-libs/readline-4.1:= ) + sqlite? ( >=dev-db/sqlite-3.3.8:3= ) + ssl? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 ) + virtual/pkgconfig + !sys-devel/gcc[libffi(-)]" +RDEPEND+=" !build? ( app-misc/mime-types )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +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 -fr Modules/expat || die + rm -fr Modules/_ctypes/libffi* || die + rm -fr Modules/zlib || die + + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + ) + + default + + 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. + 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 + + # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. + tc-export 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! + append-ldflags "-L." + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + if use berkdb; then + dbmliborder+="${dbmliborder:+:}bdb" + fi + + local myeconfargs=( + # The check is broken on clang, and gives false positive: + # https://bugs.gentoo.org/596798 + # (upstream dropped this flag in 3.2a4 anyway) + ac_cv_opt_olimit_ok=no + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --with-fpectl + --enable-shared + $(use_enable ipv6) + $(use_with threads) + $(use wide-unicode && 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 + ) + + 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() { + # Ensure sed works as expected + # https://bugs.gentoo.org/594768 + local -x LC_ALL=C + + # Avoid invoking pgen for cross-compiles. + touch Include/graminit.h Python/graminit.c + + 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 + + # 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${PYVER}/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${PYVER} + + emake DESTDIR="${D}" altinstall + + sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die + + # Fix collisions between different slots of Python. + mv "${ED}/usr/bin/2to3" "${ED}/usr/bin/2to3-${PYVER}" || die + mv "${ED}/usr/bin/pydoc" "${ED}/usr/bin/pydoc${PYVER}" || die + mv "${ED}/usr/bin/idle" "${ED}/usr/bin/idle${PYVER}" || die + rm "${ED}/usr/bin/smtpd.py" || die + + 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${PYVER}" "${libdir}/"{idlelib,lib-tk} || die + use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} + + use threads || rm -r "${libdir}/multiprocessing" || die + use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die + + dodoc Misc/{ACKS,HISTORY,NEWS} + + if use examples; then + docinto examples + 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 "${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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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/python${PYVER}" \ + "${scriptdir}/python${pymajor}" || die + ln -s "python${pymajor}" "${scriptdir}/python" || die + # python-config and pythonX-config + ln -s "../../../bin/python${PYVER}-config" \ + "${scriptdir}/python${pymajor}-config" || die + ln -s "python${pymajor}-config" \ + "${scriptdir}/python-config" || die + # 2to3, pydoc, pyvenv + 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 +} + +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-2.7.18.ebuild b/dev-lang/python/python-2.7.18.ebuild deleted file mode 100644 index bd043f3e2c6a..000000000000 --- a/dev-lang/python/python-2.7.18.ebuild +++ /dev/null @@ -1,366 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-2.7.18" - -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" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86" -IUSE="-berkdb bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +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:= - dev-libs/libffi:= - >=sys-libs/zlib-1.1.3:= - virtual/libcrypt:= - 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:=[berkdb] ) - ncurses? ( >=sys-libs/ncurses-5.2:= ) - readline? ( >=sys-libs/readline-4.1:= ) - sqlite? ( >=dev-db/sqlite-3.3.8:3= ) - ssl? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 ) - virtual/pkgconfig - !sys-devel/gcc[libffi(-)]" -RDEPEND+=" !build? ( app-misc/mime-types )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -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 -fr Modules/expat || die - rm -fr Modules/_ctypes/libffi* || die - rm -fr Modules/zlib || die - - local PATCHES=( - "${WORKDIR}/${PATCHSET}" - ) - - default - - 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. - 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 - - # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. - tc-export 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! - append-ldflags "-L." - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - if use berkdb; then - dbmliborder+="${dbmliborder:+:}bdb" - fi - - local myeconfargs=( - # The check is broken on clang, and gives false positive: - # https://bugs.gentoo.org/596798 - # (upstream dropped this flag in 3.2a4 anyway) - ac_cv_opt_olimit_ok=no - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --with-fpectl - --enable-shared - $(use_enable ipv6) - $(use_with threads) - $(use wide-unicode && 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 - ) - - 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() { - # Ensure sed works as expected - # https://bugs.gentoo.org/594768 - local -x LC_ALL=C - - # Avoid invoking pgen for cross-compiles. - touch Include/graminit.h Python/graminit.c - - 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 - - # 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${PYVER}/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${PYVER} - - emake DESTDIR="${D}" altinstall - - sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die - - # Fix collisions between different slots of Python. - mv "${ED}/usr/bin/2to3" "${ED}/usr/bin/2to3-${PYVER}" || die - mv "${ED}/usr/bin/pydoc" "${ED}/usr/bin/pydoc${PYVER}" || die - mv "${ED}/usr/bin/idle" "${ED}/usr/bin/idle${PYVER}" || die - rm "${ED}/usr/bin/smtpd.py" || die - - 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${PYVER}" "${libdir}/"{idlelib,lib-tk} || die - use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} - - use threads || rm -r "${libdir}/multiprocessing" || die - use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die - - dodoc Misc/{ACKS,HISTORY,NEWS} - - if use examples; then - docinto examples - 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 "${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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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/python${PYVER}" \ - "${scriptdir}/python${pymajor}" || die - ln -s "python${pymajor}" "${scriptdir}/python" || die - # python-config and pythonX-config - ln -s "../../../bin/python${PYVER}-config" \ - "${scriptdir}/python${pymajor}-config" || die - ln -s "python${pymajor}-config" \ - "${scriptdir}/python-config" || die - # 2to3, pydoc, pyvenv - 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 -} - -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.6.10-r2.ebuild b/dev-lang/python/python-3.6.10-r2.ebuild deleted file mode 100644 index 24b9bc8e4b6e..000000000000 --- a/dev-lang/python/python-3.6.10-r2.ebuild +++ /dev/null @@ -1,357 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.6.10-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 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}/${PYVER}m" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads 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:= - >=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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -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}" - ) - - default - - 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 \ - configure.ac \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - # 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." - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --with-fpectl - --enable-shared - $(use_enable ipv6) - $(use_with threads) - --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[@]}" - - 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() { - # 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= - - emake test EXTRATESTOPTS="-u-network" 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/$(get_libdir)/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/$(get_libdir)/python${PYVER} - - emake DESTDIR="${D}" altinstall - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 threads || rm -r "${libdir}/multiprocessing" || 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 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - 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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv - ln -s "../../../bin/2to3-${PYVER}" \ - "${scriptdir}/2to3" || die - ln -s "../../../bin/pydoc${PYVER}" \ - "${scriptdir}/pydoc" || die - ln -s "../../../bin/pyvenv-${PYVER}" \ - "${scriptdir}/pyvenv" || die - # idle - if use tk; then - ln -s "../../../bin/idle${PYVER}" \ - "${scriptdir}/idle" || die - fi -} - -pkg_preinst() { - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then - python_updater_warning="1" - 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 - - if [[ "${python_updater_warning}" == "1" ]]; then - ewarn "You have just upgraded from an older version of Python." - ewarn - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." - fi -} - -pkg_postrm() { - eselect_python_update -} diff --git a/dev-lang/python/python-3.6.11-r2.ebuild b/dev-lang/python/python-3.6.11-r2.ebuild new file mode 100644 index 000000000000..ea7d7c2ab712 --- /dev/null +++ b/dev-lang/python/python-3.6.11-r2.ebuild @@ -0,0 +1,365 @@ +# Copyright 1999-2020 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}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-3.6.11-r3" + +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" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}/${PYVER}m" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads 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:= + >=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? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +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}" + ) + + default + + 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 \ + configure.ac \ + 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 "/self\.parallel/s:True:${jobs}:" setup.py || die + + 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 + + # 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." + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --with-fpectl + --enable-shared + $(use_enable ipv6) + $(use_with threads) + --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[@]}" + + 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() { + # 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/$(get_libdir)/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/$(get_libdir)/python${PYVER} + + emake DESTDIR="${D}" altinstall + + # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + 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 threads || rm -r "${libdir}/multiprocessing" || 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 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + 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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv + ln -s "../../../bin/2to3-${PYVER}" \ + "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" \ + "${scriptdir}/pydoc" || die + ln -s "../../../bin/pyvenv-${PYVER}" \ + "${scriptdir}/pyvenv" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" \ + "${scriptdir}/idle" || die + fi +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then + python_updater_warning="1" + 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 + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} diff --git a/dev-lang/python/python-3.6.11.ebuild b/dev-lang/python/python-3.6.11.ebuild deleted file mode 100644 index cebadb559b7d..000000000000 --- a/dev-lang/python/python-3.6.11.ebuild +++ /dev/null @@ -1,357 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.6.11" - -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" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}/${PYVER}m" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads 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:= - >=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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -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}" - ) - - default - - 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 \ - configure.ac \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - # 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." - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --with-fpectl - --enable-shared - $(use_enable ipv6) - $(use_with threads) - --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[@]}" - - 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() { - # 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= - - emake test EXTRATESTOPTS="-u-network" 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/$(get_libdir)/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/$(get_libdir)/python${PYVER} - - emake DESTDIR="${D}" altinstall - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 threads || rm -r "${libdir}/multiprocessing" || 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 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - 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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv - ln -s "../../../bin/2to3-${PYVER}" \ - "${scriptdir}/2to3" || die - ln -s "../../../bin/pydoc${PYVER}" \ - "${scriptdir}/pydoc" || die - ln -s "../../../bin/pyvenv-${PYVER}" \ - "${scriptdir}/pyvenv" || die - # idle - if use tk; then - ln -s "../../../bin/idle${PYVER}" \ - "${scriptdir}/idle" || die - fi -} - -pkg_preinst() { - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then - python_updater_warning="1" - 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 - - if [[ "${python_updater_warning}" == "1" ]]; then - ewarn "You have just upgraded from an older version of Python." - ewarn - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." - fi -} - -pkg_postrm() { - eselect_python_update -} diff --git a/dev-lang/python/python-3.6.12.ebuild b/dev-lang/python/python-3.6.12.ebuild new file mode 100644 index 000000000000..b19332465493 --- /dev/null +++ b/dev-lang/python/python-3.6.12.ebuild @@ -0,0 +1,365 @@ +# Copyright 1999-2020 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}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${PV}" + +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" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}/${PYVER}m" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads 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:= + >=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? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +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}" + ) + + default + + 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 \ + configure.ac \ + 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 "/self\.parallel/s:True:${jobs}:" setup.py || die + + 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 + + # 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." + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --with-fpectl + --enable-shared + $(use_enable ipv6) + $(use_with threads) + --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[@]}" + + 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() { + # 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/$(get_libdir)/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/$(get_libdir)/python${PYVER} + + emake DESTDIR="${D}" altinstall + + # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + 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 threads || rm -r "${libdir}/multiprocessing" || 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 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + 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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv + ln -s "../../../bin/2to3-${PYVER}" \ + "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" \ + "${scriptdir}/pydoc" || die + ln -s "../../../bin/pyvenv-${PYVER}" \ + "${scriptdir}/pyvenv" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" \ + "${scriptdir}/idle" || die + fi +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then + python_updater_warning="1" + 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 + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} diff --git a/dev-lang/python/python-3.7.7-r2.ebuild b/dev-lang/python/python-3.7.7-r2.ebuild deleted file mode 100644 index ce301b612b1c..000000000000 --- a/dev-lang/python/python-3.7.7-r2.ebuild +++ /dev/null @@ -1,343 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.7.7" - -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" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}/${PYVER}m" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= - 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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -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}" - ) - - default - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - # 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 - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --enable-shared - $(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= - - emake test EXTRATESTOPTS="-u-network" 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 - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - 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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv - ln -s "../../../bin/2to3-${PYVER}" \ - "${scriptdir}/2to3" || die - ln -s "../../../bin/pydoc${PYVER}" \ - "${scriptdir}/pydoc" || die - ln -s "../../../bin/pyvenv-${PYVER}" \ - "${scriptdir}/pyvenv" || die - # idle - if use tk; then - ln -s "../../../bin/idle${PYVER}" \ - "${scriptdir}/idle" || die - fi -} - -pkg_preinst() { - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then - python_updater_warning="1" - 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 - - if [[ "${python_updater_warning}" == "1" ]]; then - ewarn "You have just upgraded from an older version of Python." - ewarn - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." - fi -} - -pkg_postrm() { - eselect_python_update -} diff --git a/dev-lang/python/python-3.7.8-r2.ebuild b/dev-lang/python/python-3.7.8-r2.ebuild new file mode 100644 index 000000000000..0daef877b50e --- /dev/null +++ b/dev-lang/python/python-3.7.8-r2.ebuild @@ -0,0 +1,351 @@ +# Copyright 1999-2020 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}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-3.7.8-r3" + +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" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}/${PYVER}m" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= + 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? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +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}" + ) + + 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 "/self\.parallel/s:True:${jobs}:" setup.py || die + + 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 + + # 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 + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --enable-shared + $(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 + + # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + 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 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + 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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv + ln -s "../../../bin/2to3-${PYVER}" \ + "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" \ + "${scriptdir}/pydoc" || die + ln -s "../../../bin/pyvenv-${PYVER}" \ + "${scriptdir}/pyvenv" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" \ + "${scriptdir}/idle" || die + fi +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then + python_updater_warning="1" + 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 + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} diff --git a/dev-lang/python/python-3.7.8.ebuild b/dev-lang/python/python-3.7.8.ebuild deleted file mode 100644 index c88e819e8b18..000000000000 --- a/dev-lang/python/python-3.7.8.ebuild +++ /dev/null @@ -1,343 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.7.8" - -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" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}/${PYVER}m" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= - 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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -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}" - ) - - default - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - # 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 - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --enable-shared - $(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= - - emake test EXTRATESTOPTS="-u-network" 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 - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - 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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv - ln -s "../../../bin/2to3-${PYVER}" \ - "${scriptdir}/2to3" || die - ln -s "../../../bin/pydoc${PYVER}" \ - "${scriptdir}/pydoc" || die - ln -s "../../../bin/pyvenv-${PYVER}" \ - "${scriptdir}/pyvenv" || die - # idle - if use tk; then - ln -s "../../../bin/idle${PYVER}" \ - "${scriptdir}/idle" || die - fi -} - -pkg_preinst() { - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then - python_updater_warning="1" - 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 - - if [[ "${python_updater_warning}" == "1" ]]; then - ewarn "You have just upgraded from an older version of Python." - ewarn - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." - fi -} - -pkg_postrm() { - eselect_python_update -} diff --git a/dev-lang/python/python-3.7.9.ebuild b/dev-lang/python/python-3.7.9.ebuild new file mode 100644 index 000000000000..fb3f26334f6f --- /dev/null +++ b/dev-lang/python/python-3.7.9.ebuild @@ -0,0 +1,351 @@ +# Copyright 1999-2020 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}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${PV}" + +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" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}/${PYVER}m" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= + 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? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +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}" + ) + + 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 "/self\.parallel/s:True:${jobs}:" setup.py || die + + 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 + + # 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 + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --enable-shared + $(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 + + # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + 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 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + 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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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, pyvenv + ln -s "../../../bin/2to3-${PYVER}" \ + "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" \ + "${scriptdir}/pydoc" || die + ln -s "../../../bin/pyvenv-${PYVER}" \ + "${scriptdir}/pyvenv" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" \ + "${scriptdir}/idle" || die + fi +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then + python_updater_warning="1" + 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 + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} diff --git a/dev-lang/python/python-3.8.2-r2.ebuild b/dev-lang/python/python-3.8.2-r2.ebuild deleted file mode 100644 index 543abfef801c..000000000000 --- a/dev-lang/python/python-3.8.2-r2.ebuild +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.8.2-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 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= - 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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -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}" - ) - - default - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --enable-shared - $(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= - - emake test EXTRATESTOPTS="-u-network" 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 - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - 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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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 -} - -pkg_preinst() { - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then - python_updater_warning="1" - 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 - - if [[ "${python_updater_warning}" == "1" ]]; then - ewarn "You have just upgraded from an older version of Python." - ewarn - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." - fi -} - -pkg_postrm() { - eselect_python_update -} diff --git a/dev-lang/python/python-3.8.3.ebuild b/dev-lang/python/python-3.8.3.ebuild deleted file mode 100644 index c1cb51ab328b..000000000000 --- a/dev-lang/python/python-3.8.3.ebuild +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" -WANT_LIBTOOL="none" - -inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs - -MY_P="Python-${PV}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.8.3" - -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" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= - 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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -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}" - ) - - default - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --enable-shared - $(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= - - emake test EXTRATESTOPTS="-u-network" 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 - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ - emake --no-print-directory -s -f - 2>/dev/null) - 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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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 -} - -pkg_preinst() { - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then - python_updater_warning="1" - 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 - - if [[ "${python_updater_warning}" == "1" ]]; then - ewarn "You have just upgraded from an older version of Python." - ewarn - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." - fi -} - -pkg_postrm() { - eselect_python_update -} diff --git a/dev-lang/python/python-3.8.4-r1.ebuild b/dev-lang/python/python-3.8.4-r1.ebuild new file mode 100644 index 000000000000..6069492f13fa --- /dev/null +++ b/dev-lang/python/python-3.8.4-r1.ebuild @@ -0,0 +1,346 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +WANT_LIBTOOL="none" + +inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs + +MY_P="Python-${PV}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-3.8.4-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" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= + 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? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +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}" + ) + + default + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" + + 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 + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --enable-shared + $(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= + + emake test EXTRATESTOPTS="-u-network" 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 + + # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + 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 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + 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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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 +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then + python_updater_warning="1" + 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 + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} diff --git a/dev-lang/python/python-3.8.5.ebuild b/dev-lang/python/python-3.8.5.ebuild new file mode 100644 index 000000000000..df05aaedef1f --- /dev/null +++ b/dev-lang/python/python-3.8.5.ebuild @@ -0,0 +1,355 @@ +# Copyright 1999-2020 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}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${PV}" + +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" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= + 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? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +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}" + ) + + 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 + + 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 + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --enable-shared + $(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 + + # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + 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 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + 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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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 +} + +pkg_preinst() { + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then + python_updater_warning="1" + 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 + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn "You have just upgraded from an older version of Python." + ewarn + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." + fi +} + +pkg_postrm() { + eselect_python_update +} diff --git a/dev-lang/python/python-3.9.0_beta3.ebuild b/dev-lang/python/python-3.9.0_beta3.ebuild deleted file mode 100644 index 8a98fd0b0c77..000000000000 --- a/dev-lang/python/python-3.9.0_beta3.ebuild +++ /dev/null @@ -1,323 +0,0 @@ -# Copyright 1999-2020 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 pax-utils python-utils-r1 \ - toolchain-funcs - -MY_P="Python-${PV/_beta/b}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.9.0b3" - -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" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= - 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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -# large file tests involve a 2.5G file being copied (duplicated) -CHECKREQS_DISK_BUILD=5500M - -pkg_pretend() { - use test && check-reqs_pkg_pretend -} - -pkg_setup() { - use test && check-reqs_pkg_setup -} - -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}" - ) - - default - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --enable-shared - $(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= - - emake test EXTRATESTOPTS="-u-network" 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 - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 - - 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 "${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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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.9.0_beta4.ebuild b/dev-lang/python/python-3.9.0_beta4.ebuild deleted file mode 100644 index 8a98fd0b0c77..000000000000 --- a/dev-lang/python/python-3.9.0_beta4.ebuild +++ /dev/null @@ -1,323 +0,0 @@ -# Copyright 1999-2020 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 pax-utils python-utils-r1 \ - toolchain-funcs - -MY_P="Python-${PV/_beta/b}" -PYVER=$(ver_cut 1-2) -PATCHSET="python-gentoo-patches-3.9.0b3" - -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" -S="${WORKDIR}/${MY_P}" - -LICENSE="PSF-2" -SLOT="${PYVER}" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= - 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? ( - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - ) - 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 )" -PDEPEND=">=app-eselect/eselect-python-20140125-r1" - -# large file tests involve a 2.5G file being copied (duplicated) -CHECKREQS_DISK_BUILD=5500M - -pkg_pretend() { - use test && check-reqs_pkg_pretend -} - -pkg_setup() { - use test && check-reqs_pkg_setup -} - -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}" - ) - - default - - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" - - 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 - - local dbmliborder - if use gdbm; then - dbmliborder+="${dbmliborder:+:}gdbm" - fi - - local myeconfargs=( - # glibc-2.30 removes it; since we can't cleanly force-rebuild - # Python on glibc upgrade, remove it proactively to give - # a chance for users rebuilding python before glibc - ac_cv_header_stropts_h=no - - --enable-shared - $(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= - - emake test EXTRATESTOPTS="-u-network" 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 - - # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die - - # Cheap hack to get version with ABIFLAGS - local abiver=$(cd "${ED}/usr/include"; echo python*) - if [[ ${abiver} != python${PYVER} ]]; then - # Replace python3.X with a symlink to python3.Xm - rm "${ED}/usr/bin/python${PYVER}" || die - dosym "${abiver}" "/usr/bin/python${PYVER}" - # Create python3.X-config symlink - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" - # Create python-3.5m.pc symlink - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" - fi - - # python seems to get rebuilt in src_install (bug 569908) - # Work around it for now. - if has_version dev-libs/libffi[pax_kernel]; then - pax-mark E "${ED}/usr/bin/${abiver}" - else - pax-mark m "${ED}/usr/bin/${abiver}" - fi - - 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 - - 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 "${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 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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.9.0_rc1.ebuild b/dev-lang/python/python-3.9.0_rc1.ebuild new file mode 100644 index 000000000000..6bf6b905d71f --- /dev/null +++ b/dev-lang/python/python-3.9.0_rc1.ebuild @@ -0,0 +1,331 @@ +# Copyright 1999-2020 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 + +MY_P="Python-${PV/_/}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${PV/_/}" + +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" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +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:= + 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? ( + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + ) + 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 )" +PDEPEND=">=app-eselect/eselect-python-20140125-r1" + +# large file tests involve a 2.5G file being copied (duplicated) +CHECKREQS_DISK_BUILD=5500M + +pkg_pretend() { + use test && check-reqs_pkg_pretend +} + +pkg_setup() { + use test && check-reqs_pkg_setup +} + +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}" + ) + + 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 + + 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 + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --enable-shared + $(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 + + # 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 "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax_kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + 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 + + 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 "${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 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_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 +} -- cgit v1.2.3