aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/Manifest5
-rw-r--r--dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch44
-rw-r--r--dev-lang/python/python-2.7.14.ebuild649
3 files changed, 698 insertions, 0 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 942ce4d0..d4082d12 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -10,6 +10,7 @@ AUX python-2.7-libffi-pkgconfig.patch 1783 SHA256 4cd8b71f97f5f55c94d45b4440f011
AUX python-2.7.10-cross-compile-warn-test.patch 775 SHA256 d5574b08e9ba7612971565c7a8e9881e4a0a07c63e79c2ca056a51ed1cf2badd SHA512 652941239541f6139ee3580ec0ea5240baf07ae1afb786f76a69b1d748de1f4dda2740a95c28866e9b0b59023410f8a1e86507642595991c0d90d187519cb758 WHIRLPOOL 95c9c404e9788fdbd7a202b7ff6df4010b6c035b097c20d6183919320a794bede013c938a6806365f9bdabd73917576f6ef0a07b20dd4d168fdc294facbfdccf
AUX python-2.7.10-semaphore-urandom.patch 1535 SHA256 e93e6b2052e0b3118ae635ca0de36282bb523145b42a7e9ec9dee5d7c6b25d54 SHA512 f2ae7e01e0b58c384448475b11ad6bcfb56b864d7f73dfc3c451ea71be8ef6da2c030175cf405d6ebbbbae6d39f1eb21fc90433357f6f8de5c8b149c76032c28 WHIRLPOOL df412da0c7df5637a84a1296853d5bb13e7ba100e6e170892559524e9d5eec4851b7c6dec9cbbc1e00ce1dc6eca7ae56a67d4e9537aaa13eaadfcdaaa4294452
AUX python-2.7.10-system-libffi.patch 1232 SHA256 d119def22ac8b15da95486981d9ddb2b19199dfeeed364de223c6321d592cdc9 SHA512 3c888638180edc81b98a869478085de63741668ea62bdb919a60708fd64cb394e60f44a3730e2ccf3e41d1d61b72b469242fe2ccd20dc61bc2064b3e759c52bd WHIRLPOOL bf69573ae6b804d44338a64c727f4b4ebde60964b89d546f4ca45d6d03619d84c69c88cc4e72975514c24cd9be31ee7fd9c3ea3cda9bce6384fa5a10cf28b2bd
+AUX python-2.7.14-libffi-pkgconfig.patch 1839 SHA256 c4c01e200c06336888011b4326343df8f1739de2c8972e4c26c95b6aacc3d326 SHA512 bd5821658042f99e64cedf673ddfc43b4e9907914f01a804f0ddd5e60a6f167fc59915aa1ab9f161a77403cb7c5bb42101664bb784119bb0eb2e4f534f402a6e WHIRLPOOL b68f836ce4458ab83468b4f3574d374478ba416a7e3e85c621ef5c26f748fa1776389f3a220c195d79cc6d5f1ea4f4701a7b35aa892023f7a1b7eaf879453f8f
AUX python-2.7.5-library-path.patch 991 SHA256 ff7a4a1846ebcadc2dbf979ea619072caac22e47909fe188fc4b6becce6ea2eb SHA512 74916d541eb38c526dc1243fe5e5a9de3a7875f02c53e5f49e60182ba042de2f15514364e7fbd821146dcf92db2bba88d8a9f46d4c71237b73fd39cbabf93d85 WHIRLPOOL 62bb1c85941ccaac7ca6f6fb2d93dc27f206cf9f815b90ef1f89748dfdd1d38deda9f6bf7eb2ce9fd8635d1a77576819192e8049ec5de52fdeb9f981dfb32f9f
AUX python-2.7.5-nonfatal-compileall.patch 750 SHA256 3f5a137602f1b3f0522f561c168a740f0080b29c2c888cb3a8dbbcc4407c2d9e SHA512 d2e93e2a6fcd55d516df0ddaca31af97faed677ea6b4be282eb99e7864f8a7399b5ca11139844a4b3c264832183483b0f4c8c9865c05de0e8520e6d2c8f1dbc6 WHIRLPOOL ab576e3a4e67f881d6d5c705503230ace125fe94d907d7f69bb573dd492070b8b34078a2b1205f315eb45244fbae8855c0f15ce35158f1d356f1bd4acf83b3c2
AUX python-2.7.5-re_unsigned_ptrdiff.patch 941 SHA256 5b0c0465a23d27e1c8f0961a8d88b3af75fbc9933ab60c2a71091720a3681079 SHA512 d46fbbc8411fae78cdfca2564faca42f32bb95ee348b9aa3fd1ca90b346cc52cd468945cee07e6df4dff46c10cee6856a58004f8e453960f6dca2751c077802b WHIRLPOOL 10bb08242dd9a055f6bdaf3eb1546786b58f180667c6355ea7276114cbac0ffba6c34822add7965fe3b5d41cc92ce8ec45e2d1d56377d8a6aa2755ef4267d101
@@ -19,22 +20,26 @@ AUX python-3.4-pyfpe-dll.patch 733 SHA256 3740abd6ef3e4e325179896ab3b281695f6946
DIST 7be648659ef46f33db6913ca0ca5a809219d5629.zip 9173 SHA256 39e2c7367357110d4bc89a5ba515cd0f419a22e45f0ffda73db6b676ac28b718 SHA512 b1c654c852baf7891b834124607115cfaf3f1b8b7a58a9c3e8e46dd5b2f608d05d27e8a6222cc98ed83634bcfdcbbddcb888070d079cc8438db7e52320f113f9 WHIRLPOOL 5bca4fbf5f4183e505b011a5400436b6b5abfeb99880cf19613548ce1d2b6dde3e9b85466a7edc476c30b3ea30c6ca277336c6baa80d7718e00ef735497d6c33
DIST Python-2.7.10.tar.xz 12250696 SHA256 1cd3730781b91caf0fa1c4d472dc29274186480161a150294c42ce9b5c5effc0 SHA512 67615a6defbcda062f15a09f9dd3b9441afd01a8cc3255e5bc45b925378a0ddc38d468b7701176f6cc153ec52a4f21671b433780d9bde343aa9b9c1b2ae29feb WHIRLPOOL 3a9dcfc55b107dc55ad0ae93fb24a11eab7d4d9b4cfbe6b6830a090b6e5f71bb2ac91526b89c6f3e4f2610fa1a2cc4e82b58a83c599aa71f94894c74181b504b
DIST Python-2.7.12.tar.xz 12390820 SHA256 d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978 SHA512 6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f WHIRLPOOL fe4224f4c3dc8dc5c49005051da0069922c86f39880a0072c09fac422e1913d924ac695e22be11603a961329dd8c17b1cf7696b31b62ef93398e42745a6446d6
+DIST Python-2.7.14.tar.xz 12576112 SHA256 71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66 SHA512 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9 WHIRLPOOL c604d747daa874de926abb8ec142a7824f2706b79fd828aa189895ba0e7d4df044b9be58d49ab70a245e9e7abd5da4340abe54fa0ff9eab32a4dee7db7ee9d29
DIST Python-2.7.5.tar.xz 10252148 SHA256 f33c4cab167dc69e10962e1cebf1c0768e2d0e8575648130c20e6bda84551db1 SHA512 c4691199d770cc4130604cd801375967ae0bb8a39ef34e01a4c8ab58d1c23ae83a1b493305178c4317c5622a19857750d33ffc3f10075becd5766ae664c68ee1 WHIRLPOOL fc5d3762cd67214b30de8b43024f5952362c4c811f23837e43ac2a7747c5353cc49b8785e75edd760ea58420609cd67a9a7e94abd2ea8ab25b3271af6a85168d
DIST Python-2.7.6.tar.xz 10431288 SHA256 1fd68e81f8bf7386ff239b7faee9ba387129d2cf34eab13350bd8503a0bff6a1 SHA512 e56e6cdd96ff7bcb680d11ad606c00f4264e413fc43ba7605b2d2e4a743fd6e464cbedabf18b461f742102e936f45d840302a99665b5f988b1df08b25285c238 WHIRLPOOL 3b83106e89c96d2227573595bd96c868e6ece7fb04fda0aa22c8d3249af99cedebcd224ec8ae788eabe8a091a55d12af9ed093ee1eedb7c72b66732c62d5e1b3
DIST Python-2.7.8.tar.xz 10525244 SHA256 edde10a0cb7d14e2735e682882d5b287028d1485c456758154c19573db68075a SHA512 0a992e34b6b704f028f5178c0404f8ca5fd9a7ab9da1879a20f0c72ffa712dc4925e45eb78e9368d6a17ee618259fc3f078d71766b314a732a1a28e526511a5e WHIRLPOOL 81ee40be85a8713dcc91e64c7faaf7605c43dc28f97b410b88411bbf7d4adbdf48a3e4bfa18c039c1da8695160a98ebb57e144c3198abec2b12398d80ece2971
DIST python-gentoo-patches-2.7.10-0.tar.xz 12892 SHA256 c9a838bd62ae50cc385da23a837acfd05f2b74e4f086c9c76eb4d3aa5366ef6d SHA512 5f100944635e360691dc0a2b340a906646c4ae9ee558246ddffc56e8b15d389f25f1fbdc1db4cc08e7d29560d04d66b058b3904902899d58ecae8c408ebdf056 WHIRLPOOL f69e9a518bb7ee50c1b262a21e70e1e2443f859ee6d2f4fa84421120dbd054a06ce8dd6cfea8512cbc64bce806322b879c25c561d5eb05e1ba6cc15035b373a9
DIST python-gentoo-patches-2.7.12-0.tar.xz 13576 SHA256 cd842eec7202df57c153adc1fbb81e70b26ef651f8e9346e065d8577b93f343b SHA512 8bf530fca15c47fa5d9bc958e433b35943a12c98e4172806a45aa60dc85ec92f8ab6ffcd90f752dc5bf8ffc711414894c15820c4b6ef72dbcedc2808119fb1f6 WHIRLPOOL 54b8ca6a4371d460dadccfdffcc096c12930d58714eef95117a658d7a1337ea89c45c69553b5b993017211faaa0f8d670e09a8452e53c0fb176be3e908524ee6
+DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 SHA256 3567feeb8f0c66161efaea1922bbfe4e71f6051533ef5f54a74b6ccf9e0359b6 SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1 WHIRLPOOL ab77023ac66def132d1dce72f98add3108fd7be303ef5b167a2374df3a94949c75f089dcfdd84ed05a5eb813d6c22cfecd0de03b5819817a20b04f30030f5f6d
DIST python-gentoo-patches-2.7.5-0.tar.xz 13848 SHA256 b84ff6a7669d639272cb2f94d4268d3be3af64903a380f4f60ab539e4a29b111 SHA512 9fec0ba9d958894861d4282ff9145f0387ad7fd3914a3689d148308f56158c1b397f0816c58383d2cf198f9a3b9bf321f2f441ec4aa91e4a503cd957b4a7fbd4 WHIRLPOOL 39d807453f6510f14db1b74f5dac1cd2c52d00be356d132c0f9229caeb8ba8bcbbbf32b05b3d3f6236e853b204ecb961e6b12cabacaadf5f515e93f00cda71d5
DIST python-gentoo-patches-2.7.6-1.tar.xz 14572 SHA256 cb0fca8f006ee7b8501cfbed063c987ad6793f61072144ded2122bca6dc608ed SHA512 e6bc3de2053b1dbc5845effe86cc7d19acbcf10b52b2a1ce3d45988492a2430dd8f6ea3e547beaf57bdf176b06a07f267aa6afac82cde61ed730fe3f4b2ab238 WHIRLPOOL ecf800bc895609bbdf5ec5c53031142b56002b20930d9dd1c34610fb6628d0d5fa6874a1111fa691474bde6ae1e18a03da795bb298cde4a6f649e45637ea4da0
DIST python-gentoo-patches-2.7.8-0.tar.xz 14016 SHA256 22ca5eab8e1702f220c272c57359f547b753b88d59b53ab95c7985c17f4f90ec SHA512 17020c8a2039cc073c973e213e77dc67ad9ed4ae7f5fafb931933943aa745733309c46e3972bfde85d112cdef6d47aa91868a614db08bb135c29051999c3df4e WHIRLPOOL 96f0e5c7329cc886d979ec782ffd3c63461f49ba112f0d95e5528d7f15048170cd4e52b78cb4100839d509ef28b927bf7a0f1a610fcf4ec562730a284f8c9fc3
DIST python-prefix-2.7.10-gentoo-patches.tar.bz2 16922 SHA256 9fe4df587363c439f1f29885b4b2a1238d16861667966b279dc1019cb904efa4 SHA512 a016e1572276dbbe0fc045d723b592b31573f99b60370f0c1506f10fd9a632cc879bdc4a2060c6a5ff411f26179189517ff4c4beb6979a5727e0dc17de935fe2 WHIRLPOOL 73542d16f9f64acb2cb941ce659d981d6d8b8a8cba9ef4f41c4b987665beedb125a6ad4a7badb5eb12092d916e1ab807330a2fcefc7914ae9708569d54faa7b6
DIST python-prefix-2.7.12-gentoo-patches-r0.tar.xz 17380 SHA256 c488011046a678eaf2febe3d02726a0efbd2f8378a0c5b896b03bcbed5b5f00a SHA512 ef17c8e8083da0ed0e6a63c96f59cc1243b0376fc6d4d7fcecb165e557403c54ae87625ed6dfe4d7d73693f8220ec98ef8a3f16124d8022dbac6a3a9d5514d9c WHIRLPOOL 7e427be36a8d558193058d7112f704993474eff7bb554b6f2f0d9cfe085c653a9cf0522a33249a92e813fad667a53439c9f70d74bcde0df9f78824bfbbfaae46
+DIST python-prefix-2.7.14-gentoo-patches-r0.tar.xz 14736 SHA256 1d57b53df4f2d3be36cbdcd046f6682ca2287ea87b6a5ce4a4704c3aaf1909af SHA512 bf8e5039fff834d03a5a671269905f1ea10961995f2327ea023f6ad4d9b49bf210ec746ac6f45a01ff7501f1eb616013951d164410f6c64bce04df0e8b9715c8 WHIRLPOOL 42a85d862e958c3bbb6a9121dac90c8370b88fdb0053292947cbe205eb4a841737025f038ea8df94c54cd0c48463466a2d545ca4767c7cc3a08f45349f8cc1fd
DIST python-prefix-2.7.5-gentoo-patches-r3.tar.bz2 19249 SHA256 fe83de95e6bbb920c3cd47b78dea84c7da76adce275843c731497ae0de94ff9b SHA512 f00960658837d0c3cb5b797439ad3e2a271fcb6c2fc53c3fffda716bbe3f4047bcf4818bff817a720b37cf4c496c7b3a23357e292631e81e364791d009636541 WHIRLPOOL 505b55b191725e28c9ac3cf000938eb556f690c0f71606b06ec4953b2a5c9c0facbca0f0643750a772fb832a6c664eb0eb6257fd2430a225ceaee7d31ff77f4f
DIST python-prefix-2.7.6-gentoo-patches.tar.bz2 19416 SHA256 997c728e47c8ad0510327dcee0e8936878afa4113a5e7045054e6232b6bfbcb5 SHA512 ecc34dd958f56fb05c2dd41a21df9bdd69255d58e0df0743089fe9360b4222baa4b162fbb69398cc6ad707e89b0fb46381998f53622216fb78e9e23d624fc9f4 WHIRLPOOL 5ed161234249d6840904e9315c65c70f6690e14f08df04066e2de7bbcd964daea7a7b2b9c15ba78da912ca244c1fc53f482461d77d4bb02a36631f38be38ccaf
DIST python-prefix-2.7.8-gentoo-patches.tar.bz2 17154 SHA256 6c5f171f15f662c2b88258ebff152224a7003c43e025be860baf99913d00a8b1 SHA512 fe53cf969e70744ed6c66757e507f55eea031fa98e08f1846e3c51b968eb8d91a377c9c47cbc5cd469715c37d71b70dd1dc46fdbb52cab372179acb497a81643 WHIRLPOOL f966f3dc68f7cf171aeef0226a72616d42f13e9b085a772aa7221b1898a74e0b31c74350c7114fc6a39ab739877d5e12be1755357e2821f8b026af61fa99b4b3
EBUILD python-2.7.10-r1.ebuild 20847 SHA256 db967fbdbf079a49b2ff59d23fbf8e5689e3b9fb160f58110bd8542d7d421805 SHA512 13de987f85ede0cb42cc108a8bcf5957a7691597d26c59283d79b5d8914261b2cb5925a25b1249d0865037b96fcfb9f7da7d17f4fc5cf657f04cbfffcad3aa19 WHIRLPOOL 1dcd65b99a29efea931e3ea6efa9960df9bc63b9ed3664e480627d45af0cb5f0fb4ea3c7446a4f25a6572449ac6d9126856b93e3c5af2995e96f7eeaaf284c0d
EBUILD python-2.7.10.ebuild 21279 SHA256 074dbbc02ca0814f688e689ba477d6209ef2cedaa1cc34d60cceedb76d368403 SHA512 ae505170a3d249994edbec9865b41e7c616587998d2a497ad18e6900c558e6f83b2fa8693de0567b342bcca8ee337de03d6960ad513b15bcc04ce45e989d0b92 WHIRLPOOL 5a0280c43e6dfabf830f5ead6c171a467fd8bd13b99abc52310856069c81bbdb526320f3d86c1236488f2ac485d476e12d89fe66ea750d62bf8169586729d9cf
EBUILD python-2.7.12.ebuild 22305 SHA256 7b2906b2f86cda233879b61596b68752903e3c2dd42e47fabd7bb7104e92c7e2 SHA512 545cec6228ce96869f49906f2aed90bed2dd3bc139b513759027f166ff38939468c1c935f0f4e672f2c0ba55e50340548a558ce2f872f4ac99711d32f676dd50 WHIRLPOOL 8f44196a6462d377490c0f687158aea29b5e3d409e9d875a2747abd30cc641e2b128195728754309f10372504502a510187088a47834ebe0e19802fe1799b6a6
+EBUILD python-2.7.14.ebuild 22695 SHA256 17b689e9cf83b9c6fc48f1e98d03a96e03703d5b69ddd13bfa5a0178da732665 SHA512 8c1dfd225f776683a8591e90d4bb629628a71d9078aab3e13a8f6845dfd1aba995aeb9f3667459e09303b4f08002b78401a7103e294c80a2b63eef67abc22f07 WHIRLPOOL 31a92c9206eda211a943e880461dcb823e51cf55e5e2a2aeb06413473f9b59bdf61d2e2a111234187299437610ced1928f62f0e051b1b4953f99e1ac7412a9b4
EBUILD python-2.7.5-r4.ebuild 19587 SHA256 28a65355a3997d89ccf803d048a33cd7fd30dca9e7fc2437d66f3c700a59b7da SHA512 417a24513b084c53ce6a7b1e53e824c6b187a5100df34099dde8170b7c0513295d5a14dda8dd52cf5dd13d2f09933b1a75a15c06f8181df8a7baf56558658a7c WHIRLPOOL 9fda9d3bf8e5768c3c9892c5cfce82551ec83bdebf95a7d060587f4358597cf8cba9291a115000f3c6080ad0ab311206e4d256d53e00ae1d820b324ba3d7f7f1
EBUILD python-2.7.6-r1.ebuild 19844 SHA256 ae90edccce43a0351643a6e5447a482d3ddd3b130ab2130307576750441ddd8b SHA512 c7200d305a1fd4edd0b9feeae7544be759655a746e86ba8bd051bda780587b7ad1f4a10034155c5d0305505def2ae7160b634f05b1e535d5a9edd4e47fe28c93 WHIRLPOOL a0918e832c27cc6bd8c5a5238b807db13cd9a74a8aa1f1442aa7daae843174a8b67f7014f6edcdd726dc38a485c53f13939f64f12bf211a3a2d3cef6994f39dd
EBUILD python-2.7.8.ebuild 20405 SHA256 c8178f68f20f84e3cb411cc01f409690dd1a720cb0e140ec01e0071e06f9a8c2 SHA512 c2f86616651acee3a4624901ddaccc4e9dc0b75ef0e7cfe76f986e2e94babc7445489ad152b92087bb0853e371ff20f2f2ed52271831eab220047f05c3d9e17f WHIRLPOOL 9d587f2fd70f5a7a694b04c7f3a174a3faff84f9c31680eb6b741dff1a227963fc1b7c7891aee0b0569976207c0608f59f2c2fd2038cbc76e2d56b344cfd12cd
diff --git a/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
new file mode 100644
index 00000000..85abb1b5
--- /dev/null
+++ b/dev-lang/python/files/python-2.7.14-libffi-pkgconfig.patch
@@ -0,0 +1,44 @@
+diff -u -r Python-2.7.5-orig//configure.ac Python-2.7.5/configure.ac
+--- Python-2.7.5-orig//configure.ac 2014-03-06 04:35:31.000000000 +0100
++++ Python-2.7.5/configure.ac 2014-03-06 04:58:10.000000000 +0100
+@@ -2300,10 +2300,13 @@
+
+ if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
+ LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
++ LIBFFI_LIB="`"$PKG_CONFIG" libffi --libs-only-l 2>/dev/null | sed -e 's/^-l//;s/ *$//'`"
+ else
+ LIBFFI_INCLUDEDIR=""
++ LIBFFI_LIB=""
+ fi
+ AC_SUBST(LIBFFI_INCLUDEDIR)
++AC_SUBST(LIBFFI_LIB)
+
+ AC_MSG_RESULT($with_system_ffi)
+
+diff -u -r Python-2.7.5-orig//Makefile.pre.in Python-2.7.5/Makefile.pre.in
+--- Python-2.7.5-orig//Makefile.pre.in 2014-03-06 04:35:31.000000000 +0100
++++ Python-2.7.5/Makefile.pre.in 2014-03-06 05:03:59.000000000 +0100
+@@ -224,6 +224,7 @@
+
+
+ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
++LIBFFI_LIB= @LIBFFI_LIB@
+
+ ##########################################################################
+ # Parser
+diff -u -r Python-2.7.5-orig//setup.py Python-2.7.5/setup.py
+--- Python-2.7.5-orig//setup.py 2014-03-06 04:35:31.000000000 +0100
++++ Python-2.7.5/setup.py 2014-03-06 04:56:15.000000000 +0100
+@@ -1893,8 +1893,10 @@
+ ffi_inc = None
+ print('Header file {} does not define LIBFFI_H or '
+ 'ffi_wrapper_h'.format(ffi_h))
+- ffi_lib = None
+- if ffi_inc is not None:
++ ffi_lib = sysconfig.get_config_var("LIBFFI_LIB")
++ if not ffi_lib or ffi_lib == '':
++ ffi_lib = None
++ if ffi_inc is not None and ffi_lib is None:
+ for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
+ if (self.compiler.find_library_file(lib_dirs, lib_name)):
+ ffi_lib = lib_name
diff --git a/dev-lang/python/python-2.7.14.ebuild b/dev-lang/python/python-2.7.14.ebuild
new file mode 100644
index 00000000..362fc751
--- /dev/null
+++ b/dev-lang/python/python-2.7.14.ebuild
@@ -0,0 +1,649 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+WANT_LIBTOOL="none"
+
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
+
+MY_P="Python-${PV}"
+PATCHSET_VERSION="2.7.14-0"
+PREFIX_PATCHREV="r0"
+CYGWINPORTS_GITREV="7be648659ef46f33db6913ca0ca5a809219d5629"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/"
+SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
+ https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz
+ prefix? ( https://dev.gentoo.org/~grobian/distfiles/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}.tar.xz )"
+
+[[ -n ${CYGWINPORTS_GITREV} ]] &&
+SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/python2/archive/${CYGWINPORTS_GITREV}.zip )"
+
+LICENSE="PSF-2"
+SLOT="2.7"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+KEYWORDS+="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="aqua -berkdb build doc 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:0=
+ >=sys-libs/zlib-1.1.3:0=
+ !m68k-mint? ( virtual/libffi )
+ virtual/libintl
+ berkdb? ( || (
+ sys-libs/db:5.3
+ sys-libs/db:5.2
+ sys-libs/db:5.1
+ sys-libs/db:5.0
+ sys-libs/db:4.8
+ sys-libs/db:4.7
+ sys-libs/db:4.6
+ sys-libs/db:4.5
+ sys-libs/db:4.4
+ sys-libs/db:4.3
+ sys-libs/db:4.2
+ ) )
+ gdbm? ( sys-libs/gdbm:0=[berkdb] )
+ ncurses? (
+ >=sys-libs/ncurses-5.2:0=
+ readline? ( >=sys-libs/readline-4.1:0= )
+ )
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )
+ )
+ tk? (
+ >=dev-lang/tcl-8.0:0=
+ >=dev-lang/tk-8.0:0=[-aqua]
+ dev-tcltk/blt:0=
+ dev-tcltk/tix
+ )
+ xml? ( >=dev-libs/expat-2.1 )
+ !!<sys-apps/portage-2.1.9"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ >=sys-devel/autoconf-2.65
+ !sys-devel/gcc[libffi(-)]"
+RDEPEND+=" !build? ( app-misc/mime-types )
+ doc? ( dev-python/python-docs:${SLOT} )"
+PDEPEND=">=app-eselect/eselect-python-20140125-r1"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ if use berkdb; then
+ ewarn "'bsddb' module is out-of-date and no longer maintained inside"
+ ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
+ ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
+ ewarn "is provided by dev-python/bsddb3."
+ else
+ if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
+ ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
+ ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
+ ewarn "You might need to migrate your databases."
+ fi
+ fi
+}
+
+src_prepare() {
+ # Ensure that internal copies of expat, libffi and zlib are not used.
+ rm -r Modules/expat || die
+ rm -r Modules/_ctypes/libffi* || die
+ rm -r Modules/zlib || die
+
+ if tc-is-cross-compiler; then
+ local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
+ fi
+
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+
+ # if building a patched source-tar, comment the rm's above, and uncomment
+ # this line:
+ #local EPATCH_EXCLUDE=" 01_all_prefix-no-patch-invention.patch"
+
+ # Prefix' round of patches
+ # http://prefix.gentooexperimental.org:8000/python-patches-2_7
+ use prefix && EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/python-prefix-${PV}-gentoo-patches-${PREFIX_PATCHREV}
+
+ if use aqua ; then
+ # make sure we don't get a framework reference here
+ sed -i -e '/-DPREFIX=/s:$(prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
+ -e '/-DEXEC_PREFIX=/s:$(exec_prefix):$(FRAMEWORKUNIXTOOLSPREFIX):' \
+ Makefile.pre.in || die
+ # Python upstream refuses to listen to configure arguments
+ sed -i -e '/FRAMEWORKINSTALLAPPSPREFIX=/s:="[^"]*":="${prefix}/../Applications":' \
+ configure.ac configure || die
+ # we handle creation of symlinks in src_install
+ sed -i -e '/ln -fs .*PYTHONFRAMEWORK/d' Makefile.pre.in || die
+ fi
+ # don't try to do fancy things on Darwin
+ sed -i -e 's/__APPLE__/__NO_MUCKING_AROUND__/g' Modules/readline.c || die
+ # On AIX, we've wrapped /usr/ccs/bin/nm to work around long TMPDIR.
+ sed -i -e "/^NM=.*nm$/s,^.*$,NM=$(tc-getNM)," Modules/makexp_aix || die
+ # fix header standards conflicts on Solaris
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ # GCC5 switched the default from gnu89 to gnu11, a standards
+ # conflict arises from that, which can be solved by upgrading
+ # _XOPEN_SOURCE from 500 to 600, but since it is compiler
+ # version specific, just force the old standard onto the
+ # compiler. Python 3 properly detects this.
+ CC="$(tc-getCC) -std=gnu89"
+ sed -i -e "/_XOPEN_SOURCE/s/500/600/" \
+ Modules/_multiprocessing/multiprocessing.h || die
+ fi
+
+ # Fix for cross-compiling.
+ epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
+ epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
+ epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
+ epatch "${FILESDIR}/python-2.7.10-system-libffi.patch"
+ epatch "${FILESDIR}/python-3.4-pyfpe-dll.patch" # Cygwin: --with-fpectl
+
+ # Make sure python doesn't use the host libffi.
+ if use prefix; then
+ epatch "${FILESDIR}/python-2.7.14-libffi-pkgconfig.patch"
+ rm configure
+ fi
+
+ if [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin; then
+ local p d="${WORKDIR}/python2-${CYGWINPORTS_GITREV}"
+ for p in $(
+ eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/python.cygport)"
+ echo ${PATCH_URI}
+ ); do
+ # dropped by 01_all_prefix-no-patch-invention.patch
+ [[ ${p} == *-tkinter-* ]] && continue
+ epatch "${d}/${p}"
+ done
+ fi
+
+ epatch_user
+
+ 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"
+ use gdbm || disable+=" gdbm"
+ use ncurses || disable+=" _curses _curses_panel"
+ use readline || disable+=" readline"
+ use sqlite || disable+=" _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL="1"
+ use tk || disable+=" _tkinter"
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+ [[ ${CHOST} == *64-apple-darwin* ]] && disable+=" Nav _Qt" # Carbon
+ [[ ${CHOST} == *-apple-darwin11 ]] && disable+=" _Fm _Qd _Qdoffs"
+ export PYTHON_DISABLE_MODULES="${disable}"
+
+ if ! use xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+ fi
+
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then
+ append-flags -fwrapv
+ fi
+
+ filter-flags -malign-double
+
+ [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
+
+ # 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
+
+ # https://bugs.gentoo.org/show_bug.cgi?id=302137
+ if [[ ${CHOST} == powerpc-*-darwin* ]] &&
+ ( is-flag "-mtune=*" || is-flag "-mcpu=*" ) ||
+ [[ ${CHOST} == powerpc64-*-darwin* ]];
+ then
+ replace-flags -O2 -O3
+ replace-flags -Os -O3 # comment #14
+ fi
+
+ if use prefix ; then
+ # for Python's setup.py not to do false assumptions (only looking in
+ # host paths) we need to make explicit where Prefix stuff is
+ append-cppflags -I"${EPREFIX}"/usr/include
+ append-ldflags -L"${EPREFIX}"/$(get_libdir)
+ append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)
+ # fix compilation on some 64-bits Linux hosts, #381163, #473520
+ for hostlibdir in /usr/lib32 /usr/lib64 /usr/lib /lib32 /lib64; do
+ [[ -d ${hostlibdir} ]] || continue
+ append-ldflags -L${hostlibdir}
+ done
+ # Have to move $(CPPFLAGS) to before $(CFLAGS) to ensure that
+ # local include paths - set in $(CPPFLAGS) - are searched first.
+ sed -i -e "/^PY_CFLAGS[ \\t]*=/s,\\\$(CFLAGS)[ \\t]*\\\$(CPPFLAGS),\$(CPPFLAGS) \$(CFLAGS)," Makefile.pre.in || die
+ fi
+
+ # Export CC so even AIX will use gcc instead of xlc_r.
+ # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
+ tc-export CC CXX
+ # The configure script fails to use pkg-config correctly.
+ # http://bugs.python.org/issue15506
+ export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+ # Set LDFLAGS so we link modules with -lpython2.7 correctly.
+ # Needed on FreeBSD unless Python 2.7 is already installed.
+ # Please query BSD team before removing this!
+ # On AIX this is not needed, but would record '.' as runpath.
+ [[ ${CHOST} == *-aix* ]] ||
+ append-ldflags "-L."
+
+ local dbmliborder
+ if use gdbm; then
+ dbmliborder+="${dbmliborder:+:}gdbm"
+ fi
+ if use berkdb; then
+ dbmliborder+="${dbmliborder:+:}bdb"
+ fi
+
+ # Don't include libmpc on IRIX - it is only available for 64bit MIPS4 (mips-sgi-irix64)
+ [[ ${CHOST} == *-irix ]] && export ac_cv_lib_mpc_usconfig=no
+
+ [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no
+
+ # we need this to get pythonw, the GUI version of python
+ # --enable-framework and --enable-shared are mutually exclusive:
+ # http://bugs.python.org/issue5809
+ local myshared
+ use aqua \
+ && myshared="--enable-framework=${EPREFIX}/usr/lib" \
+ || myshared="--enable-shared"
+
+ BUILD_DIR="${WORKDIR}/${CHOST}"
+ mkdir -p "${BUILD_DIR}" || die
+ cd "${BUILD_DIR}" || die
+
+ # note: for a framework build we need to use ucs2 because macOS
+ # uses that internally too:
+ # http://bugs.python.org/issue763708
+ # HAS_HG to avoid finding obsolete hg of the host
+ ECONF_SOURCE="${S}" OPT="" HAS_HG="no" \
+ econf \
+ --with-fpectl \
+ ${myshared} \
+ $(use_enable ipv6) \
+ $(use_with threads) \
+ $( (use wide-unicode && ! use aqua) && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
+ --infodir='${prefix}/share/info' \
+ --mandir='${prefix}/share/man' \
+ --with-computed-gotos \
+ --with-dbmliborder="${dbmliborder}" \
+ --with-libc="" \
+ --enable-loadable-sqlite-extensions \
+ --with-system-expat \
+ --with-system-ffi \
+ --without-ensurepip
+
+ if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+ eerror "configure has detected that the sem_open function is broken."
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+ die "Broken sem_open function (bug 496328)"
+ fi
+}
+
+src_compile() {
+ # Avoid invoking pgen for cross-compiles.
+ touch Include/graminit.h Python/graminit.c
+
+ cd "${BUILD_DIR}" || die
+ emake
+
+ # Work around bug 329499. See also bug 413751 and 457194.
+ if has_version dev-libs/libffi[pax_kernel]; then
+ pax-mark E python
+ else
+ pax-mark m python
+ fi
+}
+
+src_test() {
+ # Tests will not work when cross compiling.
+ if tc-is-cross-compiler; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ cd "${BUILD_DIR}" || die
+
+ # Skip failing tests.
+ local skipped_tests="distutils gdb"
+
+ for test in ${skipped_tests}; do
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
+ done
+
+ # Daylight saving time problem
+ # https://bugs.python.org/issue22067
+ # https://bugs.gentoo.org/610628
+ local -x TZ=UTC
+
+ # Rerun failed tests in verbose mode (regrtest -w).
+ emake test EXTRATESTOPTS="-w" < /dev/tty
+ local result="$?"
+
+ for test in ${skipped_tests}; do
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
+ done
+
+ elog "The following tests have been skipped:"
+ for test in ${skipped_tests}; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you would like to run them, you may:"
+ elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
+ elog "and run the tests separately."
+
+ if [[ "${result}" -ne 0 ]]; then
+ die "emake test failed"
+ fi
+}
+
+src_install() {
+ local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
+
+ cd "${BUILD_DIR}" || die
+
+ [[ ${CHOST} == *-mint* ]] && keepdir /usr/lib/python${SLOT}/lib-dynload/
+
+ if ! use aqua ; then
+ emake DESTDIR="${D}" altinstall
+ else
+ local fwdir="${EPREFIX}"/usr/$(get_libdir)/Python.framework
+
+ # do not make multiple targets in parallel when there are broken
+ # sharedmods (during bootstrap), would build them twice in parallel.
+
+ # Python_Launcher is kind of a wrapper, and we should fix it for
+ # Prefix (it uses /usr/bin/pythonw) so useless
+ # IDLE doesn't run, no idea, but definitely not used
+ sed -i -e 's/install_\(BuildApplet\|PythonLauncher\|IDLE\)[^:]//g' \
+ Mac/Makefile || die
+
+ # let the makefiles do their thing
+ emake -j1 CC="$(tc-getCC)" DESTDIR="${D}" STRIPFLAG= altinstall
+ rmdir "${ED}"/Applications/Python* || die
+ rmdir "${ED}"/Applications || die
+
+ # avoid framework incompatability, degrade to a normal UNIX lib
+ mkdir -p "${ED}"/usr/$(get_libdir)
+ cp "${D}${fwdir}"/Versions/${SLOT}/Python \
+ "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib || die
+ chmod u+w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
+ "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
+ chmod u-w "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib
+ cp libpython${SLOT}.a "${ED}"/usr/$(get_libdir)/ || die
+
+ # rebuild python executable to be the non-pythonw (python wrapper)
+ # version so we don't get framework crap
+ rm "${ED}"/usr/bin/python${SLOT} # drop existing symlink, bug #390861
+ $(tc-getCC) "${ED}"/usr/$(get_libdir)/libpython${SLOT}.dylib \
+ -o "${ED}"/usr/bin/python${SLOT} \
+ Modules/python.o || die
+
+ # don't install the "Current" symlink, will always conflict
+ rm "${D}${fwdir}"/Versions/Current || die
+ # update whatever points to it, eselect-python sets them
+ rm "${D}${fwdir}"/{Headers,Python,Resources} || die
+
+ # remove unversioned files (that are not made versioned below)
+ pushd "${ED}"/usr/bin > /dev/null
+ rm -f python python-config python${SLOT}-config
+ # python${SLOT} was created above
+ for f in pythonw smtpd${SLOT}.py pydoc idle ; do
+ rm -f ${f} ${f}${SLOT}
+ done
+ # pythonw needs to remain in the framework (that's the whole
+ # reason we go through this framework hassle)
+ ln -s ../lib/Python.framework/Versions/${SLOT}/bin/pythonw${SLOT} || die
+ # copy the scripts to we can fix their shebangs
+ for f in 2to3 pydoc${SLOT} idle${SLOT} python${SLOT}-config ; do
+ # for some reason sometimes they already exist, bug #347321
+ rm -f ${f}
+ cp "${D}${fwdir}"/Versions/${SLOT}/bin/${f} . || die
+ sed -i -e '1c\#!'"${EPREFIX}"'/usr/bin/python'"${SLOT}" \
+ ${f} || die
+ done
+ # "fix" to have below collision fix not to bail
+ mv pydoc${SLOT} pydoc || die
+ mv idle${SLOT} idle || die
+ popd > /dev/null
+
+ # basically we don't like the framework stuff at all, so just move
+ # stuff around or add some symlinks to make our life easier
+ mkdir -p "${ED}"/usr
+ mv "${D}${fwdir}"/Versions/${SLOT}/share \
+ "${ED}"/usr/ || die "can't move share"
+ # get includes just UNIX style
+ mkdir -p "${ED}"/usr/include
+ mv "${D}${fwdir}"/Versions/${SLOT}/include/python${SLOT} \
+ "${ED}"/usr/include/ || die "can't move include"
+ pushd "${D}${fwdir}"/Versions/${SLOT}/include > /dev/null
+ ln -s ../../../../../include/python${SLOT} || die
+ popd > /dev/null
+ rm -f "${ED}"/usr/share/man/man1/python{,2}.1
+
+ # same for libs
+ # NOTE: can't symlink the entire dir, because a real dir already exists
+ # on upgrade (site-packages), however since we h4x0rzed python to
+ # actually look into the UNIX-style dir, we just switch them around.
+ mkdir -p "${ED}"/usr/$(get_libdir)/python${SLOT}
+ mv "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT}/* \
+ "${ED}"/usr/$(get_libdir)/python${SLOT}/ \
+ || die "can't move python${SLOT}"
+ rmdir "${D}${fwdir}"/Versions/${SLOT}/lib/python${SLOT} || die
+ pushd "${D}${fwdir}"/Versions/${SLOT}/lib > /dev/null
+ ln -s ../../../../python${SLOT} || die
+ popd > /dev/null
+ # remove now dead symlinks
+ rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.a
+ rm "${ED}"/usr/lib/python${SLOT}/config/libpython${SLOT}.dylib
+
+ # fix up Makefile
+ sed -i \
+ -e '/^LINKFORSHARED=/s/-u _PyMac_Error.*$//' \
+ -e '/^LDFLAGS=/s/=.*$/=/' \
+ -e '/^prefix=/s:=.*$:= '"${EPREFIX}"'/usr:' \
+ -e '/^PYTHONFRAMEWORK=/s/=.*$/=/' \
+ -e '/^PYTHONFRAMEWORKDIR=/s/=.*$/= no-framework/' \
+ -e '/^PYTHONFRAMEWORKPREFIX=/s/=.*$/=/' \
+ -e '/^PYTHONFRAMEWORKINSTALLDIR=/s/=.*$/=/' \
+ -e '/^LDLIBRARY=/s:=.*$:libpython$(VERSION).dylib:' \
+ "${libdir}"/config/Makefile || die
+ # and sysconfigdata likewise
+ sed -i \
+ -e "/'LINKFORSHARED'/s/-u _PyMac_Error[^']*'/'/" \
+ -e "/'LDFLAGS'/s/:.*$/:'',/" \
+ -e "/'prefix'/s|:.*$|:'${EPREFIX}/usr',|" \
+ -e "/'PYTHONFRAMEWORK'/s/:.*$/:'',/" \
+ -e "/'PYTHONFRAMEWORKDIR'/s/:.*$/:'no-framework',/" \
+ -e "/'PYTHONFRAMEWORKPREFIX'/s/:.*$/:'',/" \
+ -e "/'PYTHONFRAMEWORKINSTALLDIR'/s/:.*$/:'',/" \
+ -e "/'LDLIBRARY'/s|:.*$|:'libpython${SLOT}.dylib',|" \
+ "${libdir}"/_sysconfigdata.py || die
+
+ # add missing version.plist file
+ mkdir -p "${D}${fwdir}"/Versions/${SLOT}/Resources
+ cat > "${D}${fwdir}"/Versions/${SLOT}/Resources/version.plist << EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
+"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>BuildVersion</key>
+ <string>1</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${PV}</string>
+ <key>CFBundleVersion</key>
+ <string>${PV}</string>
+ <key>ProjectName</key>
+ <string>Python</string>
+ <key>SourceVersion</key>
+ <string>${PV}</string>
+</dict>
+</plist>
+EOF
+ fi
+
+ sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
+ if [[ ${CHOST} == *-aix* ]]; then
+ # fix upstream bugs with quite large proposed diffs still to be sorted out:
+ # http://bugs.python.org/issue13493
+ # http://bugs.python.org/issue14150
+ # http://bugs.python.org/issue15590
+ # http://bugs.python.org/issue16189
+ sed -e "/Libs:/s|\$| -Wl,-bE:${EPREFIX}/${libdir#$ED}/config/python.exp -lld|" \
+ -i "${ED}"usr/$(get_libdir)/pkgconfig/python-${SLOT}.pc || die "sed failed"
+ sed -e "s|:Modules/python.exp|:${EPREFIX}/${libdir#$ED}/config/python.exp|" \
+ -e 's| -bI:| -Wl,-bI:|g' \
+ -e '/LINKFORSHARED/s|-bE:|-bI:|g' \
+ -e '/LINKFORSHARED/s| -lld||g' \
+ -i "${libdir}"/{_sysconfigdata.py,config/Makefile} || die "sed failed"
+ fi
+
+ # Fix collisions between different slots of Python.
+ mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
+ mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
+ mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
+ rm -f "${ED}usr/bin/smtpd.py"
+
+ # http://src.opensolaris.org/source/xref/jds/spec-files/trunk/SUNWPython.spec
+ # These #defines cause problems when building c99 compliant python modules
+ # http://bugs.python.org/issue1759169
+ [[ ${CHOST} == *-solaris* ]] && sed -i -e \
+ 's:^\(^#define \(_POSIX_C_SOURCE\|_XOPEN_SOURCE\|_XOPEN_SOURCE_EXTENDED\).*$\):/* \1 */:' \
+ "${ED}"/usr/include/python${SLOT}/pyconfig.h
+
+ use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
+ use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
+ use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
+
+ use threads || rm -r "${libdir}/multiprocessing" || die
+ use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
+
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r "${S}"/Tools
+ fi
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+ local libname
+ if use aqua ; then
+ # we do framework, so the emake trick below returns a pathname
+ # since that won't work here, use a (cheap) trick instead
+ libname=libpython${SLOT}
+ else
+ libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' |
+ emake --no-print-directory -s -f - 2>/dev/null)
+ fi
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
+ sed \
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
+ -e "s:@PYDOC@:pydoc${SLOT}:" \
+ -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
+
+ # for python-exec
+ local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
+
+ # if not using a cross-compiler, use the fresh binary
+ if ! tc-is-cross-compiler; then
+ local -x PYTHON="./python$( sed -n '/BUILDEXE=/s/^.*=\s\+//p' Makefile )"
+ local -x LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${PWD}"
+ local -x DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}${PWD}"
+ else
+ vars=( PYTHON "${vars[@]}" )
+ fi
+
+ python_export "python${SLOT}" "${vars[@]}"
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die
+ python_domodule epython.py
+
+ # python-exec wrapping support
+ local pymajor=${SLOT%.*}
+ mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
+ # python and pythonX
+ ln -s "../../../bin/python${SLOT}" \
+ "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
+ ln -s "python${pymajor}" \
+ "${D}${PYTHON_SCRIPTDIR}/python" || die
+ # python-config and pythonX-config
+ ln -s "../../../bin/python${SLOT}-config" \
+ "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
+ ln -s "python${pymajor}-config" \
+ "${D}${PYTHON_SCRIPTDIR}/python-config" || die
+ # 2to3, pydoc, pyvenv
+ ln -s "../../../bin/2to3-${SLOT}" \
+ "${D}${PYTHON_SCRIPTDIR}/2to3" || die
+ ln -s "../../../bin/pydoc${SLOT}" \
+ "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
+ # idle
+ if use tk; then
+ ln -s "../../../bin/idle${SLOT}" \
+ "${D}${PYTHON_SCRIPTDIR}/idle" || die
+ fi
+}
+
+eselect_python_update() {
+ if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
+ eselect python update
+ fi
+
+ if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
+pkg_postinst() {
+ eselect_python_update
+}
+
+pkg_postrm() {
+ eselect_python_update
+}
+
+# vi: set diffopt=iwhite,filler: