summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2014-07-10 19:31:50 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2014-07-10 19:31:50 +0000
commit8d07bb47b138c77adc723f0283b44d910415a99b (patch)
treecdeee21d103263b701a874b4eab2204a54600faf /dev-lang
parentMask fresh ghc-7.8.3. (diff)
downloadhistorical-8d07bb47b138c77adc723f0283b44d910415a99b.tar.gz
historical-8d07bb47b138c77adc723f0283b44d910415a99b.tar.bz2
historical-8d07bb47b138c77adc723f0283b44d910415a99b.zip
Version bump.
Package-Manager: portage-2.2.10_p15/cvs/Linux x86_64 Manifest-Sign-Key: 0x611FF3AA
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/ghc/ChangeLog9
-rw-r--r--dev-lang/ghc/Manifest15
-rw-r--r--dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch81
-rw-r--r--dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch34
-rw-r--r--dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch18
-rw-r--r--dev-lang/ghc/ghc-7.8.3.ebuild609
6 files changed, 760 insertions, 6 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog
index 4e3fd235ada1..cb903afc4d04 100644
--- a/dev-lang/ghc/ChangeLog
+++ b/dev-lang/ghc/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-lang/ghc
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.257 2014/07/05 15:40:40 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.258 2014/07/10 19:31:41 slyfox Exp $
+
+*ghc-7.8.3 (10 Jul 2014)
+
+ 10 Jul 2014; Sergei Trofimovich <slyfox@gentoo.org>
+ +files/ghc-7.8.1_rc1-libbfd.patch, +files/ghc-7.8.2-cgen-constify.patch,
+ +files/ghc-7.8.2-ia64-no-shared.patch, +ghc-7.8.3.ebuild:
+ Version bump.
05 Jul 2014; Sergei Trofimovich <slyfox@gentoo.org> ghc-7.6.3-r1.ebuild:
pax-mark ghc-stage2 before it's used first time. Fixes bootstrap failure on
diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest
index 8d5eef128fb1..a312e64f6e7b 100644
--- a/dev-lang/ghc/Manifest
+++ b/dev-lang/ghc/Manifest
@@ -39,6 +39,9 @@ AUX ghc-7.4.2-system-libffi.patch 4348 SHA256 12c1c60401fcaed156aa67ff4a26fbcd9e
AUX ghc-7.5.20120505-system-libffi.patch 3519 SHA256 817b7938720497dfa8706a058e50c34f09482989fcd042f9783c5d3c6b9d4dbd SHA512 fefa7c3de2912aab7f037a6ef1d3fc4e36cdc128f96079c12a22613efacc2474f805b10784f01cc81742df72d7041a6c24add2b107223d7680cbb83e26c7f1c7 WHIRLPOOL bdcc1fbf7d7ed93cee7b235eeab3e61da1468f573ff8bcf48aab8fb70df10e2c8376016c935e08135a43dc6ffe5d319b27ce34e58762c974a45859110fce94cc
AUX ghc-7.6.2-integer-simple-div-mod.patch 2264 SHA256 20c1bd20c329d12b0aea00b92fd07585d88e4ef4d454525eab8234d4158a6866 SHA512 2f5a4ab52bf9d624f2e17aa4eb431e4a970454b1e4a71635ecfa918495518a5dabdf53b33be4c868976a2435b0e526c12615f9a65ca6544a036583c9dbd0e984 WHIRLPOOL 24d636540e208bf13afa63ea57e62bee68b3ebb333692d9d120bf08e84c3ea295787ce8d5c55cfa6d4af70d24061ca6414fe599091d2ee9b8fc7f7cead65d04a
AUX ghc-7.6.3-trac-3333-weak-syms.patch 14378 SHA256 cdbf32550b5eb273e35fda3277284efe8bea496251f4c91b64c5cbae7c2e3d64 SHA512 9c0a3755c94124605fe1ab0fcaa60b95ecb0b6eb82d3dcd0be21c695458b4ae68512bab4a36cc09a9f2578ffa82a75664b1245eb4e4b06efe0080ab4a2501d6f WHIRLPOOL 6baebc6df6cb38cc7f990970ade199788d4a73d97a966e2c45f83f8170bc8ffe7421050d8d97ed45519ba671d783d414919894251231b86e1081b80718a41859
+AUX ghc-7.8.1_rc1-libbfd.patch 2771 SHA256 d3d27bc0d161df7b9c7c64aca0138f04f0a2317f1e7194d549a8865848026071 SHA512 e232596342675769c6bf97686aff0fa7a8991e1edd3bf607068482cd0d0c9f9a9500e5b15f176a2025732474c9e547c0bae603d373c81b374c96787d46bbfa4a WHIRLPOOL 1fff73527c348a9561583f36e232cbb15c8e681b5b2ba81b786783ec5486db6c31b1d445201d9e56701a32d1210d5d2b47fa4b48e1688913b0c0111a080cbb57
+AUX ghc-7.8.2-cgen-constify.patch 1173 SHA256 604738d87e786b8b52e8e5a7059213fd7231f7998e76e125a0a0962e18931653 SHA512 3e1bca7d7f9062d231c45a6765485291871df833da31b0a5573bb04639791c554dd5c0d8fe33bab05455fe06d3f36fe81dd1db6d3819c739284a3af5c4ec8fb0 WHIRLPOOL c246ef43917caff35d85b80f3231de54fa5ff703cf6ebf3a6822406ec2b28e5b650736bc7688e4823fa16d40c700ca3db615c346435e79db89b7f1e09f472fc8
+AUX ghc-7.8.2-ia64-no-shared.patch 545 SHA256 f5a80008dece46183cef2e58a0b77cdf6216fb7940c81db01795c17b72fae99f SHA512 fa4362cd65f7c4980e8e9de959e25a2247340837c6316d063ff0ee6be0c9d3c057de6115164a01bac051f9a4154532026c4b1b63bb5d4a63ff3783dbaab5945e WHIRLPOOL 8ffa4162304351ac4e85e4ea0ec8186443d8d16695e8ffd289b366046387560c327389afa7a6620e6cf70b0f4435029349ada68023a8a4d70b3771684fbc7b18
AUX ghc-apply-gmp-hack 2585 SHA256 0d3c9e52be232734c916e9765fae770225ad6fb04c0948780867450401ff1eed SHA512 54d4a7ccb4a652e36b012bfa37696895755495a698449f77e854822f0be10d33803a7d049101c8835c8bcb587af3b5ab735e578e820feaa6a90bba0e21ad0a63 WHIRLPOOL 76d2d62886a1dcdb1da1ada62e48846f20b91dcdc2d1d7882107fc7662dd127a821f275eb909b93e4a3e0733c70afb70e41ae405da2eb39f57246f3dec01a914
AUX ghc-bash-completion 6496 SHA256 82a862bea2c9248e06fcf74d307de07b05a55f9eb95f412762bd02e53fece822 SHA512 ede79ccf23555f60f48297d29bd98e3ccfd67d2cf27462153e00beb930398cb497e34ba8316e91df44c577ed11fdbe5606f7c6a2777e35d5e783590e49ccfeb5 WHIRLPOOL 271dc4159ac500beb53981259e4b154b1f96e2909bb7cc43b7364f4fd4f86ce65df04611a46043c14079f699226195a002532fbb1e4ec01715e07e8469f9a7a4
AUX terminfo-0.3.2.5-tinfo.patch 1217 SHA256 dfbb8d5c9ca133837e6f6be766fa8e3af2715e39d8994e56a4a84d6cdc15f9b3 SHA512 60552b163295c565d506b1d3c9624d6d0e94e814c37bb38d0cf0911e153c593c2bd13418306b44fbe611b7fd9064307a201860ed1e2ce5f2a7bb16618bd0b615 WHIRLPOOL 2c06869486a8eb08ff63f7bacebfddfdf68cf0c0dd94ef3578c5dbc49b4374b2ba8c0de9ac2ed4731a3ad27466a4169d2bd13d1c208a8d0aa1226770bcb30847
@@ -55,6 +58,7 @@ DIST ghc-7.4.1-x86_64-apple-darwin.tar.bz2 148037332 SHA256 52eb17e513f9eb2e221b
DIST ghc-7.4.2-src.tar.bz2 25836446 SHA256 f2ee1289a33cc70539287129841acc7eaf16112bb60c59b5a6ee91887bfd836d SHA512 5a3d06a36702fa7e337b482c9de92ce1f84a68f18d8560bcc11f3617d6d46f93167fee27e786de6483a9ef0eab3b1ac6909a71dd53908d36156df4e465075050 WHIRLPOOL 61865eed2bf92728e7c4c4a0c48be44081bf728cfd824760d643e2fad838d96c19e173052d3aac073e0795b5efa3720ba5ddf13cca1ec7952b7524bbe1f204bc
DIST ghc-7.6.2-src.tar.bz2 110778081 SHA256 d5f45184abeacf7e9c6b4f63c7101a5c1d7b4fe9007901159e2287ecf38de533 SHA512 2e6e54f509e564f3713ea15dfefb16a84a467f8044c692ad2647c05b641e1ccb4125b9b63bbf711be1054d7ef56612186d2b9cd88ba4127fe01eec225152e4cf WHIRLPOOL 78724187c0f7579c3f39f257620d3046711f20fe07c540b6b70cf1b0b87bb8476d2382835895b5770865faaac291de05be88e2708fd0c1956ad7bc132d558b9c
DIST ghc-7.6.3-src.tar.bz2 110763823 SHA256 bd43823d31f6b5d0b2ca7b74151a8f98336ab0800be85f45bb591c9c26aac998 SHA512 ac86f18b4feeb0bdc9e867261600b210caf62740d73ae657259bbe8149b8c2c4f5a73d09d74d944d4e50f85cc87503485365f0a0ae65befe8d2b6844e5e1253a WHIRLPOOL 0fe1f5f2987699067494559e6a679d28f027eee8fb2a00c683161dbce5443b1faeebfb51572209b75231cee24c7f0c929cabbc82a93f70e16d05e351fdfe2eaf
+DIST ghc-7.8.3-src.tar.xz 9160092 SHA256 b0cd96a549ba3b5e512847a4a8cd1a3174e4b2b75dadfc41c568fb812887b958 SHA512 2cc8c2aa6f18ba565c1e2aa637045e246f1214c2a77e95c2a97dfb97203b8983e4ad3cc13178b4b51aff70c58d59a1f68f94cd813d043745cb02411bad04bb00 WHIRLPOOL 3a2e8eea0db7a150e4732efed488a3a5eb56da00a9a90a3379afcb4090323925a2a7485fec6676e784139f112d7c825e8d18a576c34c760af4a7f3adb22c021a
DIST ghc-bin-6.12.3-alpha-haddock.tbz2 106307940 SHA256 22951ccbaa2e77f811c634fa95492451f28f8b79e5cfe0297890ce1dd9d525ab SHA512 47b124cb2b745ffa6471dd75b9b922170cd275d837093f320116a842cc2ed4e6f215128fe7269bbe5f85b34239fe46bac697d7210c2f5df97b67c5629ea30c94 WHIRLPOOL 2f26c8c046e779ed63f86fdfcf2cb4815f5f0ea08b0c6c98668909a7a3bcca3c6fa2dac390d3bd066e197093227086cbe4bd5c35044a23d344e591b5d5a1cfc1
DIST ghc-bin-6.12.3-amd64.tbz2 82390661 SHA256 6a1c9978c4ad19bb98f70b900afa799f16cfd3e159bb6d51437c264e35f4d6cc SHA512 ae883f94621fcf0ffe8b57954e403db6812769bbeee92e031be49fc9cc2087c7700bb6a36c6fdd170936c2fea9024d2400db04db94c530841ab6662be34227e8 WHIRLPOOL ffbb50018216af9cc84d2cc04a39646dd47f70e1451bbaf700495864edddbbf729c61c3a020dde472e27236b19151b3373fd1b1735da5d3d9f68c63d9e3ea4ed
DIST ghc-bin-6.12.3-ia64-haddock.tbz2 113756002 SHA256 135c60f870badec5e10add87061d0d9c85276e182ae448ab52c6f9f7ebe6eb2e SHA512 0e789ff5af719106e9eac030c477109a928f04facfd9b7da0c55a25465cd5c92c409d08838f75206939943df6c028e302854da368eefe17fd704c88bc5e83fe4 WHIRLPOOL 7e6ad1b44f28724c4cbf8c618aa04202e61dddaf2f50a71de42161d32b78573fc530aeffb1cb4b550e2141690515487fd99e8c5e01d5c79775ffb771ee5cefe9
@@ -103,12 +107,13 @@ EBUILD ghc-7.4.2.ebuild 22109 SHA256 c061678ca7fb3e578856ed5e5ccd72b9e1cf8600088
EBUILD ghc-7.6.2.ebuild 25352 SHA256 1986bda9cf2dcc52b90b3dd18d8241bb9d93b5f7b7eac5bf5db99dc2bb0503af SHA512 64ebb74a3132a6a162c30fc588592dbfe72328da0d3fa2435942165e470df0ffbcbb640361d1f0a6a9efaf25a5648149c4e8a5e0a16fc39f4bcaa07907e38038 WHIRLPOOL 68d57561fa4dc29ba9c104c85cf9b0df624860ff2b24438659861c76e3472847fd34de8f619eaf0e010e115a712ab7837c3a39153d663c4a429a3c7ba035de10
EBUILD ghc-7.6.3-r1.ebuild 29113 SHA256 2dbf5ec58e8960667d4ea29880cc467341a036b3bdc3d57380b49934fb70006e SHA512 db516cbebd53d3ffe29cc697fbdf094d02da416f366171b22da97871425de7d6cfb1662e1bec3ea10ebc486aebed7d887b5197ebb351813ebc06dd00a196c041 WHIRLPOOL f0e1ef9d0646052b1fa7c9850c5851c6267b9c6f21997f2fa279505e18b60d33bae6a719d0473a736e93a9f81749658804cf4390f3a69ecfd208454e1f5d882c
EBUILD ghc-7.6.3.ebuild 26240 SHA256 517f567d0241deee7c473edcc999c7255f7a8cb14e6cc36f13850021e7802310 SHA512 26c8aa9894e1bcc194b2f62dd1741d03e90ea0b8607e760027117c391ab0ff036e66fe76ce8b07d5cc1acf372e3ed4316d9b866d818e5299285cfbfcb13c19eb WHIRLPOOL 429c9f83b45b153145a999655c6a9f17518f70e48ecbfe91cb8d682eacc3ea9d7818b0de23a7507aa454b3885dbcff3a8393f5f4eb734402f1dd0688535500bc
-MISC ChangeLog 46952 SHA256 325ccd30668d1e41bd886b5698b5ae1606aff4f3933e580a16d18a2e49eb4a86 SHA512 6d278fda44b5225a2e2fb05c9968cf6baf0824e1fecf70b0d689f96809fa2dfb304351f092efc578ebd554791fc2dccc84cd03d0ca13e04bcdbcbf78931756b5 WHIRLPOOL fafafdd30c31a9f27f734884a0bdb8d27bc626146c070232ee57421f5363a92b303aadcd616d51e8bf4ba33288c088ba65d89033e440ad245dec3fa9ed5a3aec
+EBUILD ghc-7.8.3.ebuild 20645 SHA256 d9eb44490dee16a9953e9e2f327ffaa122df0dd2b18eef2fce745ee4e96c2cd3 SHA512 d7afbd558c538fe1f95e9adbb4aa7bda483cc49308dea17f2d15515374d0d97fc78edabb37c69dd4395dfd8a5d2158e1b8778290847f88895a8f3c8357a8b34e WHIRLPOOL e8ca491294cca14ae13b661c670738b6f93a24b983ce04cf2845e13a66af14bc881a9455fae08f7376b9cc204ea43042803cc63a29cca67d7c5a54241d82e2e5
+MISC ChangeLog 47184 SHA256 46f9a8ffaf4f9d281c410fc604a4cb63714195a20ad4944ff4fe734a71e55ca3 SHA512 50903da0b01e86dca6e8ca1d0dfbaa075e3d1a9d9ea9a09fe2a7efa3599123c00f011936453e27f3758501b5ad650c174471c2ac09dba900f3ff85250d8b9f76 WHIRLPOOL cde3f17af24905cacebb4062b2f9525ea65534c3895ac8722ff65808391cdb2cd0b1745b123694d7e5f00621b117f6708806396b97f07a6b666dc172b439f179
MISC metadata.xml 626 SHA256 3bca7daea686cdf5a067c63614567e4764b7130d056205e759f6d8c39bbc70c2 SHA512 687a12b19afe4db07e06e10c51179a69730fc2c236602ecc71011d61644f626d368b8f272e970dbd5bc6ac4dc6bb9c23e2ca06e558c3c0f7bb715dfb3dcdbc35 WHIRLPOOL c15587a1b4d9e5b32556cb281d5a947520629548a9bacc51ff8247bfa09aed2d3420dd6731b0c3a5cc5e8b9a3baba033aa27402b8dcc50bf23dcebe8e3250db3
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.22 (GNU/Linux)
+Version: GnuPG v2
-iEYEAREIAAYFAlO4HHMACgkQcaHudmEf86pQ4ACeKQZx6UMIQnVxlXbmJpDVH2HM
-IkoAn27+BVRlcs5TcPlQE6VVqUByOlD3
-=sWo/
+iEYEAREIAAYFAlO+6iEACgkQcaHudmEf86prTgCbBmo9mVaN6FYYKFowP/3naqnv
+CgQAn1htM71S181AlTPXk/957Sw1Sqvn
+=meLw
-----END PGP SIGNATURE-----
diff --git a/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch b/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch
new file mode 100644
index 000000000000..d01cb49affbd
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.1_rc1-libbfd.patch
@@ -0,0 +1,81 @@
+commit bb5953484579968c984d074ca1af5d21e1c9e7a0
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon Feb 10 12:45:58 2014 +0300
+
+ rts: unrust 'libbfd' debug symbols parser
+
+ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+diff --git a/configure.ac b/configure.ac
+index e7fbc7f..e47979c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -801,7 +801,8 @@ fi
+ dnl ** check whether this machine has BFD and libiberty installed (used for debugging)
+ dnl the order of these tests matters: bfd needs libiberty
+ AC_CHECK_LIB(iberty, xmalloc)
+-AC_CHECK_LIB(bfd, bfd_uncompress_section_contents)
++dnl 'bfd_init' is a rare non-macro in libbfd
++AC_CHECK_LIB(bfd, bfd_init)
+
+ dnl ################################################################
+ dnl Check for libraries
+diff --git a/rts/Printer.c b/rts/Printer.c
+index ca9ca49..ce02b02 100644
+--- a/rts/Printer.c
++++ b/rts/Printer.c
+@@ -48,6 +48,9 @@ void printPtr( StgPtr p )
+ raw = lookupGHCName(p);
+ if (raw != NULL) {
+ printZcoded(raw);
++ /* it can be just a C symbol, like 'stg_returnToStackTop' */
++ debugBelch("<%s>", raw);
++ debugBelch("[%p]", p);
+ } else {
+ debugBelch("%p", p);
+ }
+@@ -794,7 +797,7 @@ static void printZcoded( const char *raw )
+ disabling this for now.
+ */
+ #ifdef USING_LIBBFD
+-
++#include "../mk/config.h" /* silly BFD's requirement */
+ #include <bfd.h>
+
+ /* Fairly ad-hoc piece of code that seems to filter out a lot of
+@@ -863,7 +866,10 @@ extern void DEBUG_LoadSymbols( char *name )
+ for( i = 0; i != number_of_symbols; ++i ) {
+ symbol_info info;
+ bfd_get_symbol_info(abfd,symbol_table[i],&info);
+- /*debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name); */
++ if (0)
++ {
++ debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name);
++ }
+ if (isReal(info.type, info.name)) {
+ num_real_syms += 1;
+ }
+diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
+index aa7306f..5bdef94 100644
+--- a/rts/RtsStartup.c
++++ b/rts/RtsStartup.c
+@@ -19,6 +19,7 @@
+ #include "RtsFlags.h"
+ #include "RtsUtils.h"
+ #include "Prelude.h"
++#include "Printer.h" /* DEBUG_LoadSymbols */
+ #include "Schedule.h" /* initScheduler */
+ #include "Stats.h" /* initStats */
+ #include "STM.h" /* initSTM */
+@@ -162,6 +163,11 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
+ rts_config.rts_opts_enabled, rts_config.rts_opts, rts_config.rts_hs_main);
+ }
+
++#ifdef DEBUG
++ /* load debugging symbols */
++ DEBUG_LoadSymbols((*argv)[0]);
++#endif /* DEBUG */
++
+ /* Initialise the stats department, phase 1 */
+ initStats1();
+
diff --git a/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch b/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch
new file mode 100644
index 000000000000..efdd54fbf3fb
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.2-cgen-constify.patch
@@ -0,0 +1,34 @@
+commit b0cf3ab7a69b878a4335d21a347b56e4b0ca0b7b
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon Apr 14 19:06:24 2014 +0300
+
+ compiler/cmm/PprC.hs: constify local string literals
+
+ Consider one-line module
+ module B (v) where v = "hello"
+ in -fvia-C mode it generates code like
+ static char gibberish_str[] = "hello";
+
+ It uselessly eats data section (precious resource on ia64!).
+ The patch switches genrator to emit:
+ static const char gibberish_str[] = "hello";
+
+ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
+index 2398981..fdb578d 100644
+--- a/compiler/cmm/PprC.hs
++++ b/compiler/cmm/PprC.hs
+@@ -112,6 +112,12 @@ pprTop (CmmProc infos clbl _ graph) =
+
+ -- We only handle (a) arrays of word-sized things and (b) strings.
+
++pprTop (CmmData ReadOnlyData (Statics lbl [CmmString str])) =
++ hcat [
++ pprLocalness lbl, ptext (sLit "const char "), ppr lbl,
++ ptext (sLit "[] = "), pprStringInCStyle str, semi
++ ]
++
+ pprTop (CmmData _section (Statics lbl [CmmString str])) =
+ hcat [
+ pprLocalness lbl, ptext (sLit "char "), ppr lbl,
diff --git a/dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch b/dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch
new file mode 100644
index 000000000000..50a2346df910
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch
@@ -0,0 +1,18 @@
+Attempt to disable dynamic libs.
+
+Crash in threaded runtime (and in -dynamic builds)
+looks very similar to sparc failures.
+diff --git a/mk/config.mk.in b/mk/config.mk.in
+index 7cc7aec..9f21256 100644
+--- a/mk/config.mk.in
++++ b/mk/config.mk.in
+@@ -99,7 +99,8 @@ NoSharedLibsPlatformList = powerpc-unknown-linux \
+ x86_64-unknown-mingw32 \
+ i386-unknown-mingw32 \
+ sparc-sun-solaris2 \
+- sparc-unknown-linux
++ sparc-unknown-linux \
++ ia64-unknown-linux
+
+ ifeq "$(SOLARIS_BROKEN_SHLD)" "YES"
+ NoSharedLibsPlatformList += i386-unknown-solaris2
diff --git a/dev-lang/ghc/ghc-7.8.3.ebuild b/dev-lang/ghc/ghc-7.8.3.ebuild
new file mode 100644
index 000000000000..6d60d3d98ab4
--- /dev/null
+++ b/dev-lang/ghc/ghc-7.8.3.ebuild
@@ -0,0 +1,609 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.8.3.ebuild,v 1.1 2014/07/10 19:31:41 slyfox Exp $
+
+EAPI=5
+
+# to make make a crosscompiler use crossdev and symlink ghc tree into
+# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
+#
+# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} = ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+
+inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
+inherit multilib pax-utils toolchain-funcs versionator
+
+DESCRIPTION="The Glasgow Haskell Compiler"
+HOMEPAGE="http://www.haskell.org/ghc/"
+
+# we don't have any binaries yet
+arch_binaries=""
+
+# sorted!
+#arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
+#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
+#arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )"
+#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )"
+#arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )"
+#arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )"
+#arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )"
+#arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )"
+
+# various ports:
+#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
+
+# 0 - yet
+yet_binary() {
+ case "${ARCH}" in
+ #alpha) return 0 ;;
+ #arm)
+ # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
+ # return 0
+ #;;
+ #amd64) return 0 ;;
+ #ia64) return 0 ;;
+ #ppc) return 0 ;;
+ #ppc64) return 0 ;;
+ #sparc) return 0 ;;
+ #x86) return 0 ;;
+ *) return 1 ;;
+ esac
+}
+
+GHC_PV=${PV}
+#GHC_PV=7.8.0.20140228 # uncomment only for -rc ebuilds
+GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
+
+SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV/_rc/-rc}/${GHC_P}-src.tar.xz )"
+S="${WORKDIR}"/${GHC_P}
+
+[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
+LICENSE="BSD"
+SLOT="0/${PV}"
+#KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+KEYWORDS=""
+IUSE="doc ghcbootstrap ghcmakebinary +gmp"
+IUSE+=" binary"
+IUSE+=" elibc_glibc" # system stuff
+
+RDEPEND="
+ >=dev-lang/perl-5.6.1
+ >=dev-libs/gmp-5:=
+ sys-libs/ncurses:=[unicode]
+ !ghcmakebinary? ( virtual/libffi:= )
+ !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 )
+ kernel_linux? ( >=sys-devel/binutils-2.17 )
+ kernel_SunOS? ( >=sys-devel/binutils-2.17 )
+"
+
+# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to
+# that we want the binaries to use the latest versioun available, and not to be
+# built against gmp-4
+
+# similar for glibc. we have bootstrapped binaries against glibc-2.17
+DEPEND="${RDEPEND}
+ ghcbootstrap? ( >=dev-haskell/alex-2.3
+ >=dev-haskell/happy-1.18
+ doc? ( app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ >=dev-libs/libxslt-1.1.2 ) )
+ !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) ) )"
+
+PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
+
+REQUIRED_USE="?? ( ghcbootstrap binary )"
+# ia64 fails to return from STG GMP primitives (stage2 always SIGSEGVs)
+REQUIRED_USE+=" ia64? ( !gmp )"
+
+# yeah, top-level 'use' sucks. I'd like to have it in 'src_install()'
+use binary && QA_PREBUILT="*"
+
+# haskell libraries built with cabal in configure mode, #515354
+QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+append-ghc-cflags() {
+ local persistent compile assemble link
+ local flag ghcflag
+
+ for flag in $*; do
+ case ${flag} in
+ persistent) persistent="yes";;
+ compile) compile="yes";;
+ assemble) assemble="yes";;
+ link) link="yes";;
+ *)
+ [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
+ [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
+ [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
+ [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
+ [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
+ [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
+ ;;
+ esac
+ done
+}
+
+ghc_setup_cflags() {
+ if is_crosscompile; then
+ export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"}
+ export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"}
+ einfo "Crosscompiling mode:"
+ einfo " CHOST: ${CHOST}"
+ einfo " CTARGET: ${CTARGET}"
+ einfo " CFLAGS: ${CFLAGS}"
+ einfo " LDFLAGS: ${LDFLAGS}"
+ return
+ fi
+ # We need to be very careful with the CFLAGS we ask ghc to pass through to
+ # gcc. There are plenty of flags which will make gcc produce output that
+ # breaks ghc in various ways. The main ones we want to pass through are
+ # -mcpu / -march flags. These are important for arches like alpha & sparc.
+ # We also use these CFLAGS for building the C parts of ghc, ie the rts.
+ strip-flags
+ strip-unsupported-flags
+
+ # Cmm can't parse line numbers #482086
+ replace-flags -ggdb[3-9] -ggdb2
+
+ GHC_FLAGS=""
+ GHC_PERSISTENT_FLAGS=""
+ for flag in ${CFLAGS}; do
+ case ${flag} in
+
+ # Ignore extra optimisation (ghc passes -O to gcc anyway)
+ # -O2 and above break on too many systems
+ -O*) ;;
+
+ # Arch and ABI flags are what we're really after
+ -m*) append-ghc-cflags compile assemble ${flag};;
+
+ # Sometimes it's handy to see backtrace of RTS
+ # to get an idea what happens there
+ -g*) append-ghc-cflags compile ${flag};;
+
+ # Ignore all other flags, including all -f* flags
+ esac
+ done
+
+ for flag in ${LDFLAGS}; do
+ append-ghc-cflags link ${flag}
+ done
+
+ # hardened-gcc needs to be disabled, because the mangler doesn't accept
+ # its output.
+ gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
+ gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector
+
+ # prevent from failind building unregisterised ghc:
+ # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
+ use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
+ # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
+ # currently ghc fails to build haddock
+ # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
+ use ia64 && append-ghc-cflags persistent compile -G0 -Os
+}
+
+# substitutes string $1 to $2 in files $3 $4 ...
+relocate_path() {
+ local from=$1
+ local to=$2
+ shift 2
+ local file=
+ for file in "$@"
+ do
+ sed -i -e "s|$from|$to|g" \
+ "$file" || die "path relocation failed for '$file'"
+ done
+}
+
+# changes hardcoded ghc paths and updates package index
+# $1 - new absolute root path
+relocate_ghc() {
+ local to=$1
+
+ # libdir for prebuilt binary and for current system may mismatch
+ # It does for prefix installation for example: bug #476998
+ local bin_ghc_prefix=${WORKDIR}/usr
+ local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
+ local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
+
+ # backup original script to use it later after relocation
+ local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
+ cp "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
+
+ if [[ ${bin_libdir} != $(get_libdir) ]]; then
+ einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
+ # moving the dir itself is not strictly needed
+ # but then USE=binary would result in installing
+ # in '${bin_libdir}'
+ mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
+
+ relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
+ "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/hsc2hs" \
+ "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
+ "$gp_back" \
+ "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
+ fi
+
+ # Relocate from /usr to ${EPREFIX}/usr
+ relocate_path "/usr" "${to}/usr" \
+ "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/hsc2hs" \
+ "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
+ "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/package.conf.d/"*
+
+ # this one we will use to regenerate cache
+ # so it should point to current tree location
+ relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
+
+ if use prefix; then
+ # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree
+ # TODO: add the same for darwin's CHOST and it's DYLD_
+ local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH'
+ sed -i -e '2i'"$new_ldpath" \
+ "${WORKDIR}/usr/bin/ghc-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/ghci-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/ghc-pkg-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/hsc2hs" \
+ "${WORKDIR}/usr/bin/runghc-${GHC_PV}" \
+ "$gp_back" \
+ "${WORKDIR}/usr/bin/hsc2hs" \
+ || die "Adding LD_LIBRARY_PATH for wrappers failed"
+ fi
+
+ # regenerate the binary package cache
+ "$gp_back" recache || die "failed to update cache after relocation"
+ rm "$gp_back"
+}
+
+pkg_setup() {
+ if use ghcbootstrap; then
+ ewarn "You requested ghc bootstrapping, this is usually only used"
+ ewarn "by Gentoo developers to make binary .tbz2 packages."
+
+ [[ -z $(type -P ghc) ]] && \
+ die "Could not find a ghc to bootstrap with."
+ else
+ if ! yet_binary; then
+ eerror "Please try emerging with USE=ghcbootstrap and report build"
+ eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
+ die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
+ fi
+ fi
+}
+
+src_unpack() {
+ # Create the ${S} dir if we're using the binary version
+ use binary && mkdir "${S}"
+
+ # the Solaris and Darwin binaries from ghc (maeder) need to be
+ # unpacked separately, so prevent them from being unpacked
+ local ONLYA=${A}
+ case ${CHOST} in
+ *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.bz2 ;;
+ esac
+ unpack ${ONLYA}
+
+ if [[ -d "${S}"/libraries/dph ]]; then
+ # Sometimes dph libs get accidentally shipped with ghc
+ # but they are not installed unless user requests it.
+ # We never install them.
+ elog "Removing 'libraries/dph'"
+ rm -rf "${S}"/libraries/dph
+ fi
+}
+
+src_prepare() {
+ ghc_setup_cflags
+
+ if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
+ # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
+ # See bug #313635.
+ sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
+ "${WORKDIR}/usr/bin/ghc-${GHC_PV}"
+
+ # allow hardened users use vanilla binary to bootstrap ghc
+ # ghci uses mmap with rwx protection at it implements dynamic
+ # linking on it's own (bug #299709)
+ pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${GHC_P}/bin/ghc"
+ fi
+
+ if use binary; then
+ if use prefix; then
+ relocate_ghc "${EPREFIX}"
+ fi
+
+ # Move unpacked files to the expected place
+ mv "${WORKDIR}/usr" "${S}"
+ else
+ if ! use ghcbootstrap; then
+ case ${CHOST} in
+ *-darwin* | *-solaris*)
+ # UPDATE ME for ghc-7
+ mkdir "${WORKDIR}"/ghc-bin-installer || die
+ pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
+ use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
+ use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
+ use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2
+ use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
+ popd > /dev/null
+
+ pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
+ # fix the binaries so they run, on Solaris we need an
+ # LD_LIBRARY_PATH which has our prefix libdirs, on
+ # Darwin we need to replace the frameworks with our libs
+ # from the prefix fix before installation, because some
+ # of the tools are actually used during configure/make
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ local readline_framework=GNUreadline.framework/GNUreadline
+ local gmp_framework=/opt/local/lib/libgmp.10.dylib
+ local ncurses_file=/opt/local/lib/libncurses.5.dylib
+ for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
+ install_name_tool -change \
+ ${readline_framework} \
+ "${EPREFIX}"/lib/libreadline.dylib \
+ ${binary} || die
+ install_name_tool -change \
+ ${gmp_framework} \
+ "${EPREFIX}"/usr/lib/libgmp.dylib \
+ ${binary} || die
+ install_name_tool -change \
+ ${ncurses_file} \
+ "${EPREFIX}"/usr/lib/libncurses.dylib \
+ ${binary} || die
+ done
+ # we don't do frameworks!
+ sed -i \
+ -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
+ -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
+ rts/package.conf.in || die
+ fi
+
+ # it is autoconf, but we really don't want to give it too
+ # much arguments, in fact we do the make in-place anyway
+ ./configure --prefix="${WORKDIR}"/usr || die
+ make install || die
+ popd > /dev/null
+ ;;
+ *)
+ relocate_ghc "${WORKDIR}"
+ ;;
+ esac
+ fi
+
+ sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
+ "${S}/ghc/ghc.wrapper"
+
+ cd "${S}" # otherwise epatch will break
+
+ epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch"
+
+ epatch "${FILESDIR}"/${PN}-7.8.1_rc1-libbfd.patch
+
+ epatch "${FILESDIR}"/${PN}-7.8.2-ia64-no-shared.patch
+ epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
+
+ if use prefix; then
+ # Make configure find docbook-xsl-stylesheets from Prefix
+ sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \
+ -i utils/haddock/doc/configure.ac || die
+ fi
+
+ # as we have changed the build system
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ if ! use binary; then
+ # initialize build.mk
+ echo '# Gentoo changes' > mk/build.mk
+
+ # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
+ echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
+ echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
+
+ # We also need to use the GHC_FLAGS flags when building ghc itself
+ echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk
+ echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
+ echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
+
+ # We can't depend on haddock except when bootstrapping when we
+ # must build docs and include them into the binary .tbz2 package
+ # app-text/dblatex is not in portage, can not build PDF or PS
+ if use ghcbootstrap && use doc; then
+ echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
+ echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
+ echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
+ echo "HADDOCK_DOCS = YES" >> mk/build.mk
+ else
+ echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
+ echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
+ echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
+ echo "HADDOCK_DOCS = NO" >> mk/build.mk
+ fi
+
+ # allows overriding build flavours for libraries:
+ # v - vanilla (static libs)
+ # p - profiled
+ # dyn - shared libraries
+ # example: GHC_LIBRARY_WAYS="v dyn"
+ if [[ -n ${GHC_LIBRARY_WAYS} ]]; then
+ echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk
+ fi
+
+ # Get ghc from the unpacked binary .tbz2
+ # except when bootstrapping we just pick ghc up off the path
+ if ! use ghcbootstrap; then
+ export PATH="${WORKDIR}/usr/bin:${PATH}"
+ fi
+
+ if use gmp; then
+ echo "INTEGER_LIBRARY=integer-gmp" >> mk/build.mk
+ else
+ echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
+ fi
+
+ # don't strip anything. Very useful when stage2 SIGSEGVs on you
+ echo "STRIP_CMD = :" >> mk/build.mk
+
+ local econf_args=()
+
+ # GHC embeds 'gcc' it was built by and uses it later.
+ # Don't allow things like ccache or versioned binary slip.
+ # We use stable thing across gcc upgrades.
+ is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
+
+ if ! use ghcmakebinary; then
+ econf_args+=(--with-system-libffi)
+ econf_args+=(--with-ffi-includes=$(pkg-config libffi --cflags-only-I | sed -e 's@^-I@@'))
+ fi
+
+ econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
+
+ if [[ ${PV} == *9999* ]]; then
+ GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
+ GHC_P=${PN}-${GHC_PV}
+ fi
+ GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
+ fi # ! use binary
+}
+
+src_compile() {
+ if ! use binary; then
+ # 1. build compiler binary(+wrapper) first
+ emake inplace/bin/ghc-stage2
+ # 2. pax-mark (bug #516430)
+ pax-mark -m inplace/lib/bin/ghc-stage2
+ # 3. and then all the rest
+ emake all
+ fi # ! use binary
+}
+
+src_install() {
+ if use binary; then
+ use prefix && mkdir -p "${ED}"
+ mv "${S}/usr" "${ED}"
+
+ # Remove the docs if not requested
+ if ! use doc; then
+ rm -rf "${ED}/usr/share/doc/${P}/*/" \
+ "${ED}/usr/share/doc/${P}/*.html" \
+ || die "could not remove docs (P vs PF revision mismatch?)"
+ fi
+ else
+ # We only build docs if we were bootstrapping, otherwise
+ # we copy them out of the unpacked binary .tbz2
+ if use doc && ! use ghcbootstrap; then
+ mkdir -p "${ED}/usr/share/doc"
+ mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \
+ || die "failed to copy docs"
+ else
+ dodoc "${S}/distrib/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION"
+ fi
+
+ emake -j1 install DESTDIR="${D}"
+
+ # remove link, but leave 'haddock-${GHC_P}'
+ rm -f "${ED}"/usr/bin/haddock
+
+ # ghci uses mmap with rwx protection at it implements dynamic
+ # linking on it's own (bug #299709)
+ # so mark resulting binary
+ pax-mark -m "${ED}/usr/$(get_libdir)/${GHC_P}/ghc"
+
+ if [[ ! -f "${S}/VERSION" ]]; then
+ echo "${GHC_PV}" > "${S}/VERSION" \
+ || die "Could not create file ${S}/VERSION"
+ fi
+ dobashcomp "${FILESDIR}/ghc-bash-completion"
+
+ fi
+
+ # path to the package.cache
+ local package_confdir="${ED}/usr/$(get_libdir)/${GHC_P}/package.conf.d"
+ PKGCACHE="${package_confdir}"/package.cache
+ # copy the package.conf.d, including timestamp, save it so we can help
+ # users that have a broken package.conf.d
+ cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
+
+ # copy the package.conf, including timestamp, save it so we later can put it
+ # back before uninstalling, or when upgrading.
+ cp -p "${PKGCACHE}"{,.shipped} \
+ || die "failed to copy package.conf.d/package.cache"
+}
+
+pkg_preinst() {
+ # have we got an earlier version of ghc installed?
+ if has_version "<${CATEGORY}/${PF}"; then
+ haskell_updater_warn="1"
+ fi
+}
+
+pkg_postinst() {
+ ghc-reregister
+
+ # path to the package.cache
+ PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
+
+ # give the cache a new timestamp, it must be as recent as
+ # the package.conf.d directory.
+ touch "${PKGCACHE}"
+
+ if [[ "${haskell_updater_warn}" == "1" ]]; then
+ ewarn
+ ewarn "\e[1;31m************************************************************************\e[0m"
+ ewarn
+ ewarn "You have just upgraded from an older version of GHC."
+ ewarn "You may have to run"
+ ewarn " 'haskell-updater --upgrade'"
+ ewarn "to rebuild all ghc-based Haskell libraries."
+ ewarn
+ ewarn "\e[1;31m************************************************************************\e[0m"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # Be very careful here... Call order when upgrading is (according to PMS):
+ # * src_install for new package
+ # * pkg_preinst for new package
+ # * pkg_postinst for new package
+ # * pkg_prerm for the package being replaced
+ # * pkg_postrm for the package being replaced
+ # so you'll actually be touching the new packages files, not the one you
+ # uninstall, due to that or installation directory ${GHC_P} will be the same for
+ # both packages.
+
+ # Call order for reinstalling is (according to PMS):
+ # * src_install
+ # * pkg_preinst
+ # * pkg_prerm for the package being replaced
+ # * pkg_postrm for the package being replaced
+ # * pkg_postinst
+
+ # Overwrite the modified package.cache with a copy of the
+ # original one, so that it will be removed during uninstall.
+
+ PKGCACHE="${EROOT}/usr/$(get_libdir)/${GHC_P}/package.conf.d/package.cache"
+ rm -rf "${PKGCACHE}"
+
+ cp -p "${PKGCACHE}"{.shipped,}
+}