Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ghc/files/, dev-lang/ghc/
Date: Wed, 28 Dec 2016 22:49:48
Message-Id: 1482964658.ce2c3248dff78e70172969b90055f439936be773.slyfox@gentoo
1 commit: ce2c3248dff78e70172969b90055f439936be773
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 28 22:20:50 2016 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 28 22:37:38 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce2c3248
7
8 dev-lang/ghc: drop old
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 dev-lang/ghc/Manifest | 26 -
13 dev-lang/ghc/files/ghc-7.0.4-darwin8.patch | 18 -
14 dev-lang/ghc/files/ghc-7.10.1-T10590-dequeue.patch | 89 ---
15 dev-lang/ghc/files/ghc-7.2.1-freebsd-CHOST.patch | 13 -
16 .../ghc-7.4-rc2-macos-prefix-respect-gcc.patch | 23 -
17 dev-lang/ghc/files/ghc-7.4.1-darwin-CHOST.patch | 18 -
18 ...ghc-7.4.1-ticket-7339-fix-unaligned-unreg.patch | 28 -
19 dev-lang/ghc/files/ghc-7.4.2-system-libffi.patch | 119 ---
20 .../ghc/files/ghc-7.5.20120505-system-libffi.patch | 88 ---
21 .../files/ghc-7.6.2-integer-simple-div-mod.patch | 57 --
22 .../ghc/files/ghc-7.6.3-trac-3333-weak-syms.patch | 387 ----------
23 dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch | 129 ----
24 dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch | 38 -
25 dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch | 69 --
26 dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch | 107 ---
27 dev-lang/ghc/files/ghc-7.8.3-unreg-lit.patch | 84 ---
28 dev-lang/ghc/files/terminfo-0.3.2.5-tinfo.patch | 25 -
29 dev-lang/ghc/ghc-7.10.2-r1.ebuild | 662 ----------------
30 dev-lang/ghc/ghc-7.10.2.ebuild | 652 ----------------
31 dev-lang/ghc/ghc-7.4.2.ebuild | 640 ----------------
32 dev-lang/ghc/ghc-7.6.3-r1.ebuild | 829 ---------------------
33 dev-lang/ghc/ghc-7.8.3.ebuild | 624 ----------------
34 dev-lang/ghc/metadata.xml | 1 -
35 23 files changed, 4726 deletions(-)
36
37 diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest
38 index a9b82dc..d15ace8 100644
39 --- a/dev-lang/ghc/Manifest
40 +++ b/dev-lang/ghc/Manifest
41 @@ -1,16 +1,7 @@
42 -DIST binary-0.7.5.0.tar.gz 45764 SHA256 4709c5aa7cc99cb4a465a68de1648968208d0c60c368e2fece476d977530ef19 SHA512 232e7c3da1c0055f3e9f211a86e81c76bc44ab1b70cabd23c93634dbaa42eed8bd9314fbedc16b9703d3ca92b0bbf232e6c30bb1384687dad0e6e85c9abb8947 WHIRLPOOL 1d8dcf9d5125ff398375f4024c0e43fa168004811db7824e2739ec5c0451b38dae9ad74f757c7708427deed0044580b182e35d1c7ecffec25f7b10c70bd32075
43 DIST binary-0.7.6.1.tar.gz 47086 SHA256 8f85cafc15be660757878a665d024ce595d4422fead174e20a501c9ec8f81067 SHA512 655daa93a52b845a85d440810452933d7bc3398ad1b51e1e955b2d19a0a32679325a0d1751ad50d252531e493528262e14dab32af4b9a515855fe7f64e0730b2 WHIRLPOOL 6853eb2c817e8ae792226c6c7764ce495833f965c3d503fe7e39c0502019d12f7bd46309b72dfdb276c7dbce8c004cb59fdea4936d69ede0a7c8b487acda2702
44 -DIST ghc-7.10.2-src.tar.bz2 12651156 SHA256 908a01ca86238318f4e880fda400ea399d0a0008d699c912b85d0e0f746e5689 SHA512 e3f99a9e848c12b728212da24bf9029ec8cde88cdfa7eeb4ee2ea223ad8bcaae3e7c27456d09d60a3d21efa8f907ccd2490caf5630ca5fe3ce87f04901275a66 WHIRLPOOL dee757e79de8ac6bcf127212703985282ce96d050be50e78c3f249f13dc0212c9fd96899502748ceb26b9fc3a804379a456e19a9bedfef72f6890992b00492da
45 DIST ghc-7.10.3-src.tar.bz2 13281867 SHA256 3e29a56a74ed6a74d3ee2a6db9389f2462837da46ca6dce9d2965f9c152f0c15 SHA512 97a8282d8a75399c78d85d6faab7ac253a993dc69f1840358572f1878b8fd1a527c28801e5823c8200b5690e268e4a0c00941945ada13790852c75a83b612c17 WHIRLPOOL 04af6ea2738a1cc9e266efbb0e1b41b70d4cd915b48ca1265fade62b1c56cd51056fd1a82fc14cebc19a0c16782609a991c1a181ebe59574f1a10b4f26ad830d
46 -DIST ghc-7.4.2-src.tar.bz2 25836446 SHA256 f2ee1289a33cc70539287129841acc7eaf16112bb60c59b5a6ee91887bfd836d SHA512 5a3d06a36702fa7e337b482c9de92ce1f84a68f18d8560bcc11f3617d6d46f93167fee27e786de6483a9ef0eab3b1ac6909a71dd53908d36156df4e465075050 WHIRLPOOL 61865eed2bf92728e7c4c4a0c48be44081bf728cfd824760d643e2fad838d96c19e173052d3aac073e0795b5efa3720ba5ddf13cca1ec7952b7524bbe1f204bc
47 -DIST ghc-7.6.3-src.tar.bz2 110763823 SHA256 bd43823d31f6b5d0b2ca7b74151a8f98336ab0800be85f45bb591c9c26aac998 SHA512 ac86f18b4feeb0bdc9e867261600b210caf62740d73ae657259bbe8149b8c2c4f5a73d09d74d944d4e50f85cc87503485365f0a0ae65befe8d2b6844e5e1253a WHIRLPOOL 0fe1f5f2987699067494559e6a679d28f027eee8fb2a00c683161dbce5443b1faeebfb51572209b75231cee24c7f0c929cabbc82a93f70e16d05e351fdfe2eaf
48 -DIST ghc-7.8.3-src.tar.xz 9160092 SHA256 b0cd96a549ba3b5e512847a4a8cd1a3174e4b2b75dadfc41c568fb812887b958 SHA512 2cc8c2aa6f18ba565c1e2aa637045e246f1214c2a77e95c2a97dfb97203b8983e4ad3cc13178b4b51aff70c58d59a1f68f94cd813d043745cb02411bad04bb00 WHIRLPOOL 3a2e8eea0db7a150e4732efed488a3a5eb56da00a9a90a3379afcb4090323925a2a7485fec6676e784139f112d7c825e8d18a576c34c760af4a7f3adb22c021a
49 DIST ghc-7.8.4-ia64-CLOSUREs-regenerated.patch.gz 13268 SHA256 3bdff22e654aee6f942d43edf1bf6cf70404c0152c4fcf89276f10d2c4c5b4b9 SHA512 a655713e06324b56f0041edf70837487e296d28e6f3ee35fe116b9938765aaf3469d25e92645e0940655ed3607dff27d3826fe0f995c84e81b51bfc956816e7d WHIRLPOOL d2cb53bdc6debc0278d554168ea3ab22b0fd8314adac81444637278a92d21b766280fedfb4b7d1b4540c7381c7962dec6b13a799ab2fee4d456fe2875d5c6a5b
50 DIST ghc-7.8.4-src.tar.bz2 10600755 SHA256 59e3bd514a1820cc1c03e1808282205c0b8518369acae12645ceaf839e6f114b SHA512 079a53891d8ebd8d9b88da96170e60981608a619f8282e4b7948f35244e99bd87277649ac7fcebc227a61a4d21960db8d5e5b9e92f2c69c82d8d68d7fd0a41d3 WHIRLPOOL a9be7641adbd237ed6e0f644c312e655e98be9566097aee5e2c0022e8756d5b2236e42dd86d76c638a001b5ca3f67307e89ec0cd003a92cd112a5d6d3e3d8467
51 -DIST ghc-bin-7.10.2-amd64.tbz2 112028560 SHA256 536297ac402da44ec1aafb1a937960883d12d192db16715ca34ab6469773a4c7 SHA512 207d8032c99d52bf4215ddeea2dbcd5816bb8d4caf2c3c31190e3ca92b49667d98a4f97aaf4cd6b40090f150854d520f75b5420dfe1ade7f036cf35d3dcb5100 WHIRLPOOL 8e43956a61c2c0fead242e3b179cde4918c04f3db7dbb27cc986f00f981261d98028ead82548b87d183d8da928635d5db4aa62ff1161f4077e5370483530a316
52 -DIST ghc-bin-7.10.2-r1-amd64-noncurses.tbz2 111863814 SHA256 782a68a13343ac8d6ed97540b411f714c4e826ccc3d152724198548c9240aceb SHA512 b154dbd7fb4fefc4283ec337b0c6ce6b6b6b3a62e9d889ca9c5dd5b5e5987f811a1c87845239ca94941afea630fc8bf1d8db94eb11a4023abd4b1d772dfb17c1 WHIRLPOOL 1e1f1ec82c831d115cd5f0b27f1914da94d92a9eca9af634210eb5f72b54281de6e08ea8e304bebaec8a456659b40866b9f0e24ef0e72c3f5a63d85296eb172a
53 -DIST ghc-bin-7.10.2-r1-x86-noncurses.tbz2 113572461 SHA256 3ad1e2888d26b6858cd1efe0e9863bc325b97c47be19fdd2e8dd5bbc86f7266b SHA512 573b7228b576a47ca1c3796cc2d4180a6c9dcaff58555cf52fc85a9b487920fc19487ff9ee8e0b6c33d6196ba05b9908f0d984bf3a4c0d91f52667e7389580a5 WHIRLPOOL 2c8cda95d04e9f345aa2f20fe8758761dd35648b788b7bf9b8f571687a8aae92456552883684d83ec2d2acaf22a002121643316df3c82349400c7de3d0300f7d
54 -DIST ghc-bin-7.10.2-x86.tbz2 113900477 SHA256 eefb7a3002e3dcdd6d936b2b2826eadf3cd100352babad4c9a355b944064240a SHA512 61dae4b9c80bfef6b1e0550c77b70f25d11f4a9fbe3b57d6c4ad451b4b584884432405d39dc32b9f85f3a5ad9d02657356ae0ebd99518848f3d330314c74b595 WHIRLPOOL da0d7eb62d2ee2aeb80a3f495da2ff123e29151b7517fbcd212f83ab3722638f10019511f4f237e8e001c68dd957ed2817fb0f1a2b42c2710239343f1d801496
55 DIST ghc-bin-7.10.3-alpha.tbz2 183558856 SHA256 780ac45b9b38fb40f08eeb7dae741649ac19dce2271df4bc764cac9be6c5c225 SHA512 08709fe9b4036ab41715c9a637a2a160104e3ab9e0ed9efaaf73428e3cfe19619e50c42b72c60bbbd27be2b9c2ea68f63d72c1a27d4519756e7c0d909f724230 WHIRLPOOL f488ecc945c6100ba86b9ae25eb6a472693556be0205a6c8634f2c235e779fe17b391ced7fec5d89c0c6c3d21583fe9f9b80bf628f3307890becf3f3ffb57a96
56 DIST ghc-bin-7.10.3-amd64.tbz2 112040431 SHA256 c3c71aff288f7de2785d1c3d54f0fd636144eb3dcb590bdda087b0775203e517 SHA512 e1554b3944edbe8e16537de5a29132dc6a22d780d9a700cdc9b76387b94191164398d6f2242bf8199527802572e2bb02545569d4f0930a0ee0dbfdeb25978558 WHIRLPOOL c2497a9565abf7d37e7928f508f7bf7241dd529aa252da708517f9f067e3d016341b7a73cac34888b99c9b84a8d01fd9e8d76f2b332d53e0d708b078f20ee807
57 DIST ghc-bin-7.10.3-ia64.tbz2 238680956 SHA256 0da9b5966f0920341f4cf041b814817e1ed06060e8a491481ab19a68153767db SHA512 3694011aec8a6dc37889418b318993cb82f9b46a5175dd837713f396c8f59a19a920e0b0669fe3b4ec37d5bd8837c115264c0a8fc97c5a4ce06a3bdd52fcfce5 WHIRLPOOL 9e059a953607b6477ea7c27bf55175d838c6aa3c57fcf92f13fa6112e9e728037073047be300a5a757395d759d30545546cb46816ec879a2d31c3c0a78868e42
58 @@ -18,22 +9,6 @@ DIST ghc-bin-7.10.3-ppc.tbz2 125832171 SHA256 67817636f5b91e04ecf94972c0bfe8e4e9
59 DIST ghc-bin-7.10.3-ppc64.tbz2 142469712 SHA256 c8fa2ea861d4c5373f7f67fd3a29db4e48593d669c8616c2f349592af7e4846f SHA512 eb59d3abc8b10010311d59df9473c5ea649eb0dd7f9ad41a1929a540a0ef8c20abaccd68254f8abab037fb1fc94d824f474e18e4316b8f2a7a954d0645a2a2a4 WHIRLPOOL 14ccfbcf818a80f1daf39b44dc7562304af925e548407ce0deecd2d4593f4e138da38cfe63d4e5b8b0303c0237c678c27eaac4331288ee9b9dcbcf8be7390f74
60 DIST ghc-bin-7.10.3-sparc.tbz2 163105069 SHA256 b9ef4179d87f4a56e9a786b28b0674f817118c73784b0dce283affadab296875 SHA512 d467a42487378d7dee311eb33aa1c151f5c16a6e7a4ab5bd8177df229f474adf19da3e1ca1064943a40abafcab6852b0589dd34413da82b33a03ede1ac17bf5d WHIRLPOOL 26ecb662f1d0eae524388008c24b3d25f954668aba781e997afd934c10b379b32e3376bc3a1232b066de84d3e1d1ad838dcef667b0f7606d0ac52acd7ef78a72
61 DIST ghc-bin-7.10.3-x86.tbz2 113877175 SHA256 a06d54e7256292123b49c4d429761794b53d2440d2efeb98bcfe79920c65b044 SHA512 75096fe9106d975c15e646b0a559c544621fd02791f491bce54926efabf0e55b97150069ddfa7a9f02cc30bb6975d3d3121a82207a9f67b8dda5ebfe17ec4744 WHIRLPOOL 63fea83be14ae317f313251b7c952c974a8e4f9671d78d1b3ef77c3ab317d2194faddc8d71431c5e1fc42215abed1842913f2f40ba383288784e984c47cd27f0
62 -DIST ghc-bin-7.4.2-alpha.tbz2 130483507 SHA256 cd8e72e569574f137bf10fcdb4337bb0dc320deb2a2c4d72529a821735c53ae6 SHA512 6fb99dea706965afa60f4aeb68da3da1c69dda477f5fcfb4e67b73d75b78583193148ce9f623a356679a57f1a740f8010f28a22f08e56ace50f3fcd42142f83f WHIRLPOOL e5ec69ab24dc963ac709f13928c0e35931d5d50ca6b21dfb0aa79f9088c0ce1196b64bb4d9668e35d73dcdf9e2df9c3da59c95eaf3db8b793a6bb65b1f4ba6c0
63 -DIST ghc-bin-7.4.2-amd64-stable-glibc.tbz2 93139900 SHA256 f06dff00585cc1a8ecc8ac29aeca7fdc601d272eed29d7613f7a2f2924cad585 SHA512 9b725f2613dd9013851a16eaea4000ea424c51cbafa97d3860f120fdb9936247f8c65208775a80a2f49b74946ddda2e843a54dec00b78c521197374aa3dd2d50 WHIRLPOOL 9e2630b1de40a059c324be38a1fe68b16ea484bc7afc2a397ea05192263d1964aed1d29fde543622ceab12ed2df111204576fdc72b7e35b2bbf9c6b9519901d1
64 -DIST ghc-bin-7.4.2-ia64.tbz2 155787636 SHA256 a1d89221645832cc5d11cde4937cce75d564e6a79eba334b92a4c465eb3f161f SHA512 c7138ed8eaf40ee7e7559b6063096351b64fc35cbd1adb4c734b2f2c6b77fb98368b1296fcb67c1a0b21b0faf053a82f8f98c3656b89c593e677ce78165d0c74 WHIRLPOOL 7ff2db2932a6d56961dcca386c9ec8f8eb1ee12e1b84230fbb089ff137eeb216117eecaa37b33b4c037ebee0063a07cd380077b754e64ef0219759b54a4f7fe2
65 -DIST ghc-bin-7.4.2-ppc.tbz2 89396808 SHA256 ebf6083a1f3256a978a9408cffa2562e837b641136e5d6ad41a8ab5c2f50e804 SHA512 d7abd4a2612f26b6937dd20c11d2081b2c846178347a8e09f4ef5d8b1ef2ad3eabb9d5429fd0c214f6c5bd53eb194ccf199745904d6b861650c9eef681a48bc1 WHIRLPOOL e2f8a4c8e3209432a744fd8587be39591d7b4fb026dca36755933f49e6f650e1b34e6087d9260aee65206a700f9d70e2fb6cbe42d29645b52f060729845a347e
66 -DIST ghc-bin-7.4.2-ppc64.tbz2 105431655 SHA256 d0aecf47749a9862085aec6403f25197465d99a02a3c721dffd5314bf81d74eb SHA512 f220fb91b1856da37f72166fe050d4908049845eec03626d09c5b6e88701b0002835c3343c3584baf9f9d9efb5c7cbc210eb64c6eb711a58764d0fea92e8ac9f WHIRLPOOL e27022a72c254fd189995fd1b39629d5328927b83237ae4e61e97ab5efb5c451c92fe77f944c724bf9d14130d5a6cd2e0896a7cd6052de1ef7091531aa39fa0f
67 -DIST ghc-bin-7.4.2-sparc.tbz2 121224130 SHA256 e5eaf1f31ddc4790e0226f0075236af340ec9674d98701452d5c51455ca1cb52 SHA512 a3647d82bbb36fe0ca55185ebc9479a264e785eb5a8a33be6c37b8a6cbcf8c55373374801c685eef004de78db5aa1c96760b2bedb2ca0ac9097d39fe286984e9 WHIRLPOOL d2d5f8c5abb001fb5425e68d3d26d941569b832c373e40b5a96aaa11f589db9e2b72eb1cbcf8df7b8d4473e2cc1c61498b284d8b006cc20822c3a203fd0fe2cd
68 -DIST ghc-bin-7.4.2-x86-stable-glibc.tbz2 92394017 SHA256 2c42257a60aec03ae622c1a600cd210a6094f26ac310fbd307006e7f2260e2a4 SHA512 9e8ef72d2aeb5681e6bb71e2eb875587ddd51089cfc3443c33c69f93274a29e5680de4bf4884af05cd84f0e9cea13d66d20f1e89994460137910cbc987b64359 WHIRLPOOL 5722824af91f1191e6a38a8eb4696e765468e3bf54ad411b1d387ae4bcc7cd4cb772bdf2054d7013a3cff41feaaf5607f051b3c0d9f609ca19f1a1f92dd02586
69 -DIST ghc-bin-7.6.3-amd64.tbz2 94441516 SHA256 3ef747e96a40c9d5021e88b8afee0a97838c27b00619d9187783d95279c31779 SHA512 89f6c693d83d6309a0e44fcc68e30279c858adb0a0ea9317dd168b2e632c22a8507da78ed953523f5d7156db98e06c6df56d6edc19c0c50b3941ea578263dc64 WHIRLPOOL 891dfbfc9d88fa579b6a837651f7cc6d9aecef8b8752ec7bcebbdfef2a6d8929d0edaceff27ec61d6160d36d1b0e8406b7829a04a858ed64210b5c57b9c98940
70 -DIST ghc-bin-7.6.3-r1-alpha.tbz2 123486983 SHA256 fb6828d9dff7b90563cc7b3277ed38801907930aebd6042a7e5ba61e5f50db73 SHA512 7821bdf7490283dc062be090d224138dd34641e014cc6742edaa51dcc9cb1de9724d575955b596c9273b878dfe79023daf172b132b124f67567132649cf9a30d WHIRLPOOL 4e51a7e7f54fcb4aeb7a4ade4140533413348f9aacf04f683fe7cc5e20843dc6a95bdd6d79a995e5e1085747be9e584df6ada61430662f06eb600abae0c7eabd
71 -DIST ghc-bin-7.6.3-r1-ia64.tbz2 154480728 SHA256 9a176312f796a189c0354deab9a7c446db274f75f40554963c2f86597a5951fb SHA512 2aa945cebcd3d0c26af5ddb53cf2002ec6d263d071173495905dd52898bd2ab6605370b0025554c1f6afbd28e276abc708708e4add9a9b8cb08b4bb39f8f50a1 WHIRLPOOL 6371531141e707618577e924c01102481a12d91e2c85e24694ba64f9b2545869c248999138146f63ca379a4243ccd0dfa322ea01a23d222b9757584787c5a899
72 -DIST ghc-bin-7.6.3-r1-ppc.tbz2 91800558 SHA256 c9b2262957585c9f02136014aa05423e1b7674c8eb0731a6d991e400e053e33a SHA512 2a101a30a4324780f1a614e044ba614f9094cd57d026c56f2b3ba514ae049c26ce8e4acbc89e93229da451b6fbe05ba0980b500cdd785bb2bce968a60434403a WHIRLPOOL 3a3b7e1eb945be01ab195880c7709514d2d11d25bab12fc15c2257207da48a37e6d6d7699c9ed5c1cc32d01057240a4d795e43cdf9d9d2748a1d94b93fb283ed
73 -DIST ghc-bin-7.6.3-r1-ppc64.tbz2 121213680 SHA256 7d820988a762dc56ec471c9fcb5510f2e0bb47560181aa7dea8a934e73952477 SHA512 17fb269a2eae326db927b8734cd8326061b059ecd50a377c51c37cd657380be1ae61964df299009259de6e4e00aa71a525a9224f8fa607d6cc7994c221848358 WHIRLPOOL 76e9664a535e6be54c5288be683959ab6aadafb04d03c5d2f08f8ee663868b3ed390e2a0c8e6d233a532af694709e03dc0f78d16dfe51b87e201655219da4704
74 -DIST ghc-bin-7.6.3-r1-sparc.tbz2 121641337 SHA256 0fb31b9584c1c6caafb44a51158bfd3d85c28d2313f8201855f58c019a1692c0 SHA512 d71efc47769efb091f93cb288b54a1fadfd4184053149b1cd7c219a0c9c95ed97c32b101c712e20643fea12546357b70a11f2852bebeac2141e961a3e4bf8764 WHIRLPOOL 37d320e01d8e43ecba6e90f8d0a9c440d30ea31ff79d9094a8205d9ce892570f81b8641080034215fdddf71131de1acc364e2a485383af8346190c36201c1e91
75 -DIST ghc-bin-7.6.3-x86.tbz2 93718672 SHA256 a55024f66a048437fcd6ef0f33cdb994a43628998a2f0fe4d094cc9ba83d1615 SHA512 624f2a3238dee15853018d45632d1363e42d34099a77e5e9ce5c8da976cb4c33578144f7c39dbf25ee68c17d8d42910db2347186849eeeda6bc20053ce2be990 WHIRLPOOL bc646fc19906b59416358fb7558b6e2c3f7ad069c2fcf443be36b621894cfcecb0844acf5b5f9c383e034dfff3e24d312a7da0d7a629836134ec5dc1ecd6f139
76 -DIST ghc-bin-7.8.3-amd64.tbz2 100786052 SHA256 af49f547336a4f9f13cd625155d5a6a998e52ae7da8bbbddc856f88b00b6aff4 SHA512 b1826095b67fa2028678057f70909bff4e082b82f3b70f1aedbc91073efad54334fa1864bc8248c9249eec6edab3671dc38ac1650be86f1245e2fecf92528952 WHIRLPOOL 5b44fff77a0d79c6f7c5c8ca792eb6b36987d1de58d5ebc0a9b05da9c19a2c312eca6b9d40e7e63437742b7f9c28c925feb3bea7f9803dda95fac7acaa7a3132
77 -DIST ghc-bin-7.8.3-x86.tbz2 102583755 SHA256 c67f0d2471e594b4fdfc5b219bb6b61e57e6ba75132aa3f63d171550af8cbe3c SHA512 badabbba2f46b5ab3a2601e53997ce6533162afeec7dc36eeb877a62680a9f599aeb05dd3682f45d3e273d71d28b8bd01eee37dcad3c7354e8f83b7be4e58536 WHIRLPOOL 7b99b6bbeb4ad6d203f270d8446285825ad0857a8ab058d8c126155b49e8819e0efc2f6c42b5ff775dc0ece5488e97fcc7ae2459fe87fdceef43d63a75443430
78 DIST ghc-bin-7.8.4-alpha.tbz2 210691009 SHA256 23c9e5ef97b444fa87d3b9509a7b2b7b68c526ca4139739dd60c08fb1279d48a SHA512 f08230de82f0c4112da9d0b48227ca74d5d0b4a84046d746b023557b7aeeb9678f5ac037fe89a863178df4b9036e5c5c63182d14dfbb42c772011de883e3966f WHIRLPOOL d624b4d5eac8aa68f389b81e68d7fa2ea960c9b9c5fabb27ddf4da5140c18fd0ee9080725fb645e2c532bb0a01ade32da2cf6aac08707f9d89a94ea9752b8e72
79 DIST ghc-bin-7.8.4-amd64.tbz2 100573133 SHA256 bd9d144c08caa0ff345ada8d7eed7592531b8f8b9ef2f94d0b9a42fd747440aa SHA512 e4416d6dae3c644f74bafb3aecf1a123f985427aba32d0e0c43143a137d64a9220fc5947cd9bde8a3bc44555ae71184fc06a3f7df7976aadd065ad5681b90954 WHIRLPOOL ab0bd6219d68e08cb473cf2f3f15538d65940f28e84f026361032c3a6bc09f7820faf67629e915f27c2afda7de41fa9c6010a1b5cd487df0936d968c7e58a3a4
80 DIST ghc-bin-7.8.4-ia64.tbz2 222789275 SHA256 8bbbc11ba64d08bad691593afafc4c6a7cf078b10cf33cb8508bf0a0b3ccf523 SHA512 2d8b89e399cbe9bfeae29cf3ceea736bfaa65ea21483fa2ee95d9814e122fcfbb67ce22ad8175493fab088e9a9d0139610c67e9d5c8b4f797b5e14846df32b6e WHIRLPOOL 181d48bbb53d181c8febf63ddae620bec1a6c212a5b5bf938228689df2ff45ba68d7d4a99ebb1b68aa516d5633be41125321e3f8fdef6e5f0cd1e4a7f9b8774c
81 @@ -41,6 +16,5 @@ DIST ghc-bin-7.8.4-ppc.tbz2 112803496 SHA256 a47e0fb17137878af1e7b5a166046bee20d
82 DIST ghc-bin-7.8.4-ppc64.tbz2 129284515 SHA256 1e8a350af39d1db1e58a74c9bc4a4c57765eceb33e5b32751fb31340b9ff02ff SHA512 53974e15c26cf6b62d8f838607abd209ec57cf0f45fcc48b90ad62736f5e4e7ff263dcd326ae03d8d5557a22eb9730e5eb8ae4eda55e52dd3d973bc73c84935e WHIRLPOOL adaaa92323d319f6576423ac41678f7d263f36e0e30d89fc14ee89104b006772c26d7b408be7f85225d1bddaf5f15ebdcbb7136f5c8bf7bda4bb0938eefbe6c2
83 DIST ghc-bin-7.8.4-sparc.tbz2 147340595 SHA256 1cde749ce3c47016c5c7a7179423d0aa2b174ddae4af0392ae3b7f57b098ec0c SHA512 ee5f0b2f1cf2693a0f2be9df71ef61b52bc2327225d40b8be955c1584b9901ffc6aaab63c1e46bf9bb352633b605c98378f8fd3e6cd71aef1c089007e4110217 WHIRLPOOL 27d55a016ffb49852553f920c29929c3bdf383e28b4b806ceb9ffc8b46a59b438801101402e498b069aa6eb56870b70a00ba7b1f4098f3fd8d8ddf1b20caa626
84 DIST ghc-bin-7.8.4-x86.tbz2 102312459 SHA256 4c53148836e5a1ba55b8db5bb7c3eb915103e0955fb503b2facdc5a72f12a974 SHA512 cabc5bd6d8760ce4120e7053f6c1dffca7d161ba454b6201087760096c037c932e3ff8c82e53346c8278855bf0cff1c2f5fb8046242ca4d8307355b060a9556e WHIRLPOOL 0171d67dc1b63381a491e1577a783eb0e8f53cb579ba96a9b4fdf6685d494d78eb2be780f77ff33422d3b7c320ed102d9b48f6e954f8fee5532982575001a4a5
85 -DIST hoopl-3.10.1.0.tar.gz 241582 SHA256 7af615dfd4051670dccf31e5a7e1e71a9ae5f301e6a0668557fd84f61f6bc2d4 SHA512 943fe7034c89f4f914617cf1bccf7f66c3e660328fbbd9ae40f78a3f78a4a5b6fdd86c2afd40c11d4c4c4a34bc8fd47ab7e6227cdf9f3f4887b5cc796720e7aa WHIRLPOOL 3a410081f70c4ebbb563a48d71ec6f1e226a13b965ea12d01ca521b32041308394c7da6d3b3e36e75d1322c188b81fc08f4b2bf6037df5d8ac4998a944326be2
86 DIST hoopl-3.10.2.0.tar.gz 241940 SHA256 6740814c774e51815e8260ae1b4ac8af6ab69f02e112904450f689c4792f1121 SHA512 083baa8a5eb53247aff8d5b9b2144e0f63adb9400934297bbd80bfcec607dd90a34def4301045a60472ef10b0fb90ab84692fc08f786e7f806c28afdab1ef66a WHIRLPOOL 761e7440d2bc32b594ab55ea967c5b075bb638b2fdba6606beaf9c31a90e20031e914146828004b3d11203668210a6994be9fabc3b0ebb428d516b57cae9ee68
87 DIST transformers-0.4.3.0.tar.gz 28632 SHA256 b3d0a797e815ca50d411e20c02f781efe7751308007d880af7f0b5c4365c3a9d SHA512 c3ec0893ebba4fbd6087c3202e919552c4a9bff3350b5c0589e7ebb18751a515d98b8cac15b0a3252906ea72b5a0eb09b7fe88c8da88b09d6ce4fbf0f50b2780 WHIRLPOOL 89591781926b1d025056dedcfc5de61705056c1e3a8eba72f2e89789e78d2ed4d8909f84d6560dfc66bc0b360f98cb3dc3835f3a05c2325f747498373c88aa4b
88
89 diff --git a/dev-lang/ghc/files/ghc-7.0.4-darwin8.patch b/dev-lang/ghc/files/ghc-7.0.4-darwin8.patch
90 deleted file mode 100644
91 index bfbee41..00000000
92 --- a/dev-lang/ghc/files/ghc-7.0.4-darwin8.patch
93 +++ /dev/null
94 @@ -1,18 +0,0 @@
95 -Workaround headers problem in Darwin 8 as well.
96 -
97 ---- rts/PosixSource.h
98 -+++ rts/PosixSource.h
99 -@@ -11,6 +11,13 @@
100 -
101 - #include <ghcplatform.h>
102 -
103 -+#if defined(darwin_HOST_OS)
104 -+/* unfortunately the hack below only works for Darwin 9 and
105 -+ * above, so as hack include sys/types early (before setting
106 -+ * _POSIX_C_SOURCE) (this obviously obsoletes the hack below) */
107 -+#include <sys/types.h>
108 -+#endif
109 -+
110 - #if defined(freebsd_HOST_OS)
111 - #define _POSIX_C_SOURCE 200112L
112 - #define _XOPEN_SOURCE 600
113
114 diff --git a/dev-lang/ghc/files/ghc-7.10.1-T10590-dequeue.patch b/dev-lang/ghc/files/ghc-7.10.1-T10590-dequeue.patch
115 deleted file mode 100644
116 index be0f7a0..00000000
117 --- a/dev-lang/ghc/files/ghc-7.10.1-T10590-dequeue.patch
118 +++ /dev/null
119 @@ -1,89 +0,0 @@
120 -diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c
121 -index 3b206ff..08c031c 100644
122 ---- a/rts/RaiseAsync.c
123 -+++ b/rts/RaiseAsync.c
124 -@@ -56,7 +56,8 @@ static void throwToSendMsg (Capability *cap USED_IF_THREADS,
125 -
126 - static void
127 - throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception,
128 -- rtsBool stop_at_atomically, StgUpdateFrame *stop_here)
129 -+ rtsBool stop_at_atomically, StgUpdateFrame *stop_here,
130 -+ rtsBool dequeue)
131 - {
132 - // Thread already dead?
133 - if (tso->what_next == ThreadComplete || tso->what_next == ThreadKilled) {
134 -@@ -64,7 +65,9 @@ throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception,
135 - }
136 -
137 - // Remove it from any blocking queues
138 -- removeFromQueues(cap,tso);
139 -+ if (dequeue) {
140 -+ removeFromQueues(cap,tso);
141 -+ }
142 -
143 - raiseAsync(cap, tso, exception, stop_at_atomically, stop_here);
144 - }
145 -@@ -72,20 +75,26 @@ throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception,
146 - void
147 - throwToSingleThreaded (Capability *cap, StgTSO *tso, StgClosure *exception)
148 - {
149 -- throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL);
150 -+ throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL, rtsTrue);
151 -+}
152 -+
153 -+void
154 -+throwToSingleThreadedNoDequeue (Capability *cap, StgTSO *tso, StgClosure *exception)
155 -+{
156 -+ throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL, rtsFalse);
157 - }
158 -
159 - void
160 - throwToSingleThreaded_ (Capability *cap, StgTSO *tso, StgClosure *exception,
161 - rtsBool stop_at_atomically)
162 - {
163 -- throwToSingleThreaded__ (cap, tso, exception, stop_at_atomically, NULL);
164 -+ throwToSingleThreaded__ (cap, tso, exception, stop_at_atomically, NULL, rtsTrue);
165 - }
166 -
167 - void // cannot return a different TSO
168 - suspendComputation (Capability *cap, StgTSO *tso, StgUpdateFrame *stop_here)
169 - {
170 -- throwToSingleThreaded__ (cap, tso, NULL, rtsFalse, stop_here);
171 -+ throwToSingleThreaded__ (cap, tso, NULL, rtsFalse, stop_here, rtsTrue);
172 - }
173 -
174 - /* -----------------------------------------------------------------------------
175 -diff --git a/rts/RaiseAsync.h b/rts/RaiseAsync.h
176 -index 6bfed8d..2e8a7a3 100644
177 ---- a/rts/RaiseAsync.h
178 -+++ b/rts/RaiseAsync.h
179 -@@ -23,6 +23,10 @@ void throwToSingleThreaded (Capability *cap,
180 - StgTSO *tso,
181 - StgClosure *exception);
182 -
183 -+void throwToSingleThreadedNoDequeue (Capability *cap,
184 -+ StgTSO *tso,
185 -+ StgClosure *exception);
186 -+
187 - void throwToSingleThreaded_ (Capability *cap,
188 - StgTSO *tso,
189 - StgClosure *exception,
190 -diff --git a/rts/posix/Select.c b/rts/posix/Select.c
191 -index 4b19235..6889499 100644
192 ---- a/rts/posix/Select.c
193 -+++ b/rts/posix/Select.c
194 -@@ -412,8 +412,12 @@ awaitEvent(rtsBool wait)
195 - IF_DEBUG(scheduler,
196 - debugBelch("Killing blocked thread %lu on bad fd=%i\n",
197 - (unsigned long)tso->id, fd));
198 -- throwToSingleThreaded(&MainCapability, tso,
199 -- (StgClosure *)blockedOnBadFD_closure);
200 -+ /*
201 -+ * We can't use throwToSingleThreaded() here
202 -+ * as 'RTS_FD_IS_READY' breaks blocked_queue_hd list
203 -+ */
204 -+ throwToSingleThreadedNoDequeue(&MainCapability, tso,
205 -+ (StgClosure *)blockedOnBadFD_closure);
206 - break;
207 - case RTS_FD_IS_READY:
208 - IF_DEBUG(scheduler,
209
210 diff --git a/dev-lang/ghc/files/ghc-7.2.1-freebsd-CHOST.patch b/dev-lang/ghc/files/ghc-7.2.1-freebsd-CHOST.patch
211 deleted file mode 100644
212 index da59cd7..00000000
213 --- a/dev-lang/ghc/files/ghc-7.2.1-freebsd-CHOST.patch
214 +++ /dev/null
215 @@ -1,13 +0,0 @@
216 -diff --git a/aclocal.m4 b/aclocal.m4
217 -index 11bb003..52df243 100644
218 ---- a/aclocal.m4
219 -+++ b/aclocal.m4
220 -@@ -1545,7 +1545,7 @@ case "$1" in
221 - freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
222 - $2="$1"
223 - ;;
224 -- freebsd8) # like i686-gentoo-freebsd8
225 -+ freebsd*) # like i686-gentoo-freebsd8 or i686-gentoo-freebsd8.2
226 - $2="freebsd"
227 - ;;
228 - darwin*)
229
230 diff --git a/dev-lang/ghc/files/ghc-7.4-rc2-macos-prefix-respect-gcc.patch b/dev-lang/ghc/files/ghc-7.4-rc2-macos-prefix-respect-gcc.patch
231 deleted file mode 100644
232 index 770fd65..00000000
233 --- a/dev-lang/ghc/files/ghc-7.4-rc2-macos-prefix-respect-gcc.patch
234 +++ /dev/null
235 @@ -1,23 +0,0 @@
236 -diff --git a/aclocal.m4 b/aclocal.m4
237 -index a377cb9..4f8fd69 100644
238 ---- a/aclocal.m4
239 -+++ b/aclocal.m4
240 -@@ -1950,17 +1950,7 @@ AC_DEFUN([XCODE_VERSION],[
241 - # --------------------------------
242 - # Finds where gcc is
243 - AC_DEFUN([FIND_GCC],[
244 -- if test "$TargetOS_CPP" = "darwin" &&
245 -- test "$XCodeVersion1" -eq 4 &&
246 -- test "$XCodeVersion2" -lt 2
247 -- then
248 -- # In Xcode 4.1, 'gcc-4.2' is the gcc legacy backend (rather
249 -- # than the LLVM backend). We prefer the legacy gcc, but in
250 -- # Xcode 4.2 'gcc-4.2' was removed.
251 -- FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc-4.2])
252 -- else
253 -- FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc])
254 -- fi
255 -+ FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc])
256 - export CC
257 - WhatGccIsCalled="$CC"
258 - AC_SUBST(WhatGccIsCalled)
259
260 diff --git a/dev-lang/ghc/files/ghc-7.4.1-darwin-CHOST.patch b/dev-lang/ghc/files/ghc-7.4.1-darwin-CHOST.patch
261 deleted file mode 100644
262 index 3481588..00000000
263 --- a/dev-lang/ghc/files/ghc-7.4.1-darwin-CHOST.patch
264 +++ /dev/null
265 @@ -1,18 +0,0 @@
266 -like the other CHOST patches, but this one catches another case where
267 -$host is used (instead of the cannonicalised variables)
268 -
269 ---- aclocal.m4
270 -+++ aclocal.m4
271 -@@ -93,10 +93,10 @@
272 - exeext='.exe'
273 - soext='.dll'
274 - ;;
275 -- i386-apple-darwin|powerpc-apple-darwin)
276 -+ i386-apple-darwin*|powerpc-apple-darwin*)
277 - soext='.dylib'
278 - ;;
279 -- x86_64-apple-darwin)
280 -+ x86_64-apple-darwin*)
281 - soext='.dylib'
282 - ;;
283 - esac
284
285 diff --git a/dev-lang/ghc/files/ghc-7.4.1-ticket-7339-fix-unaligned-unreg.patch b/dev-lang/ghc/files/ghc-7.4.1-ticket-7339-fix-unaligned-unreg.patch
286 deleted file mode 100644
287 index f2f19f1..00000000
288 --- a/dev-lang/ghc/files/ghc-7.4.1-ticket-7339-fix-unaligned-unreg.patch
289 +++ /dev/null
290 @@ -1,28 +0,0 @@
291 -From 26f8466507bd9383e0a7d1e62e397eca4a13822a Mon Sep 17 00:00:00 2001
292 -From: Sergei Trofimovich <slyfox@g.o>
293 -Date: Tue, 13 Nov 2012 01:39:14 +0300
294 -Subject: [PATCH] Fix unaligned access on alpha and friends (ticket #7339)
295 -
296 -Assume unknown arch (alpha and mips) an alignment sensitive target.
297 -Otherwise on alpha it causes ghc-7.4.1 to generate invalud lexers.
298 -
299 -Signed-off-by: Sergei Trofimovich <slyfox@g.o>
300 ----
301 - compiler/cmm/PprC.hs | 1 +
302 - 1 file changed, 1 insertion(+)
303 -
304 -diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
305 -index 21826f8..8cdcde6 100644
306 ---- a/compiler/cmm/PprC.hs
307 -+++ b/compiler/cmm/PprC.hs
308 -@@ -963,6 +963,7 @@ cLoad platform expr rep
309 - | otherwise
310 - = char '*' <> parens (cCast platform (machRepPtrCType rep) expr)
311 - where -- On these platforms, unaligned loads are known to cause problems
312 -+ bewareLoadStoreAlignment ArchUnknown = True -- like alpha or mips
313 - bewareLoadStoreAlignment (ArchARM {}) = True
314 - bewareLoadStoreAlignment _ = False
315 -
316 ---
317 -1.8.0
318 -
319
320 diff --git a/dev-lang/ghc/files/ghc-7.4.2-system-libffi.patch b/dev-lang/ghc/files/ghc-7.4.2-system-libffi.patch
321 deleted file mode 100644
322 index 73c4aa2..00000000
323 --- a/dev-lang/ghc/files/ghc-7.4.2-system-libffi.patch
324 +++ /dev/null
325 @@ -1,119 +0,0 @@
326 -Make ghc use the libffi installed on the system instead of the bundled one.
327 -
328 -This patch is based on the one used by Debian and Fedora, but was
329 -augmented by additional lines to identify the libffi include directory
330 -using pkg-config, as libffi on Gentoo installs into a subdirectory of
331 -the system include directory.
332 -
333 -2012-04-24 Martin von Gagern
334 -
335 -References:
336 -https://bugs.gentoo.org/411925
337 -http://hackage.haskell.org/trac/ghc/ticket/5743
338 -
339 -Index: ghc-7.4.1/ghc.mk
340 -===================================================================
341 ---- ghc-7.4.1.orig/ghc.mk
342 -+++ ghc-7.4.1/ghc.mk
343 -@@ -579,7 +579,6 @@ BUILD_DIRS += \
344 - driver/ghci \
345 - driver/ghc \
346 - driver/haddock \
347 -- libffi \
348 - includes \
349 - rts
350 -
351 -Index: ghc-7.4.1/rts/ghc.mk
352 -===================================================================
353 ---- ghc-7.4.1.orig/rts/ghc.mk
354 -+++ ghc-7.4.1/rts/ghc.mk
355 -@@ -86,8 +86,7 @@
356 - ALL_RTS_DEF_LIBNAMES = base ghc-prim
357 - ALL_RTS_DEF_LIBS = \
358 - rts/dist/build/win32/libHSbase.dll.a \
359 -- rts/dist/build/win32/libHSghc-prim.dll.a \
360 -- libffi/build/inst/lib/libffi.dll.a
361 -+ rts/dist/build/win32/libHSghc-prim.dll.a
362 -
363 - # -- import libs for the regular Haskell libraries
364 - define make-importlib-def # args $1 = lib name
365 -@@ -172,12 +171,12 @@
366 - # Making a shared library for the RTS.
367 - ifneq "$$(findstring dyn, $1)" ""
368 - ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32"
369 --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/libffi-5.dll
370 -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend
371 - "$$(RM)" $$(RM_OPTS) $$@
372 - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
373 - -no-auto-link-packages -Lrts/dist/build -lffi-5 `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
374 - else
375 --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
376 -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend
377 - "$$(RM)" $$(RM_OPTS) $$@
378 - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
379 - -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \
380 -@@ -188,9 +187,9 @@
381 - endif
382 - endif
383 - else
384 --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp)
385 -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS)
386 - "$$(RM)" $$(RM_OPTS) $$@
387 -- echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
388 -+ echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
389 - $$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@
390 - endif
391 -
392 -@@ -403,6 +402,12 @@
393 - rts/dist/build/sm/Evac_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
394 - rts/dist/build/sm/Scav_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
395 -
396 -+# Use system libffi
397 -+libffi_include_flags:=$(shell pkg-config --cflags-only-I libffi)
398 -+rts/Adjustor_CC_OPTS += $(libffi_include_flags)
399 -+rts/Interpreter_CC_OPTS += $(libffi_include_flags)
400 -+rts/sm/Storage_CC_OPTS += $(libffi_include_flags)
401 -+
402 - #-----------------------------------------------------------------------------
403 - # Add PAPI library if needed
404 -
405 -@@ -504,10 +509,8 @@
406 - # installing
407 -
408 - INSTALL_LIBS += $(ALL_RTS_LIBS)
409 --INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
410 --INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll)
411 -
412 --install: install_libffi_headers
413 -+install:
414 -
415 - .PHONY: install_libffi_headers
416 - install_libffi_headers :
417 -Index: ghc-7.4.1/rts/package.conf.in
418 -===================================================================
419 ---- ghc-7.4.1.orig/rts/package.conf.in
420 -+++ ghc-7.4.1/rts/package.conf.in
421 -@@ -24,8 +24,9 @@
422 - hs-libraries: "HSrts"
423 -
424 - extra-libraries:
425 -+ "ffi"
426 - #ifdef HAVE_LIBM
427 -- "m" /* for ldexp() */
428 -+ , "m" /* for ldexp() */
429 - #endif
430 - #ifdef HAVE_LIBRT
431 - , "rt"
432 -Index: ghc-7.4.1/compiler/ghc.mk
433 -===================================================================
434 ---- ghc-7.4.1.orig/compiler/ghc.mk
435 -+++ ghc-7.4.1/compiler/ghc.mk
436 -@@ -260,6 +260,8 @@
437 -
438 - compiler_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
439 - compiler_CPP_OPTS += ${GhcCppOpts}
440 -+libffi_include_flags := $(shell pkg-config --cflags-only-I libffi)
441 -+compiler/ghci/LibFFI_HSC2HS_OPTS += $(addprefix --cflag=,$(libffi_include_flags))
442 -
443 - $(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H)
444 - $(CPP) $(RAWCPP_FLAGS) -P $(compiler_CPP_OPTS) -x c $< | grep -v '^#pragma GCC' > $@
445
446 diff --git a/dev-lang/ghc/files/ghc-7.5.20120505-system-libffi.patch b/dev-lang/ghc/files/ghc-7.5.20120505-system-libffi.patch
447 deleted file mode 100644
448 index f3b0c71..00000000
449 --- a/dev-lang/ghc/files/ghc-7.5.20120505-system-libffi.patch
450 +++ /dev/null
451 @@ -1,88 +0,0 @@
452 ---- ghc-7.5.20120505-orig/ghc.mk 2012-05-06 03:01:29.000000000 +1000
453 -+++ ghc-7.5.20120505/ghc.mk 2012-05-06 17:22:01.023416003 +1000
454 -@@ -584,7 +584,6 @@
455 - $(MAYBE_GHCI) \
456 - driver/ghc \
457 - driver/haddock \
458 -- libffi \
459 - includes \
460 - rts
461 -
462 ---- ghc-7.5.20120505-orig/rts/ghc.mk 2012-05-06 03:01:30.000000000 +1000
463 -+++ ghc-7.5.20120505/rts/ghc.mk 2012-05-06 17:28:31.925897226 +1000
464 -@@ -171,12 +171,12 @@
465 - # Making a shared library for the RTS.
466 - ifneq "$$(findstring dyn, $1)" ""
467 - ifeq "$$(HostOS_CPP)" "mingw32"
468 --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/$$(LIBFFI_DLL)
469 -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend
470 - "$$(RM)" $$(RM_OPTS) $$@
471 - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
472 - -no-auto-link-packages -Lrts/dist/build -l$(LIBFFI_WINDOWS_LIB) `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
473 - else
474 --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
475 -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend
476 - "$$(RM)" $$(RM_OPTS) $$@
477 - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
478 - -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \
479 -@@ -187,9 +187,9 @@
480 - endif
481 - endif
482 - else
483 --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp)
484 -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS)
485 - "$$(RM)" $$(RM_OPTS) $$@
486 -- echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
487 -+ echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \
488 - $$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@
489 - endif
490 -
491 -@@ -407,6 +407,12 @@
492 - rts/dist/build/sm/Evac_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
493 - rts/dist/build/sm/Scav_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm
494 -
495 -+# Use system libffi
496 -+libffi_include_flags:=$(shell pkg-config --cflags-only-I libffi)
497 -+rts/Adjustor_CC_OPTS += $(libffi_include_flags)
498 -+rts/Interpreter_CC_OPTS += $(libffi_include_flags)
499 -+rts/sm/Storage_CC_OPTS += $(libffi_include_flags)
500 -+
501 - #-----------------------------------------------------------------------------
502 - # Add PAPI library if needed
503 -
504 -@@ -508,10 +514,8 @@
505 - # installing
506 -
507 - INSTALL_LIBS += $(ALL_RTS_LIBS)
508 --INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
509 --INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL))
510 -
511 --install: install_libffi_headers
512 -+install:
513 -
514 - .PHONY: install_libffi_headers
515 - install_libffi_headers :
516 ---- ghc-7.5.20120505-orig/rts/package.conf.in 2012-05-06 03:01:30.000000000 +1000
517 -+++ ghc-7.5.20120505/rts/package.conf.in 2012-05-06 17:22:01.025416056 +1000
518 -@@ -24,8 +24,9 @@
519 - hs-libraries: "HSrts"
520 -
521 - extra-libraries:
522 -+ "ffi"
523 - #ifdef HAVE_LIBM
524 -- "m" /* for ldexp() */
525 -+ , "m" /* for ldexp() */
526 - #endif
527 - #ifdef HAVE_LIBRT
528 - , "rt"
529 ---- ghc-7.5.20120505-orig/compiler/ghc.mk 2012-05-06 03:01:29.000000000 +1000
530 -+++ ghc-7.5.20120505/compiler/ghc.mk 2012-05-06 17:22:01.026416083 +1000
531 -@@ -260,6 +260,8 @@
532 -
533 - compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
534 - compiler_CPP_OPTS += ${GhcCppOpts}
535 -+libffi_include_flags := $(shell pkg-config --cflags-only-I libffi)
536 -+compiler/ghci/LibFFI_HSC2HS_OPTS += $(addprefix --cflag=,$(libffi_include_flags))
537 -
538 - $(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H)
539 - $(CPP) $(RAWCPP_FLAGS) -P $(compiler_CPP_OPTS) -x c $< | grep -v '^#pragma GCC' > $@
540
541 diff --git a/dev-lang/ghc/files/ghc-7.6.2-integer-simple-div-mod.patch b/dev-lang/ghc/files/ghc-7.6.2-integer-simple-div-mod.patch
542 deleted file mode 100644
543 index 0dc5391..00000000
544 --- a/dev-lang/ghc/files/ghc-7.6.2-integer-simple-div-mod.patch
545 +++ /dev/null
546 @@ -1,57 +0,0 @@
547 -commit de13417726b90b0945aaaf0b9cfbaf8ab975d8b5
548 -Author: Gabor Greif <ggreif@×××××.com>
549 -Date: Tue Jul 24 14:31:36 2012 +0200
550 -
551 - track integer-gmp and add 'divInteger', 'modInteger'
552 -
553 -diff --git a/libraries/integer-simple/GHC/Integer.hs b/libraries/integer-simple/GHC/Integer.hs
554 -index c9b50a7..4122d38 100644
555 ---- a/libraries/integer-simple/GHC/Integer.hs
556 -+++ b/libraries/integer-simple/GHC/Integer.hs
557 -@@ -4,7 +4,7 @@
558 - -----------------------------------------------------------------------------
559 - -- |
560 - -- Module : GHC.Integer
561 ---- Copyright : (c) Ian Lynagh 2007-2008
562 -+-- Copyright : (c) Ian Lynagh 2007-2012
563 - -- License : BSD3
564 - --
565 - -- Maintainer : igloo@×××××.li
566 -@@ -27,6 +27,7 @@ module GHC.Integer (
567 - plusInteger, minusInteger, timesInteger, negateInteger,
568 - eqInteger, neqInteger, absInteger, signumInteger,
569 - leInteger, gtInteger, ltInteger, geInteger, compareInteger,
570 -+ divInteger, modInteger,
571 - divModInteger, quotRemInteger, quotInteger, remInteger,
572 - encodeFloatInteger, decodeFloatInteger, floatFromInteger,
573 - encodeDoubleInteger, decodeDoubleInteger, doubleFromInteger,
574 -diff --git a/libraries/integer-simple/GHC/Integer/Type.hs b/libraries/integer-simple/GHC/Integer/Type.hs
575 -index c3d812c..67ed19c 100644
576 ---- a/libraries/integer-simple/GHC/Integer/Type.hs
577 -+++ b/libraries/integer-simple/GHC/Integer/Type.hs
578 -@@ -7,7 +7,7 @@
579 - -----------------------------------------------------------------------------
580 - -- |
581 - -- Module : GHC.Integer.Type
582 ---- Copyright : (c) Ian Lynagh 2007-2008
583 -+-- Copyright : (c) Ian Lynagh 2007-2012
584 - -- License : BSD3
585 - --
586 - -- Maintainer : igloo@×××××.li
587 -@@ -370,6 +370,16 @@ n `divModInteger` d =
588 - then (# q `minusInteger` oneInteger, r `plusInteger` d #)
589 - else (# q, r #)
590 -
591 -+{-# NOINLINE divInteger #-}
592 -+divInteger :: Integer -> Integer -> Integer
593 -+n `divInteger` d = quotient
594 -+ where (# quotient, _ #) = n `divModInteger` d
595 -+
596 -+{-# NOINLINE modInteger #-}
597 -+modInteger :: Integer -> Integer -> Integer
598 -+n `modInteger` d = modulus
599 -+ where (# _, modulus #) = n `divModInteger` d
600 -+
601 - {-# NOINLINE quotRemInteger #-}
602 - quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
603 - Naught `quotRemInteger` (!_) = (# Naught, Naught #)
604
605 diff --git a/dev-lang/ghc/files/ghc-7.6.3-trac-3333-weak-syms.patch b/dev-lang/ghc/files/ghc-7.6.3-trac-3333-weak-syms.patch
606 deleted file mode 100644
607 index c3184a6..00000000
608 --- a/dev-lang/ghc/files/ghc-7.6.3-trac-3333-weak-syms.patch
609 +++ /dev/null
610 @@ -1,387 +0,0 @@
611 -The patch set adds support for weak symbols to ghci.
612 -
613 -For gentoo it fixes nonworking ghci / template haskell
614 -for package base.
615 -
616 -Steps to reproduce:
617 - 1. CFLAGS=-Os emerge ghc
618 - 2. ghci -package base
619 - Loading package base ... linking ... ghc: /usr/lib64/ghc-7.6.3/base-4.6.0.1/HSbase-4.6.0.1.o: unknown symbol `stat'
620 -
621 -When built with -O2 weak 'stat' resolved to '__xstat' and we don't see any errors.
622 -But on olwer optimization levels 'stat' remains.
623 -
624 -Patches-by: akio
625 -Gentoo-bug: http://bugs.gentoo.org/452442
626 -Upstream-bug: http://ghc.haskell.org/trac/ghc/ticket/3333
627 -
628 -From 500d57d3a18412c78cab5abc4d91f1564edc964d Mon Sep 17 00:00:00 2001
629 -From: Takano Akio <aljee@×××××.cx>
630 -Date: Sat, 29 Dec 2012 11:47:22 +0900
631 -Subject: [PATCH 1/3] Linker.c: remove stablehash, which is no longer used
632 -
633 ----
634 - includes/rts/Linker.h | 3 ---
635 - rts/Linker.c | 31 ++-----------------------------
636 - 2 files changed, 2 insertions(+), 32 deletions(-)
637 -
638 -diff --git a/includes/rts/Linker.h b/includes/rts/Linker.h
639 -index e900e85..d20ebc2 100644
640 ---- a/includes/rts/Linker.h
641 -+++ b/includes/rts/Linker.h
642 -@@ -23,9 +23,6 @@ typedef char pathchar;
643 - /* initialize the object linker */
644 - void initLinker( void );
645 -
646 --/* insert a stable symbol in the hash table */
647 --void insertStableSymbol(pathchar* obj_name, char* key, StgPtr data);
648 --
649 - /* insert a symbol in the hash table */
650 - void insertSymbol(pathchar* obj_name, char* key, void* data);
651 -
652 -diff --git a/rts/Linker.c b/rts/Linker.c
653 -index fa1de89..513fe3f 100644
654 ---- a/rts/Linker.c
655 -+++ b/rts/Linker.c
656 -@@ -30,1 +30,0 @@
657 --#include "Stable.h"
658 -@@ -150,9 +149,6 @@ int dynamicByDefault = 0;
659 - /* Hash table mapping symbol names to Symbol */
660 - static /*Str*/HashTable *symhash;
661 -
662 --/* Hash table mapping symbol names to StgStablePtr */
663 --static /*Str*/HashTable *stablehash;
664 --
665 - /* List of currently loaded objects */
666 - ObjectCode *objects = NULL; /* initially empty */
667 -
668 -@@ -1126,1 +1126,0 @@ typedef struct _RtsSymbolVal {
669 -- SymI_HasProto(insertStableSymbol) \
670 -@@ -1488,7 +1483,6 @@ initLinker( void )
671 - #if defined(THREADED_RTS) && (defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO))
672 - initMutex(&dl_mutex);
673 - #endif
674 -- stablehash = allocStrHashTable();
675 - symhash = allocStrHashTable();
676 -
677 - /* populate the symbol table with stuff from the RTS */
678 -@@ -1817,17 +1811,6 @@ error:
679 - }
680 -
681 - /* -----------------------------------------------------------------------------
682 -- * insert a stable symbol in the hash table
683 -- */
684 --
685 --void
686 --insertStableSymbol(pathchar* obj_name, char* key, StgPtr p)
687 --{
688 -- ghciInsertStrHashTable(obj_name, stablehash, key, getStablePtr(p));
689 --}
690 --
691 --
692 --/* -----------------------------------------------------------------------------
693 - * insert a symbol in the hash table
694 - */
695 - void
696 -@@ -4749,8 +4732,6 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
697 - #ifdef i386_HOST_ARCH
698 - Elf_Addr value;
699 - #endif
700 -- StgStablePtr stablePtr;
701 -- StgPtr stableVal;
702 - #ifdef arm_HOST_ARCH
703 - int is_target_thm=0, T=0;
704 - #endif
705 -@@ -4773,16 +4754,8 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
706 -
707 - } else {
708 - symbol = strtab + sym.st_name;
709 -- stablePtr = (StgStablePtr)lookupHashTable(stablehash, (StgWord)symbol);
710 -- if (NULL == stablePtr) {
711 -- /* No, so look up the name in our global table. */
712 -- S_tmp = lookupSymbol( symbol );
713 -- S = (Elf_Addr)S_tmp;
714 -- } else {
715 -- stableVal = deRefStablePtr( stablePtr );
716 -- S_tmp = stableVal;
717 -- S = (Elf_Addr)S_tmp;
718 -- }
719 -+ S_tmp = lookupSymbol( symbol );
720 -+ S = (Elf_Addr)S_tmp;
721 - }
722 - if (!S) {
723 - errorBelch("%s: unknown symbol `%s'", oc->fileName, symbol);
724 ---
725 -1.7.9.5
726 -
727 -From 2e5e0f7a90dd390adc5ae5fb2a3bc6e879aa42d6 Mon Sep 17 00:00:00 2001
728 -From: Takano Akio <aljee@×××××.cx>
729 -Date: Sat, 29 Dec 2012 11:59:34 +0900
730 -Subject: [PATCH 2/3] ghci: add support for ELF weak symbols
731 -
732 ----
733 - rts/Linker.c | 102 ++++++++++++++++++++++++++++++++++++++++++++--------------
734 - 1 file changed, 78 insertions(+), 24 deletions(-)
735 -
736 -diff --git a/rts/Linker.c b/rts/Linker.c
737 -index 513fe3f..5105085 100644
738 ---- a/rts/Linker.c
739 -+++ b/rts/Linker.c
740 -@@ -146,7 +146,13 @@ int dynamicByDefault = 1;
741 - int dynamicByDefault = 0;
742 - #endif
743 -
744 --/* Hash table mapping symbol names to Symbol */
745 -+typedef struct _RtsSymbolInfo {
746 -+ void *value;
747 -+ const ObjectCode *owner;
748 -+ HsBool weak;
749 -+} RtsSymbolInfo;
750 -+
751 -+/* Hash table mapping symbol names to RtsSymbolInfo */
752 - static /*Str*/HashTable *symhash;
753 -
754 - /* List of currently loaded objects */
755 -@@ -1415,15 +1421,31 @@ static RtsSymbolVal rtsSyms[] = {
756 - * Insert symbols into hash tables, checking for duplicates.
757 - */
758 -
759 --static void ghciInsertStrHashTable ( pathchar* obj_name,
760 -- HashTable *table,
761 -- char* key,
762 -- void *data
763 -- )
764 -+static void ghciInsertSymbolTable(
765 -+ pathchar* obj_name,
766 -+ HashTable *table,
767 -+ char* key,
768 -+ void *data,
769 -+ HsBool weak,
770 -+ ObjectCode *owner)
771 - {
772 -- if (lookupHashTable(table, (StgWord)key) == NULL)
773 -+ RtsSymbolInfo *pinfo = lookupStrHashTable(table, key);
774 -+ if (!pinfo) /* new entry */
775 -+ {
776 -+ pinfo = stgMallocBytes(sizeof (*pinfo), "ghciInsertToSymbolTable");
777 -+ pinfo->value = data;
778 -+ pinfo->owner = owner;
779 -+ pinfo->weak = weak;
780 -+ insertStrHashTable(table, key, pinfo);
781 -+ return;
782 -+ } else if ((!pinfo->weak || pinfo->value) && weak) {
783 -+ return; /* duplicate weak symbol, throw it away */
784 -+ } else if (pinfo->weak) /* weak symbol is in the table */
785 - {
786 -- insertStrHashTable(table, (StgWord)key, data);
787 -+ /* override the weak definition with the non-weak one */
788 -+ pinfo->value = data;
789 -+ pinfo->owner = owner;
790 -+ pinfo->weak = HS_BOOL_FALSE;
791 - return;
792 - }
793 - debugBelch(
794 -@@ -1444,6 +1466,32 @@ static void ghciInsertStrHashTable ( pathchar* obj_name,
795 - );
796 - stg_exit(1);
797 - }
798 -+
799 -+static HsBool ghciLookupSymbolTable(HashTable *table,
800 -+ const char *key, void **result)
801 -+{
802 -+ RtsSymbolInfo *pinfo = lookupStrHashTable(table, key);
803 -+ if (!pinfo) {
804 -+ *result = NULL;
805 -+ return HS_BOOL_FALSE;
806 -+ }
807 -+ if (pinfo->weak)
808 -+ IF_DEBUG(linker, debugBelch("lookup: promoting %s\n", key));
809 -+ /* Once it's looked up, it can no longer be overridden */
810 -+ pinfo->weak = HS_BOOL_FALSE;
811 -+
812 -+ *result = pinfo->value;
813 -+ return HS_BOOL_TRUE;
814 -+}
815 -+
816 -+static void ghciRemoveSymbolTable(HashTable *table, const char *key,
817 -+ ObjectCode *owner)
818 -+{
819 -+ RtsSymbolInfo *pinfo = lookupStrHashTable(table, key);
820 -+ if (!pinfo || owner != pinfo->owner) return;
821 -+ removeStrHashTable(table, key, NULL);
822 -+ stgFree(pinfo);
823 -+}
824 - /* -----------------------------------------------------------------------------
825 - * initialize the object linker
826 - */
827 -@@ -1487,8 +1535,8 @@ initLinker( void )
828 -
829 - /* populate the symbol table with stuff from the RTS */
830 - for (sym = rtsSyms; sym->lbl != NULL; sym++) {
831 -- ghciInsertStrHashTable(WSTR("(GHCi built-in symbols)"),
832 -- symhash, sym->lbl, sym->addr);
833 -+ ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"),
834 -+ symhash, sym->lbl, sym->addr, HS_BOOL_FALSE, NULL);
835 - IF_DEBUG(linker, debugBelch("initLinker: inserting rts symbol %s, %p\n", sym->lbl, sym->addr));
836 - }
837 - # if defined(OBJFORMAT_MACHO) && defined(powerpc_HOST_ARCH)
838 -@@ -1816,7 +1864,7 @@ error:
839 - void
840 - insertSymbol(pathchar* obj_name, char* key, void* data)
841 - {
842 -- ghciInsertStrHashTable(obj_name, symhash, key, data);
843 -+ ghciInsertSymbolTable(obj_name, symhash, key, data, HS_BOOL_FALSE, NULL);
844 - }
845 -
846 - /* -----------------------------------------------------------------------------
847 -@@ -1829,9 +1877,8 @@ lookupSymbol( char *lbl )
848 - IF_DEBUG(linker, debugBelch("lookupSymbol: looking up %s\n", lbl));
849 - initLinker() ;
850 - ASSERT(symhash != NULL);
851 -- val = lookupStrHashTable(symhash, lbl);
852 -
853 -- if (val == NULL) {
854 -+ if (!ghciLookupSymbolTable(symhash, lbl, &val)) {
855 - IF_DEBUG(linker, debugBelch("lookupSymbol: symbol not found\n"));
856 - # if defined(OBJFORMAT_ELF)
857 - return internal_dlsym(dl_prog_handle, lbl);
858 -@@ -1903,7 +1950,7 @@ void ghci_enquire ( char* addr )
859 - if (sym == NULL) continue;
860 - a = NULL;
861 - if (a == NULL) {
862 -- a = lookupStrHashTable(symhash, sym);
863 -+ ghciLookupSymbolTable(symhash, sym, (void **)&a);
864 - }
865 - if (a == NULL) {
866 - // debugBelch("ghci_enquire: can't find %s\n", sym);
867 -@@ -2715,7 +2762,7 @@ unloadObj( pathchar *path )
868 - int i;
869 - for (i = 0; i < oc->n_symbols; i++) {
870 - if (oc->symbols[i] != NULL) {
871 -- removeStrHashTable(symhash, oc->symbols[i], NULL);
872 -+ ghciRemoveSymbolTable(symhash, oc->symbols[i], oc);
873 - }
874 - }
875 - }
876 -@@ -3802,7 +3849,8 @@ ocGetNames_PEi386 ( ObjectCode* oc )
877 - ASSERT(i >= 0 && i < oc->n_symbols);
878 - /* cstring_from_COFF_symbol_name always succeeds. */
879 - oc->symbols[i] = (char*)sname;
880 -- ghciInsertStrHashTable(oc->fileName, symhash, (char*)sname, addr);
881 -+ ghciInsertSymbolTable(oc->fileName, symhash, (char*)sname, addr,
882 -+ HS_BOOL_FALSE, oc);
883 - } else {
884 - # if 0
885 - debugBelch(
886 -@@ -4595,6 +4643,7 @@ ocGetNames_ELF ( ObjectCode* oc )
887 - for (j = 0; j < nent; j++) {
888 -
889 - char isLocal = FALSE; /* avoids uninit-var warning */
890 -+ HsBool isWeak = HS_BOOL_FALSE;
891 - char* ad = NULL;
892 - char* nm = strtab + stab[j].st_name;
893 - int secno = stab[j].st_shndx;
894 -@@ -4615,6 +4664,7 @@ ocGetNames_ELF ( ObjectCode* oc )
895 - else
896 - if ( ( ELF_ST_BIND(stab[j].st_info)==STB_GLOBAL
897 - || ELF_ST_BIND(stab[j].st_info)==STB_LOCAL
898 -+ || ELF_ST_BIND(stab[j].st_info)==STB_WEAK
899 - )
900 - /* and not an undefined symbol */
901 - && stab[j].st_shndx != SHN_UNDEF
902 -@@ -4638,7 +4688,8 @@ ocGetNames_ELF ( ObjectCode* oc )
903 - ad = ehdrC + shdr[ secno ].sh_offset + stab[j].st_value;
904 - if (ELF_ST_BIND(stab[j].st_info)==STB_LOCAL) {
905 - isLocal = TRUE;
906 -- } else {
907 -+ isWeak = FALSE;
908 -+ } else { /* STB_GLOBAL or STB_WEAK */
909 - #ifdef ELF_FUNCTION_DESC
910 - /* dlsym() and the initialisation table both give us function
911 - * descriptors, so to be consistent we store function descriptors
912 -@@ -4649,6 +4700,7 @@ ocGetNames_ELF ( ObjectCode* oc )
913 - IF_DEBUG(linker,debugBelch( "addOTabName(GLOB): %10p %s %s\n",
914 - ad, oc->fileName, nm ));
915 - isLocal = FALSE;
916 -+ isWeak = (ELF_ST_BIND(stab[j].st_info)==STB_WEAK);
917 - }
918 - }
919 -
920 -@@ -4661,7 +4713,7 @@ ocGetNames_ELF ( ObjectCode* oc )
921 - if (isLocal) {
922 - /* Ignore entirely. */
923 - } else {
924 -- ghciInsertStrHashTable(oc->fileName, symhash, nm, ad);
925 -+ ghciInsertSymbolTable(oc->fileName, symhash, nm, ad, isWeak, oc);
926 - }
927 - } else {
928 - /* Skip. */
929 -@@ -6306,11 +6358,13 @@ ocGetNames_MachO(ObjectCode* oc)
930 - else
931 - {
932 - IF_DEBUG(linker, debugBelch("ocGetNames_MachO: inserting %s\n", nm));
933 -- ghciInsertStrHashTable(oc->fileName, symhash, nm,
934 -+ ghciInsertSymbolTable(oc->fileName, symhash, nm,
935 - image
936 - + sections[nlist[i].n_sect-1].offset
937 - - sections[nlist[i].n_sect-1].addr
938 -- + nlist[i].n_value);
939 -+ + nlist[i].n_value,
940 -+ HS_BOOL_FALSE,
941 -+ oc);
942 - oc->symbols[curSymbol++] = nm;
943 - }
944 - }
945 -@@ -6341,8 +6395,8 @@ ocGetNames_MachO(ObjectCode* oc)
946 - nlist[i].n_value = commonCounter;
947 -
948 - IF_DEBUG(linker, debugBelch("ocGetNames_MachO: inserting common symbol: %s\n", nm));
949 -- ghciInsertStrHashTable(oc->fileName, symhash, nm,
950 -- (void*)commonCounter);
951 -+ ghciInsertSymbolTable(oc->fileName, symhash, nm,
952 -+ (void*)commonCounter, HS_BOOL_FALSE, oc);
953 - oc->symbols[curSymbol++] = nm;
954 -
955 - commonCounter += sz;
956 -@@ -6466,7 +6520,7 @@ machoInitSymbolsWithoutUnderscore(void)
957 -
958 - #undef SymI_NeedsProto
959 - #define SymI_NeedsProto(x) \
960 -- ghciInsertStrHashTable("(GHCi built-in symbols)", symhash, #x, *p++);
961 -+ ghciInsertSymbolTable("(GHCi built-in symbols)", symhash, #x, *p++, HS_BOOL_FALSE, NULL);
962 -
963 - RTS_MACHO_NOUNDERLINE_SYMBOLS
964 -
965 ---
966 -1.7.9.5
967 -
968 -From 916d7713b34b529ae7ec24eaa836a4eaca7724fc Mon Sep 17 00:00:00 2001
969 -From: Takano Akio <aljee@×××××.cx>
970 -Date: Sun, 6 Jan 2013 17:51:19 +0900
971 -Subject: [PATCH 3/3] Linker.c: add dso_handle to the symbol table
972 -
973 ----
974 - rts/Linker.c | 7 +++++++
975 - 1 file changed, 7 insertions(+)
976 -
977 -diff --git a/rts/Linker.c b/rts/Linker.c
978 -index 5105085..0b2bf63 100644
979 ---- a/rts/Linker.c
980 -+++ b/rts/Linker.c
981 -@@ -1542,6 +1542,13 @@ initLinker( void )
982 - # if defined(OBJFORMAT_MACHO) && defined(powerpc_HOST_ARCH)
983 - machoInitSymbolsWithoutUnderscore();
984 - # endif
985 -+ /* GCC defines a special symbol __dso_handle which is resolved to NULL if
986 -+ referenced from a statically linked module. We need to mimic this, but
987 -+ we cannot use NULL because we use it to mean nonexistent symbols. So we
988 -+ use an arbitrary (hopefully unique) address here.
989 -+ */
990 -+ ghciInsertSymbolTable(WSTR("(GHCi special symbols)"),
991 -+ symhash, "__dso_handle", (void *)0x12345687, HS_BOOL_FALSE, NULL);
992 -
993 - # if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO)
994 - # if defined(RTLD_DEFAULT)
995 ---
996 -1.7.9.5
997 -
998
999 diff --git a/dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch b/dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch
1000 deleted file mode 100644
1001 index 032dc9a..00000000
1002 --- a/dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch
1003 +++ /dev/null
1004 @@ -1,129 +0,0 @@
1005 -commit 4d4d07704ee78221607a18b8118294b0aea1bac4
1006 -Author: Sergei Trofimovich <slyfox@g.o>
1007 -Date: Tue Sep 2 00:06:56 2014 +0300
1008 -
1009 - systools: fix gcc version detecton on non-english locale
1010 -
1011 - Summary:
1012 - ghc runs 'gcc -v' to check if we run under vanilla gcc
1013 - or disaguised clang by checking for string
1014 -
1015 - "gcc version <something>"
1016 -
1017 - But this check does not always work as gcc has that string
1018 - localized via gettext mechanism:
1019 -
1020 - (some gcc's locale strings)
1021 - be.po-msgstr "версія gcc %s\n"
1022 - da.po-msgstr "GCC version %s\n"
1023 - de.po-msgstr "gcc-Version %s %s\n"
1024 - el.po-msgstr "έκδοση gcc %s\n"
1025 - ...
1026 -
1027 - To ping gcc to English locale we now override environment
1028 - variable with 'LANGUAGE=en' value.
1029 -
1030 - Fixes Issue #8825
1031 -
1032 - Signed-off-by: Sergei Trofimovich <slyfox@g.o>
1033 -
1034 - Test Plan: validate
1035 -
1036 - Reviewers: austin
1037 -
1038 - Reviewed By: austin
1039 -
1040 - Subscribers: simonmar, ezyang, carter
1041 -
1042 - Differential Revision: https://phabricator.haskell.org/D185
1043 -
1044 - GHC Trac Issues: #8825
1045 -
1046 -diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
1047 -index 72fa19b..67926f5 100644
1048 ---- a/compiler/main/SysTools.lhs
1049 -+++ b/compiler/main/SysTools.lhs
1050 -@@ -492,6 +492,51 @@ readCreateProcess proc = do
1051 -
1052 - return (ex, output)
1053 -
1054 -+readProcessEnvWithExitCode
1055 -+ :: String -- ^ program path
1056 -+ -> [String] -- ^ program args
1057 -+ -> [(String, String)] -- ^ environment to override
1058 -+ -> IO (ExitCode, String, String) -- ^ (exit_code, stdout, stderr)
1059 -+readProcessEnvWithExitCode prog args env_update = do
1060 -+ current_env <- getEnvironment
1061 -+ let new_env = env_update ++ [ (k, v)
1062 -+ | let overriden_keys = map fst env_update
1063 -+ , (k, v) <- current_env
1064 -+ , k `notElem` overriden_keys
1065 -+ ]
1066 -+ p = proc prog args
1067 -+
1068 -+ (_stdin, Just stdoh, Just stdeh, pid) <-
1069 -+ createProcess p{ std_out = CreatePipe
1070 -+ , std_err = CreatePipe
1071 -+ , env = Just new_env
1072 -+ }
1073 -+
1074 -+ outMVar <- newEmptyMVar
1075 -+ errMVar <- newEmptyMVar
1076 -+
1077 -+ _ <- forkIO $ do
1078 -+ stdo <- hGetContents stdoh
1079 -+ _ <- evaluate (length stdo)
1080 -+ putMVar outMVar stdo
1081 -+
1082 -+ _ <- forkIO $ do
1083 -+ stde <- hGetContents stdeh
1084 -+ _ <- evaluate (length stde)
1085 -+ putMVar errMVar stde
1086 -+
1087 -+ out <- takeMVar outMVar
1088 -+ hClose stdoh
1089 -+ err <- takeMVar errMVar
1090 -+ hClose stdeh
1091 -+
1092 -+ ex <- waitForProcess pid
1093 -+
1094 -+ return (ex, out, err)
1095 -+
1096 -+-- Don't let gcc localize version info string, #8825
1097 -+en_locale_env :: [(String, String)]
1098 -+en_locale_env = [("LANGUAGE", "en")]
1099 -
1100 - -- If the -B<dir> option is set, add <dir> to PATH. This works around
1101 - -- a bug in gcc on Windows Vista where it can't find its auxiliary
1102 -@@ -746,8 +791,9 @@ getLinkerInfo' dflags = do
1103 - _ -> do
1104 - -- In practice, we use the compiler as the linker here. Pass
1105 - -- -Wl,--version to get linker version info.
1106 -- (exitc, stdo, stde) <- readProcessWithExitCode pgm
1107 -- ["-Wl,--version"] ""
1108 -+ (exitc, stdo, stde) <- readProcessEnvWithExitCode pgm
1109 -+ ["-Wl,--version"]
1110 -+ en_locale_env
1111 - -- Split the output by lines to make certain kinds
1112 - -- of processing easier. In particular, 'clang' and 'gcc'
1113 - -- have slightly different outputs for '-Wl,--version', but
1114 -@@ -802,7 +848,8 @@ getCompilerInfo' dflags = do
1115 -
1116 - -- Process the executable call
1117 - info <- catchIO (do
1118 -- (exitc, stdo, stde) <- readProcessWithExitCode pgm ["-v"] ""
1119 -+ (exitc, stdo, stde) <-
1120 -+ readProcessEnvWithExitCode pgm ["-v"] en_locale_env
1121 - -- Split the output by lines to make certain kinds
1122 - -- of processing easier.
1123 - parseCompilerInfo (lines stdo) (lines stde) exitc
1124 -@@ -952,7 +999,8 @@ readElfSection _dflags section exe = do
1125 - prog = "readelf"
1126 - args = [Option "-p", Option section, FileOption "" exe]
1127 - --
1128 -- r <- readProcessWithExitCode prog (filter notNull (map showOpt args)) ""
1129 -+ r <- readProcessEnvWithExitCode prog (filter notNull (map showOpt args))
1130 -+ en_locale_env
1131 - case r of
1132 - (ExitSuccess, out, _err) -> return (doFilter (lines out))
1133 - _ -> return Nothing
1134
1135 diff --git a/dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch b/dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch
1136 deleted file mode 100644
1137 index 8deec21..00000000
1138 --- a/dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch
1139 +++ /dev/null
1140 @@ -1,38 +0,0 @@
1141 -commit 104a66a461f4f89b8e5ad9c829923bb7ca8ceddb
1142 -Author: Sergei Trofimovich <slyfox@g.o>
1143 -Date: Sat Aug 23 13:11:23 2014 +0300
1144 -
1145 - rts/Linker.c: declare 'deRefStablePtr' as an exported 'rts' symbol
1146 -
1147 - $ inplace/bin/ghc-stage2 -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -optc-fno-builtin -fno-ghci-history \
1148 - testsuite/tests/ffi/should_run/T4038.hs --interactive -v0 -ignore-dot-ghci +RTS -I0.1 -RTS
1149 -
1150 - *Main> main
1151 - <interactive>: /tmp/ghc16668_0/ghc16668_5.o: unknown symbol `deRefStablePtr'
1152 -
1153 - The reference to 'deRefStablePtr' is generated by 'compiler/deSugar/DsForeign.lhs':
1154 - the_cfun
1155 - = case maybe_target of
1156 - Nothing -> text "(StgClosure*)deRefStablePtr(the_stableptr)"
1157 - Just hs_fn -> char '&' <> ppr hs_fn <> text "_closure"
1158 -
1159 - Patch fixes all broken tests using 'import wrapper':
1160 - TEST="ffi013 ffi010 ffi011 ffi005 ffi020 ffi006 ffi019 fed001 T1679 T4038"
1161 -
1162 - Tests manifested as broken only in DYNAMIC_GHC_PROGRAMS=NO builds,
1163 - where GHCi's custom linker is used instead of system's linker.
1164 -
1165 - Signed-off-by: Sergei Trofimovich <slyfox@g.o>
1166 -
1167 -diff --git a/rts/Linker.c b/rts/Linker.c
1168 -index e97580d..b24be58 100644
1169 ---- a/rts/Linker.c
1170 -+++ b/rts/Linker.c
1171 -@@ -1092,6 +1092,7 @@ typedef struct _RtsSymbolVal {
1172 - SymI_HasProto(__word_encodeFloat) \
1173 - SymI_HasProto(stg_atomicallyzh) \
1174 - SymI_HasProto(barf) \
1175 -+ SymI_HasProto(deRefStablePtr) \
1176 - SymI_HasProto(debugBelch) \
1177 - SymI_HasProto(errorBelch) \
1178 - SymI_HasProto(sysErrorBelch) \
1179
1180 diff --git a/dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch b/dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch
1181 deleted file mode 100644
1182 index 9026ecf..00000000
1183 --- a/dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch
1184 +++ /dev/null
1185 @@ -1,69 +0,0 @@
1186 -commit e2a8801b9779949010f30db6f6ef66f3c3a70776
1187 -Author: Sergei Trofimovich <slyfox@g.o>
1188 -Date: Thu Sep 4 17:50:45 2014 +0300
1189 -
1190 - pprC: declare extern cmm primitives as functions, not data
1191 -
1192 - Summary:
1193 - The commit fixes incorrect code generation of
1194 - integer-gmp package on ia64 due to C prototype mismatch.
1195 - Before patch prototype was
1196 - StgWord poizh[];
1197 - After patch it became
1198 - StgFunPtr poizh();
1199 -
1200 - Long story:
1201 -
1202 - Consider the following simple example:
1203 -
1204 - {-# LANGUAGE MagicHash, GHCForeignImportPrim, UnliftedFFITypes #-}
1205 - module M where
1206 - import GHC.Prim -- Int#
1207 - foreign import prim "poizh" poi# :: Int# -> Int#
1208 -
1209 - Before the patch Unregisterised build generated the
1210 - following 'poizh' reference:
1211 - EI_(poizh); /* StgWord poizh[]; */
1212 - FN_(M_poizh_entry) {
1213 - // ...
1214 - JMP_((W_)&poizh);
1215 - }
1216 -
1217 - After the patch it looks this way:
1218 - EF_(poizh); /* StgFunPtr poizh(); */
1219 - FN_(M_poizh_entry) {
1220 - // ...
1221 - JMP_((W_)&poizh);
1222 - }
1223 -
1224 - On ia64 it leads to different relocation types being generated:
1225 - incorrect one:
1226 - addl r14 = @ltoffx(poizh#)
1227 - ld8.mov r14 = [r14], poizh#
1228 - correct one:
1229 - addl r14 = @ltoff(@fptr(poizh#)), gp
1230 - ld8 r14 = [r14]
1231 -
1232 - '@fptr(poizh#)' basically instructs assembler to creates
1233 - another obect consisting of real address to 'poizh' instructions
1234 - and module address. That '@fptr' object is used as a function "address".
1235 - This object is different for every module referencing 'poizh' symbol.
1236 -
1237 - All indirect function calls expect '@fptr' object. That way
1238 - call site can read real destination address and set destination
1239 - module address in 'gp' register.
1240 -
1241 - Signed-off-by: Sergei Trofimovich <slyfox@g.o>
1242 -
1243 -diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
1244 -index 02ad026..0f2c0ae 100644
1245 ---- a/compiler/cmm/CLabel.hs
1246 -+++ b/compiler/cmm/CLabel.hs
1247 -@@ -813,6 +813,7 @@ labelType (CmmLabel _ _ CmmClosure) = GcPtrLabel
1248 - labelType (CmmLabel _ _ CmmCode) = CodeLabel
1249 - labelType (CmmLabel _ _ CmmInfo) = DataLabel
1250 - labelType (CmmLabel _ _ CmmEntry) = CodeLabel
1251 -+labelType (CmmLabel _ _ CmmPrimCall) = CodeLabel
1252 - labelType (CmmLabel _ _ CmmRetInfo) = DataLabel
1253 - labelType (CmmLabel _ _ CmmRet) = CodeLabel
1254 - labelType (RtsLabel (RtsSelectorInfoTable _ _)) = DataLabel
1255
1256 diff --git a/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch b/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch
1257 deleted file mode 100644
1258 index 10c41d5..00000000
1259 --- a/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch
1260 +++ /dev/null
1261 @@ -1,107 +0,0 @@
1262 -commit a93ab43ab5f40cadbedea2f6342b93c245e91434
1263 -Author: Sergei Trofimovich <slyfox@g.o>
1264 -Date: Wed Aug 27 22:19:52 2014 +0300
1265 -
1266 - driver: pass '-fPIC' option to assembler as well
1267 -
1268 - Summary:
1269 - Before the patch '-fPIC' was passed only to C compiler,
1270 - but not to assembler itself.
1271 -
1272 - It led to runtime crash in GHC_DYNAMIC_PROGRAMS=YES mode
1273 - on sparc32.
1274 -
1275 - Technical details are in 'Note [-fPIC for assembler]'.
1276 -
1277 - Signed-off-by: Sergei Trofimovich <slyfox@g.o>
1278 -
1279 - Test Plan: validate on sparc
1280 -
1281 - Reviewers: simonmar, austin, kgardas
1282 -
1283 - Reviewed By: austin
1284 -
1285 - Subscribers: simonmar, ezyang, carter
1286 -
1287 - Differential Revision: https://phabricator.haskell.org/D177
1288 -
1289 -diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
1290 -index 183f435..5a18e6e 100644
1291 ---- a/compiler/main/DriverPipeline.hs
1292 -+++ b/compiler/main/DriverPipeline.hs
1293 -@@ -1199,6 +1199,7 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags
1294 -
1295 - as_prog <- whichAsProg
1296 - let cmdline_include_paths = includePaths dflags
1297 -+ let pic_c_flags = picCCOpts dflags
1298 -
1299 - next_phase <- maybeMergeStub
1300 - output_fn <- phaseOutputFilename next_phase
1301 -@@ -1212,6 +1213,9 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags
1302 - = liftIO $ as_prog dflags
1303 - ([ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ]
1304 -
1305 -+ -- See Note [-fPIC for assembler]
1306 -+ ++ map SysTools.Option pic_c_flags
1307 -+
1308 - -- We only support SparcV9 and better because V8 lacks an atomic CAS
1309 - -- instruction so we have to make sure that the assembler accepts the
1310 - -- instruction set. Note that the user can still override this
1311 -@@ -1253,6 +1257,8 @@ runPhase (RealPhase SplitAs) _input_fn dflags
1312 - osuf = objectSuf dflags
1313 - split_odir = base_o ++ "_" ++ osuf ++ "_split"
1314 -
1315 -+ let pic_c_flags = picCCOpts dflags
1316 -+
1317 - -- this also creates the hierarchy
1318 - liftIO $ createDirectoryIfMissing True split_odir
1319 -
1320 -@@ -1286,6 +1292,9 @@ runPhase (RealPhase SplitAs) _input_fn dflags
1321 - then [SysTools.Option "-mcpu=v9"]
1322 - else []) ++
1323 -
1324 -+ -- See Note [-fPIC for assembler]
1325 -+ map SysTools.Option pic_c_flags ++
1326 -+
1327 - [ SysTools.Option "-c"
1328 - , SysTools.Option "-o"
1329 - , SysTools.FileOption "" (split_obj n)
1330 -@@ -2203,3 +2212,38 @@ haveRtsOptsFlags dflags =
1331 - isJust (rtsOpts dflags) || case rtsOptsEnabled dflags of
1332 - RtsOptsSafeOnly -> False
1333 - _ -> True
1334 -+
1335 -+-- Note [-fPIC for assembler]
1336 -+-- When compiling .c source file GHC's driver pipeline basically
1337 -+-- does the following two things:
1338 -+-- 1. ${CC} -S 'PIC_CFLAGS' source.c
1339 -+-- 2. ${CC} -x assembler -c 'PIC_CFLAGS' source.S
1340 -+--
1341 -+-- Why do we need to pass 'PIC_CFLAGS' both to C compiler and assembler?
1342 -+-- Because on some architectures (at least sparc32) assembler also choses
1343 -+-- relocation type!
1344 -+-- Consider the following C module:
1345 -+--
1346 -+-- /* pic-sample.c */
1347 -+-- int v;
1348 -+-- void set_v (int n) { v = n; }
1349 -+-- int get_v (void) { return v; }
1350 -+--
1351 -+-- $ gcc -S -fPIC pic-sample.c
1352 -+-- $ gcc -c pic-sample.s -o pic-sample.no-pic.o # incorrect binary
1353 -+-- $ gcc -c -fPIC pic-sample.s -o pic-sample.pic.o # correct binary
1354 -+--
1355 -+-- $ objdump -r -d pic-sample.pic.o > pic-sample.pic.o.od
1356 -+-- $ objdump -r -d pic-sample.no-pic.o > pic-sample.no-pic.o.od
1357 -+-- $ diff -u pic-sample.pic.o.od pic-sample.no-pic.o.od
1358 -+--
1359 -+-- Most of architectures won't show any difference in this test, but on sparc32
1360 -+-- the following assembly snippet:
1361 -+--
1362 -+-- sethi %hi(_GLOBAL_OFFSET_TABLE_-8), %l7
1363 -+--
1364 -+-- generates two kinds or relocations, only 'R_SPARC_PC22' is correct:
1365 -+--
1366 -+-- 3c: 2f 00 00 00 sethi %hi(0), %l7
1367 -+-- - 3c: R_SPARC_PC22 _GLOBAL_OFFSET_TABLE_-0x8
1368 -+-- + 3c: R_SPARC_HI22 _GLOBAL_OFFSET_TABLE_-0x8
1369
1370 diff --git a/dev-lang/ghc/files/ghc-7.8.3-unreg-lit.patch b/dev-lang/ghc/files/ghc-7.8.3-unreg-lit.patch
1371 deleted file mode 100644
1372 index 632696d..00000000
1373 --- a/dev-lang/ghc/files/ghc-7.8.3-unreg-lit.patch
1374 +++ /dev/null
1375 @@ -1,84 +0,0 @@
1376 -commit a6ea05e21e175407dc9e45f18c56c1d727fd0f26
1377 -Author: Sergei Trofimovich <slyfox@g.o>
1378 -Date: Fri Aug 22 23:24:32 2014 +0300
1379 -
1380 - UNREG: fix emission of large Integer literals in C codegen
1381 -
1382 - Summary:
1383 - On amd64/UNREG build there is many failing tests trying
1384 - to deal with 'Integer' types.
1385 -
1386 - Looking at 'overflow1' test I've observed invalid C code generated by
1387 - GHC.
1388 -
1389 - Cmm code
1390 - CInt a = -1; (a == -1)
1391 - yields 'False' with optimisations enabled via the following C code:
1392 - StgWord64 a = (StgWord32)0xFFFFffffFFFFffffu; (a == 0xFFFFffffFFFFffffu)
1393 -
1394 - The patch fixes it by shrinking emitted literals to required sizes:
1395 - StgWord64 a = (StgWord32)0xFFFFffffu; (a == 0xFFFFffffu)
1396 -
1397 - Thanks to Reid Barton for tracking down and fixing the issue.
1398 -
1399 - Signed-off-by: Sergei Trofimovich <slyfox@g.o>
1400 -
1401 - Test Plan: validate on UNREG build (amd64)
1402 -
1403 - Reviewers: simonmar, rwbarton, austin
1404 -
1405 - Subscribers: simonmar, ezyang, carter
1406 -
1407 - Differential Revision: https://phabricator.haskell.org/D173
1408 -
1409 -diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
1410 -index 93a5d06..8605988 100644
1411 ---- a/compiler/cmm/PprC.hs
1412 -+++ b/compiler/cmm/PprC.hs
1413 -@@ -1221,8 +1221,9 @@ commafy xs = hsep $ punctuate comma xs
1414 - pprHexVal :: Integer -> Width -> SDoc
1415 - pprHexVal 0 _ = ptext (sLit "0x0")
1416 - pprHexVal w rep
1417 -- | w < 0 = parens (char '-' <> ptext (sLit "0x") <> go (-w) <> repsuffix rep)
1418 -- | otherwise = ptext (sLit "0x") <> go w <> repsuffix rep
1419 -+ | w < 0 = parens (char '-' <>
1420 -+ ptext (sLit "0x") <> intToDoc (-w) <> repsuffix rep)
1421 -+ | otherwise = ptext (sLit "0x") <> intToDoc w <> repsuffix rep
1422 - where
1423 - -- type suffix for literals:
1424 - -- Integer literals are unsigned in Cmm/C. We explicitly cast to
1425 -@@ -1237,10 +1238,33 @@ pprHexVal w rep
1426 - else panic "pprHexVal: Can't find a 64-bit type"
1427 - repsuffix _ = char 'U'
1428 -
1429 -+ intToDoc :: Integer -> SDoc
1430 -+ intToDoc i = go (truncInt i)
1431 -+
1432 -+ -- We need to truncate value as Cmm backend does not drop
1433 -+ -- redundant bits to ease handling of negative values.
1434 -+ -- Thus the following Cmm code on 64-bit arch, like amd64:
1435 -+ -- CInt v;
1436 -+ -- v = {something};
1437 -+ -- if (v == %lobits32(-1)) { ...
1438 -+ -- leads to the following C code:
1439 -+ -- StgWord64 v = (StgWord32)({something});
1440 -+ -- if (v == 0xFFFFffffFFFFffffU) { ...
1441 -+ -- Such code is incorrect as it promotes both operands to StgWord64
1442 -+ -- and the whole condition is always false.
1443 -+ truncInt :: Integer -> Integer
1444 -+ truncInt i =
1445 -+ case rep of
1446 -+ W8 -> i `rem` (2^(8 :: Int))
1447 -+ W16 -> i `rem` (2^(16 :: Int))
1448 -+ W32 -> i `rem` (2^(32 :: Int))
1449 -+ W64 -> i `rem` (2^(64 :: Int))
1450 -+ _ -> panic ("pprHexVal/truncInt: C backend can't encode "
1451 -+ ++ show rep ++ " literals")
1452 -+
1453 - go 0 = empty
1454 - go w' = go q <> dig
1455 - where
1456 - (q,r) = w' `quotRem` 16
1457 - dig | r < 10 = char (chr (fromInteger r + ord '0'))
1458 - | otherwise = char (chr (fromInteger r - 10 + ord 'a'))
1459 --
1460
1461 diff --git a/dev-lang/ghc/files/terminfo-0.3.2.5-tinfo.patch b/dev-lang/ghc/files/terminfo-0.3.2.5-tinfo.patch
1462 deleted file mode 100644
1463 index ca10da2..00000000
1464 --- a/dev-lang/ghc/files/terminfo-0.3.2.5-tinfo.patch
1465 +++ /dev/null
1466 @@ -1,25 +0,0 @@
1467 -http://bugs.gentoo.org/454216
1468 -
1469 -Mon Jan 7 16:34:47 FET 2013 Judah Jacobson <judah.jacobson@×××××.com>
1470 - * Search for terminfo in libtinfo; fixes GHC #7281.
1471 -
1472 - Patch from Paul Johnson.
1473 -diff -rN -u old-terminfo/configure.ac new-terminfo/configure.ac
1474 ---- old-terminfo/configure.ac 2013-02-14 00:16:11.816111434 +0300
1475 -+++ new-terminfo/configure.ac 2013-02-14 00:16:11.819111434 +0300
1476 -@@ -39,10 +39,11 @@
1477 - TERMINFO_INCLUDES="$CursesIncludes term.h"
1478 - fi
1479 -
1480 --AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw,
1481 -- [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,
1482 -- [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,
1483 -- HaveLibCurses=NO; LibCurses=not-installed)])])
1484 -+AC_CHECK_LIB(tinfo, setupterm, HaveLibCurses=YES; LibCurses=tinfo,
1485 -+ [AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw,
1486 -+ [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,
1487 -+ [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,
1488 -+ HaveLibCurses=NO; LibCurses=not-installed)])])])
1489 -
1490 - if test "x$HaveLibCurses" = "xNO" ; then
1491 - AC_MSG_FAILURE([curses library not found, so this package cannot be built])
1492
1493 diff --git a/dev-lang/ghc/ghc-7.10.2-r1.ebuild b/dev-lang/ghc/ghc-7.10.2-r1.ebuild
1494 deleted file mode 100644
1495 index 13af9a4..00000000
1496 --- a/dev-lang/ghc/ghc-7.10.2-r1.ebuild
1497 +++ /dev/null
1498 @@ -1,662 +0,0 @@
1499 -# Copyright 1999-2016 Gentoo Foundation
1500 -# Distributed under the terms of the GNU General Public License v2
1501 -# $Id$
1502 -
1503 -EAPI=5
1504 -
1505 -# to make make a crosscompiler use crossdev and symlink ghc tree into
1506 -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
1507 -#
1508 -# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
1509 -export CTARGET=${CTARGET:-${CHOST}}
1510 -if [[ ${CTARGET} = ${CHOST} ]] ; then
1511 - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
1512 - export CTARGET=${CATEGORY/cross-}
1513 - fi
1514 -fi
1515 -
1516 -inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
1517 -inherit multilib pax-utils toolchain-funcs versionator
1518 -
1519 -DESCRIPTION="The Glasgow Haskell Compiler"
1520 -HOMEPAGE="http://www.haskell.org/ghc/"
1521 -
1522 -# we don't have any binaries yet
1523 -arch_binaries=""
1524 -
1525 -# sorted!
1526 -#arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
1527 -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
1528 -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PVR}-amd64-noncurses.tbz2 )"
1529 -#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
1530 -#arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )"
1531 -#arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )"
1532 -#arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )"
1533 -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PVR}-x86-noncurses.tbz2 )"
1534 -
1535 -# various ports:
1536 -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
1537 -
1538 -# 0 - yet
1539 -yet_binary() {
1540 - case "${ARCH}" in
1541 - #alpha) return 0 ;;
1542 - #arm)
1543 - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
1544 - # return 0
1545 - #;;
1546 - amd64) return 0 ;;
1547 - #ia64) return 0 ;;
1548 - #ppc) return 0 ;;
1549 - #ppc64) return 0 ;;
1550 - #sparc) return 0 ;;
1551 - x86) return 0 ;;
1552 - *) return 1 ;;
1553 - esac
1554 -}
1555 -
1556 -GHC_PV=${PV}
1557 -#GHC_PV=7.10.1.20150630 # uncomment only for -rc ebuilds
1558 -GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
1559 -
1560 -#SRC_URI="!binary? ( http://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.bz2 )"
1561 -# Upstream tarball was repackaged and inplace-updated. CDN cached old version for
1562 -# many users
1563 -SRC_URI="!binary? ( http://dev.gentoo.org/~slyfox/distfiles/${GHC_P}-src.tar.bz2 )"
1564 -S="${WORKDIR}"/${GHC_P}
1565 -
1566 -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
1567 -
1568 -BUMP_LIBRARIES=(
1569 - # "hackage-name hackage-version"
1570 - "binary 0.7.5.0"
1571 - "hoopl 3.10.1.0"
1572 - "transformers 0.4.3.0"
1573 -)
1574 -
1575 -LICENSE="BSD"
1576 -SLOT="0/${PV}"
1577 -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
1578 -IUSE="doc ghcbootstrap ghcmakebinary +gmp"
1579 -IUSE+=" binary"
1580 -IUSE+=" elibc_glibc" # system stuff
1581 -
1582 -RDEPEND="
1583 - >=dev-lang/perl-5.6.1
1584 - >=dev-libs/gmp-5:=
1585 - sys-libs/ncurses:=[unicode]
1586 - !ghcmakebinary? ( virtual/libffi:= )
1587 - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3:* )
1588 - kernel_linux? ( >=sys-devel/binutils-2.17:* )
1589 - kernel_SunOS? ( >=sys-devel/binutils-2.17:* )
1590 -"
1591 -# gentoo binaries are built against ncurses-5
1592 -RDEPEND+="
1593 - binary? (
1594 - || (
1595 - sys-libs/ncurses:0/5
1596 - sys-libs/ncurses:5/5
1597 - )
1598 - )
1599 -"
1600 -
1601 -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to
1602 -# that we want the binaries to use the latest versioun available, and not to be
1603 -# built against gmp-4
1604 -
1605 -# similar for glibc. we have bootstrapped binaries against glibc-2.17
1606 -DEPEND="${RDEPEND}
1607 - doc? ( app-text/docbook-xml-dtd:4.2
1608 - app-text/docbook-xml-dtd:4.5
1609 - app-text/docbook-xsl-stylesheets
1610 - >=dev-libs/libxslt-1.1.2 )
1611 - !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) ) )"
1612 -
1613 -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
1614 -
1615 -REQUIRED_USE="?? ( ghcbootstrap binary )"
1616 -
1617 -# haskell libraries built with cabal in configure mode, #515354
1618 -QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
1619 -
1620 -is_crosscompile() {
1621 - [[ ${CHOST} != ${CTARGET} ]]
1622 -}
1623 -
1624 -append-ghc-cflags() {
1625 - local persistent compile assemble link
1626 - local flag ghcflag
1627 -
1628 - for flag in $*; do
1629 - case ${flag} in
1630 - persistent) persistent="yes";;
1631 - compile) compile="yes";;
1632 - assemble) assemble="yes";;
1633 - link) link="yes";;
1634 - *)
1635 - [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
1636 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
1637 - [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
1638 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
1639 - [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
1640 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
1641 - ;;
1642 - esac
1643 - done
1644 -}
1645 -
1646 -# $1 - lib name (under libraries/)
1647 -# $2 - lib version
1648 -# example: bump_lib "transformers" "0.4.2.0"
1649 -bump_lib() {
1650 - local pn=$1 pv=$2
1651 - local p=${pn}-${pv}
1652 - local f
1653 -
1654 - einfo "Bumping ${pn} up to ${pv}"
1655 -
1656 - for f in ghc.mk GNUmakefile; do
1657 - mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
1658 - done
1659 - mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
1660 - mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
1661 -}
1662 -
1663 -update_SRC_URI() {
1664 - local p pn pv
1665 - for p in "${BUMP_LIBRARIES[@]}"; do
1666 - set -- $p
1667 - pn=$1 pv=$2
1668 -
1669 - SRC_URI+=" mirror://hackage/package/${pn}/${pn}-${pv}.tar.gz"
1670 - done
1671 -}
1672 -
1673 -update_SRC_URI
1674 -
1675 -bump_libs() {
1676 - local p pn pv
1677 - for p in "${BUMP_LIBRARIES[@]}"; do
1678 - set -- $p
1679 - pn=$1 pv=$2
1680 -
1681 - bump_lib "${pn}" "${pv}"
1682 - done
1683 -}
1684 -
1685 -ghc_setup_cflags() {
1686 - if is_crosscompile; then
1687 - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
1688 - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
1689 - einfo "Crosscompiling mode:"
1690 - einfo " CHOST: ${CHOST}"
1691 - einfo " CTARGET: ${CTARGET}"
1692 - einfo " CFLAGS: ${CFLAGS}"
1693 - einfo " LDFLAGS: ${LDFLAGS}"
1694 - return
1695 - fi
1696 - # We need to be very careful with the CFLAGS we ask ghc to pass through to
1697 - # gcc. There are plenty of flags which will make gcc produce output that
1698 - # breaks ghc in various ways. The main ones we want to pass through are
1699 - # -mcpu / -march flags. These are important for arches like alpha & sparc.
1700 - # We also use these CFLAGS for building the C parts of ghc, ie the rts.
1701 - strip-flags
1702 - strip-unsupported-flags
1703 -
1704 - # Cmm can't parse line numbers #482086
1705 - replace-flags -ggdb[3-9] -ggdb2
1706 -
1707 - GHC_FLAGS=""
1708 - GHC_PERSISTENT_FLAGS=""
1709 - for flag in ${CFLAGS}; do
1710 - case ${flag} in
1711 -
1712 - # Ignore extra optimisation (ghc passes -O to gcc anyway)
1713 - # -O2 and above break on too many systems
1714 - -O*) ;;
1715 -
1716 - # Arch and ABI flags are what we're really after
1717 - -m*) append-ghc-cflags compile assemble ${flag};;
1718 -
1719 - # Sometimes it's handy to see backtrace of RTS
1720 - # to get an idea what happens there
1721 - -g*) append-ghc-cflags compile ${flag};;
1722 -
1723 - # Ignore all other flags, including all -f* flags
1724 - esac
1725 - done
1726 -
1727 - for flag in ${LDFLAGS}; do
1728 - append-ghc-cflags link ${flag}
1729 - done
1730 -
1731 - # hardened-gcc needs to be disabled, because the mangler doesn't accept
1732 - # its output.
1733 - gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
1734 - gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector
1735 -
1736 - # prevent from failind building unregisterised ghc:
1737 - # http://www.mail-archive.com/debian-bugs-dist@××××××××××××.org/msg171602.html
1738 - use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
1739 - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
1740 - # currently ghc fails to build haddock
1741 - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
1742 - use ia64 && append-ghc-cflags persistent compile -G0
1743 -}
1744 -
1745 -# substitutes string $1 to $2 in files $3 $4 ...
1746 -relocate_path() {
1747 - local from=$1
1748 - local to=$2
1749 - shift 2
1750 - local file=
1751 - for file in "$@"
1752 - do
1753 - sed -i -e "s|$from|$to|g" \
1754 - "$file" || die "path relocation failed for '$file'"
1755 - done
1756 -}
1757 -
1758 -# changes hardcoded ghc paths and updates package index
1759 -# $1 - new absolute root path
1760 -relocate_ghc() {
1761 - local to=$1
1762 -
1763 - # libdir for prebuilt binary and for current system may mismatch
1764 - # It does for prefix installation for example: bug #476998
1765 - local bin_ghc_prefix=${WORKDIR}/usr
1766 - local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
1767 - local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
1768 -
1769 - # backup original script to use it later after relocation
1770 - local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
1771 - cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
1772 -
1773 - if [[ ${bin_libdir} != $(get_libdir) ]]; then
1774 - einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
1775 - # moving the dir itself is not strictly needed
1776 - # but then USE=binary would result in installing
1777 - # in '${bin_libdir}'
1778 - mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
1779 -
1780 - relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
1781 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
1782 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
1783 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
1784 - "${WORKDIR}/usr/bin/hsc2hs" \
1785 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
1786 - "$gp_back" \
1787 - "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
1788 - fi
1789 -
1790 - # Relocate from /usr to ${EPREFIX}/usr
1791 - relocate_path "/usr" "${to}/usr" \
1792 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
1793 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
1794 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
1795 - "${WORKDIR}/usr/bin/hsc2hs" \
1796 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
1797 - "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
1798 -
1799 - # this one we will use to regenerate cache
1800 - # so it should point to current tree location
1801 - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
1802 -
1803 - if use prefix; then
1804 - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree
1805 - # TODO: add the same for darwin's CHOST and it's DYLD_
1806 - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH'
1807 - sed -i -e '2i'"$new_ldpath" \
1808 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
1809 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
1810 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
1811 - "${WORKDIR}/usr/bin/hsc2hs" \
1812 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
1813 - "$gp_back" \
1814 - "${WORKDIR}/usr/bin/hsc2hs" \
1815 - || die "Adding LD_LIBRARY_PATH for wrappers failed"
1816 - fi
1817 -
1818 - # regenerate the binary package cache
1819 - "$gp_back" recache || die "failed to update cache after relocation"
1820 - rm "$gp_back"
1821 -}
1822 -
1823 -pkg_setup() {
1824 - # quiet portage about prebuilt binaries
1825 - use binary && QA_PREBUILT="*"
1826 -
1827 - [[ ${MERGE_TYPE} == binary ]] && return
1828 -
1829 - if use ghcbootstrap; then
1830 - ewarn "You requested ghc bootstrapping, this is usually only used"
1831 - ewarn "by Gentoo developers to make binary .tbz2 packages."
1832 -
1833 - [[ -z $(type -P ghc) ]] && \
1834 - die "Could not find a ghc to bootstrap with."
1835 - else
1836 - if ! yet_binary; then
1837 - eerror "Please try emerging with USE=ghcbootstrap and report build"
1838 - eerror "sucess or failure to the haskell team (haskell@g.o)"
1839 - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
1840 - fi
1841 - fi
1842 -}
1843 -
1844 -src_unpack() {
1845 - # Create the ${S} dir if we're using the binary version
1846 - use binary && mkdir "${S}"
1847 -
1848 - # the Solaris and Darwin binaries from ghc (maeder) need to be
1849 - # unpacked separately, so prevent them from being unpacked
1850 - local ONLYA=${A}
1851 - case ${CHOST} in
1852 - *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.bz2 ;;
1853 - esac
1854 - unpack ${ONLYA}
1855 -
1856 - if [[ -d "${S}"/libraries/dph ]]; then
1857 - # Sometimes dph libs get accidentally shipped with ghc
1858 - # but they are not installed unless user requests it.
1859 - # We never install them.
1860 - elog "Removing 'libraries/dph'"
1861 - rm -rf "${S}"/libraries/dph
1862 - fi
1863 -}
1864 -
1865 -src_prepare() {
1866 - ghc_setup_cflags
1867 -
1868 - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
1869 - # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
1870 - # See bug #313635.
1871 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
1872 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
1873 -
1874 - # allow hardened users use vanilla binary to bootstrap ghc
1875 - # ghci uses mmap with rwx protection at it implements dynamic
1876 - # linking on it's own (bug #299709)
1877 - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
1878 - fi
1879 -
1880 - if use binary; then
1881 - if use prefix; then
1882 - relocate_ghc "${EPREFIX}"
1883 - fi
1884 -
1885 - # Move unpacked files to the expected place
1886 - mv "${WORKDIR}/usr" "${S}"
1887 - else
1888 - if ! use ghcbootstrap; then
1889 - case ${CHOST} in
1890 - *-darwin* | *-solaris*)
1891 - # UPDATE ME for ghc-7
1892 - mkdir "${WORKDIR}"/ghc-bin-installer || die
1893 - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
1894 - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
1895 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
1896 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2
1897 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
1898 - popd > /dev/null
1899 -
1900 - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
1901 - # fix the binaries so they run, on Solaris we need an
1902 - # LD_LIBRARY_PATH which has our prefix libdirs, on
1903 - # Darwin we need to replace the frameworks with our libs
1904 - # from the prefix fix before installation, because some
1905 - # of the tools are actually used during configure/make
1906 - if [[ ${CHOST} == *-solaris* ]] ; then
1907 - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
1908 - elif [[ ${CHOST} == *-darwin* ]] ; then
1909 - local readline_framework=GNUreadline.framework/GNUreadline
1910 - local gmp_framework=/opt/local/lib/libgmp.10.dylib
1911 - local ncurses_file=/opt/local/lib/libncurses.5.dylib
1912 - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
1913 - install_name_tool -change \
1914 - ${readline_framework} \
1915 - "${EPREFIX}"/lib/libreadline.dylib \
1916 - ${binary} || die
1917 - install_name_tool -change \
1918 - ${gmp_framework} \
1919 - "${EPREFIX}"/usr/lib/libgmp.dylib \
1920 - ${binary} || die
1921 - install_name_tool -change \
1922 - ${ncurses_file} \
1923 - "${EPREFIX}"/usr/lib/libncurses.dylib \
1924 - ${binary} || die
1925 - done
1926 - # we don't do frameworks!
1927 - sed -i \
1928 - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
1929 - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
1930 - rts/package.conf.in || die
1931 - fi
1932 -
1933 - # it is autoconf, but we really don't want to give it too
1934 - # much arguments, in fact we do the make in-place anyway
1935 - ./configure --prefix="${WORKDIR}"/usr || die
1936 - make install || die
1937 - popd > /dev/null
1938 - ;;
1939 - *)
1940 - relocate_ghc "${WORKDIR}"
1941 - ;;
1942 - esac
1943 - fi
1944 -
1945 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
1946 - "${S}/ghc/ghc.wrapper"
1947 -
1948 - cd "${S}" # otherwise epatch will break
1949 -
1950 - epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
1951 -
1952 - epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
1953 - epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
1954 - epatch "${FILESDIR}"/${PN}-7.10.1-rc3-ghc-7.10-bootstrap.patch
1955 - epatch "${FILESDIR}"/${PN}-7.10.1-T10590-dequeue.patch
1956 - # Since ${S}/packages does not include base, etc. add them to gen_contents_index
1957 - sed -e 's@\(for REPO in .*\)@\1 base integer-gmp integer-gmp2 integer-simple template-haskell@' \
1958 - -i libraries/gen_contents_index || die
1959 -
1960 - if use prefix; then
1961 - # Make configure find docbook-xsl-stylesheets from Prefix
1962 - sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \
1963 - -i utils/haddock/doc/configure.ac || die
1964 - fi
1965 -
1966 - bump_libs
1967 -
1968 - # as we have changed the build system
1969 - eautoreconf
1970 - fi
1971 -}
1972 -
1973 -src_configure() {
1974 - if ! use binary; then
1975 - # initialize build.mk
1976 - echo '# Gentoo changes' > mk/build.mk
1977 -
1978 - # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
1979 - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
1980 - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
1981 -
1982 - # We also need to use the GHC_FLAGS flags when building ghc itself
1983 - echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
1984 - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
1985 - echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
1986 -
1987 - # We can't depend on haddock except when bootstrapping when we
1988 - # must build docs and include them into the binary .tbz2 package
1989 - # app-text/dblatex is not in portage, can not build PDF or PS
1990 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
1991 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
1992 - if use doc; then
1993 - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
1994 - else
1995 - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
1996 - fi
1997 -
1998 - # this controls presence on 'xhtml' and 'haddock' in final install
1999 - echo "HADDOCK_DOCS = YES" >> mk/build.mk
2000 -
2001 - # allows overriding build flavours for libraries:
2002 - # v - vanilla (static libs)
2003 - # p - profiled
2004 - # dyn - shared libraries
2005 - # example: GHC_LIBRARY_WAYS="v dyn"
2006 - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
2007 - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
2008 - fi
2009 -
2010 - # Get ghc from the unpacked binary .tbz2
2011 - # except when bootstrapping we just pick ghc up off the path
2012 - if ! use ghcbootstrap; then
2013 - export PATH="${WORKDIR}/usr/bin:${PATH}"
2014 - fi
2015 -
2016 - if use gmp; then
2017 - echo "INTEGER_LIBRARY=integer-gmp2" >> mk/build.mk
2018 - else
2019 - echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
2020 - fi
2021 -
2022 - # don't strip anything. Very useful when stage2 SIGSEGVs on you
2023 - echo "STRIP_CMD = :" >> mk/build.mk
2024 -
2025 - local econf_args=()
2026 -
2027 - # GHC embeds 'gcc' it was built by and uses it later.
2028 - # Don't allow things like ccache or versioned binary slip.
2029 - # We use stable thing across gcc upgrades.
2030 - is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
2031 -
2032 - if use ghcmakebinary; then
2033 - # When building booting libary we are trying to
2034 - # bundle or restrict most of external depends
2035 - # with unstable ABI:
2036 - # - embed libffi (default GHC behaviour)
2037 - # - disable ncurses support for ghci (via haskeline)
2038 - # https://bugs.gentoo.org/557478
2039 - # - disable ncurses support for ghc-pkg
2040 - echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
2041 - echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
2042 - else
2043 - econf_args+=(--with-system-libffi)
2044 - econf_args+=(--with-ffi-includes=$(pkg-config libffi --cflags-only-I | sed -e 's@^-I@@'))
2045 - fi
2046 -
2047 - elog "Final mk/build.mk:"
2048 - cat mk/build.mk || die
2049 -
2050 - econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
2051 -
2052 - if [[ ${PV} == *9999* ]]; then
2053 - GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
2054 - GHC_P=${PN}-${GHC_PV}
2055 - fi
2056 - GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
2057 - fi # ! use binary
2058 -}
2059 -
2060 -src_compile() {
2061 - if ! use binary; then
2062 - # 1. build compiler binary first
2063 - emake ghc/stage2/build/tmp/ghc-stage2
2064 - # 2. pax-mark (bug #516430)
2065 - pax-mark -m ghc/stage2/build/tmp/ghc-stage2
2066 - # 3. and then all the rest
2067 - emake all
2068 - fi # ! use binary
2069 -}
2070 -
2071 -src_install() {
2072 - if use binary; then
2073 - use prefix && mkdir -p "${ED}"
2074 - mv "${S}/usr" "${ED}"
2075 - else
2076 -
2077 - emake -j1 install DESTDIR="${D}"
2078 - dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
2079 -
2080 - # rename ghc-shipped files to avoid collision
2081 - # of external packages. Motivating example:
2082 - # user had installed:
2083 - # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
2084 - # dev-haskell/transformers-0.4.2.0
2085 - # then user tried to update to
2086 - # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
2087 - # this will lead to single .conf file collision.
2088 - local shipped_conf renamed_conf
2089 - local package_confdir="${ED}/usr/$(get_libdir)/${GHC_P}/package.conf.d"
2090 - for shipped_conf in "${package_confdir}"/*.conf; do
2091 - # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
2092 - renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
2093 - mv "${shipped_conf}" "${renamed_conf}" || die
2094 - done
2095 -
2096 - # remove link, but leave 'haddock-${GHC_P}'
2097 - rm -f "${ED}"/usr/bin/haddock
2098 -
2099 - if [[ ! -f "${S}/VERSION" ]]; then
2100 - echo "${GHC_PV}" > "${S}/VERSION" \
2101 - || die "Could not create file ${S}/VERSION"
2102 - fi
2103 - newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
2104 - newbashcomp utils/completion/ghc.bash ghc
2105 - fi
2106 -
2107 - # path to the package.cache
2108 - local package_confdir="${ED}/usr/$(get_libdir)/${GHC_P}/package.conf.d"
2109 - PKGCACHE="${package_confdir}"/package.cache
2110 - # copy the package.conf.d, including timestamp, save it so we can help
2111 - # users that have a broken package.conf.d
2112 - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
2113 -
2114 - # copy the package.conf, including timestamp, save it so we later can put it
2115 - # back before uninstalling, or when upgrading.
2116 - cp -p "${PKGCACHE}"{,.shipped} \
2117 - || die "failed to copy package.conf.d/package.cache"
2118 -}
2119 -
2120 -pkg_preinst() {
2121 - # have we got an earlier version of ghc installed?
2122 - if has_version "<${CATEGORY}/${PF}"; then
2123 - haskell_updater_warn="1"
2124 - fi
2125 -}
2126 -
2127 -pkg_postinst() {
2128 - ghc-reregister
2129 -
2130 - # path to the package.cache
2131 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
2132 -
2133 - # give the cache a new timestamp, it must be as recent as
2134 - # the package.conf.d directory.
2135 - touch "${PKGCACHE}"
2136 -
2137 - if [[ "${haskell_updater_warn}" == "1" ]]; then
2138 - ewarn
2139 - ewarn "\e[1;31m************************************************************************\e[0m"
2140 - ewarn
2141 - ewarn "You have just upgraded from an older version of GHC."
2142 - ewarn "You may have to run"
2143 - ewarn " 'haskell-updater'"
2144 - ewarn "to rebuild all ghc-based Haskell libraries."
2145 - ewarn
2146 - ewarn "\e[1;31m************************************************************************\e[0m"
2147 - ewarn
2148 - fi
2149 -}
2150 -
2151 -pkg_prerm() {
2152 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
2153 - rm -rf "${PKGCACHE}"
2154 -
2155 - cp -p "${PKGCACHE}"{.shipped,}
2156 -}
2157 -
2158 -pkg_postrm() {
2159 - ghc-package_pkg_postrm
2160 -}
2161
2162 diff --git a/dev-lang/ghc/ghc-7.10.2.ebuild b/dev-lang/ghc/ghc-7.10.2.ebuild
2163 deleted file mode 100644
2164 index 7b04d83..00000000
2165 --- a/dev-lang/ghc/ghc-7.10.2.ebuild
2166 +++ /dev/null
2167 @@ -1,652 +0,0 @@
2168 -# Copyright 1999-2016 Gentoo Foundation
2169 -# Distributed under the terms of the GNU General Public License v2
2170 -# $Id$
2171 -
2172 -EAPI=5
2173 -
2174 -# to make make a crosscompiler use crossdev and symlink ghc tree into
2175 -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
2176 -#
2177 -# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
2178 -export CTARGET=${CTARGET:-${CHOST}}
2179 -if [[ ${CTARGET} = ${CHOST} ]] ; then
2180 - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
2181 - export CTARGET=${CATEGORY/cross-}
2182 - fi
2183 -fi
2184 -
2185 -inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
2186 -inherit multilib pax-utils toolchain-funcs versionator
2187 -
2188 -DESCRIPTION="The Glasgow Haskell Compiler"
2189 -HOMEPAGE="http://www.haskell.org/ghc/"
2190 -
2191 -# we don't have any binaries yet
2192 -arch_binaries=""
2193 -
2194 -# sorted!
2195 -#arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
2196 -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
2197 -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )"
2198 -#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
2199 -#arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )"
2200 -#arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )"
2201 -#arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )"
2202 -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )"
2203 -
2204 -# various ports:
2205 -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
2206 -
2207 -# 0 - yet
2208 -yet_binary() {
2209 - case "${ARCH}" in
2210 - #alpha) return 0 ;;
2211 - #arm)
2212 - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
2213 - # return 0
2214 - #;;
2215 - amd64) return 0 ;;
2216 - #ia64) return 0 ;;
2217 - #ppc) return 0 ;;
2218 - #ppc64) return 0 ;;
2219 - #sparc) return 0 ;;
2220 - x86) return 0 ;;
2221 - *) return 1 ;;
2222 - esac
2223 -}
2224 -
2225 -GHC_PV=${PV}
2226 -#GHC_PV=7.10.1.20150630 # uncomment only for -rc ebuilds
2227 -GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
2228 -
2229 -#SRC_URI="!binary? ( http://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.bz2 )"
2230 -# Upstream tarball was repackaged and inplace-updated. CDN cached old version for
2231 -# many users
2232 -SRC_URI="!binary? ( https://dev.gentoo.org/~slyfox/distfiles/${GHC_P}-src.tar.bz2 )"
2233 -S="${WORKDIR}"/${GHC_P}
2234 -
2235 -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
2236 -
2237 -BUMP_LIBRARIES=(
2238 - # "hackage-name hackage-version"
2239 - "binary 0.7.5.0"
2240 - "hoopl 3.10.1.0"
2241 - "transformers 0.4.3.0"
2242 -)
2243 -
2244 -LICENSE="BSD"
2245 -SLOT="0/${PV}"
2246 -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
2247 -IUSE="doc ghcbootstrap ghcmakebinary +gmp"
2248 -IUSE+=" binary"
2249 -IUSE+=" elibc_glibc" # system stuff
2250 -
2251 -RDEPEND="
2252 - >=dev-lang/perl-5.6.1
2253 - >=dev-libs/gmp-5:=
2254 - sys-libs/ncurses:=[unicode]
2255 - !ghcmakebinary? ( virtual/libffi:= )
2256 - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3:* )
2257 - kernel_linux? ( >=sys-devel/binutils-2.17:* )
2258 - kernel_SunOS? ( >=sys-devel/binutils-2.17:* )
2259 -"
2260 -# gentoo binaries are built against ncurses-5
2261 -RDEPEND+="
2262 - binary? (
2263 - || (
2264 - sys-libs/ncurses:0/5
2265 - sys-libs/ncurses:5/5
2266 - )
2267 - )
2268 -"
2269 -
2270 -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to
2271 -# that we want the binaries to use the latest versioun available, and not to be
2272 -# built against gmp-4
2273 -
2274 -# similar for glibc. we have bootstrapped binaries against glibc-2.17
2275 -DEPEND="${RDEPEND}
2276 - doc? ( app-text/docbook-xml-dtd:4.2
2277 - app-text/docbook-xml-dtd:4.5
2278 - app-text/docbook-xsl-stylesheets
2279 - >=dev-libs/libxslt-1.1.2 )
2280 - !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) ) )"
2281 -
2282 -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
2283 -
2284 -REQUIRED_USE="?? ( ghcbootstrap binary )"
2285 -
2286 -# haskell libraries built with cabal in configure mode, #515354
2287 -QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
2288 -
2289 -is_crosscompile() {
2290 - [[ ${CHOST} != ${CTARGET} ]]
2291 -}
2292 -
2293 -append-ghc-cflags() {
2294 - local persistent compile assemble link
2295 - local flag ghcflag
2296 -
2297 - for flag in $*; do
2298 - case ${flag} in
2299 - persistent) persistent="yes";;
2300 - compile) compile="yes";;
2301 - assemble) assemble="yes";;
2302 - link) link="yes";;
2303 - *)
2304 - [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
2305 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
2306 - [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
2307 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
2308 - [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
2309 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
2310 - ;;
2311 - esac
2312 - done
2313 -}
2314 -
2315 -# $1 - lib name (under libraries/)
2316 -# $2 - lib version
2317 -# example: bump_lib "transformers" "0.4.2.0"
2318 -bump_lib() {
2319 - local pn=$1 pv=$2
2320 - local p=${pn}-${pv}
2321 - local f
2322 -
2323 - einfo "Bumping ${pn} up to ${pv}"
2324 -
2325 - for f in ghc.mk GNUmakefile; do
2326 - mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
2327 - done
2328 - mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
2329 - mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
2330 -}
2331 -
2332 -update_SRC_URI() {
2333 - local p pn pv
2334 - for p in "${BUMP_LIBRARIES[@]}"; do
2335 - set -- $p
2336 - pn=$1 pv=$2
2337 -
2338 - SRC_URI+=" mirror://hackage/package/${pn}/${pn}-${pv}.tar.gz"
2339 - done
2340 -}
2341 -
2342 -update_SRC_URI
2343 -
2344 -bump_libs() {
2345 - local p pn pv
2346 - for p in "${BUMP_LIBRARIES[@]}"; do
2347 - set -- $p
2348 - pn=$1 pv=$2
2349 -
2350 - bump_lib "${pn}" "${pv}"
2351 - done
2352 -}
2353 -
2354 -ghc_setup_cflags() {
2355 - if is_crosscompile; then
2356 - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
2357 - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
2358 - einfo "Crosscompiling mode:"
2359 - einfo " CHOST: ${CHOST}"
2360 - einfo " CTARGET: ${CTARGET}"
2361 - einfo " CFLAGS: ${CFLAGS}"
2362 - einfo " LDFLAGS: ${LDFLAGS}"
2363 - return
2364 - fi
2365 - # We need to be very careful with the CFLAGS we ask ghc to pass through to
2366 - # gcc. There are plenty of flags which will make gcc produce output that
2367 - # breaks ghc in various ways. The main ones we want to pass through are
2368 - # -mcpu / -march flags. These are important for arches like alpha & sparc.
2369 - # We also use these CFLAGS for building the C parts of ghc, ie the rts.
2370 - strip-flags
2371 - strip-unsupported-flags
2372 -
2373 - # Cmm can't parse line numbers #482086
2374 - replace-flags -ggdb[3-9] -ggdb2
2375 -
2376 - GHC_FLAGS=""
2377 - GHC_PERSISTENT_FLAGS=""
2378 - for flag in ${CFLAGS}; do
2379 - case ${flag} in
2380 -
2381 - # Ignore extra optimisation (ghc passes -O to gcc anyway)
2382 - # -O2 and above break on too many systems
2383 - -O*) ;;
2384 -
2385 - # Arch and ABI flags are what we're really after
2386 - -m*) append-ghc-cflags compile assemble ${flag};;
2387 -
2388 - # Sometimes it's handy to see backtrace of RTS
2389 - # to get an idea what happens there
2390 - -g*) append-ghc-cflags compile ${flag};;
2391 -
2392 - # Ignore all other flags, including all -f* flags
2393 - esac
2394 - done
2395 -
2396 - for flag in ${LDFLAGS}; do
2397 - append-ghc-cflags link ${flag}
2398 - done
2399 -
2400 - # hardened-gcc needs to be disabled, because the mangler doesn't accept
2401 - # its output.
2402 - gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
2403 - gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector
2404 -
2405 - # prevent from failind building unregisterised ghc:
2406 - # http://www.mail-archive.com/debian-bugs-dist@××××××××××××.org/msg171602.html
2407 - use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
2408 - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
2409 - # currently ghc fails to build haddock
2410 - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
2411 - use ia64 && append-ghc-cflags persistent compile -G0
2412 -}
2413 -
2414 -# substitutes string $1 to $2 in files $3 $4 ...
2415 -relocate_path() {
2416 - local from=$1
2417 - local to=$2
2418 - shift 2
2419 - local file=
2420 - for file in "$@"
2421 - do
2422 - sed -i -e "s|$from|$to|g" \
2423 - "$file" || die "path relocation failed for '$file'"
2424 - done
2425 -}
2426 -
2427 -# changes hardcoded ghc paths and updates package index
2428 -# $1 - new absolute root path
2429 -relocate_ghc() {
2430 - local to=$1
2431 -
2432 - # libdir for prebuilt binary and for current system may mismatch
2433 - # It does for prefix installation for example: bug #476998
2434 - local bin_ghc_prefix=${WORKDIR}/usr
2435 - local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
2436 - local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
2437 -
2438 - # backup original script to use it later after relocation
2439 - local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
2440 - cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
2441 -
2442 - if [[ ${bin_libdir} != $(get_libdir) ]]; then
2443 - einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
2444 - # moving the dir itself is not strictly needed
2445 - # but then USE=binary would result in installing
2446 - # in '${bin_libdir}'
2447 - mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
2448 -
2449 - relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
2450 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
2451 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
2452 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
2453 - "${WORKDIR}/usr/bin/hsc2hs" \
2454 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
2455 - "$gp_back" \
2456 - "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
2457 - fi
2458 -
2459 - # Relocate from /usr to ${EPREFIX}/usr
2460 - relocate_path "/usr" "${to}/usr" \
2461 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
2462 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
2463 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
2464 - "${WORKDIR}/usr/bin/hsc2hs" \
2465 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
2466 - "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
2467 -
2468 - # this one we will use to regenerate cache
2469 - # so it should point to current tree location
2470 - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
2471 -
2472 - if use prefix; then
2473 - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree
2474 - # TODO: add the same for darwin's CHOST and it's DYLD_
2475 - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH'
2476 - sed -i -e '2i'"$new_ldpath" \
2477 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
2478 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
2479 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
2480 - "${WORKDIR}/usr/bin/hsc2hs" \
2481 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
2482 - "$gp_back" \
2483 - "${WORKDIR}/usr/bin/hsc2hs" \
2484 - || die "Adding LD_LIBRARY_PATH for wrappers failed"
2485 - fi
2486 -
2487 - # regenerate the binary package cache
2488 - "$gp_back" recache || die "failed to update cache after relocation"
2489 - rm "$gp_back"
2490 -}
2491 -
2492 -pkg_setup() {
2493 - # quiet portage about prebuilt binaries
2494 - use binary && QA_PREBUILT="*"
2495 -
2496 - [[ ${MERGE_TYPE} == binary ]] && return
2497 -
2498 - if use ghcbootstrap; then
2499 - ewarn "You requested ghc bootstrapping, this is usually only used"
2500 - ewarn "by Gentoo developers to make binary .tbz2 packages."
2501 -
2502 - [[ -z $(type -P ghc) ]] && \
2503 - die "Could not find a ghc to bootstrap with."
2504 - else
2505 - if ! yet_binary; then
2506 - eerror "Please try emerging with USE=ghcbootstrap and report build"
2507 - eerror "sucess or failure to the haskell team (haskell@g.o)"
2508 - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
2509 - fi
2510 - fi
2511 -}
2512 -
2513 -src_unpack() {
2514 - # Create the ${S} dir if we're using the binary version
2515 - use binary && mkdir "${S}"
2516 -
2517 - # the Solaris and Darwin binaries from ghc (maeder) need to be
2518 - # unpacked separately, so prevent them from being unpacked
2519 - local ONLYA=${A}
2520 - case ${CHOST} in
2521 - *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.bz2 ;;
2522 - esac
2523 - unpack ${ONLYA}
2524 -
2525 - if [[ -d "${S}"/libraries/dph ]]; then
2526 - # Sometimes dph libs get accidentally shipped with ghc
2527 - # but they are not installed unless user requests it.
2528 - # We never install them.
2529 - elog "Removing 'libraries/dph'"
2530 - rm -rf "${S}"/libraries/dph
2531 - fi
2532 -}
2533 -
2534 -src_prepare() {
2535 - ghc_setup_cflags
2536 -
2537 - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
2538 - # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
2539 - # See bug #313635.
2540 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
2541 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
2542 -
2543 - # allow hardened users use vanilla binary to bootstrap ghc
2544 - # ghci uses mmap with rwx protection at it implements dynamic
2545 - # linking on it's own (bug #299709)
2546 - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
2547 - fi
2548 -
2549 - if use binary; then
2550 - if use prefix; then
2551 - relocate_ghc "${EPREFIX}"
2552 - fi
2553 -
2554 - # Move unpacked files to the expected place
2555 - mv "${WORKDIR}/usr" "${S}"
2556 - else
2557 - if ! use ghcbootstrap; then
2558 - case ${CHOST} in
2559 - *-darwin* | *-solaris*)
2560 - # UPDATE ME for ghc-7
2561 - mkdir "${WORKDIR}"/ghc-bin-installer || die
2562 - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
2563 - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
2564 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
2565 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2
2566 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
2567 - popd > /dev/null
2568 -
2569 - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
2570 - # fix the binaries so they run, on Solaris we need an
2571 - # LD_LIBRARY_PATH which has our prefix libdirs, on
2572 - # Darwin we need to replace the frameworks with our libs
2573 - # from the prefix fix before installation, because some
2574 - # of the tools are actually used during configure/make
2575 - if [[ ${CHOST} == *-solaris* ]] ; then
2576 - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
2577 - elif [[ ${CHOST} == *-darwin* ]] ; then
2578 - local readline_framework=GNUreadline.framework/GNUreadline
2579 - local gmp_framework=/opt/local/lib/libgmp.10.dylib
2580 - local ncurses_file=/opt/local/lib/libncurses.5.dylib
2581 - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
2582 - install_name_tool -change \
2583 - ${readline_framework} \
2584 - "${EPREFIX}"/lib/libreadline.dylib \
2585 - ${binary} || die
2586 - install_name_tool -change \
2587 - ${gmp_framework} \
2588 - "${EPREFIX}"/usr/lib/libgmp.dylib \
2589 - ${binary} || die
2590 - install_name_tool -change \
2591 - ${ncurses_file} \
2592 - "${EPREFIX}"/usr/lib/libncurses.dylib \
2593 - ${binary} || die
2594 - done
2595 - # we don't do frameworks!
2596 - sed -i \
2597 - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
2598 - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
2599 - rts/package.conf.in || die
2600 - fi
2601 -
2602 - # it is autoconf, but we really don't want to give it too
2603 - # much arguments, in fact we do the make in-place anyway
2604 - ./configure --prefix="${WORKDIR}"/usr || die
2605 - make install || die
2606 - popd > /dev/null
2607 - ;;
2608 - *)
2609 - relocate_ghc "${WORKDIR}"
2610 - ;;
2611 - esac
2612 - fi
2613 -
2614 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
2615 - "${S}/ghc/ghc.wrapper"
2616 -
2617 - cd "${S}" # otherwise epatch will break
2618 -
2619 - epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
2620 -
2621 - epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
2622 - epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
2623 - epatch "${FILESDIR}"/${PN}-7.10.1-rc3-ghc-7.10-bootstrap.patch
2624 - epatch "${FILESDIR}"/${PN}-7.10.1-T10590-dequeue.patch
2625 - # Since ${S}/packages does not include base, etc. add them to gen_contents_index
2626 - sed -e 's@\(for REPO in .*\)@\1 base integer-gmp integer-gmp2 integer-simple template-haskell@' \
2627 - -i libraries/gen_contents_index || die
2628 -
2629 - if use prefix; then
2630 - # Make configure find docbook-xsl-stylesheets from Prefix
2631 - sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \
2632 - -i utils/haddock/doc/configure.ac || die
2633 - fi
2634 -
2635 - bump_libs
2636 -
2637 - # as we have changed the build system
2638 - eautoreconf
2639 - fi
2640 -}
2641 -
2642 -src_configure() {
2643 - if ! use binary; then
2644 - # initialize build.mk
2645 - echo '# Gentoo changes' > mk/build.mk
2646 -
2647 - # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
2648 - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
2649 - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
2650 -
2651 - # We also need to use the GHC_FLAGS flags when building ghc itself
2652 - echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
2653 - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
2654 - echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
2655 -
2656 - # We can't depend on haddock except when bootstrapping when we
2657 - # must build docs and include them into the binary .tbz2 package
2658 - # app-text/dblatex is not in portage, can not build PDF or PS
2659 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
2660 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
2661 - if use doc; then
2662 - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
2663 - else
2664 - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
2665 - fi
2666 -
2667 - # this controls presence on 'xhtml' and 'haddock' in final install
2668 - echo "HADDOCK_DOCS = YES" >> mk/build.mk
2669 -
2670 - # allows overriding build flavours for libraries:
2671 - # v - vanilla (static libs)
2672 - # p - profiled
2673 - # dyn - shared libraries
2674 - # example: GHC_LIBRARY_WAYS="v dyn"
2675 - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
2676 - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
2677 - fi
2678 -
2679 - # Get ghc from the unpacked binary .tbz2
2680 - # except when bootstrapping we just pick ghc up off the path
2681 - if ! use ghcbootstrap; then
2682 - export PATH="${WORKDIR}/usr/bin:${PATH}"
2683 - fi
2684 -
2685 - if use gmp; then
2686 - echo "INTEGER_LIBRARY=integer-gmp2" >> mk/build.mk
2687 - else
2688 - echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
2689 - fi
2690 -
2691 - # don't strip anything. Very useful when stage2 SIGSEGVs on you
2692 - echo "STRIP_CMD = :" >> mk/build.mk
2693 -
2694 - elog "Final mk/build.mk:"
2695 - cat mk/build.mk || die
2696 -
2697 - local econf_args=()
2698 -
2699 - # GHC embeds 'gcc' it was built by and uses it later.
2700 - # Don't allow things like ccache or versioned binary slip.
2701 - # We use stable thing across gcc upgrades.
2702 - is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
2703 -
2704 - if ! use ghcmakebinary; then
2705 - econf_args+=(--with-system-libffi)
2706 - econf_args+=(--with-ffi-includes=$(pkg-config libffi --cflags-only-I | sed -e 's@^-I@@'))
2707 - fi
2708 -
2709 - econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
2710 -
2711 - if [[ ${PV} == *9999* ]]; then
2712 - GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
2713 - GHC_P=${PN}-${GHC_PV}
2714 - fi
2715 - GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
2716 - fi # ! use binary
2717 -}
2718 -
2719 -src_compile() {
2720 - if ! use binary; then
2721 - # 1. build compiler binary first
2722 - emake ghc/stage2/build/tmp/ghc-stage2
2723 - # 2. pax-mark (bug #516430)
2724 - pax-mark -m ghc/stage2/build/tmp/ghc-stage2
2725 - # 3. and then all the rest
2726 - emake all
2727 - fi # ! use binary
2728 -}
2729 -
2730 -src_install() {
2731 - if use binary; then
2732 - use prefix && mkdir -p "${ED}"
2733 - mv "${S}/usr" "${ED}"
2734 - else
2735 -
2736 - emake -j1 install DESTDIR="${D}"
2737 - dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
2738 -
2739 - # rename ghc-shipped files to avoid collision
2740 - # of external packages. Motivating example:
2741 - # user had installed:
2742 - # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
2743 - # dev-haskell/transformers-0.4.2.0
2744 - # then user tried to update to
2745 - # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
2746 - # this will lead to single .conf file collision.
2747 - local shipped_conf renamed_conf
2748 - local package_confdir="${ED}/usr/$(get_libdir)/${GHC_P}/package.conf.d"
2749 - for shipped_conf in "${package_confdir}"/*.conf; do
2750 - # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
2751 - renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
2752 - mv "${shipped_conf}" "${renamed_conf}" || die
2753 - done
2754 -
2755 - # remove link, but leave 'haddock-${GHC_P}'
2756 - rm -f "${ED}"/usr/bin/haddock
2757 -
2758 - if [[ ! -f "${S}/VERSION" ]]; then
2759 - echo "${GHC_PV}" > "${S}/VERSION" \
2760 - || die "Could not create file ${S}/VERSION"
2761 - fi
2762 - newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
2763 - newbashcomp utils/completion/ghc.bash ghc
2764 - fi
2765 -
2766 - # path to the package.cache
2767 - local package_confdir="${ED}/usr/$(get_libdir)/${GHC_P}/package.conf.d"
2768 - PKGCACHE="${package_confdir}"/package.cache
2769 - # copy the package.conf.d, including timestamp, save it so we can help
2770 - # users that have a broken package.conf.d
2771 - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
2772 -
2773 - # copy the package.conf, including timestamp, save it so we later can put it
2774 - # back before uninstalling, or when upgrading.
2775 - cp -p "${PKGCACHE}"{,.shipped} \
2776 - || die "failed to copy package.conf.d/package.cache"
2777 -}
2778 -
2779 -pkg_preinst() {
2780 - # have we got an earlier version of ghc installed?
2781 - if has_version "<${CATEGORY}/${PF}"; then
2782 - haskell_updater_warn="1"
2783 - fi
2784 -}
2785 -
2786 -pkg_postinst() {
2787 - ghc-reregister
2788 -
2789 - # path to the package.cache
2790 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
2791 -
2792 - # give the cache a new timestamp, it must be as recent as
2793 - # the package.conf.d directory.
2794 - touch "${PKGCACHE}"
2795 -
2796 - if [[ "${haskell_updater_warn}" == "1" ]]; then
2797 - ewarn
2798 - ewarn "\e[1;31m************************************************************************\e[0m"
2799 - ewarn
2800 - ewarn "You have just upgraded from an older version of GHC."
2801 - ewarn "You may have to run"
2802 - ewarn " 'haskell-updater'"
2803 - ewarn "to rebuild all ghc-based Haskell libraries."
2804 - ewarn
2805 - ewarn "\e[1;31m************************************************************************\e[0m"
2806 - ewarn
2807 - fi
2808 -}
2809 -
2810 -pkg_prerm() {
2811 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
2812 - rm -rf "${PKGCACHE}"
2813 -
2814 - cp -p "${PKGCACHE}"{.shipped,}
2815 -}
2816 -
2817 -pkg_postrm() {
2818 - ghc-package_pkg_postrm
2819 -}
2820
2821 diff --git a/dev-lang/ghc/ghc-7.4.2.ebuild b/dev-lang/ghc/ghc-7.4.2.ebuild
2822 deleted file mode 100644
2823 index 366f1d4..00000000
2824 --- a/dev-lang/ghc/ghc-7.4.2.ebuild
2825 +++ /dev/null
2826 @@ -1,640 +0,0 @@
2827 -# Copyright 1999-2015 Gentoo Foundation
2828 -# Distributed under the terms of the GNU General Public License v2
2829 -# $Id$
2830 -
2831 -# Brief explanation of the bootstrap logic:
2832 -#
2833 -# Previous ghc ebuilds have been split into two: ghc and ghc-bin,
2834 -# where ghc-bin was primarily used for bootstrapping purposes.
2835 -# From now on, these two ebuilds have been combined, with the
2836 -# binary USE flag used to determine whether or not the pre-built
2837 -# binary package should be emerged or whether ghc should be compiled
2838 -# from source. If the latter, then the relevant ghc-bin for the
2839 -# arch in question will be used in the working directory to compile
2840 -# ghc from source.
2841 -#
2842 -# This solution has the advantage of allowing us to retain the one
2843 -# ebuild for both packages, and thus phase out virtual/ghc.
2844 -
2845 -# Note to users of hardened gcc-3.x:
2846 -#
2847 -# If you emerge ghc with hardened gcc it should work fine (because we
2848 -# turn off the hardened features that would otherwise break ghc).
2849 -# However, emerging ghc while using a vanilla gcc and then switching to
2850 -# hardened gcc (using gcc-config) will leave you with a broken ghc. To
2851 -# fix it you would need to either switch back to vanilla gcc or re-emerge
2852 -# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and
2853 -# you switch to gcc-4.x that this will also break ghc and you'll need to
2854 -# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between
2855 -# gcc-3.x and 4.x with no problems.
2856 -
2857 -EAPI="5"
2858 -
2859 -inherit base autotools bash-completion-r1 eutils flag-o-matic multilib toolchain-funcs ghc-package versionator pax-utils
2860 -
2861 -DESCRIPTION="The Glasgow Haskell Compiler"
2862 -HOMEPAGE="http://www.haskell.org/ghc/"
2863 -
2864 -# we don't have any binaries yet
2865 -arch_binaries=""
2866 -
2867 -# sorted!
2868 -arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
2869 -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
2870 -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64-stable-glibc.tbz2 )"
2871 -arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64.tbz2 )"
2872 -arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )"
2873 -arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )"
2874 -arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )"
2875 -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86-stable-glibc.tbz2 )"
2876 -
2877 -# various ports:
2878 -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
2879 -
2880 -# 0 - yet
2881 -yet_binary() {
2882 - case "${ARCH}" in
2883 - alpha) return 0 ;;
2884 - #arm)
2885 - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
2886 - # return 0
2887 - #;;
2888 - amd64) return 0 ;;
2889 - ia64) return 0 ;;
2890 - ppc) return 0 ;;
2891 - ppc64) return 0 ;;
2892 - sparc) return 0 ;;
2893 - x86) return 0 ;;
2894 - *) return 1 ;;
2895 - esac
2896 -}
2897 -
2898 -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )"
2899 -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
2900 -LICENSE="BSD"
2901 -SLOT="0/${PV}"
2902 -# ghc on ia64 needs gcc to support -mcmodel=medium (or some dark hackery) to avoid TOC overflow
2903 -KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
2904 -IUSE="doc ghcbootstrap ghcmakebinary +gmp llvm"
2905 -IUSE+=" binary" # don't forget about me later!
2906 -IUSE+=" elibc_glibc" # system stuff
2907 -
2908 -RDEPEND="
2909 - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 )
2910 - kernel_linux? ( >=sys-devel/binutils-2.17 )
2911 - kernel_SunOS? ( >=sys-devel/binutils-2.17 )
2912 - >=dev-lang/perl-5.6.1
2913 - >=dev-libs/gmp-5
2914 - virtual/libffi
2915 - !<dev-haskell/haddock-2.10.0
2916 - sys-libs/ncurses[unicode]"
2917 -# earlier versions than 2.4.2 of haddock only works with older ghc releases
2918 -
2919 -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to
2920 -# that we want the binaries to use the latest versioun available, and not to be
2921 -# built against gmp-4
2922 -
2923 -# similar for glibc. we have bootstrapped binaries against glibc-2.14
2924 -DEPEND="${RDEPEND}
2925 - ghcbootstrap? (
2926 - doc? ( app-text/docbook-xml-dtd:4.2
2927 - app-text/docbook-xml-dtd:4.5
2928 - app-text/docbook-xsl-stylesheets
2929 - >=dev-libs/libxslt-1.1.2 ) )
2930 - !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.14 ) ) )"
2931 -
2932 -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
2933 -PDEPEND="
2934 - ${PDEPEND}
2935 - llvm? ( sys-devel/llvm )"
2936 -
2937 -# ia64 fails to return from STG GMP primitives (stage2 always SIGSEGVs)
2938 -REQUIRED_USE="ia64? ( !gmp )"
2939 -
2940 -append-ghc-cflags() {
2941 - local flag compile assemble link
2942 - for flag in $*; do
2943 - case ${flag} in
2944 - compile) compile="yes";;
2945 - assemble) assemble="yes";;
2946 - link) link="yes";;
2947 - *)
2948 - [[ ${compile} ]] && GHC_FLAGS="${GHC_FLAGS} -optc${flag}" CFLAGS="${CFLAGS} ${flag}"
2949 - [[ ${assemble} ]] && GHC_FLAGS="${GHC_FLAGS} -opta${flag}" CFLAGS="${CFLAGS} ${flag}"
2950 - [[ ${link} ]] && GHC_FLAGS="${GHC_FLAGS} -optl${flag}" FILTERED_LDFLAGS="${FILTERED_LDFLAGS} ${flag}";;
2951 - esac
2952 - done
2953 -}
2954 -
2955 -ghc_setup_cflags() {
2956 - # We need to be very careful with the CFLAGS we ask ghc to pass through to
2957 - # gcc. There are plenty of flags which will make gcc produce output that
2958 - # breaks ghc in various ways. The main ones we want to pass through are
2959 - # -mcpu / -march flags. These are important for arches like alpha & sparc.
2960 - # We also use these CFLAGS for building the C parts of ghc, ie the rts.
2961 - strip-flags
2962 - strip-unsupported-flags
2963 -
2964 - # Cmm can't parse line numbers #482086
2965 - replace-flags -ggdb[3-9] -ggdb2
2966 -
2967 - GHC_FLAGS=""
2968 - for flag in ${CFLAGS}; do
2969 - case ${flag} in
2970 -
2971 - # Ignore extra optimisation (ghc passes -O to gcc anyway)
2972 - # -O2 and above break on too many systems
2973 - -O*) ;;
2974 -
2975 - # Arch and ABI flags are what we're really after
2976 - -m*) append-ghc-cflags compile assemble ${flag};;
2977 -
2978 - # Debugging flags don't help either. You can't debug Haskell code
2979 - # at the C source level and the mangler discards the debug info.
2980 - -g*) ;;
2981 -
2982 - # Ignore all other flags, including all -f* flags
2983 - esac
2984 - done
2985 -
2986 - FILTERED_LDFLAGS=""
2987 - for flag in ${LDFLAGS}; do
2988 - case ${flag} in
2989 - # Pass the canary. we don't quite respect LDFLAGS, but we have an excuse!
2990 - "-Wl,--hash-style="*) append-ghc-cflags link ${flag};;
2991 -
2992 - # Ignore all other flags
2993 - esac
2994 - done
2995 -
2996 - # hardened-gcc needs to be disabled, because the mangler doesn't accept
2997 - # its output.
2998 - gcc-specs-pie && append-ghc-cflags compile link -nopie
2999 - gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
3000 -
3001 - # prevent from failind building unregisterised ghc:
3002 - # http://www.mail-archive.com/debian-bugs-dist@××××××××××××.org/msg171602.html
3003 - use ppc64 && append-ghc-cflags compile -mminimal-toc
3004 - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
3005 - # currently ghc fails to build haddock
3006 - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
3007 - use ia64 && append-ghc-cflags compile -G0
3008 -
3009 - # Unfortunately driver/split/ghc-split.lprl is dumb
3010 - # enough to preserve stack marking for each split object
3011 - # and it flags stack marking violation:
3012 - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__1.o
3013 - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__2.o
3014 - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__3.o
3015 - case $($(tc-getAS) -v 2>&1 </dev/null) in
3016 - *"GNU Binutils"*) # GNU ld
3017 - append-ghc-cflags compile assemble -Wa,--noexecstack
3018 - ;;
3019 - esac
3020 -}
3021 -
3022 -# substitutes string $1 to $2 in files $3 $4 ...
3023 -relocate_path() {
3024 - local from=$1
3025 - local to=$2
3026 - shift 2
3027 - local file=
3028 - for file in "$@"
3029 - do
3030 - sed -i -e "s|$from|$to|g" \
3031 - "$file" || die "path relocation failed for '$file'"
3032 - done
3033 -}
3034 -
3035 -# changes hardcoded ghc paths and updates package index
3036 -# $1 - new absolute root path
3037 -relocate_ghc() {
3038 - local to=$1
3039 -
3040 - # backup original script to use it later after relocation
3041 - local gp_back="${T}/ghc-pkg-${PV}-orig"
3042 - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
3043 -
3044 - # Relocate from /usr to ${EPREFIX}/usr
3045 - relocate_path "/usr" "${to}/usr" \
3046 - "${WORKDIR}/usr/bin/ghc-${PV}" \
3047 - "${WORKDIR}/usr/bin/ghci-${PV}" \
3048 - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
3049 - "${WORKDIR}/usr/bin/hsc2hs" \
3050 - "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"*
3051 -
3052 - # this one we will use to regenerate cache
3053 - # so it shoult point to current tree location
3054 - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
3055 -
3056 - if use prefix; then
3057 - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree
3058 - # TODO: add the same for darwin's CHOST and it's DYLD_
3059 - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH'
3060 - sed -i -e '2i'"$new_ldpath" \
3061 - "${WORKDIR}/usr/bin/ghc-${PV}" \
3062 - "${WORKDIR}/usr/bin/ghci-${PV}" \
3063 - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
3064 - "$gp_back" \
3065 - "${WORKDIR}/usr/bin/hsc2hs" \
3066 - || die "Adding LD_LIBRARY_PATH for wrappers failed"
3067 - fi
3068 -
3069 - # regenerate the binary package cache
3070 - "$gp_back" recache || die "failed to update cache after relocation"
3071 - rm "$gp_back"
3072 -}
3073 -
3074 -pkg_setup() {
3075 - # quiet portage about prebuilt binaries
3076 - use binary && QA_PREBUILT="*"
3077 -
3078 - if use ghcbootstrap; then
3079 - ewarn "You requested ghc bootstrapping, this is usually only used"
3080 - ewarn "by Gentoo developers to make binary .tbz2 packages for"
3081 - ewarn "use with the ghc ebuild's USE=\"binary\" feature."
3082 - use binary && \
3083 - die "USE=\"ghcbootstrap binary\" is not a valid combination."
3084 - [[ -z $(type -P ghc) ]] && \
3085 - die "Could not find a ghc to bootstrap with."
3086 - else
3087 - if ! yet_binary; then
3088 - eerror "Please try emerging with USE=ghcbootstrap and report build"
3089 - eerror "sucess or failure to the haskell team (haskell@g.o)"
3090 - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
3091 - fi
3092 - fi
3093 -}
3094 -
3095 -src_unpack() {
3096 - # Create the ${S} dir if we're using the binary version
3097 - use binary && mkdir "${S}"
3098 -
3099 - # the Solaris and Darwin binaries from ghc (maeder) need to be
3100 - # unpacked separately, so prevent them from being unpacked
3101 - local ONLYA=${A}
3102 - case ${CHOST} in
3103 - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;;
3104 - esac
3105 - unpack ${ONLYA}
3106 -}
3107 -
3108 -src_prepare() {
3109 - ghc_setup_cflags
3110 -
3111 - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
3112 - # Modify the wrapper script from the binary tarball to use GHC_FLAGS.
3113 - # See bug #313635.
3114 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \
3115 - "${WORKDIR}/usr/bin/ghc-${PV}"
3116 -
3117 - # allow hardened users use vanilla binary to bootstrap ghc
3118 - # ghci uses mmap with rwx protection at it implements dynamic
3119 - # linking on it's own (bug #299709)
3120 - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc"
3121 - fi
3122 -
3123 - if use binary; then
3124 - if use prefix; then
3125 - relocate_ghc "${EPREFIX}"
3126 - fi
3127 -
3128 - # Move unpacked files to the expected place
3129 - mv "${WORKDIR}/usr" "${S}"
3130 - else
3131 - if ! use ghcbootstrap; then
3132 - case ${CHOST} in
3133 - *-darwin* | *-solaris*)
3134 - mkdir "${WORKDIR}"/ghc-bin-installer || die
3135 - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
3136 - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
3137 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
3138 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2
3139 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
3140 - popd > /dev/null
3141 -
3142 - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
3143 - # fix the binaries so they run, on Solaris we need an
3144 - # LD_LIBRARY_PATH which has our prefix libdirs, on
3145 - # Darwin we need to replace the frameworks with our libs
3146 - # from the prefix fix before installation, because some
3147 - # of the tools are actually used during configure/make
3148 - if [[ ${CHOST} == *-solaris* ]] ; then
3149 - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
3150 - elif [[ ${CHOST} == *-darwin* ]] ; then
3151 - local readline_framework=GNUreadline.framework/GNUreadline
3152 - local gmp_framework=/opt/local/lib/libgmp.10.dylib
3153 - local ncurses_file=/opt/local/lib/libncurses.5.dylib
3154 - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
3155 - install_name_tool -change \
3156 - ${readline_framework} \
3157 - "${EPREFIX}"/lib/libreadline.dylib \
3158 - ${binary} || die
3159 - install_name_tool -change \
3160 - ${gmp_framework} \
3161 - "${EPREFIX}"/usr/lib/libgmp.dylib \
3162 - ${binary} || die
3163 - install_name_tool -change \
3164 - ${ncurses_file} \
3165 - "${EPREFIX}"/usr/lib/libncurses.dylib \
3166 - ${binary} || die
3167 - done
3168 - # we don't do frameworks!
3169 - sed -i \
3170 - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
3171 - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
3172 - rts/package.conf.in || die
3173 - fi
3174 -
3175 - # it is autoconf, but we really don't want to give it too
3176 - # much arguments, in fact we do the make in-place anyway
3177 - ./configure --prefix="${WORKDIR}"/usr || die
3178 - make install || die
3179 - popd > /dev/null
3180 - ;;
3181 - *)
3182 - relocate_ghc "${WORKDIR}"
3183 - ;;
3184 - esac
3185 - fi
3186 -
3187 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \
3188 - "${S}/ghc/ghc.wrapper"
3189 -
3190 - cd "${S}" # otherwise epatch will break
3191 -
3192 - epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
3193 -
3194 - epatch "${FILESDIR}"/${PN}-7.0.4-darwin8.patch
3195 - # failed to apply. FIXME
3196 - #epatch "${FILESDIR}"/${PN}-6.12.3-mach-o-relocation-limit.patch
3197 -
3198 - epatch "${FILESDIR}"/${PN}-7.4-rc2-macos-prefix-respect-gcc.patch
3199 - epatch "${FILESDIR}"/${PN}-7.4.1-darwin-CHOST.patch
3200 - epatch "${FILESDIR}"/${PN}-7.2.1-freebsd-CHOST.patch
3201 -
3202 - we_want_libffi_workaround() {
3203 - use ghcmakebinary && return 1
3204 -
3205 - # pick only registerised arches
3206 - # https://bugs.gentoo.org/463814
3207 - use amd64 && return 0
3208 - use x86 && return 0
3209 - return 1
3210 - }
3211 - # one mode external depend with unstable ABI be careful to stash it
3212 - # avoid external libffi runtime when we build binaries
3213 - we_want_libffi_workaround && epatch "${FILESDIR}"/${PN}-7.4.2-system-libffi.patch
3214 -
3215 - epatch "${FILESDIR}"/${PN}-7.4.1-ticket-7339-fix-unaligned-unreg.patch
3216 -
3217 - if use prefix; then
3218 - # Make configure find docbook-xsl-stylesheets from Prefix
3219 - sed -i -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' utils/haddock/doc/configure.ac || die
3220 - fi
3221 -
3222 - cd "${S}"/libraries/terminfo
3223 - # bug #454216
3224 - epatch "${FILESDIR}"/terminfo-0.3.2.5-tinfo.patch
3225 -
3226 - cd "${S}"
3227 - # as we have changed the build system
3228 - eautoreconf
3229 - fi
3230 -}
3231 -
3232 -src_configure() {
3233 - if ! use binary; then
3234 -
3235 - # initialize build.mk
3236 - echo '# Gentoo changes' > mk/build.mk
3237 -
3238 - # Put docs into the right place, ie /usr/share/doc/ghc-${PV}
3239 - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
3240 - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
3241 -
3242 - # We also need to use the GHC_FLAGS flags when building ghc itself
3243 - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk
3244 - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
3245 - echo "SRC_LD_OPTS+=${FILTERED_LDFLAGS}" >> mk/build.mk
3246 -
3247 - # We can't depend on haddock except when bootstrapping when we
3248 - # must build docs and include them into the binary .tbz2 package
3249 - if use ghcbootstrap && use doc; then
3250 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
3251 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
3252 - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
3253 - echo "HADDOCK_DOCS = YES" >> mk/build.mk
3254 - else
3255 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
3256 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
3257 - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
3258 - echo "HADDOCK_DOCS = NO" >> mk/build.mk
3259 - fi
3260 -
3261 - # circumvent a very strange bug that seems related with ghc producing
3262 - # too much output while being filtered through tee (e.g. due to
3263 - # portage logging) reported as bug #111183
3264 - echo "SRC_HC_OPTS+=-w" >> mk/build.mk
3265 -
3266 - # some arches do not support ELF parsing for ghci module loading
3267 - # PPC64: never worked (should be easy to implement)
3268 - # alpha: never worked
3269 - # arm: unimplemented or never worked
3270 - if use alpha || use ppc64 || use arm; then
3271 - echo "GhcWithInterpreter=NO" >> mk/build.mk
3272 - fi
3273 -
3274 - # we have to tell it to build unregisterised on some arches
3275 - # ppc64: EvilMangler currently does not understand some TOCs
3276 - # ia64: EvilMangler bitrot
3277 - if use alpha || use ia64 || use ppc64; then
3278 - echo "GhcUnregisterised=YES" >> mk/build.mk
3279 - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
3280 - echo "SplitObjs=NO" >> mk/build.mk
3281 - echo "GhcRTSWays := debug" >> mk/build.mk
3282 - echo "GhcNotThreaded=YES" >> mk/build.mk
3283 - fi
3284 -
3285 - # arm: no EvilMangler support, no NCG support
3286 - if use arm; then
3287 - echo "GhcUnregisterised=YES" >> mk/build.mk
3288 - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
3289 - fi
3290 -
3291 - # Have "ld -r --relax" problem with split-objs on sparc:
3292 - if use sparc; then
3293 - echo "SplitObjs=NO" >> mk/build.mk
3294 - fi
3295 -
3296 - if ! use llvm; then
3297 - echo "GhcWithLlvmCodeGen=NO" >> mk/build.mk
3298 - fi
3299 -
3300 - # allows overriding build flavours for libraries:
3301 - # v - vanilla (static libs)
3302 - # p - profiled
3303 - # dyn - shared libraries
3304 - # example: GHC_LIBRARY_WAYS="v dyn"
3305 - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
3306 - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
3307 - fi
3308 -
3309 - # Get ghc from the unpacked binary .tbz2
3310 - # except when bootstrapping we just pick ghc up off the path
3311 - if ! use ghcbootstrap; then
3312 - export PATH="${WORKDIR}/usr/bin:${PATH}"
3313 - fi
3314 -
3315 - if use gmp; then
3316 - echo "INTEGER_LIBRARY=integer-gmp" >> mk/build.mk
3317 - else
3318 - echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
3319 - fi
3320 -
3321 - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was
3322 - # compiled with, by saving the path to it. The purpose is to make sure
3323 - # that GHC will use the very same gcc version when it compiles haskell
3324 - # sources, as the extra-gcc-opts files contains extra gcc options which
3325 - # match only this GCC version.
3326 - # However, this is not required in Gentoo, as only modern GCCs are used
3327 - # (>4).
3328 - # Instead, this causes trouble when for example ccache is used during
3329 - # compilation, but we don't want the wrappers to point to ccache.
3330 - # Due to the above, we simply set GCC to be "gcc". When compiling ghc it
3331 - # might point to ccache, once installed it will point to the users
3332 - # regular gcc.
3333 -
3334 - econf --with-gcc=gcc || die "econf failed"
3335 - fi # ! use binary
3336 -}
3337 -
3338 -src_compile() {
3339 - if ! use binary; then
3340 - limit_jobs() {
3341 - if [[ -n ${I_DEMAND_MY_CORES_LOADED} ]]; then
3342 - ewarn "You have requested parallel build which is known to break."
3343 - ewarn "Please report all breakages upstream."
3344 - return
3345 - fi
3346 - echo $@
3347 - }
3348 - # ghc massively parallel make: #409631, #409873
3349 - # but let users screw it by setting 'I_DEMAND_MY_CORES_LOADED'
3350 - emake $(limit_jobs -j1) all
3351 - fi # ! use binary
3352 -}
3353 -
3354 -src_install() {
3355 - if use binary; then
3356 - use prefix && mkdir -p "${ED}"
3357 - mv "${S}/usr" "${ED}"
3358 -
3359 - # Remove the docs if not requested
3360 - if ! use doc; then
3361 - rm -rf "${ED}/usr/share/doc/${P}/*/" \
3362 - "${ED}/usr/share/doc/${P}/*.html" \
3363 - || die "could not remove docs (P vs PF revision mismatch?)"
3364 - fi
3365 - else
3366 - local insttarget="install"
3367 -
3368 - # We only built docs if we were bootstrapping, otherwise
3369 - # we copy them out of the unpacked binary .tbz2
3370 - if use doc && ! use ghcbootstrap; then
3371 - mkdir -p "${ED}/usr/share/doc"
3372 - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \
3373 - || die "failed to copy docs"
3374 - else
3375 - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION"
3376 - fi
3377 -
3378 - emake -j1 ${insttarget} \
3379 - DESTDIR="${D}" \
3380 - || die "make ${insttarget} failed"
3381 -
3382 - # remove wrapper and linker
3383 - rm -f "${ED}"/usr/bin/haddock*
3384 -
3385 - # ghci uses mmap with rwx protection at it implements dynamic
3386 - # linking on it's own (bug #299709)
3387 - # so mark resulting binary
3388 - pax-mark -m "${ED}/usr/$(get_libdir)/${P}/ghc"
3389 -
3390 - dobashcomp "${FILESDIR}/ghc-bash-completion"
3391 -
3392 - fi
3393 -
3394 - # path to the package.cache
3395 - local package_confdir="${ED}/usr/$(get_libdir)/${P}/package.conf.d"
3396 - PKGCACHE="${package_confdir}"/package.cache
3397 -
3398 - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
3399 -
3400 - # copy the package.conf, including timestamp, save it so we later can put it
3401 - # back before uninstalling, or when upgrading.
3402 - cp -p "${PKGCACHE}"{,.shipped} \
3403 - || die "failed to copy package.conf.d/package.cache"
3404 -}
3405 -
3406 -pkg_preinst() {
3407 - # have we got an earlier version of ghc installed?
3408 - if has_version "<${CATEGORY}/${PF}"; then
3409 - haskell_updater_warn="1"
3410 - fi
3411 -}
3412 -
3413 -pkg_postinst() {
3414 - ghc-reregister
3415 -
3416 - # path to the package.cache
3417 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
3418 -
3419 - # give the cache a new timestamp, it must be as recent as
3420 - # the package.conf.d directory.
3421 - touch "${PKGCACHE}"
3422 -
3423 - if [[ "${haskell_updater_warn}" == "1" ]]; then
3424 - ewarn
3425 - ewarn "\e[1;31m************************************************************************\e[0m"
3426 - ewarn
3427 - ewarn "You have just upgraded from an older version of GHC."
3428 - ewarn "You may have to run"
3429 - ewarn " 'haskell-updater --upgrade'"
3430 - ewarn "to rebuild all ghc-based Haskell libraries."
3431 - ewarn
3432 - ewarn "\e[1;31m************************************************************************\e[0m"
3433 - ewarn
3434 - fi
3435 -}
3436 -
3437 -pkg_prerm() {
3438 - # Be very careful here... Call order when upgrading is (according to PMS):
3439 - # * src_install for new package
3440 - # * pkg_preinst for new package
3441 - # * pkg_postinst for new package
3442 - # * pkg_prerm for the package being replaced
3443 - # * pkg_postrm for the package being replaced
3444 - # so you'll actually be touching the new packages files, not the one you
3445 - # uninstall, due to that or installation directory ${P} will be the same for
3446 - # both packages.
3447 -
3448 - # Call order for reinstalling is (according to PMS):
3449 - # * src_install
3450 - # * pkg_preinst
3451 - # * pkg_prerm for the package being replaced
3452 - # * pkg_postrm for the package being replaced
3453 - # * pkg_postinst
3454 -
3455 - # Overwrite the modified package.cache with a copy of the
3456 - # original one, so that it will be removed during uninstall.
3457 -
3458 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
3459 - rm -rf "${PKGCACHE}"
3460 -
3461 - cp -p "${PKGCACHE}"{.shipped,}
3462 -}
3463 -
3464 -pkg_postrm() {
3465 - ghc-package_pkg_postrm
3466 -}
3467
3468 diff --git a/dev-lang/ghc/ghc-7.6.3-r1.ebuild b/dev-lang/ghc/ghc-7.6.3-r1.ebuild
3469 deleted file mode 100644
3470 index c5c2e89..00000000
3471 --- a/dev-lang/ghc/ghc-7.6.3-r1.ebuild
3472 +++ /dev/null
3473 @@ -1,829 +0,0 @@
3474 -# Copyright 1999-2015 Gentoo Foundation
3475 -# Distributed under the terms of the GNU General Public License v2
3476 -# $Id$
3477 -
3478 -# Brief explanation of the bootstrap logic:
3479 -#
3480 -# Previous ghc ebuilds have been split into two: ghc and ghc-bin,
3481 -# where ghc-bin was primarily used for bootstrapping purposes.
3482 -# From now on, these two ebuilds have been combined, with the
3483 -# binary USE flag used to determine whether or not the pre-built
3484 -# binary package should be emerged or whether ghc should be compiled
3485 -# from source. If the latter, then the relevant ghc-bin for the
3486 -# arch in question will be used in the working directory to compile
3487 -# ghc from source.
3488 -#
3489 -# This solution has the advantage of allowing us to retain the one
3490 -# ebuild for both packages, and thus phase out virtual/ghc.
3491 -
3492 -# Note to users of hardened gcc-3.x:
3493 -#
3494 -# If you emerge ghc with hardened gcc it should work fine (because we
3495 -# turn off the hardened features that would otherwise break ghc).
3496 -# However, emerging ghc while using a vanilla gcc and then switching to
3497 -# hardened gcc (using gcc-config) will leave you with a broken ghc. To
3498 -# fix it you would need to either switch back to vanilla gcc or re-emerge
3499 -# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and
3500 -# you switch to gcc-4.x that this will also break ghc and you'll need to
3501 -# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between
3502 -# gcc-3.x and 4.x with no problems.
3503 -
3504 -EAPI="5"
3505 -
3506 -# to make make a crosscompiler use crossdev and symlink ghc tree into
3507 -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
3508 -#
3509 -# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
3510 -export CTARGET=${CTARGET:-${CHOST}}
3511 -if [[ ${CTARGET} = ${CHOST} ]] ; then
3512 - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
3513 - export CTARGET=${CATEGORY/cross-}
3514 - fi
3515 -fi
3516 -
3517 -inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
3518 -inherit multilib multiprocessing pax-utils toolchain-funcs versionator
3519 -
3520 -DESCRIPTION="The Glasgow Haskell Compiler"
3521 -HOMEPAGE="http://www.haskell.org/ghc/"
3522 -
3523 -# we don't have any binaries yet
3524 -arch_binaries=""
3525 -
3526 -# sorted!
3527 -arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-r1-alpha.tbz2 )"
3528 -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
3529 -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )"
3530 -arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-r1-ia64.tbz2 )"
3531 -arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-r1-ppc.tbz2 )"
3532 -arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-r1-ppc64.tbz2 )"
3533 -arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-r1-sparc.tbz2 )"
3534 -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )"
3535 -
3536 -# various ports:
3537 -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
3538 -
3539 -# 0 - yet
3540 -yet_binary() {
3541 - case "${ARCH}" in
3542 - alpha) return 0 ;;
3543 - #arm)
3544 - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
3545 - # return 0
3546 - #;;
3547 - amd64) return 0 ;;
3548 - ia64) return 0 ;;
3549 - ppc) return 0 ;;
3550 - ppc64) return 0 ;;
3551 - sparc) return 0 ;;
3552 - x86) return 0 ;;
3553 - *) return 1 ;;
3554 - esac
3555 -}
3556 -
3557 -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )"
3558 -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
3559 -LICENSE="BSD"
3560 -SLOT="0/${PV}"
3561 -KEYWORDS="~alpha amd64 ~ia64 ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
3562 -IUSE="doc ghcbootstrap ghcmakebinary +gmp llvm"
3563 -IUSE+=" binary" # don't forget about me later!
3564 -IUSE+=" elibc_glibc" # system stuff
3565 -
3566 -RDEPEND="
3567 - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 )
3568 - kernel_linux? ( >=sys-devel/binutils-2.17 )
3569 - kernel_SunOS? ( >=sys-devel/binutils-2.17 )
3570 - >=dev-lang/perl-5.6.1
3571 - >=dev-libs/gmp-5
3572 - virtual/libffi
3573 - !<dev-haskell/haddock-2.4.2
3574 - sys-libs/ncurses[unicode]"
3575 -# earlier versions than 2.4.2 of haddock only works with older ghc releases
3576 -
3577 -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to
3578 -# that we want the binaries to use the latest versioun available, and not to be
3579 -# built against gmp-4
3580 -
3581 -# similar for glibc. we have bootstrapped binaries against glibc-2.14
3582 -DEPEND="${RDEPEND}
3583 - ghcbootstrap? (
3584 - doc? ( app-text/docbook-xml-dtd:4.2
3585 - app-text/docbook-xml-dtd:4.5
3586 - app-text/docbook-xsl-stylesheets
3587 - >=dev-libs/libxslt-1.1.2 ) )
3588 - !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.15 ) ) )"
3589 -
3590 -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
3591 -PDEPEND="
3592 - ${PDEPEND}
3593 - llvm? ( sys-devel/llvm )"
3594 -
3595 -# ia64 fails to return from STG GMP primitives (stage2 always SIGSEGVs)
3596 -REQUIRED_USE="ia64? ( !gmp )"
3597 -
3598 -# haskell libraries built with cabal in configure mode, #515354
3599 -QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
3600 -
3601 -is_crosscompile() {
3602 - [[ ${CHOST} != ${CTARGET} ]]
3603 -}
3604 -
3605 -append-ghc-cflags() {
3606 - local flag compile assemble link
3607 - for flag in $*; do
3608 - case ${flag} in
3609 - compile) compile="yes";;
3610 - assemble) assemble="yes";;
3611 - link) link="yes";;
3612 - *)
3613 - [[ ${compile} ]] && GHC_FLAGS="${GHC_FLAGS} -optc${flag}" CFLAGS="${CFLAGS} ${flag}"
3614 - [[ ${assemble} ]] && GHC_FLAGS="${GHC_FLAGS} -opta${flag}" CFLAGS="${CFLAGS} ${flag}"
3615 - [[ ${link} ]] && GHC_FLAGS="${GHC_FLAGS} -optl${flag}" FILTERED_LDFLAGS="${FILTERED_LDFLAGS} ${flag}";;
3616 - esac
3617 - done
3618 -}
3619 -
3620 -ghc_setup_cflags() {
3621 - if is_crosscompile; then
3622 - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
3623 - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
3624 - einfo "Crosscompiling mode:"
3625 - einfo " CHOST: ${CHOST}"
3626 - einfo " CTARGET: ${CTARGET}"
3627 - einfo " CFLAGS: ${CFLAGS}"
3628 - einfo " LDFLAGS: ${LDFLAGS}"
3629 - return
3630 - fi
3631 - # We need to be very careful with the CFLAGS we ask ghc to pass through to
3632 - # gcc. There are plenty of flags which will make gcc produce output that
3633 - # breaks ghc in various ways. The main ones we want to pass through are
3634 - # -mcpu / -march flags. These are important for arches like alpha & sparc.
3635 - # We also use these CFLAGS for building the C parts of ghc, ie the rts.
3636 - strip-flags
3637 - strip-unsupported-flags
3638 -
3639 - # Cmm can't parse line numbers #482086
3640 - replace-flags -ggdb[3-9] -ggdb2
3641 -
3642 - GHC_FLAGS=""
3643 - for flag in ${CFLAGS}; do
3644 - case ${flag} in
3645 -
3646 - # Ignore extra optimisation (ghc passes -O to gcc anyway)
3647 - # -O2 and above break on too many systems
3648 - -O*) ;;
3649 -
3650 - # Arch and ABI flags are what we're really after
3651 - -m*) append-ghc-cflags compile assemble ${flag};;
3652 -
3653 - # Sometimes it's handy to see backtrace of RTS
3654 - # to get an idea what happens there
3655 - -g*) append-ghc-cflags compile ${flag};;
3656 -
3657 - # Ignore all other flags, including all -f* flags
3658 - esac
3659 - done
3660 -
3661 - FILTERED_LDFLAGS=""
3662 - for flag in ${LDFLAGS}; do
3663 - case ${flag} in
3664 - # Pass the canary. we don't quite respect LDFLAGS, but we have an excuse!
3665 - "-Wl,--hash-style="*) append-ghc-cflags link ${flag};;
3666 -
3667 - # Ignore all other flags
3668 - esac
3669 - done
3670 -
3671 - # hardened-gcc needs to be disabled, because the mangler doesn't accept
3672 - # its output.
3673 - gcc-specs-pie && append-ghc-cflags compile link -nopie
3674 - gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
3675 -
3676 - # prevent from failind building unregisterised ghc:
3677 - # http://www.mail-archive.com/debian-bugs-dist@××××××××××××.org/msg171602.html
3678 - use ppc64 && append-ghc-cflags compile -mminimal-toc
3679 - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
3680 - # currently ghc fails to build haddock
3681 - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
3682 - use ia64 && append-ghc-cflags compile -G0 -Os
3683 -
3684 - # Unfortunately driver/split/ghc-split.lprl is dumb
3685 - # enough to preserve stack marking for each split object
3686 - # and it flags stack marking violation:
3687 - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__1.o
3688 - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__2.o
3689 - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__3.o
3690 - case $($(tc-getAS) -v 2>&1 </dev/null) in
3691 - *"GNU Binutils"*) # GNU ld
3692 - append-ghc-cflags compile assemble -Wa,--noexecstack
3693 - ;;
3694 - esac
3695 -}
3696 -
3697 -# substitutes string $1 to $2 in files $3 $4 ...
3698 -relocate_path() {
3699 - local from=$1
3700 - local to=$2
3701 - shift 2
3702 - local file=
3703 - for file in "$@"
3704 - do
3705 - sed -i -e "s|$from|$to|g" \
3706 - "$file" || die "path relocation failed for '$file'"
3707 - done
3708 -}
3709 -
3710 -# changes hardcoded ghc paths and updates package index
3711 -# $1 - new absolute root path
3712 -relocate_ghc() {
3713 - local to=$1
3714 -
3715 - # libdir for prebuilt binary and for current system may mismatch
3716 - # It does for prefix installation for example: bug #476998
3717 - local bin_ghc_prefix=${WORKDIR}/usr
3718 - local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
3719 - local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
3720 -
3721 - # backup original script to use it later after relocation
3722 - local gp_back="${T}/ghc-pkg-${PV}-orig"
3723 - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
3724 -
3725 - if [[ ${bin_libdir} != $(get_libdir) ]]; then
3726 - einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
3727 - # moving the dir itself is not strictly needed
3728 - # but then USE=binary would result in installing
3729 - # in '${bin_libdir}'
3730 - mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
3731 -
3732 - relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
3733 - "${WORKDIR}/usr/bin/ghc-${PV}" \
3734 - "${WORKDIR}/usr/bin/ghci-${PV}" \
3735 - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
3736 - "${WORKDIR}/usr/bin/hsc2hs" \
3737 - "${WORKDIR}/usr/bin/runghc-${PV}" \
3738 - "$gp_back" \
3739 - "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"*
3740 - fi
3741 -
3742 - # Relocate from /usr to ${EPREFIX}/usr
3743 - relocate_path "/usr" "${to}/usr" \
3744 - "${WORKDIR}/usr/bin/ghc-${PV}" \
3745 - "${WORKDIR}/usr/bin/ghci-${PV}" \
3746 - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
3747 - "${WORKDIR}/usr/bin/hsc2hs" \
3748 - "${WORKDIR}/usr/bin/runghc-${PV}" \
3749 - "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"*
3750 -
3751 - # this one we will use to regenerate cache
3752 - # so it should point to current tree location
3753 - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
3754 -
3755 - if use prefix; then
3756 - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree
3757 - # TODO: add the same for darwin's CHOST and it's DYLD_
3758 - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH'
3759 - sed -i -e '2i'"$new_ldpath" \
3760 - "${WORKDIR}/usr/bin/ghc-${PV}" \
3761 - "${WORKDIR}/usr/bin/ghci-${PV}" \
3762 - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
3763 - "${WORKDIR}/usr/bin/hsc2hs" \
3764 - "${WORKDIR}/usr/bin/runghc-${PV}" \
3765 - "$gp_back" \
3766 - || die "Adding LD_LIBRARY_PATH for wrappers failed"
3767 - fi
3768 -
3769 - # regenerate the binary package cache
3770 - "$gp_back" recache || die "failed to update cache after relocation"
3771 - rm "$gp_back"
3772 -}
3773 -
3774 -pkg_setup() {
3775 - # quiet portage about prebuilt binaries
3776 - use binary && QA_PREBUILT="*"
3777 -
3778 - if use ghcbootstrap; then
3779 - ewarn "You requested ghc bootstrapping, this is usually only used"
3780 - ewarn "by Gentoo developers to make binary .tbz2 packages for"
3781 - ewarn "use with the ghc ebuild's USE=\"binary\" feature."
3782 - use binary && \
3783 - die "USE=\"ghcbootstrap binary\" is not a valid combination."
3784 - [[ -z $(type -P ghc) ]] && \
3785 - die "Could not find a ghc to bootstrap with."
3786 - else
3787 - if ! yet_binary; then
3788 - eerror "Please try emerging with USE=ghcbootstrap and report build"
3789 - eerror "sucess or failure to the haskell team (haskell@g.o)"
3790 - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
3791 - fi
3792 - fi
3793 -}
3794 -
3795 -src_unpack() {
3796 - # Create the ${S} dir if we're using the binary version
3797 - use binary && mkdir "${S}"
3798 -
3799 - # the Solaris and Darwin binaries from ghc (maeder) need to be
3800 - # unpacked separately, so prevent them from being unpacked
3801 - local ONLYA=${A}
3802 - case ${CHOST} in
3803 - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;;
3804 - esac
3805 - unpack ${ONLYA}
3806 -}
3807 -
3808 -src_prepare() {
3809 - ghc_setup_cflags
3810 -
3811 - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
3812 - # Modify the wrapper script from the binary tarball to use GHC_FLAGS.
3813 - # See bug #313635.
3814 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \
3815 - "${WORKDIR}/usr/bin/ghc-${PV}"
3816 -
3817 - # allow hardened users use vanilla binary to bootstrap ghc
3818 - # ghci uses mmap with rwx protection at it implements dynamic
3819 - # linking on it's own (bug #299709)
3820 - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc"
3821 - fi
3822 -
3823 - if use binary; then
3824 - if use prefix; then
3825 - relocate_ghc "${EPREFIX}"
3826 - fi
3827 -
3828 - # Move unpacked files to the expected place
3829 - mv "${WORKDIR}/usr" "${S}"
3830 - else
3831 - if ! use ghcbootstrap; then
3832 - case ${CHOST} in
3833 - *-darwin* | *-solaris*)
3834 - # UPDATE ME for ghc-7
3835 - mkdir "${WORKDIR}"/ghc-bin-installer || die
3836 - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
3837 - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
3838 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
3839 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2
3840 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
3841 - popd > /dev/null
3842 -
3843 - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
3844 - # fix the binaries so they run, on Solaris we need an
3845 - # LD_LIBRARY_PATH which has our prefix libdirs, on
3846 - # Darwin we need to replace the frameworks with our libs
3847 - # from the prefix fix before installation, because some
3848 - # of the tools are actually used during configure/make
3849 - if [[ ${CHOST} == *-solaris* ]] ; then
3850 - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
3851 - elif [[ ${CHOST} == *-darwin* ]] ; then
3852 - local readline_framework=GNUreadline.framework/GNUreadline
3853 - local gmp_framework=/opt/local/lib/libgmp.10.dylib
3854 - local ncurses_file=/opt/local/lib/libncurses.5.dylib
3855 - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
3856 - install_name_tool -change \
3857 - ${readline_framework} \
3858 - "${EPREFIX}"/lib/libreadline.dylib \
3859 - ${binary} || die
3860 - install_name_tool -change \
3861 - ${gmp_framework} \
3862 - "${EPREFIX}"/usr/lib/libgmp.dylib \
3863 - ${binary} || die
3864 - install_name_tool -change \
3865 - ${ncurses_file} \
3866 - "${EPREFIX}"/usr/lib/libncurses.dylib \
3867 - ${binary} || die
3868 - done
3869 - # we don't do frameworks!
3870 - sed -i \
3871 - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
3872 - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
3873 - rts/package.conf.in || die
3874 - fi
3875 -
3876 - # it is autoconf, but we really don't want to give it too
3877 - # much arguments, in fact we do the make in-place anyway
3878 - ./configure --prefix="${WORKDIR}"/usr || die
3879 - make install || die
3880 - popd > /dev/null
3881 - ;;
3882 - *)
3883 - relocate_ghc "${WORKDIR}"
3884 - ;;
3885 - esac
3886 - fi
3887 -
3888 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \
3889 - "${S}/ghc/ghc.wrapper"
3890 -
3891 - cd "${S}" # otherwise epatch will break
3892 -
3893 - epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
3894 -
3895 - # epatch "${FILESDIR}"/${PN}-7.0.4-darwin8.patch
3896 - # failed to apply. FIXME
3897 - #epatch "${FILESDIR}"/${PN}-6.12.3-mach-o-relocation-limit.patch
3898 -
3899 - # epatch "${FILESDIR}"/${PN}-7.4-rc2-macos-prefix-respect-gcc.patch
3900 - # epatch "${FILESDIR}"/${PN}-7.2.1-freebsd-CHOST.patch
3901 -
3902 - we_want_libffi_workaround() {
3903 - use ghcmakebinary && return 1
3904 -
3905 - # pick only registerised arches
3906 - # https://bugs.gentoo.org/463814
3907 - use amd64 && return 0
3908 - use x86 && return 0
3909 - return 1
3910 - }
3911 - # one mode external depend with unstable ABI be careful to stash it
3912 - # avoid external libffi runtime when we build binaries
3913 - we_want_libffi_workaround && epatch "${FILESDIR}"/${PN}-7.5.20120505-system-libffi.patch
3914 -
3915 - epatch "${FILESDIR}"/${PN}-7.4.1-ticket-7339-fix-unaligned-unreg.patch
3916 - epatch "${FILESDIR}"/${PN}-7.6.2-integer-simple-div-mod.patch
3917 - # ghc-7.8 changed linker code and likely fixed it
3918 - epatch "${FILESDIR}"/${PN}-7.6.3-trac-3333-weak-syms.patch
3919 - # bug 518734
3920 - epatch "${FILESDIR}"/${PN}-7.6.3-preserve-inplace-xattr.patch
3921 -
3922 - if use prefix; then
3923 - # Make configure find docbook-xsl-stylesheets from Prefix
3924 - sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \
3925 - -i utils/haddock/doc/configure.ac || die
3926 - fi
3927 -
3928 - # as we have changed the build system
3929 - eautoreconf
3930 - fi
3931 -}
3932 -
3933 -src_configure() {
3934 - GHC_PV=${PV} # overrided in live ebuilds
3935 -
3936 - if ! use binary; then
3937 - # initialize build.mk
3938 - echo '# Gentoo changes' > mk/build.mk
3939 -
3940 - # Put docs into the right place, ie /usr/share/doc/ghc-${PV}
3941 - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
3942 - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
3943 -
3944 - # We also need to use the GHC_FLAGS flags when building ghc itself
3945 - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk
3946 - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
3947 - echo "SRC_LD_OPTS+=${FILTERED_LDFLAGS}" >> mk/build.mk
3948 -
3949 - # We can't depend on haddock except when bootstrapping when we
3950 - # must build docs and include them into the binary .tbz2 package
3951 - # app-text/dblatex is not in portage, can not build PDF or PS
3952 - if use ghcbootstrap && use doc; then
3953 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
3954 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
3955 - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
3956 - if is_crosscompile; then
3957 - # TODO this is a workaround for this build error with the live ebuild with haddock:
3958 - # make[1]: *** No rule to make target `compiler/stage2/build/Module.hi',
3959 - # needed by `utils/haddock/dist/build/Main.o'. Stop.
3960 - echo "HADDOCK_DOCS = NO" >> mk/build.mk
3961 - else
3962 - echo "HADDOCK_DOCS = YES" >> mk/build.mk
3963 - fi
3964 - else
3965 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
3966 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
3967 - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
3968 - echo "HADDOCK_DOCS = NO" >> mk/build.mk
3969 - fi
3970 -
3971 - # circumvent a very strange bug that seems related with ghc producing
3972 - # too much output while being filtered through tee (e.g. due to
3973 - # portage logging) reported as bug #111183
3974 - echo "SRC_HC_OPTS+=-w" >> mk/build.mk
3975 -
3976 - # some arches do not support ELF parsing for ghci module loading
3977 - # PPC64: never worked (should be easy to implement)
3978 - # alpha: never worked
3979 - # arm: http://hackage.haskell.org/trac/ghc/changeset/27302c9094909e04eb73f200d52d5e9370c34a8a
3980 - if use alpha || use ppc64; then
3981 - echo "GhcWithInterpreter=NO" >> mk/build.mk
3982 - fi
3983 -
3984 - # we have to tell it to build unregisterised on some arches
3985 - # ppc64: EvilMangler currently does not understand some TOCs
3986 - # ia64: EvilMangler bitrot
3987 - # set GHC_IS_UNREG if you like to build slow unregisterised
3988 - # host compiler. Handy if you plan to user resulting
3989 - # host compiler as a booting compiler for crosscompiler
3990 - # which can work only in unregisterised mode.
3991 - if use alpha || use ia64 || use ppc64 || [[ -n ${GHC_IS_UNREG} ]]; then
3992 - echo "GhcUnregisterised=YES" >> mk/build.mk
3993 - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
3994 - echo "SplitObjs=NO" >> mk/build.mk
3995 - echo "GhcRTSWays := debug" >> mk/build.mk
3996 - echo "GhcNotThreaded=YES" >> mk/build.mk
3997 - fi
3998 -
3999 - # arm: no EvilMangler support, no NCG support
4000 - if use arm; then
4001 - echo "GhcUnregisterised=YES" >> mk/build.mk
4002 - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
4003 - fi
4004 -
4005 - # Have "ld -r --relax" problem with split-objs on sparc:
4006 - if use sparc; then
4007 - echo "SplitObjs=NO" >> mk/build.mk
4008 - fi
4009 -
4010 - if ! use llvm; then
4011 - echo "GhcWithLlvmCodeGen=NO" >> mk/build.mk
4012 - fi
4013 -
4014 - # allows overriding build flavours for libraries:
4015 - # v - vanilla (static libs)
4016 - # p - profiled
4017 - # dyn - shared libraries
4018 - # example: GHC_LIBRARY_WAYS="v dyn"
4019 - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
4020 - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
4021 - fi
4022 -
4023 - # Get ghc from the unpacked binary .tbz2
4024 - # except when bootstrapping we just pick ghc up off the path
4025 - if ! use ghcbootstrap; then
4026 - export PATH="${WORKDIR}/usr/bin:${PATH}"
4027 - fi
4028 -
4029 - if use gmp; then
4030 - echo "INTEGER_LIBRARY=integer-gmp" >> mk/build.mk
4031 - else
4032 - echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
4033 - fi
4034 -
4035 - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was
4036 - # compiled with, by saving the path to it. The purpose is to make sure
4037 - # that GHC will use the very same gcc version when it compiles haskell
4038 - # sources, as the extra-gcc-opts files contains extra gcc options which
4039 - # match only this GCC version.
4040 - # However, this is not required in Gentoo, as only modern GCCs are used
4041 - # (>4).
4042 - # Instead, this causes trouble when for example ccache is used during
4043 - # compilation, but we don't want the wrappers to point to ccache.
4044 - # Due to the above, we simply set GCC to be "gcc". When compiling ghc it
4045 - # might point to ccache, once installed it will point to the users
4046 - # regular gcc.
4047 -
4048 - local econf_args=()
4049 -
4050 - is_crosscompile || econf_args+=--with-gcc=${CHOST}-gcc
4051 -
4052 - econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot \
4053 - || die "econf failed"
4054 -
4055 - [[ ${PV} == *9999* ]] && GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
4056 - GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
4057 - fi # ! use binary
4058 -}
4059 -
4060 -src_compile() {
4061 - if ! use binary; then
4062 - limit_jobs() {
4063 - local user_jobs=$(makeopts_jobs)
4064 - local max_nonbreaking_jobs=$1
4065 -
4066 - [[ ${user_jobs} -le ${max_nonbreaking_jobs} ]] && return
4067 -
4068 - if [[ -n ${I_DEMAND_MY_CORES_LOADED} ]]; then
4069 - ewarn "You have requested parallel build which is known to break."
4070 - ewarn "Please report all breakages upstream."
4071 - return
4072 - else
4073 - ewarn "Limiting MAKEOPTS -j${user_jobs} -> -j${max_nonbreaking_jobs} (bug #456386)"
4074 - user_jobs=${max_nonbreaking_jobs}
4075 - fi
4076 - echo -j${user_jobs}
4077 - }
4078 - # ghc massively parallel make: #409631, #409873
4079 - # but let users screw it by setting 'I_DEMAND_MY_CORES_LOADED'
4080 - # 4 parallel jobs usually does not break
4081 -
4082 - # 1. build compiler binary first
4083 - emake $(limit_jobs 4) ghc/stage2/build/tmp/ghc-stage2 V=1
4084 - # 2. pax-mark (bug #516430)
4085 - pax-mark -m ghc/stage2/build/tmp/ghc-stage2
4086 - # 3. and then all the rest
4087 - emake $(limit_jobs 4) all V=1
4088 -
4089 - if is_crosscompile; then
4090 - # runghc does not work for a stage1 compiler, we can build it anyway
4091 - # so it will print the error message: not built for interactive use
4092 - pushd "${S}/utils/runghc" || die "Could not cd to utils/runghc"
4093 - if [ ! -f Setup.hs ]; then
4094 - echo 'import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks' \
4095 - > Setup.hs || die "failed to create default Setup.hs"
4096 - fi
4097 - ghc -o setup --make Setup.hs || die "setup build failed"
4098 - ./setup configure || die "runghc configure failed"
4099 - sed -e "s@VERSION@\"${GHC_PV}\"@" -i runghc.hs
4100 - ./setup build || die "runghc build failed"
4101 - popd
4102 - fi
4103 - fi # ! use binary
4104 -}
4105 -
4106 -add-c_nonshared-to-ghci-libs() {
4107 - local ghci_lib
4108 - local nonshared_dir=${T}/libc_nonshared_objects
4109 -
4110 - is_crosscompile && return
4111 - use elibc_glibc || return
4112 - use prefix && return
4113 -
4114 - # we expect 'libc.a' bits be self-sufficient
4115 - if gcc-specs-pie; then
4116 - use x86 && return # but on x86 pie means linker support: #486140
4117 - fi
4118 -
4119 - get-nonshared-objects() {
4120 - # ns - 'nonshared'
4121 - local ns_objects=" "
4122 - local ns_sym
4123 - local ns_srco
4124 - local ns_dsto
4125 -
4126 - # extract
4127 - mkdir "${nonshared_dir}" || die
4128 - pushd "${nonshared_dir}" >/dev/null || die
4129 - $(tc-getAR) x "${ROOT}"/usr/$(get_libdir)/libc.a
4130 - popd >/dev/null || die
4131 -
4132 - # they are mostly contents of /usr/$(get_libdir)/libc_nonstahed.a
4133 - # but 'c_nonstahed' contains PIC variants of symbols.
4134 - # ghci uses non-PIC ones
4135 - for ns_sym in \
4136 - stat fstat lstat mknod \
4137 - stat64 fstat64 lstat64 \
4138 - fstatat fstatat64 mknodat
4139 - do
4140 - ns_srco=${nonshared_dir}/${ns_sym}.o
4141 - ns_dsto=${nonshared_dir}/${ns_sym}_weakened.o
4142 - [[ -f ${ns_srco} ]] || continue
4143 - # here we do The Magic:
4144 - # 1. --keep-global-symbol= hides everything to adoid double definition
4145 - # of stuff like __stat, __fstat and
4146 - # 2. --weaken converts exported symbols to weak symbols to be available
4147 - # for redefinition
4148 - $(tc-getOBJCOPY) \
4149 - --weaken --keep-global-symbol=${ns_sym} \
4150 - "${ns_srco}" "${ns_dsto}" || die
4151 -
4152 - ns_objects+=" ${ns_dsto}"
4153 - done
4154 -
4155 - echo "${ns_objects}"
4156 - }
4157 - # bug #452442: when building libraries for ghci
4158 - # ghc basically glues them together:
4159 - # $ ld -r -o result foo.o bar.o ...
4160 - # that way some symbols defined in libc_nonshared.a
4161 - # do not get included into final HS*.o files
4162 - # We piggyback on one of early loaded wired-in library
4163 - # loaded before 'base'.
4164 - while read ghci_lib
4165 - do
4166 - einfo "relinking '${ghci_lib}' with c_includes"
4167 - mv "${ghci_lib}" "${ghci_lib}".unrelinked.o || die
4168 - $(tc-getLD) -r -o "${ghci_lib}" \
4169 - "${ghci_lib}".unrelinked.o \
4170 - $(get-nonshared-objects) || die
4171 - rm -r "${nonshared_dir}" || die
4172 - rm "${ghci_lib}".unrelinked.o || die
4173 - done < <(find "${ED}"/usr/$(get_libdir)/${P}/ -name 'HSghc-prim*.o')
4174 -}
4175 -
4176 -src_install() {
4177 - if use binary; then
4178 - use prefix && mkdir -p "${ED}"
4179 - mv "${S}/usr" "${ED}"
4180 -
4181 - # Remove the docs if not requested
4182 - if ! use doc; then
4183 - rm -rf "${ED}/usr/share/doc/${P}/*/" \
4184 - "${ED}/usr/share/doc/${P}/*.html" \
4185 - || die "could not remove docs (P vs PF revision mismatch?)"
4186 - fi
4187 - else
4188 - local insttarget="install"
4189 -
4190 - # We only built docs if we were bootstrapping, otherwise
4191 - # we copy them out of the unpacked binary .tbz2
4192 - if use doc && ! use ghcbootstrap; then
4193 - mkdir -p "${ED}/usr/share/doc"
4194 - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \
4195 - || die "failed to copy docs"
4196 - else
4197 - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION"
4198 - fi
4199 -
4200 - emake -j1 ${insttarget} \
4201 - DESTDIR="${D}" \
4202 - || die "make ${insttarget} failed"
4203 -
4204 - # remove wrapper and link
4205 - rm -f "${ED}"/usr/bin/haddock*
4206 -
4207 - add-c_nonshared-to-ghci-libs
4208 -
4209 - if [[ ! -f "${S}/VERSION" ]]; then
4210 - echo "${GHC_PV}" > "${S}/VERSION" \
4211 - || die "Could not create file ${S}/VERSION"
4212 - fi
4213 - dobashcomp "${FILESDIR}/ghc-bash-completion"
4214 -
4215 - fi
4216 -
4217 - # path to the package.cache
4218 - local package_confdir="${ED}/usr/$(get_libdir)/${PN}-${GHC_PV}/package.conf.d"
4219 - PKGCACHE="${package_confdir}"/package.cache
4220 - # copy the package.conf.d, including timestamp, save it so we can help
4221 - # users that have a broken package.conf.d
4222 - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
4223 -
4224 - # copy the package.conf, including timestamp, save it so we later can put it
4225 - # back before uninstalling, or when upgrading.
4226 - cp -p "${PKGCACHE}"{,.shipped} \
4227 - || die "failed to copy package.conf.d/package.cache"
4228 -}
4229 -
4230 -pkg_preinst() {
4231 - # have we got an earlier version of ghc installed?
4232 - if has_version "<${CATEGORY}/${PF}"; then
4233 - haskell_updater_warn="1"
4234 - fi
4235 -}
4236 -
4237 -pkg_postinst() {
4238 - ghc-reregister
4239 -
4240 - # path to the package.cache
4241 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
4242 -
4243 - # give the cache a new timestamp, it must be as recent as
4244 - # the package.conf.d directory.
4245 - touch "${PKGCACHE}"
4246 -
4247 - if [[ "${haskell_updater_warn}" == "1" ]]; then
4248 - ewarn
4249 - ewarn "\e[1;31m************************************************************************\e[0m"
4250 - ewarn
4251 - ewarn "You have just upgraded from an older version of GHC."
4252 - ewarn "You may have to run"
4253 - ewarn " 'haskell-updater --upgrade'"
4254 - ewarn "to rebuild all ghc-based Haskell libraries."
4255 - ewarn
4256 - ewarn "\e[1;31m************************************************************************\e[0m"
4257 - ewarn
4258 - fi
4259 - if is_crosscompile; then
4260 - ewarn
4261 - ewarn "\e[1;31m************************************************************************\e[0m"
4262 - ewarn
4263 - ewarn "GHC built as a cross compiler. The interpreter, ghci and runghc, do"
4264 - ewarn "not work for a cross compiler."
4265 - ewarn "For the ghci error: \"<command line>: not built for interactive use\" see:"
4266 - ewarn "http://www.haskell.org/haskellwiki/GHC:FAQ#When_I_try_to_start_ghci_.28probably_one_I_compiled_myself.29_it_says_ghc-5.02:_not_built_for_interactive_use"
4267 - ewarn
4268 - ewarn "\e[1;31m************************************************************************\e[0m"
4269 - ewarn
4270 - fi
4271 -}
4272 -
4273 -pkg_prerm() {
4274 - # Be very careful here... Call order when upgrading is (according to PMS):
4275 - # * src_install for new package
4276 - # * pkg_preinst for new package
4277 - # * pkg_postinst for new package
4278 - # * pkg_prerm for the package being replaced
4279 - # * pkg_postrm for the package being replaced
4280 - # so you'll actually be touching the new packages files, not the one you
4281 - # uninstall, due to that or installation directory ${P} will be the same for
4282 - # both packages.
4283 -
4284 - # Call order for reinstalling is (according to PMS):
4285 - # * src_install
4286 - # * pkg_preinst
4287 - # * pkg_prerm for the package being replaced
4288 - # * pkg_postrm for the package being replaced
4289 - # * pkg_postinst
4290 -
4291 - # Overwrite the modified package.cache with a copy of the
4292 - # original one, so that it will be removed during uninstall.
4293 -
4294 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache"
4295 - rm -rf "${PKGCACHE}"
4296 -
4297 - cp -p "${PKGCACHE}"{.shipped,}
4298 -}
4299 -
4300 -pkg_postrm() {
4301 - ghc-package_pkg_postrm
4302 -}
4303
4304 diff --git a/dev-lang/ghc/ghc-7.8.3.ebuild b/dev-lang/ghc/ghc-7.8.3.ebuild
4305 deleted file mode 100644
4306 index 30b7aa5..00000000
4307 --- a/dev-lang/ghc/ghc-7.8.3.ebuild
4308 +++ /dev/null
4309 @@ -1,624 +0,0 @@
4310 -# Copyright 1999-2016 Gentoo Foundation
4311 -# Distributed under the terms of the GNU General Public License v2
4312 -# $Id$
4313 -
4314 -EAPI=5
4315 -
4316 -# to make make a crosscompiler use crossdev and symlink ghc tree into
4317 -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
4318 -#
4319 -# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
4320 -export CTARGET=${CTARGET:-${CHOST}}
4321 -if [[ ${CTARGET} = ${CHOST} ]] ; then
4322 - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
4323 - export CTARGET=${CATEGORY/cross-}
4324 - fi
4325 -fi
4326 -
4327 -inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
4328 -inherit multilib pax-utils toolchain-funcs versionator
4329 -
4330 -DESCRIPTION="The Glasgow Haskell Compiler"
4331 -HOMEPAGE="http://www.haskell.org/ghc/"
4332 -
4333 -# we don't have any binaries yet
4334 -arch_binaries=""
4335 -
4336 -# sorted!
4337 -#arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
4338 -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
4339 -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )"
4340 -#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
4341 -#arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )"
4342 -#arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )"
4343 -#arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )"
4344 -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )"
4345 -
4346 -# various ports:
4347 -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
4348 -
4349 -# 0 - yet
4350 -yet_binary() {
4351 - case "${ARCH}" in
4352 - #alpha) return 0 ;;
4353 - #arm)
4354 - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
4355 - # return 0
4356 - #;;
4357 - amd64) return 0 ;;
4358 - #ia64) return 0 ;;
4359 - #ppc) return 0 ;;
4360 - #ppc64) return 0 ;;
4361 - #sparc) return 0 ;;
4362 - x86) return 0 ;;
4363 - *) return 1 ;;
4364 - esac
4365 -}
4366 -
4367 -GHC_PV=${PV}
4368 -#GHC_PV=7.8.0.20140228 # uncomment only for -rc ebuilds
4369 -GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
4370 -
4371 -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV/_rc/-rc}/${GHC_P}-src.tar.xz )"
4372 -S="${WORKDIR}"/${GHC_P}
4373 -
4374 -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
4375 -LICENSE="BSD"
4376 -SLOT="0/${PV}"
4377 -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
4378 -IUSE="doc ghcbootstrap ghcmakebinary +gmp"
4379 -IUSE+=" binary"
4380 -IUSE+=" elibc_glibc" # system stuff
4381 -
4382 -RDEPEND="
4383 - >=dev-lang/perl-5.6.1
4384 - >=dev-libs/gmp-5:=
4385 - sys-libs/ncurses:=[unicode]
4386 - !ghcmakebinary? ( virtual/libffi:= )
4387 - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 )
4388 - kernel_linux? ( >=sys-devel/binutils-2.17 )
4389 - kernel_SunOS? ( >=sys-devel/binutils-2.17 )
4390 -"
4391 -# gentoo binaries are built against ncurses-5
4392 -RDEPEND+="
4393 - binary? (
4394 - || (
4395 - sys-libs/ncurses:0/5
4396 - sys-libs/ncurses:5/5
4397 - )
4398 - )
4399 -"
4400 -
4401 -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to
4402 -# that we want the binaries to use the latest versioun available, and not to be
4403 -# built against gmp-4
4404 -
4405 -# similar for glibc. we have bootstrapped binaries against glibc-2.17
4406 -DEPEND="${RDEPEND}
4407 - ghcbootstrap? (
4408 - doc? ( app-text/docbook-xml-dtd:4.2
4409 - app-text/docbook-xml-dtd:4.5
4410 - app-text/docbook-xsl-stylesheets
4411 - >=dev-libs/libxslt-1.1.2 ) )
4412 - !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) ) )"
4413 -
4414 -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
4415 -
4416 -REQUIRED_USE="?? ( ghcbootstrap binary )"
4417 -
4418 -# haskell libraries built with cabal in configure mode, #515354
4419 -QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
4420 -
4421 -is_crosscompile() {
4422 - [[ ${CHOST} != ${CTARGET} ]]
4423 -}
4424 -
4425 -append-ghc-cflags() {
4426 - local persistent compile assemble link
4427 - local flag ghcflag
4428 -
4429 - for flag in $*; do
4430 - case ${flag} in
4431 - persistent) persistent="yes";;
4432 - compile) compile="yes";;
4433 - assemble) assemble="yes";;
4434 - link) link="yes";;
4435 - *)
4436 - [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
4437 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
4438 - [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
4439 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
4440 - [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
4441 - [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
4442 - ;;
4443 - esac
4444 - done
4445 -}
4446 -
4447 -ghc_setup_cflags() {
4448 - if is_crosscompile; then
4449 - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
4450 - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
4451 - einfo "Crosscompiling mode:"
4452 - einfo " CHOST: ${CHOST}"
4453 - einfo " CTARGET: ${CTARGET}"
4454 - einfo " CFLAGS: ${CFLAGS}"
4455 - einfo " LDFLAGS: ${LDFLAGS}"
4456 - return
4457 - fi
4458 - # We need to be very careful with the CFLAGS we ask ghc to pass through to
4459 - # gcc. There are plenty of flags which will make gcc produce output that
4460 - # breaks ghc in various ways. The main ones we want to pass through are
4461 - # -mcpu / -march flags. These are important for arches like alpha & sparc.
4462 - # We also use these CFLAGS for building the C parts of ghc, ie the rts.
4463 - strip-flags
4464 - strip-unsupported-flags
4465 -
4466 - # Cmm can't parse line numbers #482086
4467 - replace-flags -ggdb[3-9] -ggdb2
4468 -
4469 - GHC_FLAGS=""
4470 - GHC_PERSISTENT_FLAGS=""
4471 - for flag in ${CFLAGS}; do
4472 - case ${flag} in
4473 -
4474 - # Ignore extra optimisation (ghc passes -O to gcc anyway)
4475 - # -O2 and above break on too many systems
4476 - -O*) ;;
4477 -
4478 - # Arch and ABI flags are what we're really after
4479 - -m*) append-ghc-cflags compile assemble ${flag};;
4480 -
4481 - # Sometimes it's handy to see backtrace of RTS
4482 - # to get an idea what happens there
4483 - -g*) append-ghc-cflags compile ${flag};;
4484 -
4485 - # Ignore all other flags, including all -f* flags
4486 - esac
4487 - done
4488 -
4489 - for flag in ${LDFLAGS}; do
4490 - append-ghc-cflags link ${flag}
4491 - done
4492 -
4493 - # hardened-gcc needs to be disabled, because the mangler doesn't accept
4494 - # its output.
4495 - gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
4496 - gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector
4497 -
4498 - # prevent from failind building unregisterised ghc:
4499 - # http://www.mail-archive.com/debian-bugs-dist@××××××××××××.org/msg171602.html
4500 - use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
4501 - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
4502 - # currently ghc fails to build haddock
4503 - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
4504 - use ia64 && append-ghc-cflags persistent compile -G0 -Os
4505 -}
4506 -
4507 -# substitutes string $1 to $2 in files $3 $4 ...
4508 -relocate_path() {
4509 - local from=$1
4510 - local to=$2
4511 - shift 2
4512 - local file=
4513 - for file in "$@"
4514 - do
4515 - sed -i -e "s|$from|$to|g" \
4516 - "$file" || die "path relocation failed for '$file'"
4517 - done
4518 -}
4519 -
4520 -# changes hardcoded ghc paths and updates package index
4521 -# $1 - new absolute root path
4522 -relocate_ghc() {
4523 - local to=$1
4524 -
4525 - # libdir for prebuilt binary and for current system may mismatch
4526 - # It does for prefix installation for example: bug #476998
4527 - local bin_ghc_prefix=${WORKDIR}/usr
4528 - local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
4529 - local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
4530 -
4531 - # backup original script to use it later after relocation
4532 - local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
4533 - cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
4534 -
4535 - if [[ ${bin_libdir} != $(get_libdir) ]]; then
4536 - einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
4537 - # moving the dir itself is not strictly needed
4538 - # but then USE=binary would result in installing
4539 - # in '${bin_libdir}'
4540 - mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
4541 -
4542 - relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
4543 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
4544 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
4545 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
4546 - "${WORKDIR}/usr/bin/hsc2hs" \
4547 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
4548 - "$gp_back" \
4549 - "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
4550 - fi
4551 -
4552 - # Relocate from /usr to ${EPREFIX}/usr
4553 - relocate_path "/usr" "${to}/usr" \
4554 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
4555 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
4556 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
4557 - "${WORKDIR}/usr/bin/hsc2hs" \
4558 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
4559 - "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
4560 -
4561 - # this one we will use to regenerate cache
4562 - # so it should point to current tree location
4563 - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
4564 -
4565 - if use prefix; then
4566 - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree
4567 - # TODO: add the same for darwin's CHOST and it's DYLD_
4568 - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH'
4569 - sed -i -e '2i'"$new_ldpath" \
4570 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
4571 - "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
4572 - "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
4573 - "${WORKDIR}/usr/bin/hsc2hs" \
4574 - "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
4575 - "$gp_back" \
4576 - "${WORKDIR}/usr/bin/hsc2hs" \
4577 - || die "Adding LD_LIBRARY_PATH for wrappers failed"
4578 - fi
4579 -
4580 - # regenerate the binary package cache
4581 - "$gp_back" recache || die "failed to update cache after relocation"
4582 - rm "$gp_back"
4583 -}
4584 -
4585 -pkg_setup() {
4586 - # quiet portage about prebuilt binaries
4587 - use binary && QA_PREBUILT="*"
4588 -
4589 - if use ghcbootstrap; then
4590 - ewarn "You requested ghc bootstrapping, this is usually only used"
4591 - ewarn "by Gentoo developers to make binary .tbz2 packages."
4592 -
4593 - [[ -z $(type -P ghc) ]] && \
4594 - die "Could not find a ghc to bootstrap with."
4595 - else
4596 - if ! yet_binary; then
4597 - eerror "Please try emerging with USE=ghcbootstrap and report build"
4598 - eerror "sucess or failure to the haskell team (haskell@g.o)"
4599 - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
4600 - fi
4601 - fi
4602 -}
4603 -
4604 -src_unpack() {
4605 - # Create the ${S} dir if we're using the binary version
4606 - use binary && mkdir "${S}"
4607 -
4608 - # the Solaris and Darwin binaries from ghc (maeder) need to be
4609 - # unpacked separately, so prevent them from being unpacked
4610 - local ONLYA=${A}
4611 - case ${CHOST} in
4612 - *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.bz2 ;;
4613 - esac
4614 - unpack ${ONLYA}
4615 -
4616 - if [[ -d "${S}"/libraries/dph ]]; then
4617 - # Sometimes dph libs get accidentally shipped with ghc
4618 - # but they are not installed unless user requests it.
4619 - # We never install them.
4620 - elog "Removing 'libraries/dph'"
4621 - rm -rf "${S}"/libraries/dph
4622 - fi
4623 -}
4624 -
4625 -src_prepare() {
4626 - ghc_setup_cflags
4627 -
4628 - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
4629 - # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
4630 - # See bug #313635.
4631 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
4632 - "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
4633 -
4634 - # allow hardened users use vanilla binary to bootstrap ghc
4635 - # ghci uses mmap with rwx protection at it implements dynamic
4636 - # linking on it's own (bug #299709)
4637 - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
4638 - fi
4639 -
4640 - if use binary; then
4641 - if use prefix; then
4642 - relocate_ghc "${EPREFIX}"
4643 - fi
4644 -
4645 - # Move unpacked files to the expected place
4646 - mv "${WORKDIR}/usr" "${S}"
4647 - else
4648 - if ! use ghcbootstrap; then
4649 - case ${CHOST} in
4650 - *-darwin* | *-solaris*)
4651 - # UPDATE ME for ghc-7
4652 - mkdir "${WORKDIR}"/ghc-bin-installer || die
4653 - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
4654 - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
4655 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
4656 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2
4657 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
4658 - popd > /dev/null
4659 -
4660 - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
4661 - # fix the binaries so they run, on Solaris we need an
4662 - # LD_LIBRARY_PATH which has our prefix libdirs, on
4663 - # Darwin we need to replace the frameworks with our libs
4664 - # from the prefix fix before installation, because some
4665 - # of the tools are actually used during configure/make
4666 - if [[ ${CHOST} == *-solaris* ]] ; then
4667 - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
4668 - elif [[ ${CHOST} == *-darwin* ]] ; then
4669 - local readline_framework=GNUreadline.framework/GNUreadline
4670 - local gmp_framework=/opt/local/lib/libgmp.10.dylib
4671 - local ncurses_file=/opt/local/lib/libncurses.5.dylib
4672 - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
4673 - install_name_tool -change \
4674 - ${readline_framework} \
4675 - "${EPREFIX}"/lib/libreadline.dylib \
4676 - ${binary} || die
4677 - install_name_tool -change \
4678 - ${gmp_framework} \
4679 - "${EPREFIX}"/usr/lib/libgmp.dylib \
4680 - ${binary} || die
4681 - install_name_tool -change \
4682 - ${ncurses_file} \
4683 - "${EPREFIX}"/usr/lib/libncurses.dylib \
4684 - ${binary} || die
4685 - done
4686 - # we don't do frameworks!
4687 - sed -i \
4688 - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
4689 - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
4690 - rts/package.conf.in || die
4691 - fi
4692 -
4693 - # it is autoconf, but we really don't want to give it too
4694 - # much arguments, in fact we do the make in-place anyway
4695 - ./configure --prefix="${WORKDIR}"/usr || die
4696 - make install || die
4697 - popd > /dev/null
4698 - ;;
4699 - *)
4700 - relocate_ghc "${WORKDIR}"
4701 - ;;
4702 - esac
4703 - fi
4704 -
4705 - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
4706 - "${S}/ghc/ghc.wrapper"
4707 -
4708 - cd "${S}" # otherwise epatch will break
4709 -
4710 - epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
4711 -
4712 - epatch "${FILESDIR}"/${PN}-7.8.1_rc1-libbfd.patch
4713 -
4714 - epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
4715 - epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
4716 - # bug 518734
4717 - epatch "${FILESDIR}"/${PN}-7.6.3-preserve-inplace-xattr.patch
4718 - epatch "${FILESDIR}"/${PN}-7.8.3-unreg-lit.patch
4719 -
4720 - # upstream backports
4721 - epatch "${FILESDIR}"/${PN}-7.8.3-linker-warn.patch
4722 - epatch "${FILESDIR}"/${PN}-7.8.3-deRefStablePtr.patch
4723 - epatch "${FILESDIR}"/${PN}-7.8.3-pic-asm.patch
4724 - epatch "${FILESDIR}"/${PN}-7.8.3-pic-sparc.patch
4725 - epatch "${FILESDIR}"/${PN}-7.8.3-cc-lang.patch
4726 - epatch "${FILESDIR}"/${PN}-7.8.3-ia64-prim.patch
4727 -
4728 - if use prefix; then
4729 - # Make configure find docbook-xsl-stylesheets from Prefix
4730 - sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \
4731 - -i utils/haddock/doc/configure.ac || die
4732 - fi
4733 -
4734 - # as we have changed the build system
4735 - eautoreconf
4736 - fi
4737 -}
4738 -
4739 -src_configure() {
4740 - if ! use binary; then
4741 - # initialize build.mk
4742 - echo '# Gentoo changes' > mk/build.mk
4743 -
4744 - # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
4745 - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
4746 - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
4747 -
4748 - # We also need to use the GHC_FLAGS flags when building ghc itself
4749 - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk
4750 - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
4751 - echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
4752 -
4753 - # We can't depend on haddock except when bootstrapping when we
4754 - # must build docs and include them into the binary .tbz2 package
4755 - # app-text/dblatex is not in portage, can not build PDF or PS
4756 - if use ghcbootstrap && use doc; then
4757 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
4758 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
4759 - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
4760 - echo "HADDOCK_DOCS = YES" >> mk/build.mk
4761 - else
4762 - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
4763 - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
4764 - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
4765 - echo "HADDOCK_DOCS = NO" >> mk/build.mk
4766 - fi
4767 -
4768 - # allows overriding build flavours for libraries:
4769 - # v - vanilla (static libs)
4770 - # p - profiled
4771 - # dyn - shared libraries
4772 - # example: GHC_LIBRARY_WAYS="v dyn"
4773 - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
4774 - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
4775 - fi
4776 -
4777 - # Get ghc from the unpacked binary .tbz2
4778 - # except when bootstrapping we just pick ghc up off the path
4779 - if ! use ghcbootstrap; then
4780 - export PATH="${WORKDIR}/usr/bin:${PATH}"
4781 - fi
4782 -
4783 - if use gmp; then
4784 - echo "INTEGER_LIBRARY=integer-gmp" >> mk/build.mk
4785 - else
4786 - echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
4787 - fi
4788 -
4789 - # don't strip anything. Very useful when stage2 SIGSEGVs on you
4790 - echo "STRIP_CMD = :" >> mk/build.mk
4791 -
4792 - local econf_args=()
4793 -
4794 - # GHC embeds 'gcc' it was built by and uses it later.
4795 - # Don't allow things like ccache or versioned binary slip.
4796 - # We use stable thing across gcc upgrades.
4797 - is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
4798 -
4799 - if ! use ghcmakebinary; then
4800 - econf_args+=(--with-system-libffi)
4801 - econf_args+=(--with-ffi-includes=$(pkg-config libffi --cflags-only-I | sed -e 's@^-I@@'))
4802 - fi
4803 -
4804 - econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
4805 -
4806 - if [[ ${PV} == *9999* ]]; then
4807 - GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
4808 - GHC_P=${PN}-${GHC_PV}
4809 - fi
4810 - GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
4811 - fi # ! use binary
4812 -}
4813 -
4814 -src_compile() {
4815 - if ! use binary; then
4816 - # 1. build compiler binary first
4817 - emake ghc/stage2/build/tmp/ghc-stage2
4818 - # 2. pax-mark (bug #516430)
4819 - pax-mark -m ghc/stage2/build/tmp/ghc-stage2
4820 - # 3. and then all the rest
4821 - emake all
4822 - fi # ! use binary
4823 -}
4824 -
4825 -src_install() {
4826 - if use binary; then
4827 - use prefix && mkdir -p "${ED}"
4828 - mv "${S}/usr" "${ED}"
4829 -
4830 - # Remove the docs if not requested
4831 - if ! use doc; then
4832 - rm -rf "${ED}/usr/share/doc/${P}/*/" \
4833 - "${ED}/usr/share/doc/${P}/*.html" \
4834 - || die "could not remove docs (P vs PF revision mismatch?)"
4835 - fi
4836 - else
4837 - # We only build docs if we were bootstrapping, otherwise
4838 - # we copy them out of the unpacked binary .tbz2
4839 - if use doc && ! use ghcbootstrap; then
4840 - mkdir -p "${ED}/usr/share/doc"
4841 - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \
4842 - || die "failed to copy docs"
4843 - else
4844 - dodoc "${S}/distrib/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION"
4845 - fi
4846 -
4847 - emake -j1 install DESTDIR="${D}"
4848 -
4849 - # remove link, but leave 'haddock-${GHC_P}'
4850 - rm -f "${ED}"/usr/bin/haddock
4851 -
4852 - if [[ ! -f "${S}/VERSION" ]]; then
4853 - echo "${GHC_PV}" > "${S}/VERSION" \
4854 - || die "Could not create file ${S}/VERSION"
4855 - fi
4856 - dobashcomp "${FILESDIR}/ghc-bash-completion"
4857 -
4858 - fi
4859 -
4860 - # path to the package.cache
4861 - local package_confdir="${ED}/usr/$(get_libdir)/${GHC_P}/package.conf.d"
4862 - PKGCACHE="${package_confdir}"/package.cache
4863 - # copy the package.conf.d, including timestamp, save it so we can help
4864 - # users that have a broken package.conf.d
4865 - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
4866 -
4867 - # copy the package.conf, including timestamp, save it so we later can put it
4868 - # back before uninstalling, or when upgrading.
4869 - cp -p "${PKGCACHE}"{,.shipped} \
4870 - || die "failed to copy package.conf.d/package.cache"
4871 -}
4872 -
4873 -pkg_preinst() {
4874 - # have we got an earlier version of ghc installed?
4875 - if has_version "<${CATEGORY}/${PF}"; then
4876 - haskell_updater_warn="1"
4877 - fi
4878 -}
4879 -
4880 -pkg_postinst() {
4881 - ghc-reregister
4882 -
4883 - # path to the package.cache
4884 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
4885 -
4886 - # give the cache a new timestamp, it must be as recent as
4887 - # the package.conf.d directory.
4888 - touch "${PKGCACHE}"
4889 -
4890 - if [[ "${haskell_updater_warn}" == "1" ]]; then
4891 - ewarn
4892 - ewarn "\e[1;31m************************************************************************\e[0m"
4893 - ewarn
4894 - ewarn "You have just upgraded from an older version of GHC."
4895 - ewarn "You may have to run"
4896 - ewarn " 'haskell-updater --upgrade'"
4897 - ewarn "to rebuild all ghc-based Haskell libraries."
4898 - ewarn
4899 - ewarn "\e[1;31m************************************************************************\e[0m"
4900 - ewarn
4901 - fi
4902 -}
4903 -
4904 -pkg_prerm() {
4905 - # Be very careful here... Call order when upgrading is (according to PMS):
4906 - # * src_install for new package
4907 - # * pkg_preinst for new package
4908 - # * pkg_postinst for new package
4909 - # * pkg_prerm for the package being replaced
4910 - # * pkg_postrm for the package being replaced
4911 - # so you'll actually be touching the new packages files, not the one you
4912 - # uninstall, due to that or installation directory ${GHC_P} will be the same for
4913 - # both packages.
4914 -
4915 - # Call order for reinstalling is (according to PMS):
4916 - # * src_install
4917 - # * pkg_preinst
4918 - # * pkg_prerm for the package being replaced
4919 - # * pkg_postrm for the package being replaced
4920 - # * pkg_postinst
4921 -
4922 - # Overwrite the modified package.cache with a copy of the
4923 - # original one, so that it will be removed during uninstall.
4924 -
4925 - PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
4926 - rm -rf "${PKGCACHE}"
4927 -
4928 - cp -p "${PKGCACHE}"{.shipped,}
4929 -}
4930 -
4931 -pkg_postrm() {
4932 - ghc-package_pkg_postrm
4933 -}
4934
4935 diff --git a/dev-lang/ghc/metadata.xml b/dev-lang/ghc/metadata.xml
4936 index a654b9b..521a174 100644
4937 --- a/dev-lang/ghc/metadata.xml
4938 +++ b/dev-lang/ghc/metadata.xml
4939 @@ -9,6 +9,5 @@
4940 <flag name="binary">Install the binary version directly, rather than using it to build the source version.</flag>
4941 <flag name="ghcbootstrap">Bootstrap from an existing GHC installation.</flag>
4942 <flag name="ghcmakebinary">Build with less runtime depends (bundle libffi for building bootstrap binaries).</flag>
4943 - <flag name="llvm">Enable llvm code generator for ghc (-fllvm).</flag>
4944 </use>
4945 </pkgmetadata>