summaryrefslogtreecommitdiff
path: root/dev-lang/ghc
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/ghc')
-rw-r--r--dev-lang/ghc/Manifest126
-rw-r--r--dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch78
-rw-r--r--dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch26
-rw-r--r--dev-lang/ghc/files/ghc-7.10.3-relnotes.patch45
-rw-r--r--dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch14
-rw-r--r--dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch81
-rw-r--r--dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch34
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch35
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch31
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch351
-rw-r--r--dev-lang/ghc/files/ghc-7.8.4-gold.patch27
-rw-r--r--dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch66
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch50
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch65
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch127
-rw-r--r--dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch34
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch35
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch65
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch57
-rw-r--r--dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch12
-rw-r--r--dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch19
-rw-r--r--dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch296
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch378
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch60
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch81
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch43
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch30
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch124
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch35
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch44
-rw-r--r--dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch27
-rw-r--r--dev-lang/ghc/files/ghc-8.8.1-no-alex.patch33
-rw-r--r--dev-lang/ghc/ghc-7.10.3.ebuild674
-rw-r--r--dev-lang/ghc/ghc-7.8.4.ebuild600
-rw-r--r--dev-lang/ghc/ghc-8.0.2.ebuild672
-rw-r--r--dev-lang/ghc/ghc-8.10.1.ebuild797
-rw-r--r--dev-lang/ghc/ghc-8.10.2.ebuild797
-rw-r--r--dev-lang/ghc/ghc-8.10.3.ebuild796
-rw-r--r--dev-lang/ghc/ghc-8.10.4.ebuild3
-rw-r--r--dev-lang/ghc/ghc-8.2.1.ebuild754
-rw-r--r--dev-lang/ghc/ghc-8.2.2.ebuild755
-rw-r--r--dev-lang/ghc/ghc-8.4.1.ebuild755
-rw-r--r--dev-lang/ghc/ghc-8.4.2.ebuild760
-rw-r--r--dev-lang/ghc/ghc-8.4.3.ebuild759
-rw-r--r--dev-lang/ghc/ghc-8.6.4.ebuild775
-rw-r--r--dev-lang/ghc/ghc-8.6.5.ebuild784
-rw-r--r--dev-lang/ghc/ghc-8.8.1.ebuild804
-rw-r--r--dev-lang/ghc/ghc-8.8.2.ebuild803
-rw-r--r--dev-lang/ghc/ghc-8.8.3.ebuild808
49 files changed, 2 insertions, 14623 deletions
diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest
index d0e41fbda30d..df45f4d6a9fb 100644
--- a/dev-lang/ghc/Manifest
+++ b/dev-lang/ghc/Manifest
@@ -1,152 +1,28 @@
AUX ghc-7.0.4-CHOST-prefix.patch 276 BLAKE2B 77c706d291928a229edad6bcde37786b2c11cf52f42b22f44d3bbb7cfe12f83b8725cae020f95994e0f12022989b125d1f1e6f43ad0cc6698452264b8634651c SHA512 9d5d30b95c0467bb77f320c82458be5eaace5bbd77684725b9f3fd70d9640accdd771e36aa957c66f9bfb01e45088d32a5f811444b472058574ccbf89e10efbb
-AUX ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch 2648 BLAKE2B 82145d17ff3f7535b80b76d98a30355895d1a43ab9cd5cab1606f989764f77b5b00d8d098ad327bfb6f3318ea8d188fcd55bcba15789234fceb0de5c132e9cbc SHA512 ea2c9cd8fde754803950e29b2eea113227ca5504c58392847090e13640bdfa6b39ef714eff985947aa27e66c2506ef2a2867696f68a7ff34418a7fbf49765d48
-AUX ghc-7.10.3-hardfloat.patch 747 BLAKE2B e2a328372ddd113752400957aa697d171b3367693c3d098c9b5b8b02b9e1ef1cc0cb86c2af4a0385a142791b4e7efbf4c7d64835f7e296a03abff2fccc9e9ef6 SHA512 a9a186ff62236d63b4b841bcfb1da1a902b3f300eb7d768c5316b5d636190d58fc71177f2d1670df261d0b681b104621f98cfdd76b30a0fb6917525874759264
-AUX ghc-7.10.3-relnotes.patch 1584 BLAKE2B e247668b1fb2a5b8ff69b00f31b8b642a7ba47cba0cacf9ac254b08cd736ee0d5276e77f64665ce37d8d85250c7cf4cc9924c86e21b35a3abfffded45b72ae9b SHA512 20d61d9f73bd0efa39c920897bdb18b69cff453f5ab24193aa3f7fafa70a9aa346ab4402604f81471f989c2401ca28d901fb85b8862577790559a35cfa3d3f05
-AUX ghc-7.6.3-preserve-inplace-xattr.patch 495 BLAKE2B f9f32485af27b76d62466bc03a17826e18efa40a87858a46b41d4f094e1c0989d2773ddd92e206d4285ae1791bf00daaabd4f19dedcd80610db1127b440394fd SHA512 98504e3b72446607deb520521c4abdd15e41e4ff69ad64e2ad13faca396bd7c7784b92c2bc7b5d8190668da480d5b1dd886f5e47e2e192d76b7fbbd58a42d44b
-AUX ghc-7.8.1_rc1-libbfd.patch 2771 BLAKE2B 8730551d3900012d04eafed69894740f603618ae59bef59e71194efb5b1e417799647c4aa1cda4cea9041504d116d74085bb99b0e9f0c543d2429529e030faca SHA512 e232596342675769c6bf97686aff0fa7a8991e1edd3bf607068482cd0d0c9f9a9500e5b15f176a2025732474c9e547c0bae603d373c81b374c96787d46bbfa4a
-AUX ghc-7.8.2-cgen-constify.patch 1173 BLAKE2B f61bef77e23e47becb8b5f99e8cfdb5f4e8858787da21b62215f5538c02d5c8d92bf58d29b080468c81d8b732dafa34969e5138df7c113e2e805c7b4e4ccdb1f SHA512 3e1bca7d7f9062d231c45a6765485291871df833da31b0a5573bb04639791c554dd5c0d8fe33bab05455fe06d3f36fe81dd1db6d3819c739284a3af5c4ec8fb0
-AUX ghc-7.8.3-linker-warn.patch 1317 BLAKE2B 399c117a216cbeff9d863893ef821b965d91428e55b447e72469ccc6940d0eccd4bca33f2ceaaea096de23789e74ca7ffe38a5fdd08005bbcc016c06db4ec8c2 SHA512 3b0ece4a6536ef43f15e97e723d036401dcf41d47c15e29dd8fe30c9f1563894102922617982db7b6c7cf3ed8aea64458b540ef92ffe690ff72994b1246834c9
-AUX ghc-7.8.3-pic-sparc.patch 1007 BLAKE2B 64a1214b1df6cc2d894e898dc21983a3df17da95f6ace2b7dfb2469ca62bf10b548a65c6242bd97e63a70fe7ae6e921e3e5828b664fa1ce04d10323fd8a4dfa6 SHA512 d3d81142a1e606c85c22127e2fbb26ceaeb2116435bf0bbc3743273577f04991e28c38a375a78b3f633a9b0e25f10951146d1f322e0ad7972089c1e5d977d16b
-AUX ghc-7.8.3-ppc32-fPIC.patch 14549 BLAKE2B 05811de54b2896c75456a0f61c64325fd347ccd3a47f86d7e9697d04266f11af0b3f3b8081b39318e8d90d76e3f763ad292adeb0114d8b7bf60157b5a90b13a1 SHA512 aa6f13e04a52e7f25db456c02031b63c01b71adf41262361b36ca97aec18965f618ebba73494b4283ad3c0224f15d5c80dbd43076553e604d86a07baf7fa86db
AUX ghc-7.8.3-prim-lm.patch 444 BLAKE2B a930bb9657441a48941debf79711e06223c5680df0f60d7d972e0150950109bf8f8a99c35c7dbcda21172dddcb15d8a379085813e44647583e3888f27f597568 SHA512 6979e002589a54c870c70eee8357dad4feb55b4e5102350cc09a466145677dacaa1bab5ebe4818cf0d3cd8ab50ee0ec2ab642ab0fb3fd34f4a266e5e90f9f389
-AUX ghc-7.8.4-gold.patch 1025 BLAKE2B f62a45f9761690a685217654e45c037c63e2cf0ae297f14f3c70c038c4b02e048899b1a787fedfd30fa4e41839f729d20c2442ec3410fb59508da57222ac19fd SHA512 3087084d8b6a202496fc7ac71fadde06f7d1622d0e3f44f1b52fd04f1451d690f54b6bd8ee0da85663d252c6110340402bd1864f746117e59ce7b02e0247ec94
-AUX ghc-7.8.4-ia64-CLOSUREs.patch 2243 BLAKE2B 7bfdd4f42917a7b856ce18b85a2131bc0b566151fda16a77412331f38a4465efa080f6aa3eb52cfe12fb9c2c3fdefc1fe4a533fa5b339f4f22ac70c2a4a404b1 SHA512 9981d13f294fe0a28d1cabfd4db98bfb18110c6adb390f509667e3166a931c7d9f7b4b0079dfb1a22c174556944fef62f0e67ec855a9c3bccc5b54b0d0952c09
-AUX ghc-8.0.1-limit-jN.patch 1896 BLAKE2B 3acabcf982c0520d628d502cf2ddc01d6fda8ead7341d8f0341a309b4cc314d01b4e9237afe810b5265b7a952c847e605dbc3fb2e35d76a35ec2c832cc7653f3 SHA512 5eb69e0d5f87e326da82f018f0466a62e307f3acec47d991c7735ddf828c98c836dbff5d8164a4dfd08829b36a9d573828b9553fe89d65f5ac6be6c0190a110a
-AUX ghc-8.0.1-par-g0-on-A32.patch 2276 BLAKE2B da7f6dd5d68e911886448afe04e3d0da6cddbdae686e040e8b060ade871075b87e464cf350f1272d33a7ee16e8e73cfa2d7f4c64ab7540980c0283b898817602 SHA512 0aab32a6f289c2a4e83bea2479c04cbd226f3399b5cb4a8a596ed756769a1b29bbbad261d7006c28ab56faa48c1c02e9e52cd35a7bba56ccc87f49ac1d17b0a5
-AUX ghc-8.0.1-ww-args-limit.patch 5212 BLAKE2B 1079855da7599a83d6e950eb1caf40da4bbb5b856746dc7d2e2e50651071e3acca45773cb0f1db35a6c7c9657ffd40c911ae4c1085b9e33ba4ab815d1773a8bb SHA512 5b3e34f52406649dca1cb3079565cfd068872387956dda296902c2e1ae8a092be0e70a1fc1d96f0e578fef0b82ff48b655d35a1e21911484f04d34809b295428
-AUX ghc-8.0.1_rc1-cgen-constify.patch 1185 BLAKE2B 3fc5807f31cbb5c30ec5782d27539987195bd83a6be28dc510568f0cc2d4d328cada1f111838e1ac79a3790ee197a4fb5cc41c040fbde66ca279c1fad01f9f5c SHA512 338c887a643b31ce6df2cbc28df03d1b98f48ae6b66afd0440cde7fafdc8ee51520f18c7f026645c3c995f106f78f451733b80abcdf8d4e4c3e9fcbcea597394
-AUX ghc-8.0.2-O2-unreg.patch 1203 BLAKE2B fd0ec53968fec2f4415a367c729b9b69e15f6e2c76f8ec39d6b3de24fdb0de0b9c87559b04f8b1031a05fee8a653c5f0b2ec09064f43eb9a6afaa8cf4f179e8d SHA512 0d0252bb7c49cce2a38fb81673e6f6a6aad16728f66be6287f5a765064ebe5e5fa43f30f247fecaadc7fdd07af416522e5eb28656b3220ff3832ef8164c94019
-AUX ghc-8.0.2-binutils-2.30.patch 2115 BLAKE2B 5affd1954283773ab1f4717b5cc735f864db9ea3eff3f859cff5548b059ef00e66230795aed8c3866f8b839d74e24bc5d767bd73bb928bf19c1bcd17acdfde5c SHA512 d7542cbf8ad2ccbf6a3b5f50125c98521f10872e319043eb048c06ffc416c6c835772190d58f6a09d10e55942168ca9588f3f1bb1cb835e1c1993a44403329a4
-AUX ghc-8.0.2-libffi-alpha.patch 2133 BLAKE2B 596410d5bead5a3c5f1f4a1e33a767bf2ade92204e469652e3ce005dd275a54e0e084799af2967529008654f4c45148b955e5e0b299a48cd5e78cf1c209e3d7c SHA512 77964b82be47219d709ed4b79ac255c4762986decadef2d65d6643cb2d1b6cb0f3210cce1bd46bc16b6e6c51a4aabc73c5bc5e1bdaa8797a5f23033194f91a4a
AUX ghc-8.0.2-no-relax-everywhere.patch 766 BLAKE2B 76ca925d56a9d2961cd342971ef8fb0165158d707f0089f3726560511e57ee5c08adeaf996595378d1cef3ec7b59ddf1df06d0255bf20da51c5b26e817f4057b SHA512 b729ddc27bbf089324f0b4d7229925226b59c0047cec0c0230e022fb8554389373e309e93a108f0aaa155fd9ff6957a7d41cdd35a90c6ca59b216381ff21483b
-AUX ghc-8.0.2_rc2-old-sphinx.patch 434 BLAKE2B ede17cd4e5848b452edeaa3b429a7485f324cf1c9133098c7d9f84a22816eedeaf55143fea082e514b5e987ca40f65b68a476060e0c18d19bb5f8b5b993fda92 SHA512 fc8fd8d40c70a77a3aecfbdb0993bee9ef1582402b7220ed3066e1c6d4bc480c5b569cab44b58b3c54d1e68f506dc5b86ff87518d744a5a846d4de6cb1093db2
AUX ghc-8.10.1-allow-cross-bootstrap.patch 541 BLAKE2B b77b3c9ebb7a33af6f82ec1b9927664e9bfce04450560a8e436ffa87feca50d606824192b7333e3b98d5552622592b6d39d0b184037ce646d6f7ebd205deb348 SHA512 d87a99ac96846e161d8c939079f8314d380be8e1dc62f956e3afcce1339a76447a14002b30bac1c86c807fd8eba23a0648912a3d074248f3513f9aadacd27489
-AUX ghc-8.10.1-no-relax-everywhere.patch 910 BLAKE2B 3afdc92313cb48a00698b8c4cc8af822b843dd107d546a95d598fa0d7e7fc4507e3e7dc8ab06faaafcb0cd24770df28826987088898a6cc2d1b914fc7576ec75 SHA512 21f1c64ed75c5b062a00f48b7439753aab15083c583a1cbea76b63398873ac14f52a45fe62e4cf3751c5dbb623e75a4f96c416f5e8f7a1f7822798b21cadcbb1
-AUX ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch 13879 BLAKE2B 6e36243742c4b4bdd900bd9f049f06c480e1582154f2dbc0071c1ba07e8e4dc4b9e37c3425840f35fee6cfe290036b6ac12493da574efa65260589ce63aa28f2 SHA512 3b14656faa2ba0416f01693fae43f856032e6607f1e27b22bf86e39f56e31dd06878d340fb4e7bf297af59fe6f3d2f32458e49efdc18191c2b887ac47ebf3d8e
AUX ghc-8.10.3-C99-typo-ac270.patch 348 BLAKE2B 8d23baffa0ae781db4610ee78fea812ebc25450c94e942d8008c591cca78c6072c24b042e7a9dab08ae5213ed4ba931ff932ad4685fc029fc004039494a70c7f SHA512 9e224c6863b5f0f0deb032d4554dd41f2396a8cbc373b860294ba76feaf1abe7594711ac02e9a06356c024df8d6fc6a7a064ca428eaa1e4e6209b3a29d4317fb
AUX ghc-8.2.1-darwin.patch 910 BLAKE2B 2f1a44dd7ead59301b5dd59c8cab932710655416640f2c8d5273cf07da4a45bf702d840768e2d32822e89f1b07cc9ed3a6110e1847e11468fca5c515e9e26f70 SHA512 0177fda8717d9158a99d96853feb1bf40ff13df8f5c5669c7c48f33accf69d6ddb05876776cda66705e85ee56c5ecff8f81722d8e748b6c2ed6b9bf611e42a2c
-AUX ghc-8.2.1_rc1-cgen-constify.patch 14371 BLAKE2B 96f9607cf857bb113b475d173a62998f2b0424f09f14c20ae3cab8497a25ab2df7523850f46e3b2867dcd75a499b3487345376b7cdd8e6f4a5e8008e160cf3d0 SHA512 8715c2f7c497eeefffd13b578ff718f36ec22bfe397501f685db0c781c614ebaa1178a9ca7550a722876d1cf9ace39aaa44493ecb934a828fa5010471672acfa
-AUX ghc-8.2.1_rc1-ghci-cross.patch 2828 BLAKE2B 89776c87d4ca8c0b74f0d7ef11680d2cea217774389bf297df1a61f9d95ea515b5f9d44387eac7715fec59d9c91e91bd06215c851c94f091c05b03f84d0b8699 SHA512 55e8f2e6bf69ff26976005e0b89c400df9facda5eb974f7340af89625361adce48371616a5d292dafbd4d98cbfbc0b656d36749f2e16918b275a0469ed88cea2
AUX ghc-8.2.1_rc1-hp2ps-cross.patch 3865 BLAKE2B d68b1e15c091047d086be780dc0bb5ce2a1b713244ee240ae045052ccac947baf6a5bdea8cad50d0fac2984700069af7dcd320b96ca09af8c7b81021329da41c SHA512 d2ed48701216f5c03567e61c207e32d6218009380941275c690edd8eb0197728e7e3c0edb00d512792dc2041a958de82ceef393e96d3324b690157162e28d29a
-AUX ghc-8.2.1_rc1-stage2-cross.patch 2986 BLAKE2B c50b502adca0730fc382831631851c61aeb067bc9f7c028d983bc9b528c22fe75839e63589a714f06c848e72cffb77d4c80d6a617908e7bbec87166652a38624 SHA512 7dcae0f9ff090e521befc9aa593a674ae9175ec07ebab91bc5a72097be509a89de12bf7c959870b12219074919eef115096b74f78e7cef00360aea32126ec8fa
-AUX ghc-8.2.1_rc1-staged-cross.patch 1605 BLAKE2B 5b5f203e17912396539530f40c5a93f72f1982a07ee8eb2b367d6b02ca82a2b41ac38d06e8694abe226da7761f169822b74c8c3ed1025a55bc2dc61214fe8996 SHA512 d9005f0310002f87972b0db8484b714d15664209b41eb84ce26950c4a19e854203e9b78e959755ec65a2a50a73bbce4999b39a3ad4da844cfe65098e65171450
-AUX ghc-8.2.1_rc1-unphased-cross.patch 1066 BLAKE2B aa29454f12ba0073779df08885c587cc5ef5ef21d72247d52b9f71bd455ba5fd0c01b144f0cf071e712c5e60c5ff1b96afdaad6c701fbaf8b7c418dbcef54efe SHA512 24b9b864e984cf3e34c2a23e0ba24a7f2c961dc590c6bb8e6461afeee7bc4a6361e5bbccf17754486c81136b60e12ae7e9ed06f485ef2f178084bcb2caa5edd9
-AUX ghc-8.2.1_rc1-win32-cross-1.patch 4535 BLAKE2B 546af93363a16fdcc7dc7b4167b30e81fac5dca126fac8d1421632d4fe9d2c3803f1a2ad3bedb7e270bd442e2ca95f99d18ec8d17ca9633079c6d486c6ec9ee2 SHA512 16e8be604af1e856bcec0603caa9d4fa66d5e4773a68fecaf4a57f509cd241cc7fb37fb9705d253e28d871ce2afc942e940ca171b45d41715acae5ef6e0fde8b
AUX ghc-8.2.1_rc1-win32-cross-2-hack.patch 6231 BLAKE2B 8ad4428ebe9a373e08e94e5373ad9578cafdf95b866ced2a4000434d9e5d4298b129e832e13e8e175e8977b9dda9351d01a896e2c320a1a40551d5892b0efc33 SHA512 8617c1346ba7aa2b41ee01feaa47f2ca477353f9b825be48c5d3505a134e0a80b613efc6cb92e7fbd3fe062e77450e197c826151a42c0c77177fc6ef8e65287f
-AUX ghc-8.2.1_rc2-O2-unreg.patch 1199 BLAKE2B 7f3fe4b40e026736a3f1c58336274b49eb2cbbdf06c20ccced7cc83fd740128e4c30716cafbb251abe4d963ad224d3c406ec9f66b4b980af5f5c523f01136722 SHA512 708f68234f3678af3d41e7a50f9b914030536aad081b1a09a6169b12ed61ffd9db207a03f8f73d1761a93c5f2a21e92cdc23475501f96cac3bf98b046f3a6dba
-AUX ghc-8.2.1_rc3-any-vendor.patch 1288 BLAKE2B ea451228b0304d35ea1047a997e26efba4eab4159b8f84fac833a8561682be15b38734434459d17a02bac8da5df97c957a7f76091c5393dd87121c3ea599c1ba SHA512 934d6d91a434ef1ec8fbeb8b13f7a20b0654a97df05d10e8d4f577567b5a0498eed484261bc1348926e112c6d4429304f74f10e4ba819120cf5840e9dd2d8329
-AUX ghc-8.2.1_rc3-stginit-data.patch 1179 BLAKE2B c67a01bf0dc9b04334592b85ce8c238d34096857759a47d37a91e305d363f1acfd2b7ebb1a65f1dba7a558db65fd4448a11e4309e2c0f4cd7b0c8075e8680990 SHA512 351b78bce46699c63ba9e02103eda0e80eeb92cba9b364049a11e61bfec3f0bbd9317a4d221b51ea29e42e6735ea4d5e3a6357d0180dc91647b11ccbe5f885e4
AUX ghc-8.4.2-allow-cross-bootstrap.patch 768 BLAKE2B b697a54fde6687d49592398be33ea4feb6404ff24f51b5b82bd71fe8234ad2d0d3322199b12770b23a0fe27ebb5a10eab2400a5c84d28c29f3d8f3d4521cf214 SHA512 1a58408a96d2e35b021f7298b399153973905e6ff8338de8a137c126f0e2598306e0c9cf2925253717c8d7125796094a0490a03947982961f583537b5188fbec
AUX ghc-8.6.5-numa.patch 850 BLAKE2B bc15c4e24a8a395f5f3540469e5e769285b705fae05790b9d9a76e87490ec1103a89c1b1a0166b05f29f9d6e07b847fba9c9b7ec01e9cb9f3c8aa0078e4caa68 SHA512 89ee983384cfb07211f37ebcc32c74f93d82541c9459857cf317a8c947d4325a9d50caf051cd68fda2c648c0f0305f7df12eef7dfaa86ada79fb5816269f76ce
-AUX ghc-8.8.1-no-alex.patch 1080 BLAKE2B 7e7d6f445f77eb5b86ff36400240d322646c4495d669c8c6dd0f3e4471170f83a2966746673b292c8cebcbb0a7a9b07602eb0fabcf5ab8820159d3b0b22d16ef SHA512 84b784c44d471a56771661a9f1a75f12ba6312e76a2b42bcfcba68b64faddda50c8c8ef93a6dca3051de13535df177f6111a1428c514f60a1e72513c10e871dc
AUX ghc-8.8.1-revert-CPP.patch 2236 BLAKE2B f793a9e9516f9f484234311372715116dfdd588a6682113914c17feedc635371779f0c0591e1f0caf3ff3e5ca5d4c7cc8b052045306f3df4085873d0df25f2af SHA512 b324c6873a802e20ee690f0574f9f2f312f3ba4331345504b7170f52ab2b1adeb9d047a0e5526053d006d67fc261e771a284bdb8f7b76653c21d9bf9337d7cf5
AUX ghc-bash-completion 6496 BLAKE2B dc94a1979e886026a2fbe04bf7b45718ffa3e025a0e8945262e21a1243bfce6517fa1794f2ba6cd54cc853e93ad5d80472b9019b95762f10b5be83634a479955 SHA512 ede79ccf23555f60f48297d29bd98e3ccfd67d2cf27462153e00beb930398cb497e34ba8316e91df44c577ed11fdbe5606f7c6a2777e35d5e783590e49ccfeb5
-DIST binary-0.7.6.1.tar.gz 47086 BLAKE2B 7d81b9c254902d5ff2bafbef4c31a6f6f0396202d8585690c1ae3b63ae6ed157db7221d65a62e393ee8f6725ffd5d80e51030c0351e954b06004fcb70e5867cd SHA512 655daa93a52b845a85d440810452933d7bc3398ad1b51e1e955b2d19a0a32679325a0d1751ad50d252531e493528262e14dab32af4b9a515855fe7f64e0730b2
-DIST ghc-7.10.3-src.tar.bz2 13281867 BLAKE2B 51b0a94cc63269926fd5d04c0fb0871266c45b3168187b891127db71980d180668fb8ef7adc51a7a3df947ecc93b4d4a06965ccf9ef53eb74ed063c54adfebde SHA512 97a8282d8a75399c78d85d6faab7ac253a993dc69f1840358572f1878b8fd1a527c28801e5823c8200b5690e268e4a0c00941945ada13790852c75a83b612c17
-DIST ghc-7.8.4-ia64-CLOSUREs-regenerated.patch.gz 13268 BLAKE2B 35af21163e3a46ee340e29eb88daf617eeb094f02da7fdcb80e947c1d26234232b12d9eb2c38c02c3207c047573521fef3ac5e7b87609e66f0c57072fef1038e SHA512 a655713e06324b56f0041edf70837487e296d28e6f3ee35fe116b9938765aaf3469d25e92645e0940655ed3607dff27d3826fe0f995c84e81b51bfc956816e7d
-DIST ghc-7.8.4-src.tar.bz2 10600755 BLAKE2B 6cf27f663178513b25032b648cf36b016e01361966725dbfc219079961e8eb9b1ab3531427c7012dc599e8e102dc87ed6dd43b31e7bd4e231e2d989936eb2c66 SHA512 079a53891d8ebd8d9b88da96170e60981608a619f8282e4b7948f35244e99bd87277649ac7fcebc227a61a4d21960db8d5e5b9e92f2c69c82d8d68d7fd0a41d3
-DIST ghc-8.0.2-src.tar.xz 10687760 BLAKE2B 3b2a487c115680342ce308ff1a42d2b6fa6fb1f31e2670b27a305b4d44160056611b77273c9d47f2e37a1ef01b1aba59c36e76b65c83142a5f09812bf3b1ea02 SHA512 58ea3853cd93b556ecdc4abd0be079b2621171b8491f59004ea4e036a4cba4470aaafe6591b942e0a50a64bdc47540e01fe6900212a1ef7087850112d9bfc5ef
-DIST ghc-8.10.1-src.tar.xz 19781652 BLAKE2B 61ff73d3a895cfa0c836e25a684d7a31cf099dcc33d1f308eaf56aa4b2a75b8f38cf963197c11dad9d027270845af20e00a7d81e5417b0fb8b4a98ddbadd53d8 SHA512 e6bb5c326f8354f0892324586c164c6e04168215d8bfeccb594173a838a535e37bac38db6fbdb01fb37150099c12842c53be5e912dfb6a6feeae3c75d4ae24d0
-DIST ghc-8.10.1-testsuite.tar.xz 2091988 BLAKE2B 88796f0fb6ea2bdd749161c84ec88768f3bf87063d2224a083db24f69282e615227626fe3c7b41d4abec10883e22042abed6a231582bab4ea530feffd683ed0b SHA512 35147f98301c5bfb6c939e108de48b2a1133adc1028aaa720ce49d60faa06a4b486a9eded658295e3f203731b4dd53475b57e8213491c45b05959430030be269
-DIST ghc-8.10.2-src.tar.xz 21880680 BLAKE2B 0c1b67c1576cfd1067d11838301f96041cabf66b94cfd546cfe6bef57babe940fc3814918ff9327e59fe73a8e230fa1d62d7816d7c6cae274dd8c53de6e81736 SHA512 6c3f1311feab3665419a301b17fcb09d303ec822f8eb8c4021edfacff00d9b52e71895bed0e58f11d8f7970415bd8c6f95ffde1294afe795e15607199b20cefc
-DIST ghc-8.10.2-testsuite.tar.xz 2101788 BLAKE2B 0d4528223471dfd68cadcda47931d53508c9eafa415716ca5990ea519eb89bfa2bdd444280057be33467382dd3d178887262d54ef633aa8ce88ea91eb9d58ece SHA512 043faaf2f0dc34a868c481b284b94afd78aa1ec1a4056d1f3c97ca3f7dadb3e9cff0517a4cfb378fe5187389db7c9027763bf066328e7dcfd264b737f6d09e41
-DIST ghc-8.10.3-src.tar.xz 19872356 BLAKE2B 043f41a21becc826b3cd13ee81b138cf2edfa18484f98361dc85b12f784df85571522347d5fafe40a19ea8ddf12390cd766db8fc21cf4971e797bc61404304cc SHA512 6f3248e728d3677dfddf2f02609167c67a194750418f2a5e34ed68f1135960761c5a5768255bfc8b2ef5640395609424878375184d2dde8e2d69021a3baf9ec8
-DIST ghc-8.10.3-testsuite.tar.xz 2261376 BLAKE2B cd03d569c30637d531d9a13fa926a28f854a37d48ef0d4e2fde684664ae000f3c941b5113ccafd42fec019428bafb5344b1ddf8f84a71b21bca8831ed4784907 SHA512 4c9d20a27ed71eb7c73bd86c1049ea5adcc8a0b12040386b7d0dddb46b3cf704c52a3392e19ae4ff1c76b8868665c599391d47e47dba516fcadf8abbc30e28df
DIST ghc-8.10.4-src.tar.xz 19818108 BLAKE2B 069dd8436c373ccf73c20d8b577243792ffdd3a031e869edd612fe1e273126e60803326542695012dbe62e57654ada18af9342bbe1a741b2bebb41cdb0d86035 SHA512 9bb078cb72535a352243b83b671c871392564efd09e478549f27ae58fc6f46e337a0782f5500d26d5704ad96eace22e77bb36031a1fe9b7e175f265b0b9c028b
DIST ghc-8.10.4-testsuite.tar.xz 2236932 BLAKE2B 17d0520ad5c6daa0cc60530279ae7e617e4d79328b9f436abbe75e72f0803d9a997fb9e1ae61425326b070f45794a488d8507957fec9a6ed49eea86d30a1e579 SHA512 1bf129c8d872e3ceff7c19929605adc5d68daab9ded9aa2e5109b0de162089631472c66f04993adf8481291f8128bf804fe64a9d344c81e257f1b962ba5e382c
-DIST ghc-8.2.1-src.tar.xz 10736016 BLAKE2B 60993cfc9569e83b0c383591ef30a7280e0138fbb7bd696ad62d87e68dcbccf31c0b8ba211b6647922b8595c7aec2c783648f12c67da53e0766b71c7d7c923fc SHA512 d9aa2aa7f9414db8f4e51d6c275694b46df515e68331a1a2b6018256333a2c63ebd877b75ee90407ecce5be672ec9afc6bebd62aadbf8ae06b94f1760d1736be
-DIST ghc-8.2.2-src.tar.xz 10753272 BLAKE2B 6fd792390d3df20f84836466705c3f3c931ba2d594dcbe2b808ea0ae284460000b443df8aae74903eabf05ff9064d68a303086cf888ea68222eb1c60959c8f21 SHA512 6549416f470b599973d409fa45f59c25b07e6a94798cef1a19ad432547dc225338cf4dbc4a4793114b4a417798a3b59b122b92b020251074405c5302b7ffe799
-DIST ghc-8.4.1-src.tar.xz 11301528 BLAKE2B 6dcf467d04cace856b68315c85b80f19b517dcbc8ae6e2a08c60afa141c9e0261e012738452c9ca208f9fc40c48bd1a0817e5e0fe9f4737383cd7b44ca65c8d9 SHA512 f8ae11f498bf2911fb92635534c6906c96f1fbe5072c7b7447bd3f69e408026b674564515af02a8aaddc57ee6905ce78d10005b12478a39c220580aaec13a9f7
-DIST ghc-8.4.2-src.tar.xz 11313140 BLAKE2B d6fe90f3c68b137c6029bf08918a51ff43c210ba0485aca8d77541cd455f6f9c94287cd011ecd710a8e5a14a27e8a27c04c517417c5748966afd63a5ba6ed19e SHA512 aeb17c986c597762381d9887679eb0eec194c2938a92b5a33e66b4c80002ead02d672b4aa968e1061ab5652b74e46a3c9f9e3d58d5be4a0ae47aa8aed288cf1f
-DIST ghc-8.4.3-src.tar.xz 11315068 BLAKE2B cfb858051aff0c4fb3cdbbe96627cacc82665a6bfc4f863b0353eb3d93d358f7ed4efd7b131280763786f397aabc5c4825f60c3890649303fc97187f2b996d21 SHA512 c6cea84264f32ae888f9931f834a1d721889242f656d14262e787ec54a1793d1862ce76daacaf1006c12b8af12919501afce1dc02571373e24830e4d51803414
-DIST ghc-8.6.4-src.tar.xz 19029904 BLAKE2B 80676923866417cbf674c3cfadc2ecf9a673e9dcefb4561be7125c83edad38990ea9427c302aeeb9ef04b2c3eeea4fa9fabc72d89c742c6714163ea280802122 SHA512 9237e45b26852cc8a6d64c80da2b28c910349bbbed60f6575035f39bcb064a5ce80ec73cd85e2298e4abefead378e19b7d7ec3ffeea09e362f20eb0b09b36798
-DIST ghc-8.6.4-testsuite.tar.xz 1906656 BLAKE2B b0e55b415c885479c3573fe86436338971e685edc95e106043f36e92e1ee6a7e86add9e86a35c8bd685916f18a7bcf08d4a7b845da41dd855132b131ccbc4a37 SHA512 b1bbe1759ec528914cbfa6b3789c596e46b6266568972b9f5d1cf13e31b7206400b65536e7acea698161e46b8ca11285b3282ebd9336d23b68d34feb4f0bf314
-DIST ghc-8.6.5-src.tar.xz 19092168 BLAKE2B 2ac0926b186c43fd179170a0690492129e9ffb6651608875db7167113becf324dcf99a82f56e578c67051f813007c0ffa32ca5b12588f0d370330c8274a2d74d SHA512 c08a7480200cb99e1ffbe4ce7669f552b1054054966f7e7efcbc5f98af8032e1249fa391c4fc4c7d62cc8e0be5d17fa05845177f3cea3dbcf86e6c92d40fc0f9
-DIST ghc-8.6.5-testsuite.tar.xz 1910060 BLAKE2B 71136207e3eccb4ec6756661ffa64c0a82475704c071cd8f060855a9f40d7d1fc4be2da7ff265df38fb918b8ee2ce21a54ee4b224aacaa3026ad1ddb1e1e4ab2 SHA512 980f3934bb18876cc80b80a0eb64a9ca1dfaa7f4d8b0761f5d733a6583053e38b231445388b992b26ec1ad5f569b6385dbe60f96381794f5577964979c253e16
-DIST ghc-8.8.1-src.tar.xz 28634672 BLAKE2B 3a012db5d9798efddf806542a88cd9fef1d0972f7f025d377c247961cf8d8071fcf390aa130ac11f1a5556fb572499b9288a8698c49bbd594f0bb5fec4130a2f SHA512 7268b012c3a6c34e7eac05c7d6959de6005651d33e870860bbfe589295502e8794a76580130b8f4da2f88032b68116dbbdbc4c1e900e0c862aaa9891fa788bef
-DIST ghc-8.8.1-testsuite.tar.xz 1959220 BLAKE2B 8606a6439f7d5b4c837b2325c4ef5705dbcea17c4b59daf7aafd0de68e55179bb2c03ce7a4f376398b185b6dbfb361d18592756558461ee43722d2142370d815 SHA512 e13b651c60deb86522efbfe8aa42679cc81a413475f70580d9ef28dbb711617c523951441a30fb46f3be9418c4c0bb4dbc522b04aaa51313afd2d39027696c30
-DIST ghc-8.8.2-src.tar.xz 19365816 BLAKE2B 85dbd2a4696755f43c28ec578d5ecfe706b27ba7f640f66b464b7aa7b959ca5f02b8b51d130299c30d024c46b9ce6a115606bde46be400fb8ee221ff18177d65 SHA512 11eec0bc03254ea848a5c86bc3e2da317801a1227dd91406a157e11cb675891d77d61177b740b6df88bd823063f6cb2af5a928a7540e25392d9d0769ea121069
-DIST ghc-8.8.2-testsuite.tar.xz 1976924 BLAKE2B cec6c5dab1782332aca6364f995cffc1e9f3506649c3410b6eaa220e665b66f033dfad8ab6cae7677e15a6a1bd51237ed491b7fd04a19fa1d4f9cd8904617c64 SHA512 0fc41a0b3cb5f172442863c8a3b1cf549f2f660a070965e6083baa2c90c27b6a7c17550625105799010f4329dc189f4e392c86991844a9704a3e3a72a6d4e2f5
-DIST ghc-8.8.3-src.tar.xz 19343672 BLAKE2B 4b33b4a386926f0ee625c7c18a3997f02bf664b8f553d7cdfb231553bf9510f44f72c0b46911539f6209f28ecab52ee520e61e2c9e750cc217b170b3596ffca0 SHA512 7db0d820a288e56bd32935cc03584295900605f6e7cac6fe6adcb3ec6c24d8d2cebf7a8efa421f2d2fa192602d7f24dfad1ddeeba252455e4cb8baa9889dcaa9
-DIST ghc-8.8.3-testsuite.tar.xz 1965236 BLAKE2B 9cd10769336513284d8e0fbca1c3fce9e298ec67eb63eb10d41087fccba0f6281f1509aee684778fd23710ffe65843c43b4042e6692940af67766056c4503273 SHA512 4ebf3eabcd7591762dfcf45716b06293fb14c00b51307f7788c90dcf4e01f67e6bbb7a887b74d8d30272919486441ac236b42a54c4874aac69d90391b76f81c9
DIST ghc-8.8.4-src.tar.xz 19395252 BLAKE2B 6fa898b9552398a724f0452f5cc88ba073264a5645288c73507258959efec40ce5a56a0eaafdabe58f15c5a9210b2c9da5954411dff5c81c52e061569d6a350a SHA512 efd23bd819f7429486696a3a929a040471db7ea8a2d1f1d832e4cf0825b9e1e0c5e6ecad0ab8376f58b74e9c28c1d2f773bd126596d6d853c9e57d57e5ceb090
DIST ghc-8.8.4-testsuite.tar.xz 1965820 BLAKE2B 3b715700561788b8abdc986961d533b91399461d57a1686ededb4ccc36881503cdc3fc126b9a7b204a728c24b9a9ca97320142348644367aca9b47c87a5b3b51 SHA512 79d8fb0ba8de0fb48c938bd54c8c3278f1895d8ce5c700ce8cf6b3fc550073bb757208e85d4f9818400ebecca96f51d9248b8bbdac9eb2995671756164d08c16
DIST ghc-9.0.1-src.tar.xz 20782336 BLAKE2B 53eaf903081d705d641459fbc1e6fa7387a6039f9cd466b4708bda86e81252a84d80878d6eb956ec2e1e5b721a313e68eeb796f8345244ca62f536a7a3f0c6df SHA512 bee7950a5118be8d8cefe0db5070139a5a93ca21c5bc6f8bf453429831f0c44f5e0fb5ee569865d6b8b92749044ee4123be06920928ac7a1ec9cffa9404a3e53
DIST ghc-9.0.1-testsuite.tar.xz 2322432 BLAKE2B 350df763c607dd89ba58ad6e856d815556159a9f088dc0b069de48ae87c1e874a45fad51159e65a3c9a9beed68602eeb2a2728dbce86277bd287455f46f6c53a SHA512 13fbe0f0ab5e2426820d0fb37f0a75e1198ef2a660398508806e8ef094fd23647ca3d386815a2118168d12253d8df3273043678dbb37cf3924c689dd0fd1932e
-DIST ghc-bin-7.10.3-alpha.tbz2 183558856 BLAKE2B 2bb02aafa49c6a91bec016e8bec2d07257d602e53c9df55792ec6fbbf8e2e46de1d5f3f72c0ccf74d6bd7f7987f53412063ccb02ae85455fce11fa928cbf5291 SHA512 08709fe9b4036ab41715c9a637a2a160104e3ab9e0ed9efaaf73428e3cfe19619e50c42b72c60bbbd27be2b9c2ea68f63d72c1a27d4519756e7c0d909f724230
-DIST ghc-bin-7.10.3-amd64.tbz2 112040431 BLAKE2B 3e59b70ca309a1cd704266c54a7983f9a58362bf700ced89c5649c780c664c650ec091e14026a7b84e339d2ebff39eba1772eebcd9fb4b99b9c99d179453d5cc SHA512 e1554b3944edbe8e16537de5a29132dc6a22d780d9a700cdc9b76387b94191164398d6f2242bf8199527802572e2bb02545569d4f0930a0ee0dbfdeb25978558
-DIST ghc-bin-7.10.3-ia64.tbz2 238680956 BLAKE2B 08593718d376051edfb0c86131e54dafc5c15056757fbeef90c653a7d217e49ff34ffaf7cd4083144c9277e73a290b822a0f889aaf806341375708e4b92654b2 SHA512 3694011aec8a6dc37889418b318993cb82f9b46a5175dd837713f396c8f59a19a920e0b0669fe3b4ec37d5bd8837c115264c0a8fc97c5a4ce06a3bdd52fcfce5
-DIST ghc-bin-7.10.3-ppc.tbz2 125832171 BLAKE2B cbf9c87200062606fddc6fa705666aeabceef954dad17166e24e181d210d7d86aad684e9af5ca05abcc89c947bea295dec3223735a6a915b680667ad32d850a5 SHA512 4eb111e3686656a83515f59d4ace8bc28806dcabfcee5201ce29aee38b8efcefaaf70c50bee55202c2d2abbfbf231a6b41df8b13199332c53055adb1754a3191
-DIST ghc-bin-7.10.3-ppc64.tbz2 142469712 BLAKE2B 05e6ca2498180399dd8a1a209843dd1229a1668d7504c424b9182fff00f78ec9aa2848d562f293dd388dc983851e0e28d481b12f0ae860b5c3a36eb616c3f1cf SHA512 eb59d3abc8b10010311d59df9473c5ea649eb0dd7f9ad41a1929a540a0ef8c20abaccd68254f8abab037fb1fc94d824f474e18e4316b8f2a7a954d0645a2a2a4
-DIST ghc-bin-7.10.3-sparc.tbz2 163105069 BLAKE2B 4a535472bf9ed83164f4da8280215a156b973a3a1f93a742a46050a112b7073d0a5f252686ee2ebde97140748cf3f164f33f1ba9df0b11fe2b35a86a7211b3a5 SHA512 d467a42487378d7dee311eb33aa1c151f5c16a6e7a4ab5bd8177df229f474adf19da3e1ca1064943a40abafcab6852b0589dd34413da82b33a03ede1ac17bf5d
-DIST ghc-bin-7.10.3-x86.tbz2 113877175 BLAKE2B 2f3064174f82f3ad6fda615d1f47f30b11f9dbd4a4b721673e5db49013a11ba80e850a0f392460651408fd3b31f8e677f1488fe2c94160881ab34740846b0390 SHA512 75096fe9106d975c15e646b0a559c544621fd02791f491bce54926efabf0e55b97150069ddfa7a9f02cc30bb6975d3d3121a82207a9f67b8dda5ebfe17ec4744
-DIST ghc-bin-7.8.4-alpha.tbz2 210691009 BLAKE2B 7a59cd1dbbe76fcf37ec7d1b2e81a76bd35f268c10614890cc8a39dcd846f6e5fb524ce1851036c315a9e5fe219d3abbb78d55f3e93f4ab5ad1dbf6c946146b7 SHA512 f08230de82f0c4112da9d0b48227ca74d5d0b4a84046d746b023557b7aeeb9678f5ac037fe89a863178df4b9036e5c5c63182d14dfbb42c772011de883e3966f
-DIST ghc-bin-7.8.4-amd64.tbz2 100573133 BLAKE2B da6bfb26eac8ef6c996ed10a56da9c535fb5fff4c69474de2cd979fe185876059f9e87940d24db8c52a0f04e81cf312982da75d04f3b96e7a11f2f134b512058 SHA512 e4416d6dae3c644f74bafb3aecf1a123f985427aba32d0e0c43143a137d64a9220fc5947cd9bde8a3bc44555ae71184fc06a3f7df7976aadd065ad5681b90954
-DIST ghc-bin-7.8.4-ia64.tbz2 222789275 BLAKE2B 2e0fc3ea11885b739156dcfbb4d52ded6492bf992ea18be2f91302d82e541a4de52e4bbe215f4d0cdbe54b32aa59e142ad10ae2fb20e8f0dfea22368a88620dd SHA512 2d8b89e399cbe9bfeae29cf3ceea736bfaa65ea21483fa2ee95d9814e122fcfbb67ce22ad8175493fab088e9a9d0139610c67e9d5c8b4f797b5e14846df32b6e
-DIST ghc-bin-7.8.4-ppc.tbz2 112803496 BLAKE2B fa60eda8b87dca0e23cbb971bc1f361f280735846cbe628e632981dc86baba0e877112e5c03d09fbb7f256cc078f8bf3248007c013208dab41c5205a82fab494 SHA512 9581f55a088e53edcc969960e45c9ad7227d71198ce2d241a4a066a138450a879287e55e7d2210e86143670539711387e36c7f60660c4422dc1b4122278fe4a0
-DIST ghc-bin-7.8.4-ppc64.tbz2 129284515 BLAKE2B 2e9a1e70830930dda7dcbd696ef3c27e7b64d571042cc0fc26bed42d13b9707ffeb337ffab38e2e04a7dabc56d8305fd77df508928d61fd0c653945afac8984d SHA512 53974e15c26cf6b62d8f838607abd209ec57cf0f45fcc48b90ad62736f5e4e7ff263dcd326ae03d8d5557a22eb9730e5eb8ae4eda55e52dd3d973bc73c84935e
-DIST ghc-bin-7.8.4-sparc.tbz2 147340595 BLAKE2B 8e39d6b144f4fce5196ad758f89887476e0482e8b98a012874d293d5e57756659cb9acb897476593a28f98f5c859548efa2e130f3806bfa2bb9e74795078a506 SHA512 ee5f0b2f1cf2693a0f2be9df71ef61b52bc2327225d40b8be955c1584b9901ffc6aaab63c1e46bf9bb352633b605c98378f8fd3e6cd71aef1c089007e4110217
-DIST ghc-bin-7.8.4-x86.tbz2 102312459 BLAKE2B 256cca9b2353af30dd7c239db0e21781d9d8aa352e38b3dd678b1429be6251e81f8955ac6ee0f766cc55f4de71c68acd98bc7b9434c3ea4b056d446ca59adc97 SHA512 cabc5bd6d8760ce4120e7053f6c1dffca7d161ba454b6201087760096c037c932e3ff8c82e53346c8278855bf0cff1c2f5fb8046242ca4d8307355b060a9556e
-DIST ghc-bin-8.0.2-alpha.tbz2 234361847 BLAKE2B 8e3439f3bbae1d3f6ab71f69669ea065f5f36c9cb4b334f06161cc1b9507aae56297d5eeb8a9cf72916aa012fab0b444a179a0336f00d5f17a8d402d5807c6f8 SHA512 c8b588feeab85f7b8fd60e2e8bf755d46790d4882d2ecf6b2c8b8e02c62a11b7e6453bf0cfbc646bfbf24310fdc775337f3957ba5783675a271b68f0af2e9070
-DIST ghc-bin-8.0.2-arm64.tbz2 191332951 BLAKE2B 305c4d618a6221e1322a5665544883624de4646e0186c6eab56d0b32877645f0b2bad8381848914751fbd2e11598727c46ab136de74c57207b75ecc6cce9572a SHA512 b9cabfda8fc6e851ba99f53274c1a63c5a6a365311a9203f1247ecf90ab843dd94960ad44c4e67032f4690f07d67bfd8bdfbe59f857d6c63344430539e2082fc
-DIST ghc-bin-8.0.2-i686-pc-linux-gnu.tbz2 133679542 BLAKE2B c50597857b53a2bf9d8047c048f86aa1782f74d5d9816d44b7bad7302181b407257ad0b52a03b4ad4936de3a15010b0ff5ca877b9578af6d3e7684dda2284718 SHA512 7f33e0b20a21fe076db142a58a81f68ab8f230ac9ce0167aba31aa0843bce20a9cf4065acc1c0ee2aaa01ea2ad4a8234388b0cf3ef886dccf25d7072602b430b
-DIST ghc-bin-8.0.2-ia64-unknown-linux-gnu.tbz2 256581880 BLAKE2B 7a9b41fccf3a097a19e169dcd8f553d38ffb96ebce3a3f0df15af79de77f6e33835a955fb7cc2c373f7bb6bfd3508a45ecf19f8b3e74bb058d2d6cdb6576bc6b SHA512 5d14521cc4f2a8fae1e5f43fce70cb976e4412df468c3bc611c99f57806816c349f4186c8a064c579858a82cc070e5942dd7b0c2d57b88d507215acddcbfcfc1
-DIST ghc-bin-8.0.2-ppc.tbz2 144760090 BLAKE2B 32410f3563f7f2555350806db460d2083c7248c57223c9c681d0b4913df942f023c7c1f5fda145179a524ee7ef105a9b8309ba87c20dc393a9f49151579b6767 SHA512 bc6bf8998064ffc1692c3bb83c44d1787760a3f4a1e6b79dedaefda5fe32b9052049a60f0ddd3c0b0bd24a722fb35e310e0189b3511721ff89d4d02b3d7c14bb
-DIST ghc-bin-8.0.2-ppc64.tbz2 117432068 BLAKE2B cae202f0d6e825127d543996b2fe7ae02578c47325674cbf22fddc53b1c4c9413f45c60d76ec3d07860cb8d0aae1ec792e4141822cc5c08ef9013308c5d29bf5 SHA512 0eaff0557b68649a15bbeb2019f46fa9e9e7b8a916aa210ab56888090a5b887d20d818e7987177bc6a8e7fde503de560026e6bb55fe39679b8b1ee13c6b7c4f9
-DIST ghc-bin-8.0.2-x86_64-pc-linux-gnu.tbz2 130852973 BLAKE2B 24d2032bbfc664d924800c1a317334e2342c8ec1e529178f9d1bb99bb4772a9cc100603bf70111b8cfafa715c1cccc643f115c77cf6adcdfb17d1f1735ee6682 SHA512 c36e0e2600fc7c284562a323d396a03062cb6e8fa63c353e672be61e76d2ec5c7698485e3a370a57cf512db9e5ba6a68338fff2ab404d9fe67b1a468ed72638f
-DIST ghc-bin-8.10.1-i686-pc-linux-gnu.tbz2 123398571 BLAKE2B 3650f9dbaaa5af684abad589953bcef5b1684a91a4cc2695d0ef735536057bb031231fe3d73dd74bc38a199f0890ef91764b551e5e158c120affc0d7bc3175b7 SHA512 52cc172de08ef30d6e89384e86eda1b8bbdef2bbff526041eb47d85d77b70ab49314ac7f33f18b40864c16fa546256f1b4c7964e65aa5d3cfbb7f9cbec505dc9
-DIST ghc-bin-8.10.1-x86_64-pc-linux-gnu.tbz2 122227601 BLAKE2B 84340866c70044eb1444a70b0cbed6814808037b697db28f567d2b14bb791cbe7d9bf2a327cc47ae85ce3c4970ba039854b4a6df44eb85cdc18040c5a4d15f4f SHA512 81df9de95aec47d60ad8d699756ad323eb525c3a16536fac8c6717e1754272061bd8d7d70cd38f5c509a2fc323305333e4f898c9b6dc27645521bb29ee218bdb
-DIST ghc-bin-8.10.2-i686-pc-linux-gnu.tbz2 123683156 BLAKE2B a486076ea6e67f124c850e037be0e63a873181c3fd746f437861f7367a968e0df6723afc934c966432274a55936c0fe48a9a43a48199840b37636843da4caccc SHA512 29cc1703bbdbfcbef8aa2a5a563b83b0663970f5902a1fc70230515a128ef47e27a3a6df2b47a01009c3976b4936cf8e64e5da4dfdda0c1bcf73ab7ea5ac0b6d
-DIST ghc-bin-8.10.2-x86_64-pc-linux-gnu.tbz2 122818630 BLAKE2B 030a68e2aca0eb0a273e0d48a3e180d92b219b2d1826d1d58fa133d0a6cae1316b3ccceadb55a4fa5870f87c3df85df2998e7611b93dbc1fea592437748b2daf SHA512 23bf47ee45fae54a843de9e6991b67fccb79c14ad8d08eff9f38a68a3530496c8ce4bc8cae8a731bb690ddd6cd0bf36d6d5bf37eb68ddae8ce646a0bf3916d8f
-DIST ghc-bin-8.10.3-i686-pc-linux-gnu.tbz2 123802832 BLAKE2B a770dd43bee7a1d60fec2eb9aaa7de715eed01c19d9514e04678801827879977a5c91f5e191d026ca83aa5e5fc5f518593053b2e78b27b08df64b39058dbaec3 SHA512 f810432a56ddcd773e6118f038cdacd2f5e3a508d87bfa468ee861aef0cfc434ec5766a8a74360d8cec6cb9c664928290901c025496100e7c8465408635227f5
-DIST ghc-bin-8.10.3-x86_64-pc-linux-gnu.tbz2 122993247 BLAKE2B e3395ebc7e87b4ae8f66dbbd9441c214c4d9535e55bfb14f78ebb92d30b1e100efc4893b3cdc65564d47bd53a21cb30106572b3fce13be022946171112c3218e SHA512 2ea4295bcaf6e3fd0db54ba67465e979cd85d3370c6c49f2381478ae9824ad89df53d7d93ccf06bdff5f4849f14306c9f50c13e6f6ba45f79e5b8c13ad63ae4f
DIST ghc-bin-8.10.4-i686-pc-linux-gnu.tbz2 123831294 BLAKE2B 1ca4c1b5c34c948011049a73d409c741db89658d10e311cffbe464c631c3733278fc7dede6ad27474832295ded2c26fd4d6419c760505255e29f7cb232a670a4 SHA512 1f87cf63651f7c0e5f7f55d1f4d7d7c48b0a911cc6673a899d4b92190d765b359f9c7d73c329969c1b76f1af102b7e2c18a80382c81d5dade9ac7dd57de4ef65
DIST ghc-bin-8.10.4-x86_64-pc-linux-gnu.tbz2 122558873 BLAKE2B 9f07c7bdc3beccfa629d28b2524ccd2f4688a5c0036a45408f5ace2d530a2a0e42f95b3cda5037ebb365317999e1ae776c6f9d21692867abfe85e33f2892b1be SHA512 68bd70f94961547746a696aa2839e156c95858fda0c7ec5b2ecf802070724ab7102b0aa86bcbf93432170d521cce4af10f46b851b470e5dc49dfa5b07380f46d
-DIST ghc-bin-8.2.1-i686-pc-linux-gnu.tbz2 96157437 BLAKE2B 2b9608845db8cea78db07209fa054b3b05085d5c3ac07cbe3de02a93c87fb0cff12b1820f08757221c59c8a0a9e7a5563c44266b181525d916825e5cf5bac34c SHA512 e891e76557fa61853e28829b8bedc4a6abb92954f90cc1ebcf22a13cc137556bbe9262e7398b7e1aedbabeb997916b008bf1561a52f16a569f3d58ea9404f41e
-DIST ghc-bin-8.2.1-x86_64-pc-linux-gnu.tbz2 97490496 BLAKE2B 3666ea70cb8b3645db071040d2069fe244042c11954b34e5d92aaa90132d2316c0ee8c176cd4e674772bea3b99df150404f62bd8745c046cdaf102ecf0a0fa54 SHA512 52630a185d0eab56bce0469a612a54109895bfee041ec362ced59a9b35ba3b9c185e86bc7dbf0a5939081d3626baa19fbb3306e36d1857530248a7b9bfc100bb
-DIST ghc-bin-8.2.2-i686-pc-linux-gnu.tbz2 96638908 BLAKE2B b470f838e77330969f162196b0f1035fa764f5d123687fbf67c14323280bfe55216af0e16f8b79c62f290905d96abc8bfafee650f8d27c81608853e78329b2c9 SHA512 15b1525890477539878385efc15ce5f1cf2f126cc785c42923be958cabe3298cebe73526a2370cf4c630124160a7ca0f0f9062aebbf035dce807a0374eaddd14
-DIST ghc-bin-8.2.2-x86_64-pc-linux-gnu.tbz2 97696152 BLAKE2B b481cfea186220ee402f9f215dd48b002288766b643f3d8352579735347136c6349d242a9a56728d88ce80f72367dc9fdb6e40c47a0331910dadbb9a4998e17b SHA512 531df6505e8987fb5c5cc0aac59adc6aa153a4757b96936d3f09f27f3614589ff41c227568b780114b2e87c6c8656f2c88683cce86925628d12723f14b893eff
-DIST ghc-bin-8.4.1-i686-pc-linux-gnu.tbz2 116995839 BLAKE2B f94f2206d603d57f7fa64bdf63bcd2528019284fbf6641273ea1d8c62324e2f0b26b2cfa50c6ef96e12beba550bcedd17aa824e7cf9a27c794e962526326e105 SHA512 8167ea80fa627a1b55d28363513ac79985229326019288e7334cc87c3017d39781f4d129081d62da112420152a41d23d2dffb0c13721b80cca72d2a21fbd2c0a
-DIST ghc-bin-8.4.1-x86_64-pc-linux-gnu.tbz2 117369638 BLAKE2B 583db924a50a3d7d261d2f392a74e0ff487ee662af055ac292ff1943534fb305d6c9f6f0045ba4bdd5afa268d75beb50f64b4760e49cddabe1f56776a5f4769f SHA512 801f4ecd538c7a035a0f573f301769984814fa3ce4cf5b09a914ba012bebe0583b6695a6a93f92c7e6e2b7d58caf812a1214b5b778d7b7835d7eab988ad69ba0
-DIST ghc-bin-8.4.2-i686-pc-linux-gnu.tbz2 117083472 BLAKE2B 7dac18523ed693efb0ec42b31bf7b910e6bb8289cdc13eb309bdb30230fc87fbb060baf41eb4f18af2bb265b42e6aca535ceb70cf0fe09046b0e4650f11bb37c SHA512 f9799bdf7a2a66d1db34b828860203872d7398bab2d667e8982c9ee89301654c3f7f54705b639df2d7adebcfb7a05e071b83d994f5e52a72f604b62098be51cd
-DIST ghc-bin-8.4.2-x86_64-pc-linux-gnu.tbz2 117604406 BLAKE2B 644ef535497eb73a2d1ceaab7ff96228e8d4021c09bc061a3f397dc27b3b86bd6d5300736e478671cee0a160bfaa5aa4611f06012285079b40973f468b59664a SHA512 7bf4bcdce954319422b8b8f09e56294012fac145662ba3de1c7765ed86ae9f8b61dcf6dd8febcf85d60db8d1a26edcaf4e89c3644ffa24c7b5b5c41a14105936
-DIST ghc-bin-8.4.3-i686-pc-linux-gnu.tbz2 117028296 BLAKE2B 0c99a2f6fe4af4a1342d948cbda53b178fe9709673e0d09bc3b6a4e0f3ec4e4b8f77830829f149993f51e490692de39024900fb188116816e41441153eac3622 SHA512 13147ae0d6b941b3bc2f0239071a2f6f854a39cb6a381f0e2fda7069ac29bb2c64fb3ccc6191e7527b5f27fe616bd62f2e487b5d50679789927b401f02c62ad7
-DIST ghc-bin-8.4.3-x86_64-pc-linux-gnu.tbz2 117537996 BLAKE2B 2be0102fcc0f1fef5aae194620a43c1c90538215d4eec2550419634ed9c5bbfb17391d57519c20ab53987a36b42488ac43ff968690a4f65b96c52c3485589d10 SHA512 5f26810ec1f0a483f03ef01f56130eba0287b49b912efba03158336ce521000b611192cf021b72c1a0d902532cc4c9470ca1b3233ccba7c7e7c2ac490c6099fa
-DIST ghc-bin-8.6.4-i686-pc-linux-gnu.tbz2 121639881 BLAKE2B 51d223b654ff23bbdd594801f4ec92b016a58b952ba98007abb56c1c4b184a672e51eb9847b42160febcc4ada0f28f18325cc27f8a025dd9fcf656e3bab73918 SHA512 6b58b080c5fb18ea7b76632b4b48726af61b52d8829f57a2ddd55e6bc109c1fe1a133d2a0ca974a168ffee0013a6dfdc4922577bad01c50a42dad8b9db70e061
-DIST ghc-bin-8.6.4-x86_64-pc-linux-gnu.tbz2 121695747 BLAKE2B 39c745f5f9946bbae622e09bbdabdde4d62eec472fe14e693f37cba6b93ff66e4e56f66df8f0f073686339d252dce71f79f4c2aaef620c3dffbc26a67b1119c3 SHA512 c60bac50e7879bda1d6dcc7c1f12fdac915b18c3ebbfcfad575b2b01fcb57a487496ce7935f7ee4ae934162209ab66370fbcc8a4f021628e5f9a2aa7ef95e119
-DIST ghc-bin-8.6.5-i686-pc-linux-gnu.tbz2 121938050 BLAKE2B 17b6d15af21390e28a025505da76d39a2f8656f74c88a81fc75e7c8e799e54171c0d964d8a977c01576603a781c139b5363ea79eeaa2252622913d2a08a79f0e SHA512 9eb33b4670ee15f53c988885a119f3ef7be896ddcb318019628cdd04e21ec0c61876e08466d9d10d6cb1e16d89cd318e0ba42f0f0ae512f48590fe87483739cd
-DIST ghc-bin-8.6.5-powerpc64le-unknown-linux-gnu.tbz2 173549697 BLAKE2B 296bf4e0745f56dfefc3ffc96b4e492ddbfd8bcbbc28a8bc9b3172c616d0e7da1081834384ab69e387808331b607104f015632d59963a87f4e257f290ff286c3 SHA512 81261614a7939adb0ffad3657cd33588ff729bb1e3a7dd228cf869afc1f21b74cb4dce6369a4c4cdc9f45f8d8ae64f25d71cd0f2dc34f36d3022afc149538a78
-DIST ghc-bin-8.6.5-x86_64-pc-linux-gnu.tbz2 121728723 BLAKE2B 6620b2a116b5696dd2d776350a43251c093e117338a4407ae8c41ae27763a4614d7e761b2684b90aa9317dafe7cb67481a6bc141c812d335d5231724ae3db2a7 SHA512 69681eab137f6713339f8912d0d92f6af865630053bcd7a32cb8a31e01628e969951db976533196794fe39e0e57f0fcd8778d9fc9fed4f4231e965b9a603dd8e
-DIST ghc-bin-8.8.1-i686-pc-linux-gnu.tbz2 120789855 BLAKE2B 386f37696d956078fad5cad50cbf5b9d9d7765615a1d9cc91a376fb5394648afe8ca956e24ef210f2ff0e51f339b63b16a50f6dc35f30babf019aa57de50b27b SHA512 193c29889693befba863d3c5a26d38d8182bb7e1932b61115dc0a21b6582f818b05db144a9fae5aee06af2044ea59f884825cf1081b62a1c67feb3041d184d3a
-DIST ghc-bin-8.8.1-powerpc64le-unknown-linux-gnu.tbz2 173653088 BLAKE2B 6c29777b596b35fee8e3a17f965e6a21dc40dc2387988f55d4ca5fef0ea9677b558ed210054216a6578b93fbf844df9e407770df184f707f8203f846f4929d2d SHA512 d338b8912c1632410c43a0df75ce69f961924a7c51049a3ac27c22f7c6cfc07388815813713d594fc38b721127df80b65f72b1b0cc6fbf0e10fa15970b8b6f46
-DIST ghc-bin-8.8.1-x86_64-pc-linux-gnu.tbz2 119317594 BLAKE2B 98f0fb262ac485dcfd6a8a67304912ffad2bf2634111fcc3b60346697a836867006bbacaab1e1be0cd5be34b4595d12bec13af644c451c10f7e3843ebaf5922f SHA512 e6acb11755db18fd86a346de642b8579a6b48b303c19795949757f5e351ad3b8892906e989dc57a7fd4471d0efe30fc8175df5bac741d7faecfe42a855a67980
-DIST ghc-bin-8.8.2-i686-pc-linux-gnu.tbz2 120289601 BLAKE2B df65bc6aa4ee22c979b9d8eda29f51188c96700d61fb4cf141ebad8a55e26b6cd959fce3ec0b8d780b68e7baf15a1ce7654dc4ef084aa4671fe05f00f9c4e9aa SHA512 da059f3fea00e14df346143e714da6484ae51d362d9e237607817791e02ec81e29e1ff7f9929fac44044f63196b395287c42f5829884c34391289179b4f6e204
-DIST ghc-bin-8.8.2-x86_64-pc-linux-gnu.tbz2 118957404 BLAKE2B cddedbb0fe8d38e9821bd8f51f5177d35922b25bf4fc8a537e921443560f141cdef44e54a0b4ef2dde07dbe33d9c1cba2e67ba80db4313f67e9bac089d967f56 SHA512 b0b801dd6abe9f5e6217e18568e2911dbfea11b1b45ff526950e87c73a34bcd597afc5105fcff2dc46bb13cf95e63db90c0d24ca9babf174b397a53001e8e0ac
-DIST ghc-bin-8.8.3-i686-pc-linux-gnu.tbz2 120243899 BLAKE2B 7f932523a71dcfd4cdd468bf67f470a942c314888c0093c21c211d54b3e158f45f051f027c78644a651047d81e809e1422bbaa5043e8559c6a4622ac0472f7e4 SHA512 12bf08b85652fd061849b9adb528d7a5c6fe9c2260cf02b92fab470fff16c3121bcb4e0f7044d05f252012083d622a1a490fa7f7c949142a3b5d03ccf0dd3ebc
-DIST ghc-bin-8.8.3-x86_64-pc-linux-gnu.tbz2 118988294 BLAKE2B 4e5aa3844934ae2726bf9c8690acd5a887f10cd49386ffadbc536f9309d33b3894b49507964eaf0d8a052747eb33aeabbe4d2cd22493297c295cf9414fcb766c SHA512 dd656157fe744c1df1c8ed34d1129ec358b26f3042c6da68e704e0f6a45d8114789000479e28a06dc16961afb283b3c666b427025590498a3d2da9b741b435c7
DIST ghc-bin-8.8.4-i686-pc-linux-gnu.tbz2 120336081 BLAKE2B 55dfbb90d5e55c2af5e93c69249828a85cd9171c164b80dfdaf86512972b2c6854c8e4f07426af4ab52a5fb1a85d96a58c2cf003fb02372c55428001cfaea491 SHA512 ad3b83344349976d3253934195b2dc6299648391572b13735943c5ea2239c031c19b0cafd86c16cfb0c061e73bc72e9248f9c1731494a9a15fbe188f02913c12
DIST ghc-bin-8.8.4-x86_64-pc-linux-gnu.tbz2 118897883 BLAKE2B a180b2dd1a3bc222044ece809ad700aee29d0c3e75b57ee9af3ca33c9c0f59dbf36f68202f746d99f80915cb717a9c41fc12db507f1cb469981732703a06b9cc SHA512 9d4be02dbd9704c93ef18feb92ea30bd5d590df31f288bf1b364818424c5019ca9ada26eec88418199f90ae8f4459d0a9352104e3f3186bbdc241891eb1b66c4
DIST ghc-bin-9.0.1-i686-pc-linux-gnu.tbz2 122955511 BLAKE2B b870f46cc78fcc1d715aafe7108951582cfd12495b4e9d804d4b66562c66a6a2b2d9513031aedc8f3630a0cdbb3257943304b05732301a084f89487452f2f2d9 SHA512 aafd4233c40f93b71e6ac1acc8a75e30d49b826e4bce6d9832836966fd5f6c4898963bd4c2f34577f4199c1d9a3f537ac1e7d87eab11e9fb5e849573580ed3fb
DIST ghc-bin-9.0.1-x86_64-pc-linux-gnu.tbz2 121542968 BLAKE2B 837870e68138f8d97dc8b2aae90090cf02416628602ca4ba4417ac92b49155f10028b05ac465665b8872b32372a5cee075616983f2eacdebb0188bd2ce6a93d2 SHA512 0e8c6d2e6f32fac95588f7323a4e02dddfc9ec2476a82b97bf5a106d3810f7e638fda7124c53b5bbc563fce70f4436553c282d8ea2f1f5fdf4fcccfb15a2b079
-DIST hoopl-3.10.2.0.tar.gz 241940 BLAKE2B 0ed7bf80486767c81415f99da8780a525401c388dea0b3f380bbecceae9cc7f66d8b5d0d7b31f8cb41796309b7a93adb113485efd14882f8af321989ce900a9b SHA512 083baa8a5eb53247aff8d5b9b2144e0f63adb9400934297bbd80bfcec607dd90a34def4301045a60472ef10b0fb90ab84692fc08f786e7f806c28afdab1ef66a
-DIST transformers-0.4.3.0.tar.gz 28632 BLAKE2B 92cabcb654bb11854a3bffbb1262f5cd62eda1aff447157086a61ebc451ebf2fddec53b6a2cc058174f24f0f0e32df671d3717e30a542c8dc90cb87e327d990c SHA512 c3ec0893ebba4fbd6087c3202e919552c4a9bff3350b5c0589e7ebb18751a515d98b8cac15b0a3252906ea72b5a0eb09b7fe88c8da88b09d6ce4fbf0f50b2780
-EBUILD ghc-7.10.3.ebuild 21609 BLAKE2B 123d31edc5db034398e355ee246741337d9f33514c0ed1198145e4073070d0232f7322c8b2da990c8e5f343c2cdf71f6321d5b81ecdf64877e7377a3909636fe SHA512 d2a81bd7a206a6c55bbfb9e5903c806949dc5fe062770fa056f142b0c8d6856c0309625d8f8375501b759efad7dcb708c6b72584a3e88ab5db60371fcef1acd1
-EBUILD ghc-7.8.4.ebuild 19744 BLAKE2B 4e9ad53b5f84a5b09bc92f19f2169706aaba7921480afd9bb08e070de8d00e75a02d42a1729c8679c90048becc5831d52d9b153cc58e966bf13c56af0251e0bd SHA512 c9a0274e070072db12b4c9e4fe162a6c94cbb03648699c82bea749ed8fff58ee67e127bf73ea580804b3159e92985c4b3ddcbff31f00081725f8640e3e4b786b
-EBUILD ghc-8.0.2.ebuild 21544 BLAKE2B 31d10f66f55ba897d1072b4376022d0cc85272c2ed91607485fb2222f0a9cd6467ee4854496824cbdd3c11eb665bd41fc475c1b29853bf02a81abdec2f186aef SHA512 8492c0c3713264d1426ab2921a07c3671057404eec116a110b09aaf3acaa093759da6ff4c4c5d835b457a8dd49d6e333ff2d0c918af538a40d7fd2ad577a8b62
-EBUILD ghc-8.10.1.ebuild 25760 BLAKE2B 90c24a0cfbc89d3c6973ae085fa738008bc0a89491ee4d9345dc9cfb21bbd02e9715ed3e9f00e43cbd33dd355835b72198f7e6d51f9eaf68018e58fcb1a6c222 SHA512 7db0aac5cbc96888887c96458f6193732f537797642f202df3edfa5413e5132171873ed2f51f5b038f857665374904ab96130e2c7ff5712fa60a8224ff07e0b2
-EBUILD ghc-8.10.2.ebuild 25785 BLAKE2B 6077cc483722c1904f1a7efaca467624f8c3b5bf9268737070b02ac8f37be6fe3cd5920282eb018d460197defac3869c11f52d1b09fcd7531c60922844e65ca4 SHA512 1c03661b3c747a1500c66ddd5acc2795e69c40381ed9e7d46468851db372906b9987650f6b3d2deeca564993b7af4860bda68923b1167629fb257f0b2cee3cf3
-EBUILD ghc-8.10.3.ebuild 25710 BLAKE2B 5cf8fcacde2c7c57e7b96ca5a826d033a3ab0f4daea692cbcaabba1968ff488bdf655f8e8c68ac446eb43e9b0076f19c945172093cf14d66d7191c984e650c75 SHA512 deff8744a1ef184614ebf003d5e23e51848a973d8126f4cc2d07955fa1fe10e3180a6a0e9a4b55a90f2a17c7796a14a13b8e1610509616d7e50cc57733010f6d
-EBUILD ghc-8.10.4.ebuild 25849 BLAKE2B 444f0198f2355bc0824da86ca732c3019ea73b3c9781ff8deed3d3abf10d41d93b40e7fd46d5791ebe0f1244ca316091f41881cca65f3c1e318669199967fc05 SHA512 303e645c617dbc53b733b481bf47549e327caf90bc10cc865501e64dac0b623045fef6f960866707f215f8d6248e729398c85946fb7b8ee04185b0310f38f6e5
-EBUILD ghc-8.2.1.ebuild 24777 BLAKE2B 39d0fed2d446b5e9c24b9d7b5b4c5db5a19e2c2d1fd189cf273b830934995c52965bd1f4918c4ca0e40e084b88dea8c6308895d2605f030aac1d1412af892f56 SHA512 1eabfec6cdfabf65b7371e08eac6e8452e14dbcf8ccce358274d7b1b13b4c6b6fdd3a5077af025e0eae021f70718d1e62f5f8e0754edbc897e322fb121560c01
-EBUILD ghc-8.2.2.ebuild 24746 BLAKE2B 918b55ca88c702e4642bcf8719e5e3645bff604aedc4021553daf1bbfbe9200773460b48b0f2eb07c848642295dc744efc217f11a18a06585bcb13b21136d3a7 SHA512 ccb2ef01f88965c4274cb407dd3cd3b9817d658a926b190876676a1875042e810b3fdfbfa19fa4ba148bbb2d189bf8e5006f00c6a7d66c39ce434267e62b7b52
-EBUILD ghc-8.4.1.ebuild 24564 BLAKE2B c722911588225628f56c02abd8daab2800ff0a5c5d412b14a0b358cd37f0ccca9db1db517a36b9185e43c2890d1d0024422ead897e56489fc4fc0cd0626c2e62 SHA512 f10fc32b3bf628ee7903ac0a15cc6484475d601a9d9ac2f1163cb61415eb173e90bba1091d006b11205adbceb0df884a43a27a7533d52bb18a80511603c72c96
-EBUILD ghc-8.4.2.ebuild 24789 BLAKE2B 252de8df8ebd5a4ff377595f1880db44f7b3411c846e26d96501d48e62c3dc373d9ea61d1b6ec7be71adf2e40a5aab02e40fff35d35403403b61e82de4e86af4 SHA512 78123fe4944f2178d23850b423f3d9f457b48eb3b957546f751580a7998215938db22d0aa2228b26de9c94ec26d7640a5432b5e3a6d371b1ec3f2af7e400b871
-EBUILD ghc-8.4.3.ebuild 24734 BLAKE2B aa5f2b9bc89a5b78aa93df13c258b53e9b5694d02a2dd861f35a1785fdac4abd99cd10dbb585181c6a4a65b066afdf2672534ed7bdcabd1bf7e5d9e92c5ad9dd SHA512 5c49e104831fffbb3e98aef7fa49f845021e8aa6af5841862f7a6e6d4ddd0c7cae636c1eb09e19b31e08b5596236240128b47af1c3ca1716d9a90e3872a2edcf
-EBUILD ghc-8.6.4.ebuild 25234 BLAKE2B 04ced0f4ebaa55b2c145fc350edbb790bd7b10c86a2d3bcf5de7145577e6ec45d8d5aca2c2384a465d370c0b58a2e1dfb4696e4d8b27d5e35f27e660c9bfa1f4 SHA512 7aa3f386b0f39879c5fd3a1dc6c2147651c8e0c8a5559d7b889d5d6084a97a78934105ebfae30ff3cf667ea5ff858fb28f7522ab3f7c2b4c8d4c8b881a8cd5b8
-EBUILD ghc-8.6.5.ebuild 25552 BLAKE2B 8b9eac7651052d8bea16b73fd2d408fd741d3bc753d2680269b77abe36c0f0ebbc4002fd7b53f7d16c017ae1151235431088fdce4ae1be2162992806eb8564b4 SHA512 37fe53899f866b0049f02a788f6e3351a3f1aa6b65aca0e2b362483874e5f2e00d978b609f367723601f35fac3239dba4beb4821d6cfa98bda35b4e3751010dc
-EBUILD ghc-8.8.1.ebuild 26204 BLAKE2B d3f3bb41c29a61e1bed42160c5f3b06b247ae501fa28dbbc1976c0efb9fc86af687b9643a419fffc440f2430559fd879f950b523c5348e3dd6a102e0d5dc768b SHA512 56053b27e560e29d61157c2436e5bdab27e09d35fc56f18234764d4bbb201d558fa18fbad284e86ec72335e3b9d174a80b8671e6cf2f00c3b3df56a75b1b711c
-EBUILD ghc-8.8.2.ebuild 26160 BLAKE2B 6e7cf133d31eb37bd895a8eaf1bbdf70a073f834eece116ef1279aa4f7321278d94e1256233d3451b7356881cea56f493febee25a968bc849fcfbf969a68a2b6 SHA512 d1fc2b95b4df7eac166373830dcc947612d5cbd0a602e0a1ab778ad6cda49adca32368fe4947d88e0df2ff01103e30a07551e148b38a1594d0729faa9ec987cf
-EBUILD ghc-8.8.3.ebuild 26294 BLAKE2B d2aa4f2ab7604d078e93d214bb6f2fa2b66f038433a872f2f93bf94918b847c28fd54b1c454d03d78e47f8bfa031efabc03d8b4b924082ed90a154d5d4a8a333 SHA512 c613abca4ab47ab17c6f91ad24d787672be4d6b50d85003bad287163e57a91aeb339b7a675ca5bdf632cc966472b9add1ea0e9a491d6f399f8df4f31d619c8c0
+EBUILD ghc-8.10.4.ebuild 25830 BLAKE2B aa68b44948d22cfe476851427bf2bbd3b1257a6ad120ef8612e867ba81c2cff2b12974c82a36d52af5ed5c5fbe6ae3f74a12aa278af6b05ce3356f775c131016 SHA512 c6587aeec865a92f00fc5b967ef9bf87f8a0fafe86516b5d3b4a76d6017c409f521cf2af39e08aacb3b38230f069a72db38be0f923b83f60b221ed82ee133ca0
EBUILD ghc-8.8.4.ebuild 26410 BLAKE2B f49c37a85a76a0edcbb7a253ef2a1c49291919e89ac933a0da5ac29dba29d16944f0e310c2a7426b4ebe800f2f1c405fbbac69b32217330b5d295efc9bac97e3 SHA512 b6a8f90a0f2b1ada7878696c7e937253c9e7dfea551bdf44b328f0ddcc0416facad4168c0a528d4d3f8235c4cad14da8903062cf887193cc15ca152dd8b860c1
EBUILD ghc-9.0.1.ebuild 25788 BLAKE2B 8a90d51d7cad901e3477c592f0e4397f0b9d6e682557539ba3c3146e0509dfb387457bbe24ed8f80da1ac03c6abe314ed1fa42466339202b81de1cead3a6473c SHA512 dea79fa098fe288a07c7c29913dd32c80b246c91c6f83be5f4878e9cbb69aefdd1f8d75f34bfbed30fa1286892efdf70060b133cb0916c4d4cbca46ca9e4e0dd
MISC metadata.xml 877 BLAKE2B 763db2ffce8c241ef55110ca08aa9f7383f14bbe7f96a443b438f027214e04f56f8216b0cd0d871e516a13f07a8a5a52835b0f75ddd3eb9ebd7faccd3a6b03d9 SHA512 516ad3cdb3b26b242668ae2bbf48628c8fb95fdc84ab3dc00afc940c68c2b78a7aa85634c228e9b3427963f0b86263d24ba043d0fd9ae57752e5075392a0322c
diff --git a/dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch b/dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch
deleted file mode 100644
index 60db34b8b362..000000000000
--- a/dev-lang/ghc/files/ghc-7.10.1-rc3-ghc-7.10-bootstrap.patch
+++ /dev/null
@@ -1,78 +0,0 @@
---- ghc-7.10.0.20150316-orig/compiler/utils/Pair.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/utils/Pair.hs 2015-03-17 09:50:48.491115080 +1100
-@@ -15,6 +15,8 @@
- import Data.Foldable
- import Data.Monoid
- import Data.Traversable
-+#else
-+import Control.Applicative ((<$>))
- #endif
-
- data Pair a = Pair { pFst :: a, pSnd :: a }
---- ghc-7.10.0.20150316-orig/compiler/types/Coercion.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/types/Coercion.hs 2015-03-17 10:11:21.636047380 +1100
-@@ -104,6 +104,8 @@
- #if __GLASGOW_HASKELL__ < 709
- import Control.Applicative hiding ( empty )
- import Data.Traversable (traverse, sequenceA)
-+#else
-+import Control.Applicative ((<$>))
- #endif
- import FastString
- import ListSetOps
---- ghc-7.10.0.20150316-orig/compiler/typecheck/TcEvidence.hs 2015-03-14 08:48:57.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/typecheck/TcEvidence.hs 2015-03-17 10:26:03.251433371 +1100
-@@ -50,6 +50,8 @@
- #if __GLASGOW_HASKELL__ < 709
- import Control.Applicative
- import Data.Traversable (traverse, sequenceA)
-+#else
-+import Control.Applicative ((<$>))
- #endif
- import qualified Data.Data as Data
- import Outputable
---- ghc-7.10.0.20150316-orig/compiler/hsSyn/HsBinds.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/hsSyn/HsBinds.hs 2015-03-17 10:42:21.459519033 +1100
-@@ -47,6 +47,8 @@
- import Data.Traversable ( Traversable(..) )
- import Data.Monoid ( mappend )
- import Control.Applicative hiding (empty)
-+#else
-+import Control.Applicative ((<$>))
- #endif
-
- {-
---- ghc-7.10.0.20150316-orig/compiler/parser/RdrHsSyn.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/parser/RdrHsSyn.hs 2015-03-17 11:17:48.950929542 +1100
-@@ -91,9 +91,7 @@
- import Util
- import ApiAnnotation
-
--#if __GLASGOW_HASKELL__ < 709
- import Control.Applicative ((<$>))
--#endif
- import Control.Monad
-
- import Text.ParserCombinators.ReadP as ReadP
---- ghc-7.10.0.20150316-orig/compiler/typecheck/TcGenDeriv.hs 2015-03-14 08:48:57.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/typecheck/TcGenDeriv.hs 2015-03-17 11:30:39.106508173 +1100
-@@ -59,6 +59,8 @@
- import Var
- #if __GLASGOW_HASKELL__ < 709
- import MonadUtils
-+#else
-+import Control.Applicative ((<$>))
- #endif
- import Outputable
- import Lexeme
---- ghc-7.10.0.20150316-orig/compiler/vectorise/Vectorise/Exp.hs 2015-03-10 05:43:13.000000000 +1100
-+++ ghc-7.10.0.20150316/compiler/vectorise/Vectorise/Exp.hs 2015-03-17 11:46:41.829481669 +1100
-@@ -46,6 +46,8 @@
- import Util
- #if __GLASGOW_HASKELL__ < 709
- import MonadUtils
-+#else
-+import Control.Applicative ((<$>))
- #endif
-
- import Control.Monad
diff --git a/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch b/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch
deleted file mode 100644
index 106d07aa31c8..000000000000
--- a/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-commit 5cc08ebf2f346992a0abd4440252165c90b5ec05
-Author: Sergei Trofimovich <siarheit@google.com>
-Date: Sat Jun 20 12:23:00 2015 +0100
-
- Recognise 'hardhloat' as a valid vendor in a host tuple
-
- Observed on a tuple armv7a-hardfloat-linux-gnueabi:
- > Unknown vendor hardfloat
-
- Reported-by: Sergey Alirzaev
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
-diff --git a/aclocal.m4 b/aclocal.m4
-index 590edb0..958622c 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -1966,6 +1966,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[
- softfloat) # like armv5tel-softfloat-linux-gnueabi
- $2="unknown"
- ;;
-+ hardfloat) # like armv7a-hardfloat-linux-gnueabi
-+ $2="unknown"
-+ ;;
- *)
- #pass thru by default
- $2="$1"
diff --git a/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch b/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch
deleted file mode 100644
index 675037946e75..000000000000
--- a/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/ANNOUNCE b/ANNOUNCE
-index 7812eba..0018b37 100644
---- a/ANNOUNCE
-+++ b/ANNOUNCE
-@@ -1,6 +1,6 @@
-
- ==============================================================
-- The (Interactive) Glasgow Haskell Compiler -- version 7.10.2
-+ The (Interactive) Glasgow Haskell Compiler -- version 7.10.3
- ==============================================================
-
- The GHC Team is pleased to announce a new minor release of GHC. This is a
-@@ -29,7 +29,7 @@ bug-fix release and contains a number of important fixes,
- A more thorough list of the changes in the release can be found in the release
- notes,
-
-- http://haskell.org/ghc/docs/7.10.2/html/users_guide/release-7-10-2.html
-+ http://haskell.org/ghc/docs/7.10.3/html/users_guide/release-7-10-3.html
-
-
- How to get it
-diff --git a/docs/users_guide/intro.xml b/docs/users_guide/intro.xml
-index 3292334..fb7116e 100644
---- a/docs/users_guide/intro.xml
-+++ b/docs/users_guide/intro.xml
-@@ -309,6 +309,7 @@
-
- &relnotes1;
- &relnotes2;
-+&relnotes3;
-
- </chapter>
-
-diff --git a/docs/users_guide/ug-ent.xml.in b/docs/users_guide/ug-ent.xml.in
-index b696aad..3629e93 100644
---- a/docs/users_guide/ug-ent.xml.in
-+++ b/docs/users_guide/ug-ent.xml.in
-@@ -5,6 +5,7 @@
- <!ENTITY intro SYSTEM "intro.xml" >
- <!ENTITY relnotes1 SYSTEM "7.10.1-notes.xml" >
- <!ENTITY relnotes2 SYSTEM "7.10.2-notes.xml" >
-+<!ENTITY relnotes3 SYSTEM "7.10.3-notes.xml" >
- <!ENTITY using SYSTEM "using.xml" >
- <!ENTITY code-gens SYSTEM "codegens.xml" >
- <!ENTITY runtime SYSTEM "runtime_control.xml" >
diff --git a/dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch b/dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch
deleted file mode 100644
index 08410fa0cd9b..000000000000
--- a/dev-lang/ghc/files/ghc-7.6.3-preserve-inplace-xattr.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-On hardened 'cp' drops out XT-pax parking.
-perfinion suggested using 'install', where portage
-might have a chance to save our marking.
-
-Reported-by: Jay Yang
-Gentoo-bug: https://bugs.gentoo.org/518734
-diff --git a/rules/build-prog.mk b/rules/build-prog.mk
-index 399369e..2ee9cd5 100644
---- a/rules/build-prog.mk
-+++ b/rules/build-prog.mk
-@@ -288,3 +288,3 @@ endif
- $$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG_INPLACE) | $$$$(dir $$$$@)/.
-- "$$(CP)" -p $$< $$@
-+ $$(INSTALL) -m 755 $$< $$@
diff --git a/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch b/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch
deleted file mode 100644
index d01cb49affbd..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-commit bb5953484579968c984d074ca1af5d21e1c9e7a0
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Mon Feb 10 12:45:58 2014 +0300
-
- rts: unrust 'libbfd' debug symbols parser
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/configure.ac b/configure.ac
-index e7fbc7f..e47979c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -801,7 +801,8 @@ fi
- dnl ** check whether this machine has BFD and libiberty installed (used for debugging)
- dnl the order of these tests matters: bfd needs libiberty
- AC_CHECK_LIB(iberty, xmalloc)
--AC_CHECK_LIB(bfd, bfd_uncompress_section_contents)
-+dnl 'bfd_init' is a rare non-macro in libbfd
-+AC_CHECK_LIB(bfd, bfd_init)
-
- dnl ################################################################
- dnl Check for libraries
-diff --git a/rts/Printer.c b/rts/Printer.c
-index ca9ca49..ce02b02 100644
---- a/rts/Printer.c
-+++ b/rts/Printer.c
-@@ -48,6 +48,9 @@ void printPtr( StgPtr p )
- raw = lookupGHCName(p);
- if (raw != NULL) {
- printZcoded(raw);
-+ /* it can be just a C symbol, like 'stg_returnToStackTop' */
-+ debugBelch("<%s>", raw);
-+ debugBelch("[%p]", p);
- } else {
- debugBelch("%p", p);
- }
-@@ -794,7 +797,7 @@ static void printZcoded( const char *raw )
- disabling this for now.
- */
- #ifdef USING_LIBBFD
--
-+#include "../mk/config.h" /* silly BFD's requirement */
- #include <bfd.h>
-
- /* Fairly ad-hoc piece of code that seems to filter out a lot of
-@@ -863,7 +866,10 @@ extern void DEBUG_LoadSymbols( char *name )
- for( i = 0; i != number_of_symbols; ++i ) {
- symbol_info info;
- bfd_get_symbol_info(abfd,symbol_table[i],&info);
-- /*debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name); */
-+ if (0)
-+ {
-+ debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name);
-+ }
- if (isReal(info.type, info.name)) {
- num_real_syms += 1;
- }
-diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
-index aa7306f..5bdef94 100644
---- a/rts/RtsStartup.c
-+++ b/rts/RtsStartup.c
-@@ -19,6 +19,7 @@
- #include "RtsFlags.h"
- #include "RtsUtils.h"
- #include "Prelude.h"
-+#include "Printer.h" /* DEBUG_LoadSymbols */
- #include "Schedule.h" /* initScheduler */
- #include "Stats.h" /* initStats */
- #include "STM.h" /* initSTM */
-@@ -162,6 +163,11 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
- rts_config.rts_opts_enabled, rts_config.rts_opts, rts_config.rts_hs_main);
- }
-
-+#ifdef DEBUG
-+ /* load debugging symbols */
-+ DEBUG_LoadSymbols((*argv)[0]);
-+#endif /* DEBUG */
-+
- /* Initialise the stats department, phase 1 */
- initStats1();
-
diff --git a/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch b/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch
deleted file mode 100644
index efdd54fbf3fb..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-commit b0cf3ab7a69b878a4335d21a347b56e4b0ca0b7b
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Mon Apr 14 19:06:24 2014 +0300
-
- compiler/cmm/PprC.hs: constify local string literals
-
- Consider one-line module
- module B (v) where v = "hello"
- in -fvia-C mode it generates code like
- static char gibberish_str[] = "hello";
-
- It uselessly eats data section (precious resource on ia64!).
- The patch switches genrator to emit:
- static const char gibberish_str[] = "hello";
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
-index 2398981..fdb578d 100644
---- a/compiler/cmm/PprC.hs
-+++ b/compiler/cmm/PprC.hs
-@@ -112,6 +112,12 @@ pprTop (CmmProc infos clbl _ graph) =
-
- -- We only handle (a) arrays of word-sized things and (b) strings.
-
-+pprTop (CmmData ReadOnlyData (Statics lbl [CmmString str])) =
-+ hcat [
-+ pprLocalness lbl, ptext (sLit "const char "), ppr lbl,
-+ ptext (sLit "[] = "), pprStringInCStyle str, semi
-+ ]
-+
- pprTop (CmmData _section (Statics lbl [CmmString str])) =
- hcat [
- pprLocalness lbl, ptext (sLit "char "), ppr lbl,
diff --git a/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch b/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch
deleted file mode 100644
index c8570c06940b..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-commit 326046739801a380c5457ef4c87bce8fb95497ba
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sun Aug 10 22:12:28 2014 +0300
-
- systools info: fix warning about C compiler (message said about linker)
-
- Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- Test Plan: build-tested
-
- Reviewers: austin
-
- Reviewed By: austin
-
- Subscribers: phaskell, simonmar, relrod, ezyang, carter
-
- Differential Revision: https://phabricator.haskell.org/D132
-
-diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
-index 1c1c52c..72fa19b 100644
---- a/compiler/main/SysTools.lhs
-+++ b/compiler/main/SysTools.lhs
-@@ -809,10 +809,10 @@ getCompilerInfo' dflags = do
- )
- (\err -> do
- debugTraceMsg dflags 2
-- (text "Error (figuring out compiler information):" <+>
-+ (text "Error (figuring out C compiler information):" <+>
- text (show err))
- errorMsg dflags $ hang (text "Warning:") 9 $
-- text "Couldn't figure out linker information!" $$
-+ text "Couldn't figure out C compiler information!" $$
- text "Make sure you're using GNU gcc, or clang"
- return UnknownCC)
- return info
diff --git a/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch b/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch
deleted file mode 100644
index 16a552fdd4be..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit 78863edbb0751f5c9694ea10c6132a87cfd0ee10
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Wed Aug 27 22:20:33 2014 +0300
-
- Revert "disable shared libs on sparc (linux/solaris) (fixes #8857)"
-
- This reverts commit 623883f1ed0ee11cc925c4590fb09565403fd231.
-
- The commit a93ab43ab5f40cadbedea2f6342b93c245e91434
- driver: pass '-fPIC' option to assembler as well
- fixes shared libraries on sparc at least on linux.
-
- Properly fixes Issue #8857
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index c210cd3..392237f 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -97,9 +97,7 @@ endif
- # Some platforms don't support shared libraries
- NoSharedLibsPlatformList = powerpc-unknown-linux \
- x86_64-unknown-mingw32 \
-- i386-unknown-mingw32 \
-- sparc-sun-solaris2 \
-- sparc-unknown-linux
-+ i386-unknown-mingw32
-
- ifeq "$(SOLARIS_BROKEN_SHLD)" "YES"
- NoSharedLibsPlatformList += i386-unknown-solaris2
diff --git a/dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch b/dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch
deleted file mode 100644
index 434be8b1bdad..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.3-ppc32-fPIC.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-commit fa31e8f4a0f853848d96549a429083941877bf8d
-Author: Sergei Trofimovich <siarheit@google.com>
-Date: Sun Dec 14 14:30:12 2014 +0000
-
- powerpc: fix and enable shared libraries by default on linux
-
- Summary:
- And fix things all the way down to it. Namely:
- - remove 'r30' from free registers, it's an .LCTOC1 register
- for gcc. generated .plt stubs expect it to be initialised.
- - fix PicBase computation, which originally forgot to use 'tmp'
- reg in 'initializePicBase_ppc.fetchPC'
- - mark 'ForeighTarget's as implicitly using 'PicBase' register
- (see comment for details)
- - add 64-bit MO_Sub and test on alloclimit3/4 regtests
- - fix dynamic label offsets to match with .LCTOC1 offset
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Test Plan: validate passes equal amount of vanilla/dyn tests
-
- Reviewers: simonmar, erikd, austin
-
- Reviewed By: erikd, austin
-
- Subscribers: carter, thomie
-
- Differential Revision: https://phabricator.haskell.org/D560
-
- GHC Trac Issues: #8024, #9831
-
-diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
-index 0f2c0ae..37b8ada 100644
---- a/compiler/cmm/CLabel.hs
-+++ b/compiler/cmm/CLabel.hs
-@@ -1170,7 +1170,8 @@ pprDynamicLinkerAsmLabel platform dllInfo lbl
- else if osElfTarget (platformOS platform)
- then if platformArch platform == ArchPPC
- then case dllInfo of
-- CodeStub -> ppr lbl <> text "@plt"
-+ CodeStub -> -- See Note [.LCTOC1 in PPC PIC code]
-+ ppr lbl <> text "+32768@plt"
- SymbolPtr -> text ".LC_" <> ppr lbl
- _ -> panic "pprDynamicLinkerAsmLabel"
- else if platformArch platform == ArchX86_64
-diff --git a/compiler/nativeGen/PIC.hs b/compiler/nativeGen/PIC.hs
-index 9b5c080..6326a8b 100644
---- a/compiler/nativeGen/PIC.hs
-+++ b/compiler/nativeGen/PIC.hs
-@@ -54,7 +54,6 @@ import qualified X86.Instr as X86
-
- import Platform
- import Instruction
--import Size
- import Reg
- import NCGMonad
-
-@@ -468,11 +467,8 @@ pprGotDeclaration dflags ArchX86 OSDarwin
- pprGotDeclaration _ _ OSDarwin
- = empty
-
---- pprGotDeclaration
-+-- Emit GOT declaration
- -- Output whatever needs to be output once per .s file.
---- The .LCTOC1 label is defined to point 32768 bytes into the table,
---- to make the most of the PPC's 16-bit displacements.
---- Only needed for PIC.
- pprGotDeclaration dflags arch os
- | osElfTarget os
- , arch /= ArchPPC_64
-@@ -482,6 +478,7 @@ pprGotDeclaration dflags arch os
- | osElfTarget os
- , arch /= ArchPPC_64
- = vcat [
-+ -- See Note [.LCTOC1 in PPC PIC code]
- ptext (sLit ".section \".got2\",\"aw\""),
- ptext (sLit ".LCTOC1 = .+32768") ]
-
-@@ -688,12 +685,7 @@ pprImportedSymbol _ _ _
-
-
- -- Get a pointer to our own fake GOT, which is defined on a per-module basis.
---- This is exactly how GCC does it, and it's quite horrible:
---- We first fetch the address of a local label (mkPicBaseLabel).
---- Then we add a 16-bit offset to that to get the address of a .long that we
---- define in .text space right next to the proc. This .long literal contains
---- the (32-bit) offset from our local label to our global offset table
---- (.LCTOC1 aka gotOffLabel).
-+-- This is exactly how GCC does it in linux.
-
- initializePicBase_ppc
- :: Arch -> OS -> Reg
-@@ -704,18 +696,9 @@ initializePicBase_ppc ArchPPC os picReg
- (CmmProc info lab live (ListGraph blocks) : statics)
- | osElfTarget os
- = do
-- dflags <- getDynFlags
-- gotOffLabel <- getNewLabelNat
-- tmp <- getNewRegNat $ intSize (wordWidth dflags)
- let
-- gotOffset = CmmData Text $ Statics gotOffLabel [
-- CmmStaticLit (CmmLabelDiffOff gotLabel
-- mkPicBaseLabel
-- 0)
-- ]
-- offsetToOffset
-- = PPC.ImmConstantDiff
-- (PPC.ImmCLbl gotOffLabel)
-+ gotOffset = PPC.ImmConstantDiff
-+ (PPC.ImmCLbl gotLabel)
- (PPC.ImmCLbl mkPicBaseLabel)
-
- blocks' = case blocks of
-@@ -726,15 +709,23 @@ initializePicBase_ppc ArchPPC os picReg
- | bID `mapMember` info = fetchPC b
- | otherwise = b
-
-+ -- GCC does PIC prologs thusly:
-+ -- bcl 20,31,.L1
-+ -- .L1:
-+ -- mflr 30
-+ -- addis 30,30,.LCTOC1-.L1@ha
-+ -- addi 30,30,.LCTOC1-.L1@l
-+ -- TODO: below we use it over temporary register,
-+ -- it can and should be optimised by picking
-+ -- correct PIC reg.
- fetchPC (BasicBlock bID insns) =
- BasicBlock bID (PPC.FETCHPC picReg
-- : PPC.ADDIS tmp picReg (PPC.HI offsetToOffset)
-- : PPC.LD PPC.archWordSize tmp
-- (PPC.AddrRegImm tmp (PPC.LO offsetToOffset))
-- : PPC.ADD picReg picReg (PPC.RIReg picReg)
-+ : PPC.ADDIS picReg picReg (PPC.HA gotOffset)
-+ : PPC.ADDI picReg picReg (PPC.LO gotOffset)
-+ : PPC.MR PPC.r30 picReg
- : insns)
-
-- return (CmmProc info lab live (ListGraph blocks') : gotOffset : statics)
-+ return (CmmProc info lab live (ListGraph blocks') : statics)
-
-
- initializePicBase_ppc ArchPPC OSDarwin picReg
-diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
-index ddf483a..c1c4a74 100644
---- a/compiler/nativeGen/PPC/CodeGen.hs
-+++ b/compiler/nativeGen/PPC/CodeGen.hs
-@@ -54,7 +54,7 @@ import Outputable
- import Unique
- import DynFlags
-
--import Control.Monad ( mapAndUnzipM )
-+import Control.Monad ( mapAndUnzipM, when )
- import Data.Bits
- import Data.Word
-
-@@ -355,6 +355,19 @@ iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do
- ADDE rhi r1hi r2hi ]
- return (ChildCode64 code rlo)
-
-+iselExpr64 (CmmMachOp (MO_Sub _) [e1,e2]) = do
-+ ChildCode64 code1 r1lo <- iselExpr64 e1
-+ ChildCode64 code2 r2lo <- iselExpr64 e2
-+ (rlo,rhi) <- getNewRegPairNat II32
-+ let
-+ r1hi = getHiVRegFromLo r1lo
-+ r2hi = getHiVRegFromLo r2lo
-+ code = code1 `appOL`
-+ code2 `appOL`
-+ toOL [ SUBFC rlo r2lo r1lo,
-+ SUBFE rhi r2hi r1hi ]
-+ return (ChildCode64 code rlo)
-+
- iselExpr64 (CmmMachOp (MO_UU_Conv W32 W64) [expr]) = do
- (expr_reg,expr_code) <- getSomeReg expr
- (rlo, rhi) <- getNewRegPairNat II32
-@@ -918,8 +931,12 @@ genCCall' dflags gcp target dest_regs args0
- (toOL []) []
-
- (labelOrExpr, reduceToFF32) <- case target of
-- ForeignTarget (CmmLit (CmmLabel lbl)) _ -> return (Left lbl, False)
-- ForeignTarget expr _ -> return (Right expr, False)
-+ ForeignTarget (CmmLit (CmmLabel lbl)) _ -> do
-+ uses_pic_base_implicitly
-+ return (Left lbl, False)
-+ ForeignTarget expr _ -> do
-+ uses_pic_base_implicitly
-+ return (Right expr, False)
- PrimTarget mop -> outOfLineMachOp mop
-
- let codeBefore = move_sp_down finalStack `appOL` passArgumentsCode
-@@ -940,6 +957,13 @@ genCCall' dflags gcp target dest_regs args0
- where
- platform = targetPlatform dflags
-
-+ uses_pic_base_implicitly = do
-+ -- See Note [implicit register in PPC PIC code]
-+ -- on why we claim to use PIC register here
-+ when (gopt Opt_PIC dflags) $ do
-+ _ <- getPicBaseNat archWordSize
-+ return ()
-+
- initialStackOffset = case gcp of
- GCPDarwin -> 24
- GCPLinux -> 8
-@@ -1431,3 +1455,21 @@ coerceFP2Int _ toRep x = do
- -- read low word of value (high word is undefined)
- LD II32 dst (spRel dflags 3)]
- return (Any (intSize toRep) code')
-+
-+-- Note [.LCTOC1 in PPC PIC code]
-+-- The .LCTOC1 label is defined to point 32768 bytes into the GOT table
-+-- to make the most of the PPC's 16-bit displacements.
-+-- As 16-bit signed offset is used (usually via addi/lwz instructions)
-+-- first element will have '-32768' offset against .LCTOC1.
-+
-+-- Note [implicit register in PPC PIC code]
-+-- PPC generates calls by labels in assembly
-+-- in form of:
-+-- bl puts+32768@plt
-+-- in this form it's not seen directly (by GHC NCG)
-+-- that r30 (PicBaseReg) is used,
-+-- but r30 is a required part of PLT code setup:
-+-- puts+32768@plt:
-+-- lwz r11,-30484(r30) ; offset in .LCTOC1
-+-- mtctr r11
-+-- bctr
-diff --git a/compiler/nativeGen/PPC/Instr.hs b/compiler/nativeGen/PPC/Instr.hs
-index f5b9506..b7081f9 100644
---- a/compiler/nativeGen/PPC/Instr.hs
-+++ b/compiler/nativeGen/PPC/Instr.hs
-@@ -205,8 +205,11 @@ data Instr
- | ADD Reg Reg RI -- dst, src1, src2
- | ADDC Reg Reg Reg -- (carrying) dst, src1, src2
- | ADDE Reg Reg Reg -- (extend) dst, src1, src2
-+ | ADDI Reg Reg Imm -- Add Immediate dst, src1, src2
- | ADDIS Reg Reg Imm -- Add Immediate Shifted dst, src1, src2
- | SUBF Reg Reg Reg -- dst, src1, src2 ; dst = src2 - src1
-+ | SUBFC Reg Reg Reg -- (carrying) dst, src1, src2 ; dst = src2 - src1
-+ | SUBFE Reg Reg Reg -- (extend) dst, src1, src2 ; dst = src2 - src1
- | MULLW Reg Reg RI
- | DIVW Reg Reg Reg
- | DIVWU Reg Reg Reg
-@@ -284,8 +287,11 @@ ppc_regUsageOfInstr platform instr
- ADD reg1 reg2 ri -> usage (reg2 : regRI ri, [reg1])
- ADDC reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
- ADDE reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-+ ADDI reg1 reg2 _ -> usage ([reg2], [reg1])
- ADDIS reg1 reg2 _ -> usage ([reg2], [reg1])
- SUBF reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-+ SUBFC reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-+ SUBFE reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
- MULLW reg1 reg2 ri -> usage (reg2 : regRI ri, [reg1])
- DIVW reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
- DIVWU reg1 reg2 reg3 -> usage ([reg2,reg3], [reg1])
-@@ -358,8 +364,11 @@ ppc_patchRegsOfInstr instr env
- ADD reg1 reg2 ri -> ADD (env reg1) (env reg2) (fixRI ri)
- ADDC reg1 reg2 reg3 -> ADDC (env reg1) (env reg2) (env reg3)
- ADDE reg1 reg2 reg3 -> ADDE (env reg1) (env reg2) (env reg3)
-+ ADDI reg1 reg2 imm -> ADDI (env reg1) (env reg2) imm
- ADDIS reg1 reg2 imm -> ADDIS (env reg1) (env reg2) imm
- SUBF reg1 reg2 reg3 -> SUBF (env reg1) (env reg2) (env reg3)
-+ SUBFC reg1 reg2 reg3 -> SUBFC (env reg1) (env reg2) (env reg3)
-+ SUBFE reg1 reg2 reg3 -> SUBFE (env reg1) (env reg2) (env reg3)
- MULLW reg1 reg2 ri -> MULLW (env reg1) (env reg2) (fixRI ri)
- DIVW reg1 reg2 reg3 -> DIVW (env reg1) (env reg2) (env reg3)
- DIVWU reg1 reg2 reg3 -> DIVWU (env reg1) (env reg2) (env reg3)
-diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs
-index 6851769..f59d51f 100644
---- a/compiler/nativeGen/PPC/Ppr.hs
-+++ b/compiler/nativeGen/PPC/Ppr.hs
-@@ -525,6 +525,16 @@ pprInstr (BCTRL _) = hcat [
- ptext (sLit "bctrl")
- ]
- pprInstr (ADD reg1 reg2 ri) = pprLogic (sLit "add") reg1 reg2 ri
-+pprInstr (ADDI reg1 reg2 imm) = hcat [
-+ char '\t',
-+ ptext (sLit "addi"),
-+ char '\t',
-+ pprReg reg1,
-+ ptext (sLit ", "),
-+ pprReg reg2,
-+ ptext (sLit ", "),
-+ pprImm imm
-+ ]
- pprInstr (ADDIS reg1 reg2 imm) = hcat [
- char '\t',
- ptext (sLit "addis"),
-@@ -539,6 +549,8 @@ pprInstr (ADDIS reg1 reg2 imm) = hcat [
- pprInstr (ADDC reg1 reg2 reg3) = pprLogic (sLit "addc") reg1 reg2 (RIReg reg3)
- pprInstr (ADDE reg1 reg2 reg3) = pprLogic (sLit "adde") reg1 reg2 (RIReg reg3)
- pprInstr (SUBF reg1 reg2 reg3) = pprLogic (sLit "subf") reg1 reg2 (RIReg reg3)
-+pprInstr (SUBFC reg1 reg2 reg3) = pprLogic (sLit "subfc") reg1 reg2 (RIReg reg3)
-+pprInstr (SUBFE reg1 reg2 reg3) = pprLogic (sLit "subfe") reg1 reg2 (RIReg reg3)
- pprInstr (MULLW reg1 reg2 ri@(RIReg _)) = pprLogic (sLit "mullw") reg1 reg2 ri
- pprInstr (MULLW reg1 reg2 ri@(RIImm _)) = pprLogic (sLit "mull") reg1 reg2 ri
- pprInstr (DIVW reg1 reg2 reg3) = pprLogic (sLit "divw") reg1 reg2 (RIReg reg3)
-diff --git a/compiler/nativeGen/PPC/Regs.hs b/compiler/nativeGen/PPC/Regs.hs
-index 0f636bf..69e69c0 100644
---- a/compiler/nativeGen/PPC/Regs.hs
-+++ b/compiler/nativeGen/PPC/Regs.hs
-@@ -37,7 +37,8 @@ module PPC.Regs (
- fits16Bits,
- makeImmediate,
- fReg,
-- sp, r3, r4, r27, r28, f1, f20, f21,
-+ sp, r3, r4, r27, r28, r30,
-+ f1, f20, f21,
-
- allocatableRegs
-
-@@ -295,12 +296,13 @@ point registers.
- fReg :: Int -> RegNo
- fReg x = (32 + x)
-
--sp, r3, r4, r27, r28, f1, f20, f21 :: Reg
-+sp, r3, r4, r27, r28, r30, f1, f20, f21 :: Reg
- sp = regSingle 1
- r3 = regSingle 3
- r4 = regSingle 4
- r27 = regSingle 27
- r28 = regSingle 28
-+r30 = regSingle 30
- f1 = regSingle $ fReg 1
- f20 = regSingle $ fReg 20
- f21 = regSingle $ fReg 21
-diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs
-index 9916e0e..1d46a01 100644
---- a/includes/CodeGen.Platform.hs
-+++ b/includes/CodeGen.Platform.hs
-@@ -881,6 +881,8 @@ freeReg 1 = fastBool False -- The Stack Pointer
- # if !MACHREGS_darwin
- -- most non-darwin powerpc OSes use r2 as a TOC pointer or something like that
- freeReg 2 = fastBool False
-+-- at least linux in -fPIC relies on r30 in PLT stubs
-+freeReg 30 = fastBool False
- # endif
- # ifdef REG_Base
- freeReg REG_Base = fastBool False
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 0f5820f..8f134bc 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -95,7 +95,7 @@ TargetElf = YES
- endif
-
- # Some platforms don't support shared libraries
--NoSharedLibsPlatformList = powerpc-unknown-linux \
-+NoSharedLibsPlatformList = \
- x86_64-unknown-mingw32 \
- i386-unknown-mingw32
-
diff --git a/dev-lang/ghc/files/ghc-7.8.4-gold.patch b/dev-lang/ghc/files/ghc-7.8.4-gold.patch
deleted file mode 100644
index a8e9b1e6c857..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.4-gold.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Gentoo-bug: https://bugs.gentoo.org/536426
-Reported-by: Eric Siegel
-commit 021b7978d14799bae779907faf7490cfd21b3f46
-Author: Austin Seipp <austin@well-typed.com>
-Date: Sun Jul 20 10:13:15 2014 -0500
-
- driver: use absolute paths in ld scripts (#7452)
-
- Patch contributed by slowmo.
-
- Signed-off-by: Austin Seipp <austin@well-typed.com>
-
-diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
-index 11427e2..49126fe 100644
---- a/compiler/main/DriverPipeline.hs
-+++ b/compiler/main/DriverPipeline.hs
-@@ -2166,7 +2166,9 @@ joinObjectFiles dflags o_files output_fn = do
- if ldIsGnuLd
- then do
- script <- newTempName dflags "ldscript"
-- writeFile script $ "INPUT(" ++ unwords o_files ++ ")"
-+ cwd <- getCurrentDirectory
-+ let o_files_abs = map (cwd </>) o_files
-+ writeFile script $ "INPUT(" ++ unwords o_files_abs ++ ")"
- ld_r [SysTools.FileOption "" script] ccInfo
- else if sLdSupportsFilelist mySettings
- then do
diff --git a/dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch b/dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch
deleted file mode 100644
index 9d50792bcf45..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.4-ia64-CLOSUREs.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From b677ba51cf8131a6f6ddcdfee8dd2a8c4c2b4ac7 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <siarheit@google.com>
-Date: Sat, 17 Jan 2015 14:27:13 +0000
-Subject: [PATCH 1/3] CMM: add a mechanism to import C data labels
-
-Fixes threaded runtime on ia64.
-sm_mutex there was not referenced correctly.
-
-Signed-off-by: Sergei Trofimovich <siarheit@google.com>
----
- compiler/cmm/CmmParse.y | 4 ++++
- rts/Exception.cmm | 2 +-
- rts/PrimOps.cmm | 6 +++---
- 3 files changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/compiler/cmm/CmmParse.y.source b/compiler/cmm/CmmParse.y.source
-index 6b51e51..fd9489b 100644
---- a/compiler/cmm/CmmParse.y.source
-+++ b/compiler/cmm/CmmParse.y.source
-@@ -575,6 +575,10 @@ importName
- : NAME
- { ($1, mkForeignLabel $1 Nothing ForeignLabelInExternalPackage IsFunction) }
-
-+ -- as previous 'NAME', but 'IsData'
-+ | 'CLOSURE' NAME
-+ { ($2, mkForeignLabel $2 Nothing ForeignLabelInExternalPackage IsData) }
-+
- -- A label imported with an explicit packageId.
- | STRING NAME
- { ($2, mkCmmCodeLabel (fsToPackageKey (mkFastString $1)) $2) }
-diff --git a/rts/Exception.cmm b/rts/Exception.cmm
-index 5007ef3..8d19c14 100644
---- a/rts/Exception.cmm
-+++ b/rts/Exception.cmm
-@@ -13,7 +13,7 @@
- #include "Cmm.h"
- #include "RaiseAsync.h"
-
--import ghczmprim_GHCziTypes_True_closure;
-+import CLOSURE ghczmprim_GHCziTypes_True_closure;
-
- /* -----------------------------------------------------------------------------
- Exception Primitives
-diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
-index 3e8612c..2e6ca46 100644
---- a/rts/PrimOps.cmm
-+++ b/rts/PrimOps.cmm
-@@ -28,12 +28,12 @@
- import pthread_mutex_lock;
- import pthread_mutex_unlock;
- #endif
--import base_ControlziExceptionziBase_nestedAtomically_closure;
-+import CLOSURE base_ControlziExceptionziBase_nestedAtomically_closure;
- import EnterCriticalSection;
- import LeaveCriticalSection;
--import ghczmprim_GHCziTypes_False_closure;
-+import CLOSURE ghczmprim_GHCziTypes_False_closure;
- #if defined(USE_MINIINTERPRETER) || !defined(mingw32_HOST_OS)
--import sm_mutex;
-+import CLOSURE sm_mutex;
- #endif
-
- /*-----------------------------------------------------------------------------
---
-2.2.1
-
diff --git a/dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch b/dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch
deleted file mode 100644
index dc5410da3020..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1-limit-jN.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-commit 501e05bb1b8974fc8b6c9eee86c87c367e87a211
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Tue Aug 30 12:10:47 2016 +0100
-
- GhcMake: limit Capability count to CPU count in parallel mode
-
- In Trac #9221 one of problems using high --jobs=<N>
- is amount of mutator (or GC) threads we crate.
-
- We use userspace spinning-and-yielding (see ACQUIRE_SPIN_LOCK)
- to acess work stealing queues. In case of
- N-worker-threads > N-CPUs fraction of time when
- thread holding spin lock gets descheduled by kernel
- increases. That causes other threads to waste CPU time
- before giving up CPU.
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Test Plan:
- ghc --make -j8 and -j80 have comparable sys time
- on a 8-core system.
-
- Reviewers: austin, gintas, bgamari, simonmar
-
- Reviewed By: bgamari, simonmar
-
- Subscribers: thomie
-
- Differential Revision: https://phabricator.haskell.org/D2482
-
- GHC Trac Issues: #9221
-
-diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
-index 9dc43cd..905df63 100644
---- a/compiler/main/GhcMake.hs
-+++ b/compiler/main/GhcMake.hs
-@@ -761,7 +761,12 @@ parUpsweep n_jobs old_hpt stable_mods cleanup sccs = do
-
- let updNumCapabilities = liftIO $ do
- n_capabilities <- getNumCapabilities
-- unless (n_capabilities /= 1) $ setNumCapabilities n_jobs
-+ n_cpus <- getNumProcessors
-+ -- Setting number of capabilities more than
-+ -- CPU count usually leads to high userspace
-+ -- lock contention. Trac #9221
-+ let n_caps = min n_jobs n_cpus
-+ unless (n_capabilities /= 1) $ setNumCapabilities n_caps
- return n_capabilities
- -- Reset the number of capabilities once the upsweep ends.
- let resetNumCapabilities orig_n = liftIO $ setNumCapabilities orig_n
diff --git a/dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch b/dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch
deleted file mode 100644
index b46e57301782..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1-par-g0-on-A32.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-commit bdfc5375f219d6def81effda4e57cb56d01fc917
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Tue Aug 30 12:10:54 2016 +0100
-
- rts: enable parallel GC scan of large (32M+) allocation area
-
- Parallel GC does not scan large allocation area (-A)
- effectively as it does not do work stealing from nursery
- by default.
-
- That leads to large imbalance when only one of threads
- overflows allocation area: most of GC threads finish
- quickly (as there is not much to collect) and sit idle
- waiting while single GC thread finishes scan of single
- allocation area for that thread.
-
- The patch enables work stealing for (equivalent of -qb0)
- allocation area of -A32M or higher.
-
- Tested on a highlighting-kate package from Trac #9221
-
- On 8-core machine the difference is around 5% faster
- of wall-clock time. On 24-core VM the speedup is 20%.
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Test Plan: measured wall time and GC parallelism on highlighting-kate build
-
- Reviewers: austin, bgamari, erikd, simonmar
-
- Reviewed By: bgamari, simonmar
-
- Subscribers: thomie
-
- Differential Revision: https://phabricator.haskell.org/D2483
-
- GHC Trac Issues: #9221
-
-diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
-index fda33f0..7a719b9 100644
---- a/rts/RtsFlags.c
-+++ b/rts/RtsFlags.c
-@@ -237,1 +237,1 @@ void initRtsFlagsDefaults(void)
-- RtsFlags.ParFlags.parGcLoadBalancingGen = 1;
-+ RtsFlags.ParFlags.parGcLoadBalancingGen = ~0u; /* auto, based on -A */
-@@ -1398,2 +1390,19 @@ static void normaliseRtsOpts (void)
- }
-
-+#ifdef THREADED_RTS
-+ if (RtsFlags.ParFlags.parGcLoadBalancingGen == ~0u) {
-+ StgWord alloc_area_bytes
-+ = RtsFlags.GcFlags.minAllocAreaSize * BLOCK_SIZE;
-+
-+ // If allocation area is larger that CPU cache
-+ // we can finish scanning quicker doing work-stealing
-+ // scan. Trac #9221
-+ // 32M looks big enough not to fit into L2 cache
-+ // of popular modern CPUs.
-+ if (alloc_area_bytes >= 32 * 1024 * 1024) {
-+ RtsFlags.ParFlags.parGcLoadBalancingGen = 0;
-+ } else {
-+ RtsFlags.ParFlags.parGcLoadBalancingGen = 1;
-+ }
-+ }
-+#endif
diff --git a/dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch b/dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch
deleted file mode 100644
index 4752f4482678..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1-ww-args-limit.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-commit 5efbf0d243984444cf352ad6f0d147e226c64498
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu Sep 1 17:34:58 2016 +0100
-
- restore -fmax-worker-args handling (Trac #11565)
-
- maxWorkerArgs handling was accidentally lost 3 years ago
- in a major update of demand analysis
- commit 0831a12ea2fc73c33652eeec1adc79fa19700578
-
- Old regression is noticeable as:
- - code bloat (requires stack reshuffling)
- - compilation slowdown (more code to optimise/generate)
- - and increased heap usage (DynFlags unboxing/reboxing?)
-
- On a simple compile benchmark this change causes heap
- allocation drop from 70G don to 67G (ghc perf build).
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
- Reviewers: simonpj, ezyang, goldfire, austin, bgamari
-
- Reviewed By: simonpj, ezyang
-
- Subscribers: thomie
-
- Differential Revision: https://phabricator.haskell.org/D2503
-
- GHC Trac Issues: #11565
-
-diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs
-index 10d5614..7166f57 100644
---- a/compiler/specialise/SpecConstr.hs
-+++ b/compiler/specialise/SpecConstr.hs
-@@ -29,7 +29,7 @@ import CoreFVs ( exprsFreeVarsList )
- import CoreMonad
- import Literal ( litIsLifted )
- import HscTypes ( ModGuts(..) )
--import WwLib ( mkWorkerArgs )
-+import WwLib ( isWorkerSmallEnough, mkWorkerArgs )
- import DataCon
- import Coercion hiding( substCo )
- import Rules
-@@ -1533,10 +1533,14 @@ specialise env bind_calls (RI { ri_fn = fn, ri_lam_bndrs = arg_bndrs
-
- | Just all_calls <- lookupVarEnv bind_calls fn
- = -- pprTrace "specialise entry {" (ppr fn <+> ppr (length all_calls)) $
-- do { (boring_call, pats) <- callsToPats env specs arg_occs all_calls
--
-+ do { (boring_call, all_pats) <- callsToPats env specs arg_occs all_calls
- -- Bale out if too many specialisations
-- ; let n_pats = length pats
-+ ; let pats = filter (is_small_enough . fst) all_pats
-+ is_small_enough vars = isWorkerSmallEnough (sc_dflags env) vars
-+ -- We are about to construct w/w pair in 'spec_one'.
-+ -- Omit specialisation leading to high arity workers.
-+ -- See Note [Limit w/w arity]
-+ n_pats = length pats
- spec_count' = n_pats + spec_count
- ; case sc_count env of
- Just max | not (sc_force env) && spec_count' > max
-diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs
-index 09bc204..d9460d9 100644
---- a/compiler/stranal/WwLib.hs
-+++ b/compiler/stranal/WwLib.hs
-@@ -8,6 +8,7 @@
-
- module WwLib ( mkWwBodies, mkWWstr, mkWorkerArgs
- , deepSplitProductType_maybe, findTypeShape
-+ , isWorkerSmallEnough
- ) where
-
- #include "HsVersions.h"
-@@ -144,7 +145,8 @@ mkWwBodies dflags fam_envs fun_ty demands res_info one_shots
- wrapper_body = wrap_fn_args . wrap_fn_cpr . wrap_fn_str . applyToVars work_call_args . Var
- worker_body = mkLams work_lam_args. work_fn_str . work_fn_cpr . work_fn_args
-
-- ; if useful1 && not (only_one_void_argument) || useful2
-+ ; if isWorkerSmallEnough dflags work_args
-+ && (useful1 && not only_one_void_argument || useful2)
- then return (Just (worker_args_dmds, wrapper_body, worker_body))
- else return Nothing
- }
-@@ -165,6 +167,12 @@ mkWwBodies dflags fam_envs fun_ty demands res_info one_shots
- | otherwise
- = False
-
-+-- See Note [Limit w/w arity]
-+isWorkerSmallEnough :: DynFlags -> [Var] -> Bool
-+isWorkerSmallEnough dflags vars = count isId vars <= maxWorkerArgs dflags
-+ -- We count only Free variables (isId) to skip Type, Kind
-+ -- variables which have no runtime representation.
-+
- {-
- Note [Always do CPR w/w]
- ~~~~~~~~~~~~~~~~~~~~~~~~
-@@ -178,6 +186,30 @@ a disaster, because then the enclosing function might say it has the CPR
- property, but now doesn't and there a cascade of disaster. A good example
- is Trac #5920.
-
-+Note [Limit w/w arity]
-+~~~~~~~~~~~~~~~~~~~~~~~~
-+Guard against high worker arity as it generates a lot of stack traffic.
-+A simplified example is Trac #11565#comment:6
-+
-+Current strategy is very simple: don't perform w/w transformation at all
-+if the result produces a wrapper with arity higher than -fmax-worker-args=.
-+
-+It is a bit all or nothing, consider
-+
-+ f (x,y) (a,b,c,d,e ... , z) = rhs
-+
-+Currently we will remove all w/w ness entirely. But actually we could
-+w/w on the (x,y) pair... it's the huge product that is the problem.
-+
-+Could we instead refrain from w/w on an arg-by-arg basis? Yes, that'd
-+solve f. But we can get a lot of args from deeply-nested products:
-+
-+ g (a, (b, (c, (d, ...)))) = rhs
-+
-+This is harder to spot on an arg-by-arg basis. Previously mkWwStr was
-+given some "fuel" saying how many arguments it could add; when we ran
-+out of fuel it would stop w/wing.
-+Still not very clever because it had a left-right bias.
-
- ************************************************************************
- * *
diff --git a/dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch b/dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch
deleted file mode 100644
index 877a5827e4ea..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.1_rc1-cgen-constify.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-commit b0cf3ab7a69b878a4335d21a347b56e4b0ca0b7b
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Mon Apr 14 19:06:24 2014 +0300
-
- compiler/cmm/PprC.hs: constify local string literals
-
- Consider one-line module
- module B (v) where v = "hello"
- in -fvia-C mode it generates code like
- static char gibberish_str[] = "hello";
-
- It uselessly eats data section (precious resource on ia64!).
- The patch switches genrator to emit:
- static const char gibberish_str[] = "hello";
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
-index 2398981..fdb578d 100644
---- a/compiler/cmm/PprC.hs
-+++ b/compiler/cmm/PprC.hs
-@@ -112,6 +112,12 @@ pprTop (CmmProc infos clbl _ graph) =
-
- -- We only handle (a) arrays of word-sized things and (b) strings.
-
-+pprTop (CmmData (Section ReadOnlyData _) (Statics lbl [CmmString str])) =
-+ hcat [
-+ pprLocalness lbl, ptext (sLit "const char "), ppr lbl,
-+ ptext (sLit "[] = "), pprStringInCStyle str, semi
-+ ]
-+
- pprTop (CmmData _section (Statics lbl [CmmString str])) =
- hcat [
- pprLocalness lbl, ptext (sLit "char "), ppr lbl,
diff --git a/dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch b/dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch
deleted file mode 100644
index b64d65b80a05..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2-O2-unreg.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-ghc -O2 generates too large C files for unregisterised compiler.
-On ia64 it causes DynFlags to compile for 60 minutes (then assembler
-crashes).
-
-To decrease C code inflation we don't use -O2 in UNREG mode.
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index bfaaa66..d8f93b3 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -72,11 +72,2 @@ GhcStage3HcOpts=-O2
-
--# Disable -O2 optimization. Otherwise amount of generated C code
--# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.lhs')
--# and sometimes not compile at all (powerpc64 overflows something
--# on 'compiler/hsSyn/HsExpr.lhs').
--ifeq "$(GhcUnregisterised)" "YES"
--GhcStage1HcOpts=
--GhcStage2HcOpts=
--GhcStage3HcOpts=
--endif
-
-@@ -894 +885,13 @@ CURSES_INCLUDE_DIRS = @CURSES_INCLUDE_DIRS@
- CURSES_LIB_DIRS = @CURSES_LIB_DIRS@
-+
-+# Disable -O2 optimization. Otherwise amount of generated C code
-+# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.lhs')
-+# and sometimes not compile at all (powerpc64 overflows something
-+# on 'compiler/hsSyn/HsExpr.lhs').
-+ifeq "$(GhcUnregisterised)" "YES"
-+GhcStage1HcOpts=
-+GhcStage2HcOpts=
-+GhcStage3HcOpts=
-+
-+GhcLibHcOpts=
-+endif
diff --git a/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch b/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch
deleted file mode 100644
index f02cb238c6b9..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2-binutils-2.30.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 358b508051333882d4099acca8f269e6fb2b7d65 Mon Sep 17 00:00:00 2001
-From: Bertram Felgenhauer <int-e@gmx.de>
-Date: Thu, 3 May 2018 18:03:53 +0300
-Subject: [PATCH] Compute DW_FORM_block length correctly; also fixes #15068
-
-Before this patch, the pprUnwindwExpr function computed the length of
-by the following assembly fragment:
-
- .uleb128 1f-.-1
- <expression data>
-1:
-
-That is, to compute the length, it takes the difference of the label 1
-and the address of the .uleb128 directive, and subtracts 1.
-
-In #15068 it was reported that `as` from binutils 4.30 has trouble with
-evaluating the `.` part of the expression. However, there is actually a
-problem with the expression, if the length of the data ever becomes
-larger than 128: In that case, the .uleb128 directive will emit more
-than 1 byte, and the computed length will be wrong.
-
-The present patch changes the assembly fragment to use two labels,
-which fixes both these problems.
-
- .uleb128 2f-1f
-1:
- <expression data>
-2:
-
-Test Plan: validate
-
-Reviewers: bgamari, osa1
-
-Reviewed By: bgamari
-
-Subscribers: thomie, carter
-
-GHC Trac Issues: #15068
-
-Differential Revision: https://phabricator.haskell.org/D4654
----
- compiler/nativeGen/Dwarf/Types.hs | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/compiler/nativeGen/Dwarf/Types.hs b/compiler/nativeGen/Dwarf/Types.hs
-index 23a2c920e7..579ed0d256 100644
---- a/compiler/nativeGen/Dwarf/Types.hs
-+++ b/compiler/nativeGen/Dwarf/Types.hs
-@@ -492,9 +492,11 @@ pprUnwindExpr spIsCFA expr
- pprE (UwPlus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_plus
- pprE (UwMinus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_minus
- pprE (UwTimes u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_mul
-- in text "\t.uleb128 1f-.-1" $$ -- DW_FORM_block length
-+ in text "\t.uleb128 2f-1f" $$ -- DW_FORM_block length
-+ -- computed as the difference of the following local labels 2: and 1:
-+ text "1:" $$
- pprE expr $$
-- text "1:"
-+ text "2:"
-
- -- | Generate code for re-setting the unwind information for a
- -- register to @undefined@
---
-2.17.0
-
diff --git a/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch b/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch
deleted file mode 100644
index 166f7fe42991..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-commit 2c220c4b053c8efb2098ee20910084a42a0b2dcd
-Author: Sergei Trofimovich <siarheit@google.com>
-Date: Sun Jan 29 11:59:36 2017 +0000
-
- libffi: fix build COMPLEX build failure on alpha
-
- libtool: compile: alpha-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude \
- -I../src -I. -I../include -Iinclude -I../src -Wall -w -mieee -D_REENTRANT -fno-stack-protector \
- -w -MT src/alpha/osf.lo -MMD -MP -MF src/alpha/.deps/osf.Tpo \
- -c ../src/alpha/osf.S -fPIC -DPIC -o src/alpha/.libs/osf.o
-
- ../src/alpha/osf.S:298:2: error: #error "osf.S out of sync with ffi.h"
- #error "osf.S out of sync with ffi.h"
- ^
-
- Signed-off-by: Sergei Trofimovich <siarheit@google.com>
-
-diff --git a/libffi/ghc.mk b/libffi/ghc.mk
-index 7c5bc9e1b3..4297ed449e 100644
---- a/libffi/ghc.mk
-+++ b/libffi/ghc.mk
-@@ -63,6 +63,9 @@ $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP)
- # will use cygwin symbolic links which cannot be read by mingw gcc.
- chmod +x libffi/ln
-
-+ # fix libffi build failure on alpha
-+ ( cd libffi/build && "$(PATCH_CMD)" -p0 < ../libffi.3.2.1-complex_alpha.diff; )
-+
- # We need to use -MMD rather than -MD, as otherwise we get paths
- # like c:/... in the dependency files on Windows, and the extra
- # colons break make
-diff --git a/libffi/libffi.3.2.1-complex_alpha.diff b/libffi/libffi.3.2.1-complex_alpha.diff
-new file mode 100644
-index 0000000000..0d6e0bc290
---- /dev/null
-+++ b/libffi/libffi.3.2.1-complex_alpha.diff
-@@ -0,0 +1,20 @@
-+--- src/alpha/osf.S.orig 2015-01-16 10:46:15.000000000 +0100
-++++ src/alpha/osf.S 2015-01-16 10:46:24.000000000 +0100
-+@@ -279,6 +279,7 @@
-+ .gprel32 $load_64 # FFI_TYPE_SINT64
-+ .gprel32 $load_none # FFI_TYPE_STRUCT
-+ .gprel32 $load_64 # FFI_TYPE_POINTER
-++ .gprel32 $load_none # FFI_TYPE_COMPLEX
-+
-+ /* Assert that the table above is in sync with ffi.h. */
-+
-+@@ -294,7 +295,8 @@
-+ || FFI_TYPE_SINT64 != 12 \
-+ || FFI_TYPE_STRUCT != 13 \
-+ || FFI_TYPE_POINTER != 14 \
-+- || FFI_TYPE_LAST != 14
-++ || FFI_TYPE_COMPLEX != 15 \
-++ || FFI_TYPE_LAST != 15
-+ #error "osf.S out of sync with ffi.h"
-+ #endif
-+
diff --git a/dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch b/dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch
deleted file mode 100644
index a4d49d3ef808..000000000000
--- a/dev-lang/ghc/files/ghc-8.0.2_rc2-old-sphinx.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst
-index 4d0bb3a..f980f72 100644
---- a/docs/users_guide/profiling.rst
-+++ b/docs/users_guide/profiling.rst
-@@ -435,7 +435,2 @@ To generate a heap profile from your program:
-
--For example, here is a heap profile produced for the ``sphere`` program
--from GHC's ``nofib`` benchmark suite,
--
--.. image:: images/prof_scc.*
--
- You might also want to take a look at
diff --git a/dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch b/dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch
deleted file mode 100644
index 19c8b4bccc48..000000000000
--- a/dev-lang/ghc/files/ghc-8.10.1-no-relax-everywhere.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-https://github.com/gentoo-haskell/gentoo-haskell/issues/704
-
-Allow users to specify -W,--relax externally and pass
--Wl,-no-relax unconditonally on all arches.
-
-Reported-by: wmyrda
---- a/compiler/main/DriverPipeline.hs
-+++ b/compiler/main/DriverPipeline.hs
-@@ -2144,9 +2144,7 @@ joinObjectFiles dflags o_files output_fn = do
- -- gcc on sparc sets -Wl,--relax implicitly, but
- -- -r and --relax are incompatible for ld, so
- -- disable --relax explicitly.
-- ++ (if platformArch (targetPlatform dflags)
-- `elem` [ArchSPARC, ArchSPARC64]
-- && ldIsGnuLd
-+ ++ (if ldIsGnuLd
- then [SysTools.Option "-Wl,-no-relax"]
- else [])
- -- See Note [Produce big objects on Windows]
diff --git a/dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch b/dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch
deleted file mode 100644
index eb30d9d9dd4c..000000000000
--- a/dev-lang/ghc/files/ghc-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch
+++ /dev/null
@@ -1,296 +0,0 @@
-From fac083e7ac8a37b61a4082bbbca2848e52fd1bb2 Mon Sep 17 00:00:00 2001
-From: Ben Gamari <ben@smart-cactus.org>
-Date: Sun, 9 Aug 2020 09:15:16 -0400
-Subject: [PATCH] Revert "[linker/rtsSymbols] More linker symbols"
-
-This reverts commit aa2e5863699306920513b216f337de09e29b5bb8.
----
- rts/RtsSymbols.c | 224 ++++-------------------------------------------
- 1 file changed, 17 insertions(+), 207 deletions(-)
-
-diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
-index d10a6900db..b2f90a892d 100644
---- a/rts/RtsSymbols.c
-+++ b/rts/RtsSymbols.c
-@@ -58,6 +58,7 @@
- SymI_HasProto(signal_handlers) \
- SymI_HasProto(stg_sig_install) \
- SymI_HasProto(rtsTimerSignal) \
-+ SymI_HasProto(atexit) \
- SymI_NeedsDataProto(nocldstop)
- #endif
-
-@@ -976,213 +977,29 @@
- RTS_USER_SIGNALS_SYMBOLS \
- RTS_INTCHAR_SYMBOLS
-
-+
- // 64-bit support functions in libgcc.a
--// See https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc
--#define RTS_LIBGCC_SYMBOLS_32 \
-- SymI_NeedsProto(__fixunsdfdi) \
-- /* 4 The GCC low-level runtime library */\
-- /* 4.1.1 Arithmetic functions */\
-- /* SymI_NeedsProto(__ashlsi3) */\
-- SymI_NeedsProto(__ashldi3) \
-- /* SymI_NeedsProto(__ashlti3) */\
-- /* These functions return the result of shifting a left by b bits. */\
-- /* SymI_NeedsProto(__ashrsi3) */\
-- SymI_NeedsProto(__ashrdi3) \
-- /* SymI_NeedsProto(__ashrti3) */\
-- /* These functions return the result of arithmetically shifting a right by b bits. */\
-- /* SymI_NeedsProto(__divsi3) */\
-- SymI_NeedsProto(__divdi3) \
-- /* SymI_NeedsProto(__divti3) */\
-- /* These functions return the quotient of the signed division of a and b. */\
-- /* SymI_NeedsProto(__lshrsi3) */ \
-- SymI_NeedsProto(__lshrdi3) \
-- /* SymI_NeedsProto(__lshrti3) */ \
-- /* These functions return the result of logically shifting a right by b bits. */\
-- /* SymI_NeedsProto(__modsi3) */ \
-- SymI_NeedsProto(__moddi3) \
-- /* SymI_NeedsProto(__modti3) */ \
-- /* These functions return the remainder of the signed division of a and b. */\
-- /* SymI_NeedsProto(__mulsi3) */ \
-- SymI_NeedsProto(__muldi3) \
-- /* SymI_NeedsProto(__multi3) */ \
-- /* These functions return the product of a and b. */\
-- SymI_NeedsProto(__negdi2) \
-- /* SymI_NeedsProto(__negti2) */ \
-- /* These functions return the negation of a. */\
-- /* SymI_NeedsProto(__udivsi3) */ \
-- SymI_NeedsProto(__udivdi3) \
-- /* SymI_NeedsProto(__udivti3) */ \
-- /* These functions return the quotient of the unsigned division of a and b. */\
-- SymI_NeedsProto(__udivmoddi4) \
-- /* SymI_NeedsProto(__udivmodti4) */ \
-- /* These functions calculate both the quotient and remainder of the unsigned division of a and b. The return value is the quotient, and the remainder is placed in variable pointed to by c. */\
-- /* SymI_NeedsProto(__umodsi3) */ \
-- SymI_NeedsProto(__umoddi3) \
-- /* SymI_NeedsProto(__umodti3) */ \
-- /* These functions return the remainder of the unsigned division of a and b. */\
-- /* 4.1.2 Comparison functions */\
-- /* The following functions implement integral comparisons. These functions implement a low-level compare, upon which the higher level comparison operators (such as less than and greater than or equal to) can be constructed. The returned values lie in the range zero to two, to allow the high-level operators to be implemented by testing the returned result using either signed or unsigned comparison. */\
-- SymI_NeedsProto(__cmpdi2) \
-- /* SymI_NeedsProto(__cmpti2) */ \
-- /* These functions perform a signed comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
-- SymI_NeedsProto(__ucmpdi2) \
-- /* SymI_NeedsProto(__ucmpti2) */ \
-- /* These functions perform an unsigned comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
-- /* 4.1.3 Trapping arithmetic functions */\
-- /* The following functions implement trapping arithmetic. These functions call the libc function abort upon signed arithmetic overflow. */\
-- SymI_NeedsProto(__absvsi2) \
-- SymI_NeedsProto(__absvdi2) \
-- /* These functions return the absolute value of a. */\
-- /* SymI_NeedsProto(__addvsi3) */ \
-- SymI_NeedsProto(__addvdi3) \
-- /* These functions return the sum of a and b; that is a + b. */\
-- /* SymI_NeedsProto(__mulvsi3) */ \
-- SymI_NeedsProto(__mulvdi3) \
-- /* The functions return the product of a and b; that is a * b. */\
-- SymI_NeedsProto(__negvsi2) \
-- SymI_NeedsProto(__negvdi2) \
-- /* These functions return the negation of a; that is -a. */\
-- /* SymI_NeedsProto(__subvsi3) */ \
-- SymI_NeedsProto(__subvdi3) \
-- /* These functions return the difference between b and a; that is a - b. */\
-- /* 4.1.4 Bit operations */\
-- SymI_NeedsProto(__clzsi2) \
-- SymI_NeedsProto(__clzdi2) \
-- /* SymI_NeedsProto(__clzti2) */ \
-- /* These functions return the number of leading 0-bits in a, starting at the most significant bit position. If a is zero, the result is undefined. */\
-- SymI_NeedsProto(__ctzsi2) \
-- SymI_NeedsProto(__ctzdi2) \
-- /* SymI_NeedsProto(__ctzti2) */ \
-- /* These functions return the number of trailing 0-bits in a, starting at the least significant bit position. If a is zero, the result is undefined. */\
-- SymI_NeedsProto(__ffsdi2) \
-- /* SymI_NeedsProto(__ffsti2) */ \
-- /* These functions return the index of the least significant 1-bit in a, or the value zero if a is zero. The least significant bit is index one. */\
-- SymI_NeedsProto(__paritysi2) \
-- SymI_NeedsProto(__paritydi2) \
-- /* SymI_NeedsProto(__parityti2) */\
-- /* These functions return the value zero if the number of bits set in a is even, and the value one otherwise. */\
-- SymI_NeedsProto(__popcountsi2) \
-- SymI_NeedsProto(__popcountdi2) \
-- /* SymI_NeedsProto(__popcountti2) */ \
-- /* These functions return the number of bits set in a. */\
-- SymI_NeedsProto(__bswapsi2) \
-- SymI_NeedsProto(__bswapdi2)
--#define RTS_LIBGCC_SYMBOLS_aarch32 \
-- /* armv6l */\
-- /* TODO: should check for __ARM_EABI__ */\
-- SymI_NeedsProto(__aeabi_d2f) \
-- SymI_NeedsProto(__aeabi_d2iz) \
-- SymI_NeedsProto(__aeabi_d2lz) \
-- SymI_NeedsProto(__aeabi_d2uiz) \
-- SymI_NeedsProto(__aeabi_d2ulz) \
-- SymI_NeedsProto(__aeabi_dadd) \
-- SymI_NeedsProto(__aeabi_dcmpeq) \
-- SymI_NeedsProto(__aeabi_dcmpge) \
-- SymI_NeedsProto(__aeabi_dcmpgt) \
-- SymI_NeedsProto(__aeabi_dcmple) \
-- SymI_NeedsProto(__aeabi_dcmplt) \
-- SymI_NeedsProto(__aeabi_dcmpun) \
-- SymI_NeedsProto(__aeabi_ddiv) \
-- SymI_NeedsProto(__aeabi_dmul) \
-- SymI_NeedsProto(__aeabi_dneg) \
-- SymI_NeedsProto(__aeabi_dsub) \
-- SymI_NeedsProto(__aeabi_f2d) \
-- SymI_NeedsProto(__aeabi_f2iz) \
-- SymI_NeedsProto(__aeabi_f2lz) \
-- SymI_NeedsProto(__aeabi_f2uiz) \
-- SymI_NeedsProto(__aeabi_f2ulz) \
-- SymI_NeedsProto(__aeabi_fadd) \
-- SymI_NeedsProto(__aeabi_fcmpeq) \
-- SymI_NeedsProto(__aeabi_fcmpge) \
-- SymI_NeedsProto(__aeabi_fcmpgt) \
-- SymI_NeedsProto(__aeabi_fcmple) \
-- SymI_NeedsProto(__aeabi_fcmplt) \
-- SymI_NeedsProto(__aeabi_fcmpun) \
-- SymI_NeedsProto(__aeabi_fdiv) \
-- SymI_NeedsProto(__aeabi_fmul) \
-- SymI_NeedsProto(__aeabi_fneg) \
-- SymI_NeedsProto(__aeabi_fsub) \
-- SymI_NeedsProto(__aeabi_i2d) \
-- SymI_NeedsProto(__aeabi_i2f) \
-- SymI_NeedsProto(__aeabi_idiv) \
-- SymI_NeedsProto(__aeabi_idivmod) \
-- SymI_NeedsProto(__aeabi_l2d) \
-- SymI_NeedsProto(__aeabi_l2f) \
-- SymI_NeedsProto(__aeabi_lasr) \
-- SymI_NeedsProto(__aeabi_lcmp) \
-- SymI_NeedsProto(__aeabi_ldivmod) \
-- SymI_NeedsProto(__aeabi_llsl) \
-- SymI_NeedsProto(__aeabi_llsr) \
-- SymI_NeedsProto(__aeabi_lmul) \
-- SymI_NeedsProto(__aeabi_ui2d) \
-- SymI_NeedsProto(__aeabi_ui2f) \
-- SymI_NeedsProto(__aeabi_uidiv) \
-- SymI_NeedsProto(__aeabi_uidivmod) \
-- SymI_NeedsProto(__aeabi_ul2d) \
-- SymI_NeedsProto(__aeabi_ul2f) \
-- SymI_NeedsProto(__aeabi_ulcmp) \
-- SymI_NeedsProto(__aeabi_uldivmod)
--#define RTS_LIBGCC_SYMBOLS_64 \
-+#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
-+#define RTS_LIBGCC_SYMBOLS \
-+ SymI_NeedsProto(__divdi3) \
-+ SymI_NeedsProto(__udivdi3) \
-+ SymI_NeedsProto(__moddi3) \
-+ SymI_NeedsProto(__umoddi3) \
-+ SymI_NeedsProto(__muldi3) \
-+ SymI_NeedsProto(__ashldi3) \
-+ SymI_NeedsProto(__ashrdi3) \
-+ SymI_NeedsProto(__lshrdi3) \
-+ SymI_NeedsProto(__fixunsdfdi)
-+#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
-+#define RTS_LIBGCC_SYMBOLS \
- SymI_NeedsProto(__udivti3) \
- SymI_NeedsProto(__umodti3)
--
--/* for aarch64 */
--#define RTS_LIBGCC_SYMBOLS_aarch64 \
-- SymI_NeedsProto(__netf2) \
-- SymI_NeedsProto(__addtf3) \
-- SymI_NeedsProto(__subtf3) \
-- SymI_NeedsProto(__multf3) \
-- SymI_NeedsProto(__extenddftf2) \
-- SymI_NeedsProto(__fixtfsi) \
-- SymI_NeedsProto(__fixunstfsi) \
-- SymI_NeedsProto(__floatsitf) \
-- SymI_NeedsProto(__floatunsitf)
--
--#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && defined(arm_HOST_OS)
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32 RTS_LIBGCC_SYMBOLS_aarch32
--#elif defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32
--#elif defined(__GNUC__) && SIZEOF_VOID_P == 8 && defined(aarch64_HOST_OS)
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64 RTS_LIBGCC_SYMBOLS_aarch64
--#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64
- #else
- #define RTS_LIBGCC_SYMBOLS
- #endif
-
--#if !defined(mingw32_HOST_OS) && !defined(DYNAMIC) && (defined(_FORTIFY_SOURCE) || defined(__SSP__))
--#define RTS_SSP_SYMBOLS \
-- SymI_NeedsProto(__stack_chk_guard) \
-- SymI_NeedsProto(__stack_chk_fail)
--#else
--#define RTS_SSP_SYMBOLS
--#endif
--#if !defined(DYNAMIC) && defined(linux_HOST_OS)
--// we need these for static musl builds. However when
--// linking shared objects (DLLs) this will fail, hence
--// we do not include them when building with -DDYNAMIC
--#define RTS_LINKER_SYMBOLS \
-- SymI_NeedsProto(__fini_array_start) \
-- SymI_NeedsProto(__fini_array_end)
--#else
--#define RTS_LINKER_SYMBOLS
--#endif
--
--#if defined(darwin_HOST_OS) && defined(powerpc_HOST_ARCH)
-- // Symbols that don't have a leading underscore
-- // on Mac OS X. They have to receive special treatment,
-- // see machoInitSymbolsWithoutUnderscore()
--#define RTS_MACHO_NOUNDERLINE_SYMBOLS \
-- SymI_NeedsProto(saveFP) \
-- SymI_NeedsProto(restFP)
--#endif
--
- /* entirely bogus claims about types of these symbols */
--/* to prevent a bit of define expansion, SymI_NeedsProto is a variadic
-- * macro. And we'll concat vvv with the __VA_ARGS__. This prevents
-- * vvv from getting macro expanded.
-- */
--#define SymI_NeedsProto(vvv,...) extern void vvv ## __VA_ARGS__ (void);
-+#define SymI_NeedsProto(vvv) extern void vvv(void);
- #define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
- #if defined(COMPILING_WINDOWS_DLL)
- #define SymE_HasProto(vvv) SymE_HasProto(vvv);
-@@ -1209,8 +1026,6 @@ RTS_DARWIN_ONLY_SYMBOLS
- RTS_OPENBSD_ONLY_SYMBOLS
- RTS_LIBGCC_SYMBOLS
- RTS_LIBFFI_SYMBOLS
--RTS_SSP_SYMBOLS
--RTS_LINKER_SYMBOLS
- #undef SymI_NeedsProto
- #undef SymI_NeedsDataProto
- #undef SymI_HasProto
-@@ -1230,7 +1045,7 @@ RTS_LINKER_SYMBOLS
- #define SymE_HasDataProto(vvv) \
- SymE_HasProto(vvv)
-
--#define SymI_NeedsProto(vvv,...) SymI_HasProto(vvv ## __VA_ARGS__)
-+#define SymI_NeedsProto(vvv) SymI_HasProto(vvv)
- #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv)
- #define SymE_NeedsProto(vvv) SymE_HasProto(vvv)
- #define SymE_NeedsDataProto(vvv) SymE_HasDataProto(vvv)
-@@ -1251,8 +1066,6 @@ RTS_LINKER_SYMBOLS
- #define SymI_HasProto_deprecated(vvv) \
- { #vvv, (void*)0xBAADF00D, true },
-
--void *RTS_DYNAMIC = NULL;
--
- RtsSymbolVal rtsSyms[] = {
- RTS_SYMBOLS
- RTS_RET_SYMBOLS
-@@ -1264,14 +1077,11 @@ RtsSymbolVal rtsSyms[] = {
- RTS_LIBGCC_SYMBOLS
- RTS_LIBFFI_SYMBOLS
- SymI_HasDataProto(nonmoving_write_barrier_enabled)
-- RTS_SSP_SYMBOLS
-- RTS_LINKER_SYMBOLS
- #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH)
- // dyld stub code contains references to this,
- // but it should never be called because we treat
- // lazy pointers as nonlazy.
- { "dyld_stub_binding_helper", (void*)0xDEADBEEF, false },
- #endif
-- { "_DYNAMIC", (void*)(&RTS_DYNAMIC), false },
- { 0, 0, false } /* sentinel */
- };
---
-2.25.4
-
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch
deleted file mode 100644
index 2e1ef932b454..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-cgen-constify.patch
+++ /dev/null
@@ -1,378 +0,0 @@
-From 7e00046772e053c63ac93630a60b0f396e32a2d7 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sun, 16 Apr 2017 10:43:38 +0100
-Subject: [PATCH] compiler/cmm/PprC.hs: constify labels in .rodata
-
-Summary:
-Consider one-line module
- module B (v) where v = "hello"
-in -fvia-C mode it generates code like
- static char gibberish_str[] = "hello";
-
-It resides in data section (precious resource on ia64!).
-The patch switches genrator to emit:
- static const char gibberish_str[] = "hello";
-
-Other types if symbols that gained 'const' qualifier are:
-
-- info tables (from haskell and CMM)
-- static reference tables (from haskell and CMM)
-
-Cleanups along the way:
-
-- fixed info tables defined in .cmm to reside in .rodata
-- split out closure declaration into 'IC_' / 'EC_'
-- added label declaration (based on label type) right before
- each label definition (based on section type) so that C
- compiler could check if declaration and definition matches
- at definition site.
-
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-Test Plan: ran testsuite on unregisterised x86_64 compiler
-
-Reviewers: simonmar, ezyang, austin, bgamari, erikd
-
-Subscribers: rwbarton, thomie
-
-GHC Trac Issues: #8996
-
-Differential Revision: https://phabricator.haskell.org/D3481
----
- compiler/cmm/CLabel.hs | 24 ++++++++++++++
- compiler/cmm/Cmm.hs | 13 ++++++++
- compiler/cmm/CmmInfo.hs | 2 +-
- compiler/cmm/PprC.hs | 62 +++++++++++++++++++++++-------------
- compiler/llvmGen/LlvmCodeGen/Data.hs | 12 -------
- includes/Stg.h | 22 +++++++++----
- includes/rts/storage/InfoTables.h | 2 +-
- includes/stg/MiscClosures.h | 14 ++++----
- 8 files changed, 102 insertions(+), 49 deletions(-)
-
-diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
-index 3ba4f7647a..62c8037e9c 100644
---- a/compiler/cmm/CLabel.hs
-+++ b/compiler/cmm/CLabel.hs
-@@ -89,6 +89,8 @@ module CLabel (
- foreignLabelStdcallInfo,
- isBytesLabel,
- isForeignLabel,
-+ isSomeRODataLabel,
-+ isStaticClosureLabel,
- mkCCLabel, mkCCSLabel,
-
- DynamicLinkerLabelInfo(..),
-@@ -575,6 +577,28 @@ isForeignLabel :: CLabel -> Bool
- isForeignLabel (ForeignLabel _ _ _ _) = True
- isForeignLabel _lbl = False
-
-+-- | Whether label is a static closure label (can come from haskell or cmm)
-+isStaticClosureLabel :: CLabel -> Bool
-+-- Closure defined in haskell (.hs)
-+isStaticClosureLabel (IdLabel _ _ Closure) = True
-+-- Closure defined in cmm
-+isStaticClosureLabel (CmmLabel _ _ CmmClosure) = True
-+isStaticClosureLabel _lbl = False
-+
-+-- | Whether label is a .rodata label
-+isSomeRODataLabel :: CLabel -> Bool
-+-- info table defined in haskell (.hs)
-+isSomeRODataLabel (IdLabel _ _ ClosureTable) = True
-+isSomeRODataLabel (IdLabel _ _ ConInfoTable) = True
-+isSomeRODataLabel (IdLabel _ _ InfoTable) = True
-+isSomeRODataLabel (IdLabel _ _ LocalInfoTable) = True
-+-- static reference tables defined in haskell (.hs)
-+isSomeRODataLabel (IdLabel _ _ SRT) = True
-+isSomeRODataLabel (SRTLabel _) = True
-+-- info table defined in cmm (.cmm)
-+isSomeRODataLabel (CmmLabel _ _ CmmInfo) = True
-+isSomeRODataLabel _lbl = False
-+
- -- | Get the label size field from a ForeignLabel
- foreignLabelStdcallInfo :: CLabel -> Maybe Int
- foreignLabelStdcallInfo (ForeignLabel _ info _ _) = info
-diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs
-index d2ee531686..bab20f3fdd 100644
---- a/compiler/cmm/Cmm.hs
-+++ b/compiler/cmm/Cmm.hs
-@@ -9,6 +9,7 @@ module Cmm (
- CmmBlock,
- RawCmmDecl, RawCmmGroup,
- Section(..), SectionType(..), CmmStatics(..), CmmStatic(..),
-+ isSecConstant,
-
- -- ** Blocks containing lists
- GenBasicBlock(..), blockId,
-@@ -167,6 +168,18 @@ data SectionType
- | OtherSection String
- deriving (Show)
-
-+-- | Should a data in this section be considered constant
-+isSecConstant :: Section -> Bool
-+isSecConstant (Section t _) = case t of
-+ Text -> True
-+ ReadOnlyData -> True
-+ RelocatableReadOnlyData -> True
-+ ReadOnlyData16 -> True
-+ CString -> True
-+ Data -> False
-+ UninitialisedData -> False
-+ (OtherSection _) -> False
-+
- data Section = Section SectionType CLabel
-
- data CmmStatic
-diff --git a/compiler/cmm/CmmInfo.hs b/compiler/cmm/CmmInfo.hs
-index b5e800a977..35e3a1888d 100644
---- a/compiler/cmm/CmmInfo.hs
-+++ b/compiler/cmm/CmmInfo.hs
-@@ -133,7 +133,7 @@ mkInfoTable dflags proc@(CmmProc infos entry_lbl live blocks)
- --
- return (top_decls ++
- [CmmProc mapEmpty entry_lbl live blocks,
-- mkDataLits (Section Data info_lbl) info_lbl
-+ mkRODataLits info_lbl
- (CmmLabel entry_lbl : rel_std_info ++ rel_extra_bits)])
-
- --
-diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
-index 56de94079f..21ed6f6516 100644
---- a/compiler/cmm/PprC.hs
-+++ b/compiler/cmm/PprC.hs
-@@ -83,12 +83,13 @@ pprC tops = vcat $ intersperse blankLine $ map pprTop tops
- -- top level procs
- --
- pprTop :: RawCmmDecl -> SDoc
--pprTop (CmmProc infos clbl _ graph) =
-+pprTop (CmmProc infos clbl _in_live_regs graph) =
-
- (case mapLookup (g_entry graph) infos of
- Nothing -> empty
-- Just (Statics info_clbl info_dat) -> pprDataExterns info_dat $$
-- pprWordArray info_clbl info_dat) $$
-+ Just (Statics info_clbl info_dat) ->
-+ pprDataExterns info_dat $$
-+ pprWordArray info_is_in_rodata info_clbl info_dat) $$
- (vcat [
- blankLine,
- extern_decls,
-@@ -99,6 +100,8 @@ pprTop (CmmProc infos clbl _ graph) =
- rbrace ]
- )
- where
-+ -- info tables are always in .rodata
-+ info_is_in_rodata = True
- blocks = toBlockListEntryFirst graph
- (temp_decls, extern_decls) = pprTempAndExternDecls blocks
-
-@@ -107,21 +110,23 @@ pprTop (CmmProc infos clbl _ graph) =
-
- -- We only handle (a) arrays of word-sized things and (b) strings.
-
--pprTop (CmmData _section (Statics lbl [CmmString str])) =
-+pprTop (CmmData section (Statics lbl [CmmString str])) =
-+ pprExternDecl lbl $$
- hcat [
-- pprLocalness lbl, text "char ", ppr lbl,
-+ pprLocalness lbl, pprConstness (isSecConstant section), text "char ", ppr lbl,
- text "[] = ", pprStringInCStyle str, semi
- ]
-
--pprTop (CmmData _section (Statics lbl [CmmUninitialised size])) =
-+pprTop (CmmData section (Statics lbl [CmmUninitialised size])) =
-+ pprExternDecl lbl $$
- hcat [
-- pprLocalness lbl, text "char ", ppr lbl,
-+ pprLocalness lbl, pprConstness (isSecConstant section), text "char ", ppr lbl,
- brackets (int size), semi
- ]
-
--pprTop (CmmData _section (Statics lbl lits)) =
-+pprTop (CmmData section (Statics lbl lits)) =
- pprDataExterns lits $$
-- pprWordArray lbl lits
-+ pprWordArray (isSecConstant section) lbl lits
-
- -- --------------------------------------------------------------------------
- -- BasicBlocks are self-contained entities: they always end in a jump.
-@@ -141,10 +146,12 @@ pprBBlock block =
- -- Info tables. Just arrays of words.
- -- See codeGen/ClosureInfo, and nativeGen/PprMach
-
--pprWordArray :: CLabel -> [CmmStatic] -> SDoc
--pprWordArray lbl ds
-+pprWordArray :: Bool -> CLabel -> [CmmStatic] -> SDoc
-+pprWordArray is_ro lbl ds
- = sdocWithDynFlags $ \dflags ->
-- hcat [ pprLocalness lbl, text "StgWord"
-+ -- TODO: align closures only
-+ pprExternDecl lbl $$
-+ hcat [ pprLocalness lbl, pprConstness is_ro, text "StgWord"
- , space, ppr lbl, text "[]"
- -- See Note [StgWord alignment]
- , pprAlignment (wordWidth dflags)
-@@ -180,6 +187,10 @@ pprLocalness :: CLabel -> SDoc
- pprLocalness lbl | not $ externallyVisibleCLabel lbl = text "static "
- | otherwise = empty
-
-+pprConstness :: Bool -> SDoc
-+pprConstness is_ro | is_ro = text "const "
-+ | otherwise = empty
-+
- -- --------------------------------------------------------------------------
- -- Statements.
- --
-@@ -984,31 +995,38 @@ is_cishCC JavaScriptCallConv = False
- pprTempAndExternDecls :: [CmmBlock] -> (SDoc{-temps-}, SDoc{-externs-})
- pprTempAndExternDecls stmts
- = (pprUFM (getUniqSet temps) (vcat . map pprTempDecl),
-- vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls)))
-+ vcat (map pprExternDecl (Map.keys lbls)))
- where (temps, lbls) = runTE (mapM_ te_BB stmts)
-
- pprDataExterns :: [CmmStatic] -> SDoc
- pprDataExterns statics
-- = vcat (map (pprExternDecl False{-ToDo-}) (Map.keys lbls))
-+ = vcat (map pprExternDecl (Map.keys lbls))
- where (_, lbls) = runTE (mapM_ te_Static statics)
-
- pprTempDecl :: LocalReg -> SDoc
- pprTempDecl l@(LocalReg _ rep)
- = hcat [ machRepCType rep, space, pprLocalReg l, semi ]
-
--pprExternDecl :: Bool -> CLabel -> SDoc
--pprExternDecl _in_srt lbl
-+pprExternDecl :: CLabel -> SDoc
-+pprExternDecl lbl
- -- do not print anything for "known external" things
- | not (needsCDecl lbl) = empty
- | Just sz <- foreignLabelStdcallInfo lbl = stdcall_decl sz
- | otherwise =
-- hcat [ visibility, label_type lbl,
-- lparen, ppr lbl, text ");" ]
-+ hcat [ visibility, label_type lbl , lparen, ppr lbl, text ");"
-+ -- occasionally useful to see label type
-+ -- , text "/* ", pprDebugCLabel lbl, text " */"
-+ ]
- where
-- label_type lbl | isBytesLabel lbl = text "B_"
-- | isForeignLabel lbl && isCFunctionLabel lbl = text "FF_"
-- | isCFunctionLabel lbl = text "F_"
-- | otherwise = text "I_"
-+ label_type lbl | isBytesLabel lbl = text "B_"
-+ | isForeignLabel lbl && isCFunctionLabel lbl
-+ = text "FF_"
-+ | isCFunctionLabel lbl = text "F_"
-+ | isStaticClosureLabel lbl = text "C_"
-+ -- generic .rodata labels
-+ | isSomeRODataLabel lbl = text "RO_"
-+ -- generic .data labels (common case)
-+ | otherwise = text "RW_"
-
- visibility
- | externallyVisibleCLabel lbl = char 'E'
-diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs
-index 9bb5a75bda..adb86d312d 100644
---- a/compiler/llvmGen/LlvmCodeGen/Data.hs
-+++ b/compiler/llvmGen/LlvmCodeGen/Data.hs
-@@ -56,18 +56,6 @@ genLlvmData (sec, Statics lbl xs) = do
-
- return ([globDef], [tyAlias])
-
---- | Should a data in this section be considered constant
--isSecConstant :: Section -> Bool
--isSecConstant (Section t _) = case t of
-- Text -> True
-- ReadOnlyData -> True
-- RelocatableReadOnlyData -> True
-- ReadOnlyData16 -> True
-- CString -> True
-- Data -> False
-- UninitialisedData -> False
-- (OtherSection _) -> False
--
- -- | Format the section type part of a Cmm Section
- llvmSectionType :: Platform -> SectionType -> FastString
- llvmSectionType p t = case t of
-diff --git a/includes/Stg.h b/includes/Stg.h
-index 619984d8e5..b1b3190307 100644
---- a/includes/Stg.h
-+++ b/includes/Stg.h
-@@ -223,13 +223,23 @@ typedef StgInt I_;
- typedef StgWord StgWordArray[];
- typedef StgFunPtr F_;
-
--#define EB_(X) extern char X[]
--#define IB_(X) static char X[]
--#define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
--#define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
-+/* byte arrays (and strings): */
-+#define EB_(X) extern const char X[]
-+#define IB_(X) static const char X[]
-+/* static (non-heap) closures (requires alignment for pointer tagging): */
-+#define EC_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
-+#define IC_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
-+/* writable data (does not require alignment): */
-+#define ERW_(X) extern StgWordArray (X)
-+#define IRW_(X) static StgWordArray (X)
-+/* read-only data (does not require alignment): */
-+#define ERO_(X) extern const StgWordArray (X)
-+#define IRO_(X) static const StgWordArray (X)
-+/* stg-native functions: */
- #define IF_(f) static StgFunPtr GNUC3_ATTRIBUTE(used) f(void)
--#define FN_(f) StgFunPtr f(void)
--#define EF_(f) StgFunPtr f(void) /* External Cmm functions */
-+#define FN_(f) StgFunPtr f(void)
-+#define EF_(f) StgFunPtr f(void) /* External Cmm functions */
-+/* foreign functions: */
- #define EFF_(f) void f() /* See Note [External function prototypes] */
-
- /* Note [External function prototypes] See Trac #8965, #11395
-diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h
-index 307aac371c..163f1d1c87 100644
---- a/includes/rts/storage/InfoTables.h
-+++ b/includes/rts/storage/InfoTables.h
-@@ -266,7 +266,7 @@ typedef struct {
- } StgFunInfoTable;
-
- // canned bitmap for each arg type, indexed by constants in FunTypes.h
--extern StgWord stg_arg_bitmaps[];
-+extern const StgWord stg_arg_bitmaps[];
-
- /* -----------------------------------------------------------------------------
- Return info tables
-diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h
-index 9d907ab3ba..b604f1c42b 100644
---- a/includes/stg/MiscClosures.h
-+++ b/includes/stg/MiscClosures.h
-@@ -21,10 +21,10 @@
- #define STGMISCCLOSURES_H
-
- #if IN_STG_CODE
--# define RTS_RET_INFO(i) extern W_(i)[]
--# define RTS_FUN_INFO(i) extern W_(i)[]
--# define RTS_THUNK_INFO(i) extern W_(i)[]
--# define RTS_INFO(i) extern W_(i)[]
-+# define RTS_RET_INFO(i) extern const W_(i)[]
-+# define RTS_FUN_INFO(i) extern const W_(i)[]
-+# define RTS_THUNK_INFO(i) extern const W_(i)[]
-+# define RTS_INFO(i) extern const W_(i)[]
- # define RTS_CLOSURE(i) extern W_(i)[]
- # define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
- #else
-@@ -489,9 +489,9 @@ extern StgWord RTS_VAR(sched_mutex);
-
- // Apply.cmm
- // canned bitmap for each arg type
--extern StgWord stg_arg_bitmaps[];
--extern StgWord stg_ap_stack_entries[];
--extern StgWord stg_stack_save_entries[];
-+extern const StgWord stg_arg_bitmaps[];
-+extern const StgWord stg_ap_stack_entries[];
-+extern const StgWord stg_stack_save_entries[];
-
- // Storage.c
- extern unsigned int RTS_VAR(g0);
---
-2.12.2
-
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch
deleted file mode 100644
index dbba18e85c7f..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-commit 732b3dbbff194eb8650c75afd79d892801afa0dc
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu Apr 6 22:48:13 2017 +0100
-
- add $(CrossCompilePrefix) to 'runghc' and 'ghci'
-
- When Stage1Only=YES install mode is used one of rare tools
- that lack $(CrossCompilePrefix) prefix are 'runghc' and 'ghci'.
-
- This causes file collisions when multiple GHC crosscompilers
- are installed in system.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/driver/ghci/ghc.mk b/driver/ghci/ghc.mk
-index 41d1f15c17..0f31884080 100644
---- a/driver/ghci/ghc.mk
-+++ b/driver/ghci/ghc.mk
-@@ -16,16 +16,16 @@ ifneq "$(Windows_Host)" "YES"
- install: install_driver_ghci
-
- .PHONY: install_driver_ghci
--install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
-+install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghci-$(ProjectVersion)
- install_driver_ghci:
- $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
- $(call removeFiles, "$(WRAPPER)")
- $(CREATE_SCRIPT) "$(WRAPPER)"
- echo '#!$(SHELL)' >> "$(WRAPPER)"
-- echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
-+ echo 'exec "$(bindir)/$(CrossCompilePrefix)ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
- $(EXECUTABLE_FILE) "$(WRAPPER)"
-- $(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
-- $(LN_S) ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghci"
-+ $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghci")
-+ $(LN_S) $(CrossCompilePrefix)ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghci"
-
- else # Windows_Host...
-
-diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk
-index 9169ca21bd..50b11a612e 100644
---- a/utils/runghc/ghc.mk
-+++ b/utils/runghc/ghc.mk
-@@ -34,11 +34,11 @@ install: install_runhaskell
- .PHONY: install_runhaskell
- ifeq "$(Windows_Host)" "YES"
- install_runhaskell: install_bins
-- "$(CP)" $(DESTDIR)$(bindir)/runghc$(exeext1) $(DESTDIR)$(bindir)/runhaskell$(exeext1)
-+ "$(CP)" $(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc$(exeext1) $(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell$(exeext1)
- else
- install_runhaskell:
-- $(call removeFiles,"$(DESTDIR)$(bindir)/runhaskell")
-- $(LN_S) runghc "$(DESTDIR)$(bindir)/runhaskell"
-- $(call removeFiles,"$(DESTDIR)$(bindir)/runghc")
-- $(LN_S) runghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/runghc"
-+ $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell")
-+ $(LN_S) $(CrossCompilePrefix)runghc "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runhaskell"
-+ $(call removeFiles,"$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc")
-+ $(LN_S) $(CrossCompilePrefix)runghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)runghc"
- endif
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch
deleted file mode 100644
index 1439d722fef4..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-commit 54895c90440cb81f18657537b91f2aa35bd54173
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Fri Apr 7 10:08:58 2017 +0100
-
- fix 'make install' for cross-stage2
-
- When cross-built GHC is being installed one of
- latest steps is to register installed libraries
- with 'ghc-pkg'.
-
- GHC uses freshly installed 'ghc-pkg' and 'ghc-stage2'
- for that.
-
- Tested as:
- ./configure --target=aarch64-unknown-linux-gnu
- make install DESTDIR=$(pwd)/__s2 STRIP_CMD=:
-
- Before the change install failed on ghc-pkg execution phase:
-
- ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg" \
- --force \
- --global-package-db \
- ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/package.conf.d" \
- update rts/dist/package.conf.install
- /bin/sh: .../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg: \
- No such file or directory
-
- To avoid breakage we use 'ghc' and 'ghc-pkg' built by stage0.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- Test Plan: run 'make install' on stage2 crosscompiler
-
- Reviewers: rwbarton, austin, bgamari
-
- Subscribers: thomie, snowleopard
-
- Differential Revision: https://phabricator.haskell.org/D3432
-
-diff --git a/ghc.mk b/ghc.mk
-index caa6c38fbb..8971f25981 100644
---- a/ghc.mk
-+++ b/ghc.mk
-@@ -962,6 +962,12 @@ endif
-
- INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
-
-+ifeq "$(CrossCompiling)" "YES"
-+# when installing ghc-stage2 we can't run target's
-+# 'ghc-pkg' and 'ghc-stage2' but those are needed for registration.
-+INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage1
-+INSTALLED_GHC_PKG_REAL=$(TOP)/$(ghc-pkg_DIST_BINARY)
-+else # CrossCompiling
- # Install packages in the right order, so that ghc-pkg doesn't complain.
- # Also, install ghc-pkg first.
- ifeq "$(Windows_Host)" "NO"
-@@ -971,6 +977,7 @@ else
- INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
- INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
- endif
-+endif # CrossCompiling
-
- # Set the INSTALL_DISTDIR_p for each package; compiler is special
- $(foreach p,$(filter-out compiler,$(INSTALL_PACKAGES)),\
-diff --git a/utils/ghc-pkg/ghc.mk b/utils/ghc-pkg/ghc.mk
-index 002c8122f2..4d5ef4e108 100644
---- a/utils/ghc-pkg/ghc.mk
-+++ b/utils/ghc-pkg/ghc.mk
-@@ -49,6 +49,12 @@ utils/ghc-pkg_dist_PROGNAME = ghc-pkg
- utils/ghc-pkg_dist_SHELL_WRAPPER = YES
- utils/ghc-pkg_dist_INSTALL_INPLACE = YES
-
-+# When cross-built ghc-stage2 is installed 'make install' needs to call
-+# native ghc-pkg (not the cross-built one) to register installed packages
-+# 'ghc-pkg_DIST_BINARY' variable only refer to native binary.
-+ghc-pkg_DIST_BINARY_NAME = ghc-pkg$(exeext0)
-+ghc-pkg_DIST_BINARY = utils/ghc-pkg/dist/build/tmp/$(ghc-pkg_DIST_BINARY_NAME)
-+
- # See Note [Stage1Only vs stage=1] in mk/config.mk.in.
- ifeq "$(Stage1Only)" "YES"
- # Install the copy of ghc-pkg from the dist directory when running 'make
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch
deleted file mode 100644
index 7e4ea7a9f610..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-commit f2685df3b10e13f142736f28835e9064334bc143
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Wed Apr 5 22:31:37 2017 +0100
-
- avoid $(CrossCompilerPrefix) for stage2 install
-
- Suppose we are crossbuilding ghc (when ghc-stage2
- is a normal compiler for $target):
-
- For this case 'make install' should install unprefixed
- stage2 'ghc' and not '$(CorssCompilePrefix)-ghc'.
-
- That way cross-built ghc is installable and
- usable on target as if it would be built natively
- on a target.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 4d5d82aa80..5e274bb71f 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -530,7 +530,7 @@ SUPPORTS_THIS_UNIT_ID = @SUPPORTS_THIS_UNIT_ID@
- # needs to know which gcc you're using in order to perform its tests.
-
- GccVersion = @GccVersion@
--CrossCompilePrefix = @CrossCompilePrefix@
-+
- # TargetPlatformFull retains the string passed to configure so we have it in
- # the necessary format to pass to libffi's configure.
- TargetPlatformFull = @TargetPlatformFull@
-@@ -567,6 +567,11 @@ CrossCompiling = @CrossCompiling@
- # See Note [Stage1Only vs stage=1]
- Stage1Only = NO
-
-+# Installed tools prefix:
-+# we add prefix to crosscompiler GHC only (ghc-stage1),
-+# not cross-built GHC (not ghc-stage2).
-+CrossCompilePrefix = $(if $(filter YES,$(Stage1Only)),@CrossCompilePrefix@,)
-+
- # Install stage 2 by default, or stage 1 in the cross compiler
- # case. Can be changed to 3
- INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch
deleted file mode 100644
index a5528956de14..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-commit 6ff98b962db15d18eb1d082fe344cef692ecef8e
-Author: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu Apr 6 08:55:56 2017 +0100
-
- config.mk.in: remove phase=0 hack for CrossCompilePrefix
-
- $(CrossCompilePrefix) is used only in 'make install'
- target filenames in $(DESTDIR). None of inplace (or boot)
- files contain $(CrossCompilePrefix).
-
- Thus we don't need to worry about phases.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 4e61eea821..4d5d82aa80 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -530,11 +530,7 @@ SUPPORTS_THIS_UNIT_ID = @SUPPORTS_THIS_UNIT_ID@
- # needs to know which gcc you're using in order to perform its tests.
-
- GccVersion = @GccVersion@
--ifeq "$(phase)" "0"
--CrossCompilePrefix =
--else
- CrossCompilePrefix = @CrossCompilePrefix@
--endif
- # TargetPlatformFull retains the string passed to configure so we have it in
- # the necessary format to pass to libffi's configure.
- TargetPlatformFull = @TargetPlatformFull@
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch b/dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch
deleted file mode 100644
index 79751e1ecbda..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-commit a691f6a7a191a268380805481d8e63134764a4a1
-Author: Sergei Trofimovich <slyfox@inbox.ru>
-Date: Sat Apr 29 22:02:24 2017 +0100
-
- add basic cross-compilation support (#87)
-
- * fix include case: s/#include <Lmcons.h>/#include <lmcons.h>
-
- Noticed when cross-compiling win32 on linux to i686-w64-mingw32-gcc.
- i686-w64-mingw32 provides all headers in lowercase.
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- * Pen.hsc: don't use c99-style comments in enum declarations
-
- Ths change workarounds hsc2hs bug in cross-compile mode:
- https://ghc.haskell.org/trac/ghc/ticket/13619
-
- To reproduce the build failure it's enough to run
- $ cabal configure --hsc2hs-options='--cross-safe --cross-compile'
- $ cabal build --hsc2hs-options='--cross-safe --cross-compile'
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
- * SimpleMAPI.hsc: don't use #ifdef in enum declarations
-
- This change workarounds hsc2hs bug in cross-compile mode:
- https://ghc.haskell.org/trac/ghc/ticket/13620
-
- To reproduce the build failure it's enough to run
- $ cabal configure --hsc2hs-options='--cross-safe --cross-compile'
- $ cabal build --hsc2hs-options='--cross-safe --cross-compile'
-
- Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-diff --git a/Graphics/Win32/GDI/Pen.hsc b/Graphics/Win32/GDI/Pen.hsc
-index c880170..8d8df5d 100644
---- a/Graphics/Win32/GDI/Pen.hsc
-+++ b/Graphics/Win32/GDI/Pen.hsc
-@@ -56,7 +56,7 @@ foreign import WINDOWS_CCONV unsafe "windows.h DeleteObject"
-
- type PenStyle = INT
-
--#{enum PenStyle, // Pick one of these
-+#{enum PenStyle,
- , pS_SOLID = PS_SOLID // default
- , pS_DASH = PS_DASH // -------
- , pS_DOT = PS_DOT // .......
-@@ -69,14 +69,14 @@ type PenStyle = INT
- , pS_STYLE_MASK = PS_STYLE_MASK // all the above
- }
-
--#{enum PenStyle , // "or" with one of these
-+#{enum PenStyle,
- , pS_ENDCAP_ROUND = PS_ENDCAP_ROUND // default
- , pS_ENDCAP_SQUARE = PS_ENDCAP_SQUARE
- , pS_ENDCAP_FLAT = PS_ENDCAP_FLAT
- , pS_ENDCAP_MASK = PS_ENDCAP_MASK // all the above
- }
-
--#{enum PenStyle, // "or" with one of these
-+#{enum PenStyle,
- , pS_JOIN_ROUND = PS_JOIN_ROUND // default
- , pS_JOIN_BEVEL = PS_JOIN_BEVEL
- , pS_JOIN_MITER = PS_JOIN_MITER
-@@ -87,7 +87,7 @@ If PS_JOIN_MASK is not defined with your GNU Windows32 header files,
- you'll have to define it.
- -}
-
--#{enum PenStyle, // "or" with one of these
-+#{enum PenStyle,
- , pS_COSMETIC = PS_COSMETIC // default
- , pS_GEOMETRIC = PS_GEOMETRIC
- , pS_TYPE_MASK = PS_TYPE_MASK // all the above
-diff --git a/System/Win32/Info/Computer.hsc b/System/Win32/Info/Computer.hsc
-index bb2eb72..65ae8dc 100644
---- a/System/Win32/Info/Computer.hsc
-+++ b/System/Win32/Info/Computer.hsc
-@@ -65,7 +65,7 @@ import System.Win32.Utils ( tryWithoutNull )
- import System.Win32.Word ( DWORD, LPDWORD )
-
- #include <windows.h>
--#include <Lmcons.h>
-+#include <lmcons.h>
- #include "alignment.h"
- ##include "windows_cconv.h"
-
-diff --git a/System/Win32/SimpleMAPI.hsc b/System/Win32/SimpleMAPI.hsc
-index 9727cfc..5ebf06b 100644
---- a/System/Win32/SimpleMAPI.hsc
-+++ b/System/Win32/SimpleMAPI.hsc
-@@ -53,12 +53,6 @@ type MapiFlag = ULONG
- , mAPI_LOGON_UI = MAPI_LOGON_UI
- , mAPI_NEW_SESSION = MAPI_NEW_SESSION
- , mAPI_FORCE_DOWNLOAD = MAPI_FORCE_DOWNLOAD
--#ifdef MAPI_LOGOFF_SHARED
-- , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED
--#endif
--#ifdef MAPI_LOGOFF_UI
-- , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI
--#endif
- , mAPI_DIALOG = MAPI_DIALOG
- , mAPI_UNREAD_ONLY = MAPI_UNREAD_ONLY
- , mAPI_LONG_MSGID = MAPI_LONG_MSGID
-@@ -74,6 +68,19 @@ type MapiFlag = ULONG
- , mAPI_RECEIPT_REQUESTED = MAPI_RECEIPT_REQUESTED
- , mAPI_SENT = MAPI_SENT
- }
-+-- Have to define enum values outside previous declaration due to
-+-- hsc2hs bug in --cross-compile mode:
-+-- https://ghc.haskell.org/trac/ghc/ticket/13620
-+#ifdef MAPI_LOGOFF_SHARED
-+#{enum MapiFlag,
-+ , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED
-+}
-+#endif
-+#ifdef MAPI_LOGOFF_UI
-+#{enum MapiFlag,
-+ , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI
-+}
-+#endif
-
- mapiErrors :: [(ULONG,String)]
- mapiErrors =
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch b/dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch
deleted file mode 100644
index 00f9ca4fdff9..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc2-O2-unreg.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-ghc -O2 generates too large C files for unregisterised compiler.
-On ia64 it causes DynFlags to compile for 60 minutes (then assembler
-crashes).
-
-To decrease C code inflation we don't use -O2 in UNREG mode.
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 4e61eea..15a56e9 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -72,11 +72,2 @@ GhcStage3HcOpts=-O2
-
--# Disable -O2 optimization. Otherwise amount of generated C code
--# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.hs')
--# and sometimes not compile at all (powerpc64 overflows something
--# on 'compiler/hsSyn/HsExpr.hs').
--ifeq "$(GhcUnregisterised)" "YES"
--GhcStage1HcOpts=
--GhcStage2HcOpts=
--GhcStage3HcOpts=
--endif
-
-@@ -904 +895,13 @@ CURSES_INCLUDE_DIRS = @CURSES_INCLUDE_DIRS@
- CURSES_LIB_DIRS = @CURSES_LIB_DIRS@
-+
-+# Disable -O2 optimization. Otherwise amount of generated C code
-+# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.hs')
-+# and sometimes not compile at all (powerpc64 overflows something
-+# on 'compiler/hsSyn/HsExpr.hs').
-+ifeq "$(GhcUnregisterised)" "YES"
-+GhcStage1HcOpts=
-+GhcStage2HcOpts=
-+GhcStage3HcOpts=
-+
-+GhcLibHcOpts=
-+endif
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch b/dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch
deleted file mode 100644
index b55e37a8bf94..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc3-any-vendor.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c2303dff95aa174021a1950656fdf9a1cf983959 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sat, 8 Jul 2017 09:47:12 +0100
-Subject: [PATCH] aclocal.m4: allow arbitrary <vendor> string in toolchain
- triplets
-
-Canonical triplets have a form of
- <arch>-<vendor>-<os>[-<abi>]
-
-Checking for vendor is almost never correct as it's an
-arbitrary string.
-
-It's useful to have multiple "vendors" to denote
-otherwise the same (WRT <arch>, <os>, <abi>) target:
- --target=x86_64-pc-linux-gnu
- --target=x86_64-unknown-linux-gnu
- --target=x86_64-ghc80-linux-gnu
- --target=x86_64-ghchead-linux-gnu
-
-Do not fail unknown vendors. Only emit a warning.
-Ideally configure checks should never use "vendor".
-
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
----
- aclocal.m4 | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/aclocal.m4 b/aclocal.m4
-index 001f813dfc..1d9c09b0cd 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -230,8 +230,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
- dec|none|unknown|hp|apple|next|sun|sgi|ibm|montavista|portbld)
- ;;
- *)
-- echo "Unknown vendor [$]1"
-- exit 1
-+ AC_MSG_WARN([Unknown vendor [$]1])
- ;;
- esac
- }
---
-2.13.3
-
diff --git a/dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch b/dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch
deleted file mode 100644
index 81e751d778c8..000000000000
--- a/dev-lang/ghc/files/ghc-8.2.1_rc3-stginit-data.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Fix label type for __stginit_* labels: those are .data labels, not .text
-
-Noticed when was building --enable-unregisterised build for x86_64:
-
-/tmp/ghc22931_0/ghc_3.hc:5:9: error:
- error: '__stginit_ghczmprim_GHCziTypes' redeclared as different kind of symbol
- StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- |
-5 | StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
- | ^
-
-In file included from /tmp/ghc22931_0/ghc_3.hc:3:0: error:
-
-/tmp/ghc22931_0/ghc_3.hc:4:5: error:
- note: previous declaration of '__stginit_ghczmprim_GHCziTypes' was here
- EF_(__stginit_ghczmprim_GHCziTypes);
- ^
-diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
-index 77a889a..05d71ab 100644
---- a/compiler/cmm/CLabel.hs
-+++ b/compiler/cmm/CLabel.hs
-@@ -956,3 +956,3 @@ labelType (CaseLabel _ CaseReturnInfo) = DataLabel
- labelType (CaseLabel _ _) = CodeLabel
--labelType (PlainModuleInitLabel _) = CodeLabel
-+labelType (PlainModuleInitLabel _) = DataLabel
- labelType (SRTLabel _) = DataLabel
diff --git a/dev-lang/ghc/files/ghc-8.8.1-no-alex.patch b/dev-lang/ghc/files/ghc-8.8.1-no-alex.patch
deleted file mode 100644
index 39b6eeedd566..000000000000
--- a/dev-lang/ghc/files/ghc-8.8.1-no-alex.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-https://github.com/gentoo-haskell/gentoo-haskell/issues/959
-
-From 144abba394c6a23eb877fbde727111a5e75b9d47 Mon Sep 17 00:00:00 2001
-From: Ben Gamari <ben@smart-cactus.org>
-Date: Wed, 18 Sep 2019 23:50:20 -0400
-Subject: [PATCH] configure: Don't depend upon alex in source dist build
-
-This fixes #16860 by verifying that the generated sources don't already
-exist before asserting that the `alex` executable was found. This
-replicates the logic already used for `happy` in the case of `alex`.
----
- aclocal.m4 | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -984,8 +984,11 @@ else
- fi;
- changequote([, ])dnl
- ])
--FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.1.7],
-- [AC_MSG_ERROR([Alex version 3.1.7 or later is required to compile GHC.])])[]
-+if test ! -f compiler/parser/Lexer.hs
-+then
-+ FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.1.7],
-+ [AC_MSG_ERROR([Alex version 3.1.7 or later is required to compile GHC.])])[]
-+fi
- AlexVersion=$fptools_cv_alex_version;
- AC_SUBST(AlexVersion)
- ])
---
-2.23.0
-
diff --git a/dev-lang/ghc/ghc-7.10.3.ebuild b/dev-lang/ghc/ghc-7.10.3.ebuild
deleted file mode 100644
index 590b6e0a913d..000000000000
--- a/dev-lang/ghc/ghc-7.10.3.ebuild
+++ /dev/null
@@ -1,674 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-#
-# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator prefix
-
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-arm.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PVR}-amd64.tbz2 )"
-arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64.tbz2 )"
-arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PVR}-x86.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- alpha) return 0 ;;
- #arm)
- # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
- # return 0
- #;;
- amd64) return 0 ;;
- ia64) return 0 ;;
- ppc) return 0 ;;
- ppc64) return 0 ;;
- sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=7.10.2.20151030 # uncomment only for -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.bz2 )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
- "binary 0.7.6.1"
- "hoopl 3.10.2.0"
- "transformers 0.4.3.0"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp"
-IUSE+=" binary"
-IUSE+=" elibc_glibc" # system stuff
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- >=dev-libs/gmp-5:=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses-compat:5
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- if is_crosscompile; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
- gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector
-
- # prevent from failind building unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
- # currently ghc fails to build haddock
- # https://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
- use ia64 && append-ghc-cflags persistent compile -G0
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)hsc2hs" \
- "${WORKDIR}/usr/bin/$(cross)runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)hsc2hs" \
- "${WORKDIR}/usr/bin/$(cross)runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-pkg_setup() {
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.bz2 ;;
- esac
- unpack ${ONLYA}
-
- if [[ -d "${S}"/libraries/dph ]]; then
- # Sometimes dph libs get accidentally shipped with ghc
- # but they are not installed unless user requests it.
- # We never install them.
- elog "Removing 'libraries/dph'"
- rm -rf "${S}"/libraries/dph
- fi
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise epatch will break
-
- epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
-
- epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
- epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- epatch "${FILESDIR}"/${PN}-7.10.1-rc3-ghc-7.10-bootstrap.patch
- epatch "${FILESDIR}"/${PN}-7.10.3-relnotes.patch
- epatch "${FILESDIR}"/${PN}-7.10.3-hardfloat.patch
-
- # Since ${S}/packages does not include base, etc. add them to gen_contents_index
- sed -e 's@\(for REPO in .*\)@\1 base integer-gmp integer-gmp2 integer-simple template-haskell@' \
- -i libraries/gen_contents_index || die
-
- if use prefix; then
- # Make configure find docbook-xsl-stylesheets from Prefix
- sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \
- -i utils/haddock/doc/configure.ac || die
- fi
-
- bump_libs
-
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
- echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
- if use doc; then
- echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
- else
- echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
- fi
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- if use gmp; then
- echo "INTEGER_LIBRARY=integer-gmp2" >> mk/build.mk
- else
- echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
- fi
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds 'gcc' it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- else
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- elog "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # 1. build compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
-
- emake -j1 install DESTDIR="${D}"
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if [[ ! -f "${S}/VERSION" ]]; then
- echo "${GHC_PV}" > "${S}/VERSION" \
- || die "Could not create file ${S}/VERSION"
- fi
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-7.8.4.ebuild b/dev-lang/ghc/ghc-7.8.4.ebuild
deleted file mode 100644
index 89b41d258710..000000000000
--- a/dev-lang/ghc/ghc-7.8.4.ebuild
+++ /dev/null
@@ -1,600 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-#
-# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator
-
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-arm.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-amd64.tbz2 )"
-arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64.tbz2 )"
-arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- alpha) return 0 ;;
- #arm)
- # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
- # return 0
- #;;
- amd64) return 0 ;;
- ia64) return 0 ;;
- ppc) return 0 ;;
- ppc64) return 0 ;;
- sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=7.8.3.20141119 # uncomment only for -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.bz2 )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-SRC_URI+=" https://dev.gentoo.org/~slyfox/distfiles/${P}-ia64-CLOSUREs-regenerated.patch.gz"
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp"
-IUSE+=" binary"
-IUSE+=" elibc_glibc" # system stuff
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- >=dev-libs/gmp-5:=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
- sys-libs/ncurses-compat:5
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-DEPEND="${RDEPEND}
- ghcbootstrap? (
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- >=dev-libs/libxslt-1.1.2 ) )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-ghc_setup_cflags() {
- if is_crosscompile; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # hardened-gcc needs to be disabled, because the mangler doesn't accept
- # its output.
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector
-
- # prevent from failind building unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
- # currently ghc fails to build haddock
- # https://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
- use ia64 && append-ghc-cflags persistent compile -G0
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-pkg_setup() {
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.bz2 ;;
- esac
- unpack ${ONLYA}
-
- if [[ -d "${S}"/libraries/dph ]]; then
- # Sometimes dph libs get accidentally shipped with ghc
- # but they are not installed unless user requests it.
- # We never install them.
- elog "Removing 'libraries/dph'"
- rm -rf "${S}"/libraries/dph
- fi
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise epatch will break
-
- epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
-
- epatch "${FILESDIR}"/${PN}-7.8.1_rc1-libbfd.patch
-
- epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
- epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- # bug 518734
- epatch "${FILESDIR}"/${PN}-7.6.3-preserve-inplace-xattr.patch
- # fix threaded runtime on ia64
- epatch "${FILESDIR}"/${PN}-7.8.4-ia64-CLOSUREs.patch
- epatch "${WORKDIR}"/${PN}-7.8.4-ia64-CLOSUREs-regenerated.patch
-
- # upstream backports
- epatch "${FILESDIR}"/${PN}-7.8.3-linker-warn.patch
- epatch "${FILESDIR}"/${PN}-7.8.3-pic-sparc.patch
- epatch "${FILESDIR}"/${PN}-7.8.3-ppc32-fPIC.patch
- epatch "${FILESDIR}"/${PN}-7.8.4-gold.patch
-
- if use prefix; then
- # Make configure find docbook-xsl-stylesheets from Prefix
- sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \
- -i utils/haddock/doc/configure.ac || die
- fi
-
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- if use ghcbootstrap && use doc; then
- echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
- echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
- echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
- else
- echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
- echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
- echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
- echo "HADDOCK_DOCS = NO" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- if use gmp; then
- echo "INTEGER_LIBRARY=integer-gmp" >> mk/build.mk
- else
- echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
- fi
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds 'gcc' it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
-
- if ! use ghcmakebinary; then
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # 1. build compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
-
- # Remove the docs if not requested
- if ! use doc; then
- rm -rf "${ED}/usr/share/doc/${P}/*/" \
- "${ED}/usr/share/doc/${P}/*.html" \
- || die "could not remove docs (P vs PF revision mismatch?)"
- fi
- else
- # We only build docs if we were bootstrapping, otherwise
- # we copy them out of the unpacked binary .tbz2
- if use doc && ! use ghcbootstrap; then
- mkdir -p "${ED}/usr/share/doc"
- mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \
- || die "failed to copy docs"
- else
- dodoc "${S}/distrib/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION"
- fi
-
- emake -j1 install DESTDIR="${D}"
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/haddock
-
- if [[ ! -f "${S}/VERSION" ]]; then
- echo "${GHC_PV}" > "${S}/VERSION" \
- || die "Could not create file ${S}/VERSION"
- fi
- newbashcomp "${FILESDIR}/ghc-bash-completion" ghc-pkg
-
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater --upgrade'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- # Be very careful here... Call order when upgrading is (according to PMS):
- # * src_install for new package
- # * pkg_preinst for new package
- # * pkg_postinst for new package
- # * pkg_prerm for the package being replaced
- # * pkg_postrm for the package being replaced
- # so you'll actually be touching the new packages files, not the one you
- # uninstall, due to that or installation directory ${GHC_P} will be the same for
- # both packages.
-
- # Call order for reinstalling is (according to PMS):
- # * src_install
- # * pkg_preinst
- # * pkg_prerm for the package being replaced
- # * pkg_postrm for the package being replaced
- # * pkg_postinst
-
- # Overwrite the modified package.cache with a copy of the
- # original one, so that it will be removed during uninstall.
-
- PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.0.2.ebuild b/dev-lang/ghc/ghc-8.0.2.ebuild
deleted file mode 100644
index ede481d98eaf..000000000000
--- a/dev-lang/ghc/ghc-8.0.2.ebuild
+++ /dev/null
@@ -1,672 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-#
-# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-arm.tbz2 )"
-arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-arm64.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- alpha) return 0 ;;
- arm64) return 0 ;;
- #arm)
- # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
- # return 0
- #;;
- amd64) return 0 ;;
- ia64) return 0 ;;
- ppc) return 0 ;;
- ppc64) return 0 ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.0.1.20161213 # uncomment only for -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.xz )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp +profile"
-IUSE+=" binary"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- if is_crosscompile; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failind building unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
- bin_libpath=${bin_ghc_prefix}/$(get_libdir)
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)hsc2hs" \
- "${WORKDIR}/usr/bin/$(cross)runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/$(cross)hsc2hs" \
- "${WORKDIR}/usr/bin/$(cross)runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise epatch will break
-
- epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
-
- epatch "${FILESDIR}"/${PN}-8.0.1_rc1-cgen-constify.patch
- epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- epatch "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
-
- epatch "${FILESDIR}"/${PN}-8.0.1-limit-jN.patch
- epatch "${FILESDIR}"/${PN}-8.0.1-ww-args-limit.patch
- epatch "${FILESDIR}"/${PN}-8.0.1-par-g0-on-A32.patch
- epatch "${FILESDIR}"/${PN}-8.0.2_rc2-old-sphinx.patch
- epatch "${FILESDIR}"/${PN}-8.0.2-libffi-alpha.patch
- epatch "${FILESDIR}"/${PN}-8.0.2-O2-unreg.patch
- epatch "${FILESDIR}"/${PN}-8.0.2-binutils-2.30.patch
-
- bump_libs
-
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds 'gcc' it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- else
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- elog "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
-
- emake -j1 install DESTDIR="${D}"
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if [[ ! -f "${S}/VERSION" ]]; then
- echo "${GHC_PV}" > "${S}/VERSION" \
- || die "Could not create file ${S}/VERSION"
- fi
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.10.1.ebuild b/dev-lang/ghc/ghc-8.10.1.ebuild
deleted file mode 100644
index 1db40de34286..000000000000
--- a/dev-lang/ghc/ghc-8.10.1.ebuild
+++ /dev/null
@@ -1,797 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64)
- # use big-endian && return 0
- # return 0
- # ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.10.0.20200123 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS=""
-IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
-IUSE+=" binary"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- elfutils? ( dev-libs/elfutils )
- !ghcmakebinary? ( dev-libs/libffi:= )
- numa? ( sys-process/numactl )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-# we build binaries without profiling support
-REQUIRED_USE="
- ?? ( ghcbootstrap binary )
- ?? ( profile binary )
-"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-if ! is_crosscompile; then
- PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-fi
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.8.1-revert-CPP.patch
- eapply "${FILESDIR}"/${PN}-8.10.1-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.10.1-allow-cross-bootstrap.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} \
- --enable-bootstrap-with-devel-snapshot \
- $(use_enable elfutils dwarf-unwind) \
- $(use_enable numa)
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-
- if is_crosscompile; then
- # When we build a cross-compiler the layout is the following:
- # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries
- # but
- # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory
- # containst host binaries (modulo bugs).
-
- # Portage's stripping mechanism does not skip stripping
- # foreign binaries. This frequently causes binaries to be
- # broken.
- #
- # Thus below we disable stripping of target libraries and allow
- # stripping hosts executables.
- dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}"
- dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin"
- fi
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.10.2.ebuild b/dev-lang/ghc/ghc-8.10.2.ebuild
deleted file mode 100644
index fc819806ed06..000000000000
--- a/dev-lang/ghc/ghc-8.10.2.ebuild
+++ /dev/null
@@ -1,797 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64)
- # use big-endian && return 0
- # return 0
- # ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.10.0.20200123 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS=""
-IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
-IUSE+=" binary"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- elfutils? ( dev-libs/elfutils )
- !ghcmakebinary? ( dev-libs/libffi:= )
- numa? ( sys-process/numactl )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-# we build binaries without profiling support
-REQUIRED_USE="
- ?? ( ghcbootstrap binary )
- ?? ( profile binary )
-"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-if ! is_crosscompile; then
- PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-fi
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.8.1-revert-CPP.patch
- eapply "${FILESDIR}"/${PN}-8.10.1-allow-cross-bootstrap.patch
- eapply "${FILESDIR}"/${PN}-8.10.2-revert-linker-rtsSymbols_more_linker_symbols.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} \
- --enable-bootstrap-with-devel-snapshot \
- $(use_enable elfutils dwarf-unwind) \
- $(use_enable numa)
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-
- if is_crosscompile; then
- # When we build a cross-compiler the layout is the following:
- # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries
- # but
- # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory
- # containst host binaries (modulo bugs).
-
- # Portage's stripping mechanism does not skip stripping
- # foreign binaries. This frequently causes binaries to be
- # broken.
- #
- # Thus below we disable stripping of target libraries and allow
- # stripping hosts executables.
- dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}"
- dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin"
- fi
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.10.3.ebuild b/dev-lang/ghc/ghc-8.10.3.ebuild
deleted file mode 100644
index 4b91c85afe92..000000000000
--- a/dev-lang/ghc/ghc-8.10.3.ebuild
+++ /dev/null
@@ -1,796 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64)
- # use big-endian && return 0
- # return 0
- # ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.10.0.20200123 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-#KEYWORDS="~amd64 ~x86"
-IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
-IUSE+=" binary"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- elfutils? ( dev-libs/elfutils )
- !ghcmakebinary? ( dev-libs/libffi:= )
- numa? ( sys-process/numactl )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-# we build binaries without profiling support
-REQUIRED_USE="
- ?? ( ghcbootstrap binary )
- ?? ( profile binary )
-"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-if ! is_crosscompile; then
- PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-fi
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.8.1-revert-CPP.patch
- eapply "${FILESDIR}"/${PN}-8.10.1-allow-cross-bootstrap.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} \
- --enable-bootstrap-with-devel-snapshot \
- $(use_enable elfutils dwarf-unwind) \
- $(use_enable numa)
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-
- if is_crosscompile; then
- # When we build a cross-compiler the layout is the following:
- # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries
- # but
- # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory
- # containst host binaries (modulo bugs).
-
- # Portage's stripping mechanism does not skip stripping
- # foreign binaries. This frequently causes binaries to be
- # broken.
- #
- # Thus below we disable stripping of target libraries and allow
- # stripping hosts executables.
- dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}"
- dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin"
- fi
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.10.4.ebuild b/dev-lang/ghc/ghc-8.10.4.ebuild
index a0a3d692f588..7257681ccbe7 100644
--- a/dev-lang/ghc/ghc-8.10.4.ebuild
+++ b/dev-lang/ghc/ghc-8.10.4.ebuild
@@ -75,8 +75,7 @@ BUMP_LIBRARIES=(
LICENSE="BSD"
SLOT="0/${PV}"
-# no binaries yet
-#KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 ~x86"
IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
IUSE+=" binary"
RESTRICT="!test? ( test )"
diff --git a/dev-lang/ghc/ghc-8.2.1.ebuild b/dev-lang/ghc/ghc-8.2.1.ebuild
deleted file mode 100644
index aa2a45cf9624..000000000000
--- a/dev-lang/ghc/ghc-8.2.1.ebuild
+++ /dev/null
@@ -1,754 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64) return 0 ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.2.0.20170704 # uncomment only for -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.xz )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-#KEYWORDS="~alpha ~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp profile"
-IUSE+=" binary"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise epatch will break
-
- epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- epatch "${FILESDIR}"/${PN}-8.2.1-darwin.patch
-
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-cgen-constify.patch
- epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- epatch "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
-
- epatch "${FILESDIR}"/${PN}-8.2.1_rc2-O2-unreg.patch
-
- # a bunch of crosscompiler patches
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-unphased-cross.patch
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-staged-cross.patch
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-ghci-cross.patch
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-stage2-cross.patch
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
- epatch "${FILESDIR}"/${PN}-8.2.1_rc3-any-vendor.patch
- epatch "${FILESDIR}"/${PN}-8.2.1_rc3-stginit-data.patch
-
- # needs a new libffi release
- epatch "${FILESDIR}"/${PN}-8.0.2-libffi-alpha.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-1.patch # upstreamed, waits for merge to -HEAD
- epatch "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- LD=${CTARGET}-ld
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- )
- if [[ ${CTARGET} == arm* ]] ; then
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- fi
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.2.2.ebuild b/dev-lang/ghc/ghc-8.2.2.ebuild
deleted file mode 100644
index 1338261d87dc..000000000000
--- a/dev-lang/ghc/ghc-8.2.2.ebuild
+++ /dev/null
@@ -1,755 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64) return 0 ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.2.1.20171108 # uncomment only for -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.xz )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-#KEYWORDS="~alpha ~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp profile"
-IUSE+=" binary"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
-
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-cgen-constify.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
-
- eapply "${FILESDIR}"/${PN}-8.2.1_rc2-O2-unreg.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-binutils-2.30.patch
-
- # a bunch of crosscompiler patches
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-unphased-cross.patch
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-staged-cross.patch
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-ghci-cross.patch
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-stage2-cross.patch
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # needs a new libffi release
- eapply "${FILESDIR}"/${PN}-8.0.2-libffi-alpha.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-1.patch # upstreamed, waits for merge to -HEAD
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- LD=${CTARGET}-ld
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- )
- if [[ ${CTARGET} == arm* ]] ; then
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- fi
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.4.1.ebuild b/dev-lang/ghc/ghc-8.4.1.ebuild
deleted file mode 100644
index 0e86ec36e7d4..000000000000
--- a/dev-lang/ghc/ghc-8.4.1.ebuild
+++ /dev/null
@@ -1,755 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64) return 0 ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.4.0.20180224 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-#KEYWORDS="~alpha ~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp profile"
-IUSE+=" binary"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.4.2.ebuild b/dev-lang/ghc/ghc-8.4.2.ebuild
deleted file mode 100644
index f6d8c953ac95..000000000000
--- a/dev-lang/ghc/ghc-8.4.2.ebuild
+++ /dev/null
@@ -1,760 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64) return 0 ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.4.1.20180329 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-#KEYWORDS="~alpha ~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp profile"
-IUSE+=" binary"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-binutils-2.30.patch
- eapply "${FILESDIR}"/${PN}-8.4.2-allow-cross-bootstrap.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.4.3.ebuild b/dev-lang/ghc/ghc-8.4.3.ebuild
deleted file mode 100644
index 58e642364d02..000000000000
--- a/dev-lang/ghc/ghc-8.4.3.ebuild
+++ /dev/null
@@ -1,759 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64) return 0 ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.4.1.20180329 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz )"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-#KEYWORDS="~alpha ~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp profile"
-IUSE+=" binary"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${GHC_PV}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
- "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # much arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.4.2-allow-cross-bootstrap.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.6.4.ebuild b/dev-lang/ghc/ghc-8.6.4.ebuild
deleted file mode 100644
index 52d995e60819..000000000000
--- a/dev-lang/ghc/ghc-8.6.4.ebuild
+++ /dev/null
@@ -1,775 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc64.tbz2 )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64) return 0 ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.6.0.20180810 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-#will need big tree sync
-#KEYWORDS="~amd64 ~x86"
-IUSE="doc ghcbootstrap ghcmakebinary +gmp profile test"
-RESTRICT="!test? ( test )"
-IUSE+=" binary"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- !ghcmakebinary? ( dev-libs/libffi:= )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.4.2-allow-cross-bootstrap.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.6.5.ebuild b/dev-lang/ghc/ghc-8.6.5.ebuild
deleted file mode 100644
index 89e16a5acd9b..000000000000
--- a/dev-lang/ghc/ghc-8.6.5.ebuild
+++ /dev/null
@@ -1,784 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs versionator prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- ppc64)
- use big-endian && return 1
- return 0
- ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.6.0.20180810 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-# to be rekeyworded when most of revdeps are updated
-#KEYWORDS="~amd64 ~x86"
-IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
-IUSE+=" binary"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- elfutils? ( dev-libs/elfutils )
- !ghcmakebinary? ( dev-libs/libffi:= )
- numa? ( sys-process/numactl )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.4.2-allow-cross-bootstrap.patch
- eapply "${FILESDIR}"/${PN}-8.6.5-numa.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} \
- --enable-bootstrap-with-devel-snapshot \
- $(use elfutils && echo --enable-dwarf-unwind) \
- $(use_enable numa)
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.8.1.ebuild b/dev-lang/ghc/ghc-8.8.1.ebuild
deleted file mode 100644
index 00ce56862619..000000000000
--- a/dev-lang/ghc/ghc-8.8.1.ebuild
+++ /dev/null
@@ -1,804 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- ppc64)
- use big-endian && return 1
- return 0
- ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.6.0.20180810 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS=""
-IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
-IUSE+=" binary"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- elfutils? ( dev-libs/elfutils )
- !ghcmakebinary? ( dev-libs/libffi:= )
- numa? ( sys-process/numactl )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-if ! is_crosscompile; then
- PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-fi
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && ver_test $(gcc-version) -ge 6.3 && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.4.2-allow-cross-bootstrap.patch
- eapply "${FILESDIR}"/${PN}-8.6.5-numa.patch
- eapply "${FILESDIR}"/${PN}-8.8.1-no-alex.patch
- eapply "${FILESDIR}"/${PN}-8.8.1-revert-CPP.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} \
- --enable-bootstrap-with-devel-snapshot \
- $(use elfutils && echo --enable-dwarf-unwind) \
- $(use_enable numa)
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-
- if is_crosscompile; then
- # When we build a cross-compiler the layout is the following:
- # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries
- # but
- # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory
- # containst host binaries (modulo bugs).
-
- # Portage's stripping mechanism does not skip stripping
- # foreign binaries. This frequently causes binaries to be
- # broken.
- #
- # Thus below we disable stripping of target libraries and allow
- # stripping hosts executables.
- dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}"
- dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin"
- fi
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.8.2.ebuild b/dev-lang/ghc/ghc-8.8.2.ebuild
deleted file mode 100644
index 61b81fb8fb23..000000000000
--- a/dev-lang/ghc/ghc-8.8.2.ebuild
+++ /dev/null
@@ -1,803 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64)
- # use big-endian && return 1
- # return 0
- # ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.6.0.20180810 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS=""
-IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
-IUSE+=" binary"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- elfutils? ( dev-libs/elfutils )
- !ghcmakebinary? ( dev-libs/libffi:= )
- numa? ( sys-process/numactl )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-REQUIRED_USE="?? ( ghcbootstrap binary )"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-if ! is_crosscompile; then
- PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-fi
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && ver_test $(gcc-version) -ge 6.3 && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.4.2-allow-cross-bootstrap.patch
- eapply "${FILESDIR}"/${PN}-8.6.5-numa.patch
- eapply "${FILESDIR}"/${PN}-8.8.1-revert-CPP.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} \
- --enable-bootstrap-with-devel-snapshot \
- $(use elfutils && echo --enable-dwarf-unwind) \
- $(use_enable numa)
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-
- if is_crosscompile; then
- # When we build a cross-compiler the layout is the following:
- # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries
- # but
- # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory
- # containst host binaries (modulo bugs).
-
- # Portage's stripping mechanism does not skip stripping
- # foreign binaries. This frequently causes binaries to be
- # broken.
- #
- # Thus below we disable stripping of target libraries and allow
- # stripping hosts executables.
- dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}"
- dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin"
- fi
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}
diff --git a/dev-lang/ghc/ghc-8.8.3.ebuild b/dev-lang/ghc/ghc-8.8.3.ebuild
deleted file mode 100644
index eb0ede0ad7fe..000000000000
--- a/dev-lang/ghc/ghc-8.8.3.ebuild
+++ /dev/null
@@ -1,808 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# to make make a crosscompiler use crossdev and symlink ghc tree into
-# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} = ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
-fi
-
-inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
-inherit multilib multiprocessing pax-utils toolchain-funcs prefix
-inherit check-reqs
-DESCRIPTION="The Glasgow Haskell Compiler"
-HOMEPAGE="https://www.haskell.org/ghc/"
-
-# we don't have any binaries yet
-arch_binaries=""
-
-BIN_PV=${PV}
-# sorted!
-#arch_binaries="$arch_binaries alpha? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-alpha.tbz2 )"
-#arch_binaries="$arch_binaries arm? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-armv7a-hardfloat-linux-gnueabi.tbz2 )"
-#arch_binaries="$arch_binaries arm64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-aarch64-unknown-linux-gnu.tbz2 )"
-arch_binaries="$arch_binaries amd64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86_64-pc-linux-gnu.tbz2 )"
-#arch_binaries="$arch_binaries ia64? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
-#arch_binaries="$arch_binaries ppc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-ppc.tbz2 )"
-#arch_binaries="$arch_binaries ppc64? ( !big-endian? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-powerpc64le-unknown-linux-gnu.tbz2 ) )"
-#arch_binaries="$arch_binaries sparc? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-sparc.tbz2 )"
-arch_binaries="$arch_binaries x86? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-i686-pc-linux-gnu.tbz2 )"
-
-# various ports:
-#arch_binaries="$arch_binaries x86-fbsd? ( https://slyfox.uni.cx/~slyfox/distfiles/ghc-bin-${PV}-x86-fbsd.tbz2 )"
-
-# 0 - yet
-yet_binary() {
- case "${ARCH}" in
- #alpha) return 0 ;;
- #arm64) return 0 ;;
- #arm) return 0 ;;
- amd64) return 0 ;;
- #ia64) return 0 ;;
- #ppc) return 0 ;;
- #ppc64)
- # use big-endian && return 1
- # return 0
- # ;;
- #sparc) return 0 ;;
- x86) return 0 ;;
- *) return 1 ;;
- esac
-}
-
-GHC_PV=${PV}
-#GHC_PV=8.6.0.20180810 # uncomment only for -alpha, -beta, -rc ebuilds
-GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
-
-SRC_URI="!binary? (
- https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-src.tar.xz
- test? ( https://downloads.haskell.org/~ghc/${PV/_/-}/${GHC_P}-testsuite.tar.xz )
-)"
-S="${WORKDIR}"/${GHC_P}
-
-[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
-
-BUMP_LIBRARIES=(
- # "hackage-name hackage-version"
-)
-
-LICENSE="BSD"
-SLOT="0/${PV}"
-KEYWORDS=""
-IUSE="big-endian doc elfutils ghcbootstrap ghcmakebinary +gmp numa profile test"
-IUSE+=" binary"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-lang/perl-5.6.1
- dev-libs/gmp:0=
- sys-libs/ncurses:0=[unicode]
- elfutils? ( dev-libs/elfutils )
- !ghcmakebinary? ( dev-libs/libffi:= )
- numa? ( sys-process/numactl )
-"
-
-# This set of dependencies is needed to run
-# prebuilt ghc. We specifically avoid ncurses
-# dependency with:
-# utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING
-PREBUILT_BINARY_DEPENDS="
- !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) )
-"
-# This set of dependencies is needed to install
-# ghc[binary] in system. terminfo package is linked
-# against ncurses.
-PREBUILT_BINARY_RDEPENDS="${PREBUILT_BINARY_DEPENDS}
- sys-libs/ncurses:0/6
-"
-
-RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
-
-DEPEND="${RDEPEND}
- doc? ( app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.5
- app-text/docbook-xsl-stylesheets
- dev-python/sphinx
- >=dev-libs/libxslt-1.1.2 )
- !ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )"
-
-# we build binaries without profiling support
-REQUIRED_USE="
- ?? ( ghcbootstrap binary )
- ?? ( profile binary )
-"
-
-# haskell libraries built with cabal in configure mode, #515354
-QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
-
-is_crosscompile() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-is_native() {
- [[ ${CHOST} == ${CBUILD} ]] && [[ ${CHOST} == ${CTARGET} ]]
-}
-
-if ! is_crosscompile; then
- PDEPEND="!ghcbootstrap? ( >=app-admin/haskell-updater-1.2 )"
-fi
-
-# returns tool prefix for crosscompiler.
-# Example:
-# CTARGET=armv7a-unknown-linux-gnueabi
-# CHOST=x86_64-pc-linux-gnu
-# "armv7a-unknown-linux-gnueabi-"
-# CTARGET=${CHOST}
-# ""
-# Used in tools and library prefix:
-# "${ED}"/usr/bin/$(cross)haddock
-# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
-
-cross() {
- if is_crosscompile; then
- echo "${CTARGET}-"
- else
- echo ""
- fi
-}
-
-append-ghc-cflags() {
- local persistent compile assemble link
- local flag ghcflag
-
- for flag in $*; do
- case ${flag} in
- persistent) persistent="yes";;
- compile) compile="yes";;
- assemble) assemble="yes";;
- link) link="yes";;
- *)
- [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
- [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
- ;;
- esac
- done
-}
-
-# $1 - lib name (under libraries/)
-# $2 - lib version
-# example: bump_lib "transformers" "0.4.2.0"
-bump_lib() {
- local pn=$1 pv=$2
- local p=${pn}-${pv}
- local f
-
- einfo "Bumping ${pn} up to ${pv}"
-
- for f in ghc.mk GNUmakefile; do
- mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
- done
- mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
- mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
-}
-
-update_SRC_URI() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- SRC_URI+=" https://hackage.haskell.org/package/${pn}-${pv}/${pn}-${pv}.tar.gz"
- done
-}
-
-update_SRC_URI
-
-bump_libs() {
- local p pn pv
- for p in "${BUMP_LIBRARIES[@]}"; do
- set -- $p
- pn=$1 pv=$2
-
- bump_lib "${pn}" "${pv}"
- done
-}
-
-ghc_setup_cflags() {
- # TODO: plumb CFLAGS and BUILD_CFLAGS to respective CONF_CC_OPTS_STAGE<N>
- if ! is_native; then
- export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
- export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
- einfo "Crosscompiling mode:"
- einfo " CHOST: ${CHOST}"
- einfo " CTARGET: ${CTARGET}"
- einfo " CFLAGS: ${CFLAGS}"
- einfo " LDFLAGS: ${LDFLAGS}"
- einfo " prefix: $(cross)"
- return
- fi
- # We need to be very careful with the CFLAGS we ask ghc to pass through to
- # gcc. There are plenty of flags which will make gcc produce output that
- # breaks ghc in various ways. The main ones we want to pass through are
- # -mcpu / -march flags. These are important for arches like alpha & sparc.
- # We also use these CFLAGS for building the C parts of ghc, ie the rts.
- strip-flags
- strip-unsupported-flags
-
- # Cmm can't parse line numbers #482086
- replace-flags -ggdb[3-9] -ggdb2
-
- GHC_FLAGS=""
- GHC_PERSISTENT_FLAGS=""
- for flag in ${CFLAGS}; do
- case ${flag} in
-
- # Ignore extra optimisation (ghc passes -O to gcc anyway)
- # -O2 and above break on too many systems
- -O*) ;;
-
- # Arch and ABI flags are what we're really after
- -m*) append-ghc-cflags compile assemble ${flag};;
-
- # Sometimes it's handy to see backtrace of RTS
- # to get an idea what happens there
- -g*) append-ghc-cflags compile ${flag};;
-
- # Ignore all other flags, including all -f* flags
- esac
- done
-
- for flag in ${LDFLAGS}; do
- append-ghc-cflags link ${flag}
- done
-
- # GHC uses ${CBUILD}-gcc, ${CHOST}-gcc and ${CTARGET}-gcc at a single build.
- # Skip any gentoo-specific tweaks for cross-case to avoid passing unsupported
- # options to gcc.
- if is_native; then
- # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries
- # are not built with fPIC, bug #606666
- gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
- tc-is-gcc && ver_test $(gcc-version) -ge 6.3 && if ! use ghcbootstrap; then
- # gcc-6.3 has support for -no-pie upstream, but spelling differs from
- # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow
- # hardened users try '-pie' in USE=ghcbootstrap mode.
- append-ghc-cflags compile link -no-pie
- fi
-
- # prevent from failing to build unregisterised ghc:
- # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
- use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
- fi
-}
-
-# substitutes string $1 to $2 in files $3 $4 ...
-relocate_path() {
- local from=$1
- local to=$2
- shift 2
- local file=
- for file in "$@"
- do
- sed -i -e "s|$from|$to|g" \
- "$file" || die "path relocation failed for '$file'"
- done
-}
-
-# changes hardcoded ghc paths and updates package index
-# $1 - new absolute root path
-relocate_ghc() {
- local to=$1 ghc_v=${BIN_PV}
-
- # libdir for prebuilt binary and for current system may mismatch
- # It does for prefix installation for example: bug #476998
- local bin_ghc_prefix=${WORKDIR}/usr
- local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
- local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
-
- # backup original script to use it later after relocation
- local gp_back="${T}/ghc-pkg-${ghc_v}-orig"
- cp "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
-
- if [[ ${bin_libdir} != $(get_libdir) ]]; then
- einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
- # moving the dir itself is not strictly needed
- # but then USE=binary would result in installing
- # in '${bin_libdir}'
- mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
-
- relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "$gp_back" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
- fi
-
- # Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
- "${WORKDIR}/usr/bin/ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghci-${ghc_v}" \
- "${WORKDIR}/usr/bin/ghc-pkg-${ghc_v}" \
- "${WORKDIR}/usr/bin/haddock-ghc-${ghc_v}" \
- "${WORKDIR}/usr/bin/hp2ps" \
- "${WORKDIR}/usr/bin/hpc" \
- "${WORKDIR}/usr/bin/hsc2hs" \
- "${WORKDIR}/usr/bin/runghc-${ghc_v}" \
- "${WORKDIR}/usr/$(get_libdir)/${PN}-${ghc_v}/package.conf.d/"*
-
- # this one we will use to regenerate cache
- # so it should point to current tree location
- relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
-
- if use prefix; then
- hprefixify "${bin_libpath}"/${PN}*/settings
- fi
-
- # regenerate the binary package cache
- "$gp_back" recache || die "failed to update cache after relocation"
- rm "$gp_back"
-}
-
-ghc-check-reqs() {
- # These are pessimistic values (slightly bigger than worst-case)
- # Worst case is UNREG USE=profile ia64. See bug #611866 for some
- # numbers on various arches.
- CHECKREQS_DISK_BUILD=8G
- CHECKREQS_DISK_USR=2G
- # USE=binary roughly takes
- use binary && CHECKREQS_DISK_BUILD=4G
-
- "$@"
-}
-
-pkg_pretend() {
- ghc-check-reqs check-reqs_pkg_pretend
-}
-
-pkg_setup() {
- ghc-check-reqs check-reqs_pkg_setup
-
- # quiet portage about prebuilt binaries
- use binary && QA_PREBUILT="*"
-
- [[ ${MERGE_TYPE} == binary ]] && return
-
- if use ghcbootstrap; then
- ewarn "You requested ghc bootstrapping, this is usually only used"
- ewarn "by Gentoo developers to make binary .tbz2 packages."
-
- [[ -z $(type -P ghc) ]] && \
- die "Could not find a ghc to bootstrap with."
- else
- if ! yet_binary; then
- eerror "Please try emerging with USE=ghcbootstrap and report build"
- eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
- die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
- fi
- fi
-}
-
-src_unpack() {
- # Create the ${S} dir if we're using the binary version
- use binary && mkdir "${S}"
-
- # the Solaris and Darwin binaries from ghc (maeder) need to be
- # unpacked separately, so prevent them from being unpacked
- local ONLYA=${A}
- case ${CHOST} in
- *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.xz ;;
- esac
- unpack ${ONLYA}
-}
-
-src_prepare() {
- ghc_setup_cflags
-
- if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
- # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
- # See bug #313635.
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${WORKDIR}/usr/bin/ghc-${BIN_PV}"
-
- # allow hardened users use vanilla binary to bootstrap ghc
- # ghci uses mmap with rwx protection at it implements dynamic
- # linking on it's own (bug #299709)
- pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${PN}-${BIN_PV}/bin/ghc"
- fi
-
- if use binary; then
- if use prefix; then
- relocate_ghc "${EPREFIX}"
- fi
-
- # Move unpacked files to the expected place
- mv "${WORKDIR}/usr" "${S}"
- eapply_user
- else
- if ! use ghcbootstrap; then
- case ${CHOST} in
- *-darwin* | *-solaris*)
- # UPDATE ME for ghc-7
- mkdir "${WORKDIR}"/ghc-bin-installer || die
- pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
- use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
- use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
- use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
- popd > /dev/null
-
- pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
- # fix the binaries so they run, on Solaris we need an
- # LD_LIBRARY_PATH which has our prefix libdirs, on
- # Darwin we need to replace the frameworks with our libs
- # from the prefix fix before installation, because some
- # of the tools are actually used during configure/make
- if [[ ${CHOST} == *-solaris* ]] ; then
- export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
- elif [[ ${CHOST} == *-darwin* ]] ; then
- local readline_framework=GNUreadline.framework/GNUreadline
- local gmp_framework=/opt/local/lib/libgmp.10.dylib
- local ncurses_file=/opt/local/lib/libncurses.5.dylib
- for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
- install_name_tool -change \
- ${readline_framework} \
- "${EPREFIX}"/lib/libreadline.dylib \
- ${binary} || die
- install_name_tool -change \
- ${gmp_framework} \
- "${EPREFIX}"/usr/lib/libgmp.dylib \
- ${binary} || die
- install_name_tool -change \
- ${ncurses_file} \
- "${EPREFIX}"/usr/lib/libncurses.dylib \
- ${binary} || die
- done
- # we don't do frameworks!
- sed -i \
- -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
- -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
- rts/package.conf.in || die
- fi
-
- # it is autoconf, but we really don't want to give it too
- # many arguments, in fact we do the make in-place anyway
- ./configure --prefix="${WORKDIR}"/usr || die
- make install || die
- popd > /dev/null
- ;;
- *)
- relocate_ghc "${WORKDIR}"
- ;;
- esac
- fi
-
- sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
- "${S}/ghc/ghc.wrapper"
-
- cd "${S}" # otherwise eapply will break
-
- eapply "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
- eapply "${FILESDIR}"/${PN}-8.2.1-darwin.patch
- eapply "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
- eapply "${FILESDIR}"/${PN}-8.0.2-no-relax-everywhere.patch
- eapply "${FILESDIR}"/${PN}-8.4.2-allow-cross-bootstrap.patch
- eapply "${FILESDIR}"/${PN}-8.6.5-numa.patch
- # rumors say this is fixed properly in 8.8.3. Let's check!
- #eapply "${FILESDIR}"/${PN}-8.8.1-revert-CPP.patch
-
- # a bunch of crosscompiler patches
- # needs newer version:
- #eapply "${FILESDIR}"/${PN}-8.2.1_rc1-hp2ps-cross.patch
-
- # mingw32 target
- pushd "${S}/libraries/Win32"
- eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround
- popd
-
- bump_libs
-
- eapply_user
- # as we have changed the build system
- eautoreconf
- fi
-}
-
-src_configure() {
- if ! use binary; then
- # initialize build.mk
- echo '# Gentoo changes' > mk/build.mk
-
- # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
- echo "docdir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
- echo "htmldir = ${EPREFIX}/usr/share/doc/$(cross)${P}" >> mk/build.mk
-
- # We also need to use the GHC_FLAGS flags when building ghc itself
- echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
- echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
- echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
- # Speed up initial Cabal bootstrap
- echo "utils/ghc-cabal_dist_EXTRA_HC_OPTS+=$(ghc-make-args)" >> mk/build.mk
-
- # We can't depend on haddock except when bootstrapping when we
- # must build docs and include them into the binary .tbz2 package
- # app-text/dblatex is not in portage, can not build PDF or PS
- echo "BUILD_SPHINX_PDF = NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML = $(usex doc YES NO)" >> mk/build.mk
- echo "BUILD_MAN = $(usex doc YES NO)" >> mk/build.mk
-
- # this controls presence on 'xhtml' and 'haddock' in final install
- echo "HADDOCK_DOCS = YES" >> mk/build.mk
-
- # not used outside of ghc's test
- if [[ -n ${GHC_BUILD_DPH} ]]; then
- echo "BUILD_DPH = YES" >> mk/build.mk
- else
- echo "BUILD_DPH = NO" >> mk/build.mk
- fi
-
- # Any non-native build has to skip as it needs
- # target haddock binary to be runnabine.
- if ! is_native; then
- # disable docs generation as it requires running stage2
- echo "HADDOCK_DOCS=NO" >> mk/build.mk
- echo "BUILD_SPHINX_HTML=NO" >> mk/build.mk
- echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
- fi
-
- if is_crosscompile; then
- # Install ghc-stage1 crosscompiler instead of
- # ghc-stage2 cross-built compiler.
- echo "Stage1Only=YES" >> mk/build.mk
- fi
-
- # allows overriding build flavours for libraries:
- # v - vanilla (static libs)
- # p - profiled
- # dyn - shared libraries
- # example: GHC_LIBRARY_WAYS="v dyn"
- if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
- echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
- fi
- echo "BUILD_PROF_LIBS = $(usex profile YES NO)" >> mk/build.mk
-
- # Get ghc from the unpacked binary .tbz2
- # except when bootstrapping we just pick ghc up off the path
- if ! use ghcbootstrap; then
- export PATH="${WORKDIR}/usr/bin:${PATH}"
- fi
-
- echo "INTEGER_LIBRARY = $(usex gmp integer-gmp integer-simple)" >> mk/build.mk
-
- # don't strip anything. Very useful when stage2 SIGSEGVs on you
- echo "STRIP_CMD = :" >> mk/build.mk
-
- local econf_args=()
-
- # GHC embeds toolchain it was built by and uses it later.
- # Don't allow things like ccache or versioned binary slip.
- # We use stable thing across gcc upgrades.
- # User can use EXTRA_ECONF=CC=... to override this default.
- econf_args+=(
- AR=${CTARGET}-ar
- CC=${CTARGET}-gcc
- # these should be inferred by GHC but ghc defaults
- # to using bundled tools on windows.
- Windres=${CTARGET}-windres
- DllWrap=${CTARGET}-dllwrap
- # we set the linker explicitly below
- --disable-ld-override
- )
- case ${CTARGET} in
- arm*)
- # ld.bfd-2.28 does not work for ghc. Force ld.gold
- # instead. This should be removed once gentoo gets
- # a fix for R_ARM_COPY bug: https://sourceware.org/PR16177
- econf_args+=(LD=${CTARGET}-ld.gold)
- ;;
- sparc*)
- # ld.gold-2.28 does not work for ghc. Force ld.bfd
- # instead. This should be removed once gentoo gets
- # a fix for missing --no-relax support bug:
- # https://sourceware.org/ml/binutils/2017-07/msg00183.html
- econf_args+=(LD=${CTARGET}-ld.bfd)
- ;;
- *)
- econf_args+=(LD=${CTARGET}-ld)
- esac
-
- if [[ ${CBUILD} != ${CHOST} ]]; then
- # GHC bug: ghc claims not to support cross-building.
- # It does, but does not distinct --host= value
- # for stage1 and stage2 compiler.
- econf_args+=(--host=${CBUILD})
- fi
-
- if use ghcmakebinary; then
- # When building booting libary we are trying to
- # bundle or restrict most of external depends
- # with unstable ABI:
- # - embed libffi (default GHC behaviour)
- # - disable ncurses support for ghci (via haskeline)
- # https://bugs.gentoo.org/557478
- # - disable ncurses support for ghc-pkg
- echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
- echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
- elif is_native; then
- # using ${GTARGET}'s libffi is not supported yet:
- # GHC embeds full path for ffi includes without /usr/${CTARGET} account.
- econf_args+=(--with-system-libffi)
- econf_args+=(--with-ffi-includes=$($(tc-getPKG_CONFIG) libffi --cflags-only-I | sed -e 's@^-I@@'))
- fi
-
- einfo "Final mk/build.mk:"
- cat mk/build.mk || die
-
- econf ${econf_args[@]} \
- --enable-bootstrap-with-devel-snapshot \
- $(use elfutils && echo --enable-dwarf-unwind) \
- $(use_enable numa)
-
- if [[ ${PV} == *9999* ]]; then
- GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
- GHC_P=${PN}-${GHC_PV}
- fi
- fi # ! use binary
-}
-
-src_compile() {
- if ! use binary; then
- # Stage1Only crosscompiler does not build stage2
- if ! is_crosscompile; then
- # 1. build/pax-mark compiler binary first
- emake ghc/stage2/build/tmp/ghc-stage2
- # 2. pax-mark (bug #516430)
- pax-mark -m ghc/stage2/build/tmp/ghc-stage2
- # 2. build/pax-mark haddock using ghc-stage2
- if is_native; then
- # non-native build does not build haddock
- # due to HADDOCK_DOCS=NO, but it could.
- emake utils/haddock/dist/build/tmp/haddock
- pax-mark -m utils/haddock/dist/build/tmp/haddock
- fi
- fi
- # 3. and then all the rest
- emake all
- fi # ! use binary
-}
-
-src_test() {
- # TODO: deal with:
- # - sandbox (pollutes environment)
- # - extra packages (to extend testsuite coverage)
- # bits are taken from 'validate'
- local make_test_target='test' # can be fulltest
- # not 'emake' as testsuite uses '$MAKE' without jobserver available
- make $make_test_target stage=2 THREADS=$(makeopts_jobs)
-}
-
-src_install() {
- if use binary; then
- use prefix && mkdir -p "${ED}"
- mv "${S}/usr" "${ED}"
- else
- [[ -f VERSION ]] || emake VERSION
-
- # -j1 due to a rare race in install script:
- # make --no-print-directory -f ghc.mk phase=final install
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 755 \
- # -d "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404/include"
- # /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c -m 644 utils/hsc2hs/template-hsc.h \
- # "/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404"
- # /usr/bin/install: cannot create regular file \
- # '/tmp/portage-tmpdir/portage/cross-armv7a-unknown-linux-gnueabi/ghc-9999/image/usr/lib64/armv7a-unknown-linux-gnueabi-ghc-8.3.20170404': No such file or directory
- emake -j1 install DESTDIR="${D}"
-
- # Skip for cross-targets as they all share target location:
- # /usr/share/doc/ghc-9999/
- if ! is_crosscompile; then
- dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
- fi
-
- # rename ghc-shipped files to avoid collision
- # of external packages. Motivating example:
- # user had installed:
- # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
- # dev-haskell/transformers-0.4.2.0
- # then user tried to update to
- # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
- # this will lead to single .conf file collision.
- local shipped_conf renamed_conf
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- for shipped_conf in "${package_confdir}"/*.conf; do
- # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
- renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
- mv "${shipped_conf}" "${renamed_conf}" || die
- done
-
- # remove link, but leave 'haddock-${GHC_P}'
- rm -f "${ED}"/usr/bin/$(cross)haddock
-
- if ! is_crosscompile; then
- newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
- newbashcomp utils/completion/ghc.bash ghc
- fi
- fi
-
- # path to the package.cache
- local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
- PKGCACHE="${package_confdir}"/package.cache
- # copy the package.conf.d, including timestamp, save it so we can help
- # users that have a broken package.conf.d
- cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
-
- # copy the package.conf, including timestamp, save it so we later can put it
- # back before uninstalling, or when upgrading.
- cp -p "${PKGCACHE}"{,.shipped} \
- || die "failed to copy package.conf.d/package.cache"
-
- if is_crosscompile; then
- # When we build a cross-compiler the layout is the following:
- # usr/lib/${CTARGET}-ghc-${VER}/ contains target libraries
- # but
- # usr/lib/${CTARGET}-ghc-${VER}/bin/ directory
- # containst host binaries (modulo bugs).
-
- # Portage's stripping mechanism does not skip stripping
- # foreign binaries. This frequently causes binaries to be
- # broken.
- #
- # Thus below we disable stripping of target libraries and allow
- # stripping hosts executables.
- dostrip -x "/usr/$(get_libdir)/$(cross)${GHC_P}"
- dostrip "/usr/$(get_libdir)/$(cross)${GHC_P}/bin"
- fi
-}
-
-pkg_preinst() {
- # have we got an earlier version of ghc installed?
- if has_version "<${CATEGORY}/${PF}"; then
- haskell_updater_warn="1"
- fi
-}
-
-pkg_postinst() {
- ghc-reregister
-
- # path to the package.cache
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
-
- # give the cache a new timestamp, it must be as recent as
- # the package.conf.d directory.
- touch "${PKGCACHE}"
-
- if [[ "${haskell_updater_warn}" == "1" ]]; then
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- ewarn "You have just upgraded from an older version of GHC."
- ewarn "You may have to run"
- ewarn " 'haskell-updater'"
- ewarn "to rebuild all ghc-based Haskell libraries."
- ewarn
- ewarn "\e[1;31m************************************************************************\e[0m"
- ewarn
- fi
-}
-
-pkg_prerm() {
- PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
- rm -rf "${PKGCACHE}"
-
- cp -p "${PKGCACHE}"{.shipped,}
-}
-
-pkg_postrm() {
- ghc-package_pkg_postrm
-}