Portage is a package management system used by Gentoo Linux
# ChangeLog for dev-lang/ghc
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.152 2008/04/28 17:44:23 armin76 Exp $
28 Apr 2008; Raúl Porcel
Upload again the binaries for alpha, and add ~ia64 wrt #206643
01 Mar 2008; Raúl Porcel
ghc-6.8.2.ebuild:
Add ~alpha
29 Jan 2008; Jeroen Roovers
Marked ~hppa (bug #206643).
26 Jan 2008; Duncan Coutts
Drop ~alpha ~hppa ~ia64 ~ppc ~ppc64 keywords as per bug #206643.
They will have to wait for new binaries. Also fix a few minor QA bugs.
23 Dec 2007; Luis F. Araujo
Droping the last reference to virtual/x11
24 Dec 2007; Lennart Kolmodin
Fix ghc-updater to be baselayout independent wrt functions.sh.
Fixes bug #190043, thanks to Jakub Moc
*ghc-6.8.2 (19 Dec 2007)
19 Dec 2007; Lennart Kolmodin
First version of the 6.8 branch. It's currently package.mask'ed.
16 Dec 2007; nixnut
Stable on ppc wrt bug 201984
13 Dec 2007; Duncan Coutts
ghc-6.2.2.ebuild, ghc-6.4.2.ebuild, ghc-6.6.ebuild, ghc-6.6.1.ebuild:
Stop providing virtual/ghc. Nothing in portage has depended on it for some
time.
12 Dec 2007; Ferris McCormick
Sparc stable --- needed for Bug #201984 generally.
26 Nov 2007; Jeroen Roovers
Stable for HPPA. Do not install LICENSE.
15 Nov 2007; Steve Dibb
amd64 stable, bug 196616
05 Nov 2007; Duncan Coutts
ghc-6.4.2.ebuild:
Use new unified ghc ebuild for 6.2.2 and 6.4.2. This merges the
functionality of ghc-bin into the ghc ebuild and eliminates virtual/ghc.
To get the binary version emerge with the "binary" USE flag.
05 Nov 2007; Duncan Coutts
Add sparc and ppc binaries. Also fix some var quoting QA warnings.
23 Oct 2007; Christian Faulhammer
stable x86, bug 196616
29 Aug 2007; Jeroen Roovers
Marked ~hppa (bug #187147).
26 Aug 2007; Lennart Kolmodin
Update ghc-updater to new baselayout.
Thanks to Jeroen Roovers
17 Aug 2007; Lennart Kolmodin
+files/ghc-bash-completion, ghc-6.6.1.ebuild:
Add optional bash completion support for ghc-pkg.
Fixes to properly remove the leftover package.conf{,.old} files upon
uninstall of this package.
Tweaking mk/build.mk regarding arches we don't yet support for this GHC
version.
08 Aug 2007; Lennart Kolmodin
Set SplitObjs=NO if >=gcc-4.2 is used.
28 Jul 2007; Lennart Kolmodin
Disable the split objects feature when using >=gcc-4.2.
25 Jul 2007; Duncan Coutts
Add ghc-6.6 back since it has binaries for alpha, ppc and sparc that we do
not have yet for 6.6.1.
25 Jul 2007; Duncan Coutts
ghc-6.6.1.ebuild:
Update 6.6.1 and remove 6.6 ebuilds.
22 Jul 2007; Hans de Graaff
Drop virtual/x11 references.
11 Jul 2007; Duncan Coutts
Add ia64 binary for ghc-6.6.1. Added ~ia64 to keywords.
10 Jul 2007; Duncan Coutts
files/ghc-6.5-norelax.patch:
Fix sparc "norelax" patch.
10 Jul 2007; Duncan Coutts
-files/ghc-6.2.hardened.patch, -files/ghc-6.4.1-configure.patch,
-files/ghc-6.4.1-gcc41.patch, -files/ghc-6.4.1-openal.patch,
files/ghc-6.5-norelax.patch, files/ghc-updater, ghc-6.2.2.ebuild,
-ghc-6.4.1-r2.ebuild, -ghc-6.4.1-r3.ebuild, ghc-6.4.2.ebuild,
ghc-6.6.ebuild, ghc-6.6.1.ebuild:
Remove ghc-6.4.1. Now that we have 6.4.2, we don't need an older version
on the 6.4.x branch. Remove old ia64 hacks that are no longer necessary.
Make the ghc-6.2.2 ebuild work again by taking many of the improvements
from the 6.4.2 ebuild.
09 Jul 2007; Duncan Coutts
Oops, alpha doesnt have a binary yet, so cant mark ~alpha yet.
08 Jul 2007; Duncan Coutts
Bump dep on cabal and no longer hide ghc's built-in cabal.
*ghc-6.6.1 (06 Jul 2007)
06 Jul 2007; Duncan Coutts
Add new version, ghc-6.6.1. So far only binaries for x86 and amd64. More
arches to follow.
06 Jul 2007; Duncan Coutts
Fix mirror url for the docs.
06 Jul 2007; Duncan Coutts
Add ~sparc and ~alpha to KEYWORDS. Both were included for old ghc-bin-6.6.
05 Jul 2007; Duncan Coutts
ghc-6.6.ebuild:
Merge ghc and ghc-bin ebuilds. emerge ghc with USE="binary" to get a binary
version. The ghc-bin ebuild will not be used anymore. This ghc ebuild is
able to bootstrap without a separate ghc-bin ebuild by downloading a binary
version specially for the purpose.
06 Apr 2007; Chris Parrott
+files/ghc-6.6-nothreadedrts.patch, ghc-6.6.ebuild:
added patches to workaround RTS problem on sparc
29 Mar 2007; Markus Rothe
ghc-6.6.ebuild:
Build unregisterised on ppc64; bug #145466
10 Mar 2007;
Add missing ghc-6.6 patch.
*ghc-6.6 (07 Mar 2007)
07 Mar 2007;
Bump version. Big changes ahead... wrt ghc-extra-libs, etc
06 Jan 2007; Andres Loeh
ghc-6.4.1-r2.ebuild, ghc-6.4.1-r3.ebuild, ghc-6.4.2.ebuild:
Fixed elog / einfo usage.
03 Oct 2006; Duncan Coutts
+files/ghc-6.4.2-sparcmangler.patch, ghc-6.4.2.ebuild:
Add fmccor's sparc mangler patch. Fixes bug #144752.
03 Oct 2006; Duncan Coutts
ghc-6.4.2.ebuild:
Use ${T} rather than ${TMP}
28 Aug 2006; Jeroen Roovers
Stable for HPPA (bug #140369).
21 Aug 2006; Daniel Gryniewicz
Marked stable on amd64 for bug #140369
16 Aug 2006; Joshua Jackson
Stable x86; bug #140369
02 Aug 2006; Duncan Coutts
Dont strip binaries on install. See QA warnings in bug #140369.
Also dep on freealut now that it's been split out of openal.
24 Jul 2006; Gustavo Zacarias
Stable on sparc wrt #140369
23 Jul 2006; Tobias Scherbaum
ppc stable, bug #140369
20 Jul 2006; Markus Rothe
Stable on ppc64; bug #140369
15 Jun 2006; Duncan Coutts
ghc-6.4.2.ebuild:
Patch to fix a mis-compilation in the rts due to strict aliasing,
should be fixed upstream for 6.4.3 and 6.6. Fixes bug #135651.
21 May 2006; Markus Rothe
Stable on ppc64
19 May 2006; Duncan Coutts
ghc-6.4.2.ebuild:
Add note to users of hardened gcc-3.x
18 May 2006; Duncan Coutts
+files/ghc-6.4.2-sparc32plus.patch, ghc-6.4.1-r3.ebuild, ghc-6.4.2.ebuild:
Support gcc-4.x better at the expense of hardened gcc-3.x.
Switching between gcc-3.x and gcc-4.x will now just work. Switching between
vanilla and hardened gcc will now require re-emerging rather than just
working. It should also enable anyone who has broken their ghc installation
by upgrading to gcc-4.x to get things working again by re-emerging ghc-6.4.2,
ghc-6.4.1-r3 or ghc-bin-6.4.1-r1.
Only build OpenAL/ALUT bindings if the OpenGL bindings will also be built
(since one depends on the other).
Fix GHCi on sparc when using the V8+ ABI (eg CFLAGS="-march=ultrasparc").
12 May 2006; Duncan Coutts
+files/ghc-6.4.2-alut.patch, ghc-6.4.2.ebuild:
Re-enable alut package and add hack for ia64
05 May 2006; Chris Parrott
Temporarily disabled openal USE flag, pending fix to openal bindings.
03 May 2006; Duncan Coutts
ghc-6.4.2.ebuild:
Ignore debugging CFLAGS (they don't help and just cause problems). Update to
PDEPEND on cabal-1.1.4. Disable ALUT bindings (because media-libs/freealut
is not available on sufficient arches). Add ~x86-fbsd to KEYWORDS.
02 May 2006; Duncan Coutts
ghc-6.4.1-r3.ebuild:
Patch to fix make-3.81 hanging (backport of the fix in ghc-6.4.2)
27 Apr 2006; Duncan Coutts
-files/ghc-6.4-powerpc.patch, +ghc-6.4.2.ebuild:
Remove old unused patch
*ghc-6.4.2 (27 Apr 2006)
27 Apr 2006; Duncan Coutts
New minor version
27 Apr 2006; Duncan Coutts
We dont need the java/fop stuff since were only building html docs
27 Apr 2006; Marien Zwart
files/digest-ghc-6.4.1-r2, Manifest:
Fixing SHA256 digest, pass four
06 Apr 2006; Duncan Coutts
-O* flags (from the users CFLAGS) breaks ghc on too many systems so don't
add it to ghc's CFLAGS. Also remove ia64 GOT patch that didn't help.
28 Mar 2006; Duncan Coutts
Enable SplitObjs on ppc. This gives much smaller binaries.
28 Mar 2006; Duncan Coutts
Change the use of CFLAGS again. Filter out -O2 on arches where it breaks.
27 Mar 2006; Duncan Coutts
Remove 6.4 since 6.4.1 is stable and 6.4 was rather buggy anyway.
27 Mar 2006; Duncan Coutts
+files/ghc-6.4.1-gcc41.patch:
Add missing patch file
*ghc-6.4.1-r3 (26 Mar 2006)
26 Mar 2006; Duncan Coutts
Add support for ia64. Change the way we do the CFLAGS and GHC_CFLAGS again.
Make limited use of users CFLAGS. Support gcc-4.1. Fix parallel make.
23 Mar 2006; Chris White
Marked ghc-6.4.1-r2 amd64/x86 stable for bug #126134.
21 Mar 2006; Gustavo Zacarias
Stable on sparc wrt #126134
20 Mar 2006;
Stable on ppc. Bug #126134
18 Mar 2006; Duncan Coutts
Enable SplitObjs on sparc. This means that a stripped hello world binary is
now 500K rather than 2.5Mb. It may work on ppc too, this needs testing.
15 Mar 2006; Duncan Coutts
A further fix for the executable stack issue.
(It seems we need -Wa,--noexecstack in SRC_CC_OPTS as well as SRC_HC_OPTS)
13 Mar 2006; Duncan Coutts
ghc-6.4.1-r2.ebuild:
Improvements to ghc-updater thanks to kosmikus and with help from ferdy
13 Mar 2006; Jeroen Roovers
Marked ~hppa (bug #125389).
13 Mar 2006; Duncan Coutts
Fix omission in hppa support.
10 Mar 2006; Duncan Coutts
Change what flags we use to disable hardened gcc and how we set them. We now
use one set of flags rather than picking them conditionally.
Use an option which should fix the executable-stack problem (bug #123698).
Prepare for hppa arch support and misc minor tidy-ups.
01 Mar 2006; Markus Rothe
Added ~ppc64; bug #88362
24 Feb 2006; Duncan Coutts
-files/ghc-6.0.1.haddock.patch:
Remove old unused patch.
*ghc-6.4.1-r2 (16 Feb 2006)
16 Feb 2006; Luis F. Araujo
Added support for modular X. New flags support to enable/disable X, hgl and
openal
10 Feb 2006;
Remove the last ghc-6.0.x version. (There's no way to bootstrap it anyway)
10 Feb 2006;
Marked ~alpha with permission of ferdy.
16 Nov 2005; Andres Loeh
Reduced the amount of output during the build slightly to work around bug
#111183.
*ghc-6.4.1-r1 (21 Oct 2005)
21 Oct 2005;
Add new revision ghc-6.4.1-r1 which now PDEPENDs on cabal.
06 Oct 2005;
Revert to using virtual/ghc in DEPEND since the other method had no advantages.
06 Oct 2005;
Make the ghc-updater script work better.
04 Oct 2005; Luis F. Araujo
Blocked ghc6.4 in ghc6.2.2
04 Oct 2005; Gustavo Zacarias
Back to the ~ppc
04 Oct 2005;
Add ~sparc to KEYWORDS and enable GHCi on sparc.
23 Sep 2005;
Disabled java USE flag due to bug #106992
*ghc-6.4.1 (22 Sep 2005)
22 Sep 2005;
Version bump.
01 Sep 2005; Gustavo Zacarias
Stable on sparc
31 Aug 2005; Gustavo Zacarias
Fixed to build on ppc for real
17 Aug 2005;
Add ~sparc to KEYWORDS since it was missing and we've already got ghc-bin-6.4
17 Aug 2005; Andres Loeh
-files/ghc-6.2.1-linker.patch.bz2, -files/ghc-6.2.documentation.patch,
-files/ghc-6.2.hardened.patch.bz2, -files/lndir.c, -ghc-6.2.ebuild,
-ghc-6.2-r1.ebuild, -ghc-6.2.1-r1.ebuild, ghc-6.2.2.ebuild:
Removed ~amd64 keyword for ghc-6.2.2, because ghc-6.2.2 is broken on this
arch. Cleaned up old versions.
20 May 2005;
Add ~sparc to KEYWORDS and disable GHCi support on sparc since it does not
work reliably.
11 May 2005; Andres Loeh
Removing ~ppc64 from ghc-6.4 again (hopefully temporarily), see comment #24
of bug #68930.
11 May 2005; Andres Loeh
Changes to ghc-updater, to make it a bit more useful for the update to ghc-6.4.
09 May 2005; Markus Rothe
+files/ghc-6.4-powerpc.patch, ghc-6.4.ebuild:
Added patch for ppc64 and added ~ppc64 to KEYWORDS
09 Apr 2005; Michael Hanselmann
Stable on ppc.
25 Mar 2005; Andres Loeh
ghc-6.4.ebuild:
ghc-6.4 supports registered builds on amd64. ghci is still not supported on
amd64, but it fails with a more informative error message now (bug #82541).
23 Mar 2005; Andres Loeh
Added dependency on haddock.
23 Mar 2005; Andres Loeh
Added missing dependency on libxslt, and slightly cleaned up the ebuild.
*ghc-6.4 (11 Mar 2005)
11 Mar 2005; Andres Loeh
-ghc-6.4_pre20050308.ebuild:
Updated ghc-6.4 snapshot to ghc-6.4 release. This version is still masked
for testing.
*ghc-6.4_pre20050308 (09 Mar 2005)
09 Mar 2005; Andres Loeh
Added a ghc-6.4 snapshot for testing purposes.
19 Feb 2005; Jason Wever
ghc-6.2-r1.ebuild, ghc-6.2.1-r1.ebuild, ghc-6.2.2.ebuild, ghc-6.2.ebuild:
Masked on SPARC as it doesn't build.
25 Jan 2005; Andres Loeh
Dependency resolution for virtuals changed in portage. Temporily adapted the
ebuild to quit with an informative error message until a real solution comes
to mind. (Bug #79509)
19 Jan 2005; Andres Loeh
Marked stable on x86.
25 Nov 2004; Andres Loeh
The amd64 build is unregistered (bug #58588).
24 Nov 2004; Andres Loeh
Added ~amd64 flag, cf. bug #58588.
22 Nov 2004; Andres Loeh
ghc-6.2.2.ebuild:
Modified ebuild to use ghc-package.eclass (bug #69270) and to include
ghc-updater script (bug #69142).
26 Oct 2004; Andres Loeh
Modified CFLAG testing code, following discussion in bug #59709.
24 Oct 2004; Matthieu Sozeau
Tested on ppc.
*ghc-6.2.2 (18 Oct 2004)
18 Oct 2004; Andres Loeh
ghc-6.2.1-r1.ebuild, ghc-6.2.1.ebuild, ghc-6.2.2.ebuild:
New version. Included mattam's fix for #59709. Removed some old versions.
19 Oct 2004; Mamoru KOMACHI
ghc-6.0.ebuild, ghc-6.2-r1.ebuild, ghc-6.2.1-r1.ebuild, ghc-6.2.1.ebuild,
ghc-6.2.ebuild:
Fixed missing dependencies; bug #68021.
24 Sep 2004;
stable bump due to bug 59753
01 Jul 2004; Jeremy Huddleston
ghc-6.0.ebuild, ghc-6.2-r1.ebuild, ghc-6.2.1-r1.ebuild, ghc-6.2.1.ebuild,
ghc-6.2.ebuild:
virtual/glibc -> virtual/libc
*ghc-6.2.1-r1 (15 Jun 2004)
15 Jun 2004; Andres Loeh
files/ghc-6.2.1-linker.patch.bz2:
Patch for ghci's linker to help loading HOpenGL. Thanks to Sven Panne.
03 Jun 2004; Aron Griffis
ghc-6.0.ebuild, ghc-6.2-r1.ebuild, ghc-6.2.1.ebuild, ghc-6.2.ebuild:
Fix use invocation
18 May 2004; Mamoru KOMACHI
ghc-6.0.ebuild, ghc-6.2-r1.ebuild, ghc-6.2.1.ebuild, ghc-6.2.ebuild:
Changed app-text/tetex to virtual/tetex.
13 May 2004; Andres Loeh
fixed patch for ghc-6.2.1; threaded rts now enabled by default (#50758)
12 May 2004; Alexander Gabert
added new hardened PIE SSP switches
12 May 2004; Alexander Gabert
-files/ghc-6.2.hardened-gcc.patch.bz2, +files/ghc-6.2.hardened.patch.bz2,
ghc-6.0.1.ebuild, ghc-6.2-r1.ebuild, ghc-6.2.ebuild:
added new hardened switches for nonPIE and nonSSP building
02 Apr 2004; Matthieu Sozeau
Add support for ppc on ghc-6.2.1.
31 Mar 2004; Andres Loeh
ghc-6.2-r1.ebuild:
Marked ghc-6.2-r1 stable on x86. Removed 5 series due to bug #46212.
23 Mar 2004; Matthieu Sozeau
Added ~ppc keyword, highly experimental build (linux-ppc is not entirely
supported yet).
*ghc-6.2.1 (22 Mar 2004)
22 Mar 2004; Andres Loeh
Version bump.
*ghc-6.2-r1 (11 Mar 2004)
11 Mar 2004; Andres Loeh
files/ghc-6.2.hardened-gcc.patch.bz2:
Disabling propolice in the resulting ghc when using gcc-hardened (cf. bug
#36154).
20 Feb 2004; Andres Loeh
Fixed a problem building libraries using recent binutils (#40128).
11 Jan 2004; Andres Loeh
moved setup checks to pkg_setup (bug #33962).
22 Dec 2003; Andres Loeh
Haddock got called even with USE=-doc.
19 Dec 2003; Andres Loeh
GHC 6.2 needs haddock-0.6 (bug #36108)
*ghc-6.2 (17 Dec 2003)
17 Dec 2003; Andres Loeh
files/ghc-6.2.documentation.patch:
New GHC version 6.2.
17 Dec 2003: Andres Loeh
files/ghc-6.0.1.haddock.patch:
Added patch needed to compile documentation with haddock-0.6.
11 Nov 2003; Alexander Gabert
ghc-6.0.1.ebuild:
added ghc-6.0.1 bugfix from ghc-5.04.3-r1 bug30789
22 Oct 2003; Andres Loeh
ghc-6.0.1.ebuild, ghc-6.0.ebuild:
Added libgmp to runtime dependencies, closing bug #31321.
12 Oct 2003; Alexander Gabert
added hardened-gcc -yet_exec flag mechanism and CFLAGS for ghc if hardened-gcc
is used
*ghc-6.0.1 (31 Jul 2003)
31 Jul 2003; Andres Loeh
Version bump.
30 Jul 2003; Andres Loeh
Fixed bug that caused ghc to be built with HOpenGL despite -opengl being set.
29 Jul 2003; Andres Loeh
Marked 5.04.3-r1 stable. It fixes a couple of problems that keep appearing
with 5.04.3.
02 Jul 2003; Andres Loeh
Removed implicit X11 dependency (bug 23708). Thanks to Aaron Son
*ghc-6.0 (01 Jun 2003)
01 Jun 2003; Andres Loeh
Version bump. Will probably remain in testing until new version is released,
as this version is considered to be beta by the developers. The ebuild has
been somewhat simplified: GHC's build system now supports bootstrapping to get
GHCi running automatically if necessary.
21 May 2003; Andres Loeh
files/ghc-5.04.3-r1.patch:
Added a dependency to haddock when generating docs. This should fix bug
#20989. Thanks to Mikael A
*ghc-5.04.3-r1 (09 May 2003)
09 May 2003; Andres Loeh
Fixed bug that caused ghci to fail with glibc-2.3.2 (reported by Ralf Hinze
again (had been missing for a while). To get full documentation, set the "doc"
USE flag.
*ghc-5.04.2 (21 Mar 2003)
21 Mar 2003; George Shapovalov
new version
Now with all virtuals in place should build off existing ghc nicely..
21 Mar 2003; George Shapovalov
created new virtual: virtual/ghc.
Made ghc depend on virtual/ghc (and provide one) instead of on dev-lang/ghc-bin
ghc-bin in turn now also provides virtual/ghc, this closes #10155
13 Mar 2003; George Shapovalov
fix for when ghc gets bootstrapped off different version.
Thanks to Andres Loeh
08 Mar 2003; George Shapovalov
updated the ebuild to correctly build (namely to build ghci) if bootstrapped off different (older)
version. See #10155 for details.
*ghc-5.04i.2 (12 Feb 2003)
12 Feb 2003; George Shapovalov
The long awaited update. (#10155)
Fixes things on x86. !!!Needs testing on sparc!!! (has good chances to work on sparc,
provided ghc-bin-5.04.2 works)
ebuild bootstraps ghc from ghc-bin and contains remarks
on how to "maintain" it correctly (in short: for general purpose no special attention required)
17 Jan 2003; Matthew Turk
Looks like it didn't take... Trying again!
09 Jan 2003; Matthew Turk
Changed the docbook-sgml-dtd dependency to one that *exists*.
06 Dec 2002; Rodney Rees
*ghc-5.04.ebuild (08 Aug 2002)
19 Aug 2002; George Shapovalov
fixed header, added >=dev-libs/gmp-4.1 dependency
08 Jul 2002; George Shapovalov
new version,
bzipped patched (too large otherwise),
will keep uncompressed for 5.02.3 anc compressed for 5.04 until new version
is tested (to have one working meanwhile)
ebuild (and large patching work) submitted by:
Sven Moritz Hallberg
*ghc-5.02.3.ebuild (09 Jun 2002)
18 Jun 2002; George Shapovalov
Few improvements by Sven Moritz Hallberg :
Build DocBook documentation only if USEing 'doc'. Require DocBook DTD 3.1 in
that case.
Thanks to a bug report by Matthew Walton I've noticed that GHC requires the
DocBook DTD 3.1, not 4.1.
09 Jun 2002; George Shapovalov
First submission
From the home page:
The Glasgow Haskell Compiler is a robust, fully-featured, optimising compiler
and interactive environment for Haskell 98, GHC compiles Haskell to either
native code or C. It implements numerous experimental language extensions
to Haskell 98; for example: concurrency, a foreign language interface,
multi-parameter type classes, scoped type variables, existential and universal
quantification, unboxed types, exceptions, weak pointers, and so on. GHC comes
with a generational garbage collector, and a space and time profiler.
AUX 10ghc 40 RMD160 1c9e367fa4ea2fa2d3a046986b066b157964390a SHA1 33486a4907e8140f4d919813df4ef4e6203d6b20 SHA256 86c80e876343456b1a1407365bfc2a441bf4c6ca23d3549d67bd800abd617e2f
AUX depsort.py 1958 RMD160 4192ad9ed14064a9da42ce1faedcf28996094da3 SHA1 2c900abeb6cfcc4327f0e9418b5abd7761ce5879 SHA256 7406f639d17b8acab6a1db7e398e74379b44950d4821bc36901abd3455d63b3d
AUX ghc-6.4.2-sparc32plus.patch 526 RMD160 970d062362284659c2570394c8f9328d8096ea8e SHA1 40d25c25a3cd6a228f3757b8e298fd8c72710544 SHA256 a05bd16c9308ec9f608aeabe0ea35e2dff6826f262108d1ccb16c4f93a2d3a44
AUX ghc-6.4.2-sparcmangler.patch 837 RMD160 7e3a2a94bb62c3c0da09f08096481cace2b1bb96 SHA1 5faccb311239c4c4d07a2c6dc507d51a18c2bc96 SHA256 3987724420c6d4b552c6fbb3b3ca10fca8aaa73573735aa3de824d3dc65f94af
AUX ghc-6.5-norelax.patch 613 RMD160 71012d8615e164c72d0db75c8cc606ccf8e3ddd9 SHA1 4bab0e904d9950ba92e16b3932635e5a1c3edee1 SHA256 0da9630bbd28edee7538d857dbeefd6d4cdddafd198499e61513f2f4d44c2fc0
AUX ghc-6.6-nothreadedrts.patch 665 RMD160 402c8eb78dc648e55d1d7e00c695b49abe0f293d SHA1 8d0bc56096ebe781371dffa668de48a97173cd32 SHA256 bdfb000a70d97bb7341dda5a2ec48bb7f688532ade830eb2d73c7fa6ef1eead1
AUX ghc-bash-completion 6496 RMD160 61574aab2f8ed4ae906df5ac291f528384b79b87 SHA1 a0d7c264cc8ff3d235511e151dc82f9e16691bac SHA256 82a862bea2c9248e06fcf74d307de07b05a55f9eb95f412762bd02e53fece822
AUX ghc-updater 9262 RMD160 10332a0dd2fd2f09e28b250fb74655e67305e2d7 SHA1 c297589995aa6c310bcf61db6fec1df57d5f0eb8 SHA256 e6277b2731c6be5159d28a450ccf9dfe701601f86552096ef8d8c5daedc5929a
DIST ghc-6.2.2-libraries.tar.gz 524182 RMD160 f4ce0df2040f91a5a56cc618e68f1aa2e4bf0185 SHA1 64af9e782f7eeae9f7f47445811f50cf3210f093 SHA256 ebcf8c1fd31c9a33ff64ca888f01e9911464469f59e5432c626b8c686c2d9142
DIST ghc-6.2.2-src.tar.bz2 5406427 RMD160 7afa370c148f2b9c3d53d662da996f5d7c05282d SHA1 9ca5bfed02210d3731a76fab5e25a8c690067fde SHA256 a0fe7eb8d447f25fbc616cdbce2bb4e03961a884c2c37969d1e23588b588a852
DIST ghc-6.2.2-users_guide.tar.gz 197576 RMD160 d17c2c89d03d911dfa0b449b47814d2e19dc6030 SHA1 7f7e79cb1a57812ac44f3e9881757cc278a8c14b SHA256 846df4bedf44f00a438a276c849289ce1b2d79f3fa53fb16d576517b2da1e509
DIST ghc-6.4.2-alut.patch.gz 6670 RMD160 e6ab2a114f44f6f176a98c9cd6ab1e336662a958 SHA1 879000d18b11d1edc1a32cf720ed24bbc20e8981 SHA256 e116b385df3bb5a5feb92ce92a92bdb0f24115361aedb1bddc9a7e6ce682d8b9
DIST ghc-6.4.2-libraries.tar.gz 975364 RMD160 e1f19920ba7cfbc92e52fb1e3a770cd6437482c1 SHA1 2640cd220cb6ad08f12f19eda27008be26c76bb9 SHA256 b1d492f1cb8b036f56e7df187730492a6dd993b5d9ce52e4bd42dbebc9044b51
DIST ghc-6.4.2-src.tar.bz2 6954958 RMD160 19943eb2673e663973e64739cdf23720b6f36d38 SHA1 60bcea323f851caa84d49c7731b86164d5cefa42 SHA256 d517e52e0204a077c54cda11b67bf9b6ac3daa47ac7bccf1561afc7c572e6be0
DIST ghc-6.4.2-users_guide.tar.gz 233341 RMD160 0c0d7325b1535c6e248a25accd068085b8ff8880 SHA1 e255ee25b796b43282caf68697e6a6fdac78bb14 SHA256 8949148e37b6ec7fbbc82f7151ac26c3cadcfec1783e17f672fa527f7366ccdd
DIST ghc-6.6-libraries.tar.gz 1221149 RMD160 7c8a8cf26f43f4cbb31f4eee0682f85bf7143daf SHA1 5a407a2df32894a9b7a8e519edd2539f808b960e SHA256 1df171a2d7996b1014c51353ef715010d682d6ff1115dbfa1fd68176dc923236
DIST ghc-6.6-src.tar.bz2 4345587 RMD160 0d8d5cdde21e5ad86fba1023872be316316d14e7 SHA1 9876dbc46ef22684c2cc95e8dce49b2a1f47017e SHA256 79b2a29136d56c8120a526188297603304dc80d3093cda76fde939df7d4dcc7e
DIST ghc-6.6-users_guide.tar.gz 255475 RMD160 ecbdff8f0501780641408204fe60946cde392c95 SHA1 13c8e0e5922a8598a7b8c0eb05dbef9c8e1b661c SHA256 7242a6ccf3df6f141f4e493f9dd37def9d036239b819aa5a5d6f3a58489799ef
DIST ghc-6.6.1-src.tar.bz2 4339970 RMD160 6b82a74559425fe5fe1fa1b67a83433457bae0ad SHA1 cc1846b4ad607e270721371ce4043b1a017cd10e SHA256 489126ceeb2dbb6a85ef8d87d6792e61e1bc0d5882e4b33a7725410d796132c6
DIST ghc-6.8.2-src.tar.bz2 7072545 RMD160 dc555c3137d9314a6ee6a0b7ad62c0ba16d9d52c SHA1 1f40b0ee2e51be1208fdb579ce4998181ec36a40 SHA256 2d10f973c35e8d7d9f62b53e26fef90177a9a15105cda4b917340ba7696a22d9
DIST ghc-bin-6.2.2-r1-ppc.tbz2 21018465 RMD160 4dda12e11ce31d395d1085e441171580832003f7 SHA1 0b0f3c5a77612a52317914730c0ecb15bd75d719 SHA256 453babea6a9c3d3382b9987f5e40d184dd3e591a7b1d1f6bd6d41984d94f4dd4
DIST ghc-bin-6.2.2-r1-sparc.tbz2 16189582 RMD160 0ba8ff87c91abcd43988c21df8537eec0932c6a3 SHA1 404333d666256164bf056f6144f0b21094719e1b SHA256 5d225e05e73cb85500b4a1860a4dd82adbb9edc4791d087341b4458e70022cc3
DIST ghc-bin-6.2.2-r1-x86.tbz2 14561932 RMD160 b8e6a08b269257689efdc95d698a9e2b86c6d3e3 SHA1 71da573a12385b69a872fb39edeb7b06f1db38b2 SHA256 24a4ea7fe9b8ba58f84e0d68012158e70972a1caacd482d6c84905bda4502f63
DIST ghc-bin-6.4.2-alpha.tbz2 30930863 RMD160 f53968b2b9329dd4ffb15dfb64c3e7748e7fcfc2 SHA1 2915deac0a915d9c317d8781a3179041daa235c9 SHA256 8668d6b4d28a6567fb17665d41784c61576cabf6d80cf47c8b66d1f3f4178a3b
DIST ghc-bin-6.4.2-amd64.tbz2 18554509 RMD160 f4b9ee0041d2a005a1d2d98290dc89eb120c5939 SHA1 d134942591fdfb17bd1b8e010220ea1086e85aca SHA256 8466a5f017a09d5bee2bd4f28cb0fa690cd2bf0f6c9fedd892624c7f1096d214
DIST ghc-bin-6.4.2-hppa.tbz2 33914952 RMD160 c20d9a783abcfdda1a69b63e941c9f5c1fd587a0 SHA1 99a83e7c3bf5a6e7dec450ddd8a565d39803921d SHA256 6c036e313b4d67ab4940e62a3719589c5e94591ac8fe96ed595796876dd4bd88
DIST ghc-bin-6.4.2-ia64.tbz2 28944776 RMD160 85f9a3f09e9f319cea0c8a253fdb03885ff7f13e SHA1 8124cb8b39c6e11c8373dfb0289c337617bc8f11 SHA256 7ac02b0277bbbc92aea4de150404ebf5b12445db197b08573446cad901638f12
DIST ghc-bin-6.4.2-ppc.tbz2 22994932 RMD160 3ee3b26a1b98ceb085a2ca12e9e9e791c245ba86 SHA1 747ee3f204389c68e7c66d20ce2d535e2992ab20 SHA256 1239845ddaafe0bbfe8e24a13a6a7a7ba4462f313227e28d47beb644e876979c
DIST ghc-bin-6.4.2-ppc64.tbz2 28817831 RMD160 98f4e0800233d0b75c519be26b77fd2455fa167d SHA1 d216e5c03d7cce7e3a109b754cde6c85596c4d68 SHA256 788a4c4e5730afd921bfe2c84c894b4190422a5d9e6d18d135de92976446d40a
DIST ghc-bin-6.4.2-sparc.tbz2 22175545 RMD160 fa8fa8d85a167db895ea74b9ce40590ceae503ab SHA1 0dd7de97eaadf548d152300a131629371648a8aa SHA256 c95edaff53778edcfd275e41f70cadc2fd7e83c058b5d09e2a44081ae1c29d30
DIST ghc-bin-6.4.2-x86-fbsd.tbz2 19091807 RMD160 6071878b02b87066f8937b671d6414330a41a841 SHA1 9f3a66fcfe872980d073e5f6cb309dcee1a7d2cb SHA256 f2a397d233a491ab65ab43223e7657f7fc47311413e168bcd6a735e705c1acf3
DIST ghc-bin-6.4.2-x86.tbz2 19367589 RMD160 5d3ad1b92c3785db1090799ee6da6182a4771248 SHA1 71876713bbe4cbd335ac50118c9c50219e02d2a5 SHA256 9628c3d3ca3c095c5c423cffb0d0daf801e518f6d6ace17c032c6ca6d5e3e24c
DIST ghc-bin-6.6-alpha.tbz2 35338275 RMD160 82b7dca5f3c8b89e7e395da95d596197eca92888 SHA1 931a6d3db14272a72398ed4b520a162f78c84a27 SHA256 3a8e6cacccdb95313a22b8a8c27ecc0311ef83380f303a286f1d8ab216aa4f5d
DIST ghc-bin-6.6-amd64.tbz2 26093530 RMD160 b44c90a8e3f99a462af0400d0d31c315833606bb SHA1 1bde6e886df681da8ff65529ca1fd288e1b768a0 SHA256 acde821d26abbd0838e5bcd41cbde0daf5a538fea7619e3f2bc6cbe491d4b387
DIST ghc-bin-6.6-ppc.tbz2 34668445 RMD160 33f811104146dc8ef4d2839f71d39eb821128515 SHA1 b7ab12fe30ada669b7241bd604280674d94a8284 SHA256 f0bc5583396666da4f03f519cec9fc239e96ae06d5fdb5bd951de8dae1cb1d79
DIST ghc-bin-6.6-sparc.tbz2 30576579 RMD160 0392fc6529f48f34a009dc9d4cd51da68db072eb SHA1 4d748c4b5b504245f1d9c793f57dc0008466371c SHA256 7588d5adc444cf82dfeaa336b4bd6ccf6dbc4621f929ad664ae6742836229503
DIST ghc-bin-6.6-x86.tbz2 24960612 RMD160 086a7784e616d0d789be8ceb3b3ba01832d3430b SHA1 4f51e60c73e1f256dc4954a2f3191415361436c5 SHA256 38f58d9fef8ccf2544c4da75c4ce6e04393cf261a2de2e253bcafbdaf4e8ea72
DIST ghc-bin-6.6.1-alpha.tbz2 36740906 RMD160 88d15d55fc6837d57b83be2dab285a3cf23b0e87 SHA1 e019fcb7cf7dbb6069a994e34696945ed6e1f49c SHA256 9637e4c1d1957ef8f0584d9e88278f1dca9db0d13b121f9ebe40a64716a652dd
DIST ghc-bin-6.6.1-amd64.tbz2 27473156 RMD160 20359587c05ebead0e357d4c217e496f28ae6d5d SHA1 48ba2f6573cba5f76f1578de70defd9210545785 SHA256 f8e1795dd84f64eec0a15ca15cdb3ec08a164790ebe35b3ba2d9743e9dae3b16
DIST ghc-bin-6.6.1-hppa.tbz2 46904941 RMD160 3107f2023f2bd26f50a3843f1fbf71a4d8db854d SHA1 ee3fbd1fe7c00774fca6949afe7cb7d6ca355fad SHA256 9d1aaf6865542a84d6c79c9a8bfb8ccfc73fb016c3ef6bae3b1b35bf6e8fb723
DIST ghc-bin-6.6.1-ia64.tbz2 31173460 RMD160 9370becd46a3446c658072a5c7a83c656b98bcff SHA1 9343e15f6fd3b1b0a4b81481426b5d02187e073e SHA256 5d0110dd4d84519e7e84e37af8b7a2b13f62ae40fd75112f96b177d9e17f6946
DIST ghc-bin-6.6.1-ppc.tbz2 36241311 RMD160 af8fbaa06d9a13337612b44b2131ee3a95a7aa0c SHA1 142c53de642514f8eaac84ab22db5b79374cd6b3 SHA256 55dd1464ce9b7385437052a7240c85299c879aec2795b12e2169482af52e686f
DIST ghc-bin-6.6.1-sparc.tbz2 31791719 RMD160 5cfd2aebfc1aae1c4fbb7bd39c6fd9715ad041cd SHA1 868a811b9cb00ab1c82e7353a0a35f5918e38944 SHA256 ecfd0dd250390d5e0a1a32e5be0bfac70f73e98d1a946641bd8be23c91e47706
DIST ghc-bin-6.6.1-x86.tbz2 26134077 RMD160 fcc31115073c2c0c4be75dce0253cb9bca5e45d3 SHA1 2c6e4bfadbae714b2f8a5da8efbc43f8124e6f8d SHA256 17a9b7125ae52c7d20f177214919837c95f96d6d997d729e493a0b94bdb84d29
DIST ghc-bin-6.8.2-alpha.tbz2 47983125 RMD160 4313112d5ab24f4120913bf8ffae46ffa37c1ee2 SHA1 7e2aa64d8e8494ba1e84be4549232253d302a205 SHA256 cd9c3b6a938b76dada2d34b33c0346b29dd645f0e7e597eda9c33d3aa7b2f756
DIST ghc-bin-6.8.2-amd64.tbz2 31838398 RMD160 6e35229a2d4506dfec6ae732199d5f1cd79c91ef SHA1 9283ba39b9443c91035d8bdbd93278af98bc279d SHA256 d4510773b96afc3b89e6820fd4d0de3ebad34bbee0c200542bd1ad917b97020e
DIST ghc-bin-6.8.2-hppa.tbz2 63658207 RMD160 9753bcef20a805ab27b3f4eae9cacc4493d0d4d6 SHA1 7f7f57b36bf895c78e35e0ff350e8fe223f32d3b SHA256 979b75550cbb45283766a7185adeb83fd338d26b5af82f08ac8f3d1963f312f3
DIST ghc-bin-6.8.2-ia64.tbz2 42446713 RMD160 6857250c2fd67771b46bd3c7f71496ea92ba6f8a SHA1 6b1f42a84cc2e1fde4543da0dee9a74cce9adafb SHA256 a021c868e89d05fac06e0a1b4263a5e6e857b0ab81f8349a0c6336409f655ea4
DIST ghc-bin-6.8.2-sparc.tbz2 47563989 RMD160 7acbb0284ab02e501d28ef520c451b8022440b63 SHA1 5c76ce09b8a440396e94ce42b8ed7e92f988a748 SHA256 b9c391858ccc63137197445541966dd01427f549ef5d45e4359a588613821c4e
DIST ghc-bin-6.8.2-x86.tbz2 30872949 RMD160 ce2f9f6fe88440ba3574d85c219e96210d35128a SHA1 17fa4fc07e12655d4599761986386c18c0ee23a1 SHA256 3c7e22dd18e622b6c9c802584cb5556b0afa7186f0df78d420d008b8c4f59fed
DIST ghc-testsuite-6.4.2.tar.gz 1181389 RMD160 1eea6a19a9fca6b3d56a6f29b69289cb88af8173 SHA1 7ada60fe2abb9208d841787781d522d5a1110dc2 SHA256 1a864243e922c233049585fa3bf4a86a0ca3e7b3ffebf26245eb037f15dd4d12
EBUILD ghc-6.2.2.ebuild 10387 RMD160 3f30eb547a048ae8a911831d6b6ac04528f7bbcf SHA1 c08282a3a2e60cfb8f742fbb8607ae1819ca3be8 SHA256 201ce669c29ee075e24f03e9abd0510aa172e000e240fadcf89c096004789935
EBUILD ghc-6.4.2.ebuild 13550 RMD160 54b1dc7fe619e62e168c42ef0135c6554c893834 SHA1 17e5ccc5479c5e387b45379960dd60d5ddbe8774 SHA256 650cc001ea76d20fe6d9deed696491a158ba1144cbb4930b501984c1bc8ab494
EBUILD ghc-6.6.1.ebuild 12238 RMD160 389782acd6d8ae37e6ffd72fb71667f3c1f04ccb SHA1 8c90cfaa9c7460e8ba9ead1650c76af24cdaa506 SHA256 1e673609fa84ecd8b89159760e7d80351d912e2acbcdb6b3dee1c58f160a5109
EBUILD ghc-6.6.ebuild 10777 RMD160 141e86d9cf0525a8aff69b9a70ab1522b078ec62 SHA1 c432175362c80acbea221137d50467c8f065985b SHA256 28e0f78ed977d31ee301c726fd0be830b161c8830e6344d55d4c51113c50acb1
EBUILD ghc-6.8.2.ebuild 9329 RMD160 c8182d203b770660a80fcb60ec812d1454e3ec2a SHA1 87e1f6c02360e3b61059f05ac19f094040f6c00c SHA256 c2e6f9989f3cd47152e7b1a41e5ee9cadbf98f75b56d7ec0a5d71b5907160474
MISC ChangeLog 25908 RMD160 258bc8d7fec04a5501a0f763a4e128b7116c9037 SHA1 491b8af5ff39fe2dcba1d51d48f1ef7dee45ea97 SHA256 ad503dcfd986df0ae39fc59da77b350964c4e92b9f77a9a9afa01874f7159e26
MISC metadata.xml 223 RMD160 7783e6057effb8b8f0b79cffe8b557b32c633839 SHA1 7b962c77f2e38479a9d1621ec8d307ca9f761753 SHA256 1d00c8be162a6cb87b3de440b3e63e10b39c12d56e8fbfe592e75aed872b2508
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.2.2.ebuild,v 1.27 2008/01/26 19:53:25 dcoutts Exp $
# Brief explanation of the bootstrap logic:
#
# Previous ghc ebuilds have been split into two: ghc and ghc-bin,
# where ghc-bin was primarily used for bootstrapping purposes.
# From now on, these two ebuilds have been combined, with the
# binary USE flag used to determine whether or not the pre-built
# binary package should be emerged or whether ghc should be compiled
# from source. If the latter, then the relevant ghc-bin for the
# arch in question will be used in the working directory to compile
# ghc from source.
# Note to users of hardened gcc-3.x:
#
# If you emerge ghc with hardened gcc it should work fine (because we
# turn off the hardened features that would otherwise break ghc).
# However, emerging ghc while using a vanilla gcc and then switching to
# hardened gcc (using gcc-config) will leave you with a broken ghc. To
# fix it you would need to either switch back to vanilla gcc or re-emerge
# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and
# you switch to gcc-4.x that this will also break ghc and you'll need to
# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between
# gcc-3.x and 4.x with no problems.
inherit base eutils flag-o-matic toolchain-funcs ghc-package
DESCRIPTION="The Glasgow Haskell Compiler"
HOMEPAGE="http://www.haskell.org/ghc/"
SRC_URI="!binary? ( http://haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )
doc? ( mirror://gentoo/${P}-libraries.tar.gz
mirror://gentoo/${P}-users_guide.tar.gz )
ppc? ( mirror://gentoo/ghc-bin-${PV}-r1-ppc.tbz2 )
sparc? ( mirror://gentoo/ghc-bin-${PV}-r1-sparc.tbz2 )
x86? ( mirror://gentoo/ghc-bin-${PV}-r1-x86.tbz2 )"
LICENSE="BSD"
SLOT="0"
KEYWORDS="-* ppc sparc x86"
IUSE="binary doc ghcbootstrap opengl"
LOC="/opt/ghc" # location for installation of binary version
RDEPEND="
!dev-lang/ghc-bin
>=sys-devel/gcc-2.95.3
>=sys-devel/binutils-2.17
>=dev-lang/perl-5.6.1
>=dev-libs/gmp-4.1
=sys-libs/readline-5*
opengl? ( virtual/opengl
virtual/glu virtual/glut )"
DEPEND="${RDEPEND}"
# In the ghcbootstrap case we rely on the developer having
# >=ghc-5.04.3 on their $PATH already
append-ghc-cflags() {
local flag compile assemble link
for flag in $*; do
case ${flag} in
compile) compile="yes";;
assemble) assemble="yes";;
link) link="yes";;
*)
[[ ${compile} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optc${flag}"
[[ ${assemble} ]] && GHC_CFLAGS="${GHC_CFLAGS} -opta${flag}"
[[ ${link} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optl${flag}";;
esac
done
}
ghc_setup_cflags() {
# 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
filter-flags -fPIC
GHC_CFLAGS=""
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};;
# Debugging flags don't help either. You can't debug Haskell code
# at the C source level and the mangler discards the debug info.
-g*) ;;
# Ignore all other flags, including all -f* flags
esac
done
# hardened-gcc needs to be disabled, because the mangler doesn't accept
# its output.
gcc-specs-pie && append-ghc-cflags compile link -nopie
gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
}
pkg_setup() {
if test $(gcc-major-version) -gt 3; then
eerror "ghc-6.2.2 does not work with gcc-4.x, only 3.x or older"
eerror "You can either use gcc-config to switch to gcc-3.x"
eerror "or you emerge '>=dev-lang/ghc-6.4' or later."
die "ghc-6.2.2 does not work with gcc-4.x, only 3.x or older"
fi
if use ghcbootstrap; then
ewarn "You requested ghc bootstrapping, this is usually only used"
ewarn "by Gentoo developers to make binary .tbz2 packages for"
ewarn "use with the ghc ebuild's USE=\"binary\" feature."
use binary && \
die "USE=\"ghcbootstrap binary\" is not a valid combination."
use doc && \
die "USE=\"ghcbootstrap doc\" is not a valid combination"
[[ -z $(type -P ghc) ]] && \
die "Could not find a ghc to bootstrap with."
fi
if use binary; then
if use opengl || use doc; then
ewarn "The binary build does not include the docs or OpenGL bindings"
ewarn "If you want those features, emerge with USE=\"-binary\""
fi
fi
set_config
}
set_config() {
# make this a separate function and call it several times as portage doesn't
# remember the variables properly between the fuctions.
use binary && GHC_PREFIX="/opt/ghc" || GHC_PREFIX="/usr"
}
src_unpack() {
# Create the ${S} dir if we're using the binary version
use binary && mkdir "${S}"
base_src_unpack
ghc_setup_cflags
if use binary; then
# Move unpacked files to the expected place
mv "${WORKDIR}/usr" "${S}"
# Relocate from /usr to /opt/ghc
sed -i -e "s|/usr|${LOC}|g" \
"${S}/usr/bin/ghc-${PV}" \
"${S}/usr/bin/ghci-${PV}" \
"${S}/usr/bin/ghc-pkg-${PV}" \
"${S}/usr/bin/hsc2hs" \
"${S}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to /opt/ghc failed"
sed -i -e "s|/usr/$(get_libdir)|${LOC}/$(get_libdir)|" \
"${S}/usr/bin/ghcprof"
else
# Modify the ghc driver script to use GHC_CFLAGS
echo "SCRIPT_SUBST_VARS += GHC_CFLAGS" >> "${S}/ghc/driver/ghc/Makefile"
echo "GHC_CFLAGS = ${GHC_CFLAGS}" >> "${S}/ghc/driver/ghc/Makefile"
sed -i -e 's|$TOPDIROPT|$TOPDIROPT $GHC_CFLAGS|' "${S}/ghc/driver/ghc/ghc.sh"
if ! use ghcbootstrap; then
# Relocate from /usr to ${WORKDIR}/usr
sed -i -e "s|/usr|${WORKDIR}/usr|g" \
"${WORKDIR}/usr/bin/ghc-${PV}" \
"${WORKDIR}/usr/bin/ghci-${PV}" \
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
"${WORKDIR}/usr/bin/hsc2hs" \
"${WORKDIR}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to workdir failed"
fi
# Patch to fix a mis-compilation in the rts due to strict aliasing,
# should be fixed upstream for 6.4.3 and 6.6. Fixes bug #135651.
echo 'GC_HC_OPTS += -optc-fno-strict-aliasing' >> "${S}/ghc/rts/Makefile"
# Don't strip binaries on install. See QA warnings in bug #140369.
sed -i -e 's/SRC_INSTALL_BIN_OPTS += -s//' "${S}/mk/config.mk.in"
fi
}
src_compile() {
if ! use binary; then
# initialize build.mk
echo '# Gentoo changes' > mk/build.mk
# We also need to use the GHC_CFLAGS flags when building ghc itself
echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk
echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk
# We can't depend on haddock so we never build docs
# and we rely on pre-built ones instead
echo SGMLDocWays="" >> mk/build.mk
# needed to prevent haddock from being called
echo NO_HADDOCK_DOCS=YES >> mk/build.mk
# circumvent a very strange bug that seems related with ghc producing too much
# output while being filtered through tee (e.g. due to portage logging)
# reported as bug #111183
echo "SRC_HC_OPTS+=-fno-warn-deprecations" >> mk/build.mk
# Required for some architectures, because they don't support ghc fully ...
use ppc || use sparc && echo "SplitObjs=NO" >> mk/build.mk
use sparc && echo "GhcWithInterpreter=NO" >> mk/build.mk
# Get ghc from the unpacked binary .tbz2
# except when bootstrapping we just pick ghc up off the path
use ghcbootstrap || \
export PATH="${WORKDIR}/usr/bin:${PATH}"
# Note that --disable-hopengl actually enables it. We have to ommit
# the flag to disable opengl.
econf \
$(use opengl && echo "--enable-hopengl") \
|| die "econf failed"
# ghc-6.2.x build system does not support parallel make
emake -j1 datadir="/usr/share/doc/${P}" || die "make failed"
# the explicit datadir is required to make the haddock entries
# in the package.conf file point to the right place ...
fi # ! use binary
}
src_install() {
if use binary; then
mkdir "${D}/opt"
mv "${S}/usr" "${D}/opt/ghc"
cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \
|| die "failed to copy package.conf"
doenvd "${FILESDIR}/10ghc"
else
# the libdir0 setting is needed for amd64, and does not
# harm for other arches
#TODO: are any of these overrides still required? isn't econf enough?
emake -j1 install \
prefix="${D}/usr" \
datadir="${D}/usr/share/doc/${PF}" \
infodir="${D}/usr/share/info" \
mandir="${D}/usr/share/man" \
libdir0="${D}/usr/$(get_libdir)" \
|| die "make install failed"
cd "${S}/ghc"
dodoc README ANNOUNCE VERSION
dosbin "${FILESDIR}/ghc-updater"
cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \
|| die "failed to copy package.conf"
fi
if use doc; then
docinto "html/libraries"
dohtml -A haddock -r "${WORKDIR}/libraries/"* \
|| die "installing library docs failed"
docinto "html/users_guide"
dohtml -r "${WORKDIR}/users_guide/"* \
|| die "installing user guide failed"
docinto ""
fi
}
pkg_postinst () {
ghc-reregister
if use binary; then
elog "The envirenment has been set to use the binary distribution of"
elog "GHC. In order to activate it please run:"
elog " env-update && source /etc/profile"
elog "Otherwise this setting will become active the next time you login"
fi
ewarn "IMPORTANT:"
ewarn "If you have upgraded from another version of ghc or"
ewarn "if you have switched between binary and source versions"
ewarn "of ghc, please run:"
if use binary; then
ewarn " /opt/ghc/sbin/ghc-updater"
else
ewarn " /usr/sbin/ghc-updater"
fi
ewarn "to re-merge all ghc-based Haskell libraries."
}
pkg_prerm() {
# Overwrite the (potentially) modified package.conf with a copy of the
# original one, so that it will be removed during uninstall.
set_config # load GHC_PREFIX
PKG="${ROOT}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"
cp -p "${PKG}"{.shipped,}
[[ -f ${PKG}.old ]] && rm "${PKG}.old"
}
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.4.2.ebuild,v 1.27 2008/01/26 19:53:25 dcoutts Exp $
# Brief explanation of the bootstrap logic:
#
# Previous ghc ebuilds have been split into two: ghc and ghc-bin,
# where ghc-bin was primarily used for bootstrapping purposes.
# From now on, these two ebuilds have been combined, with the
# binary USE flag used to determine whether or not the pre-built
# binary package should be emerged or whether ghc should be compiled
# from source. If the latter, then the relevant ghc-bin for the
# arch in question will be used in the working directory to compile
# ghc from source.
# Note to users of hardened gcc-3.x:
#
# If you emerge ghc with hardened gcc it should work fine (because we
# turn off the hardened features that would otherwise break ghc).
# However, emerging ghc while using a vanilla gcc and then switching to
# hardened gcc (using gcc-config) will leave you with a broken ghc. To
# fix it you would need to either switch back to vanilla gcc or re-emerge
# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and
# you switch to gcc-4.x that this will also break ghc and you'll need to
# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between
# gcc-3.x and 4.x with no problems.
inherit base eutils flag-o-matic toolchain-funcs autotools ghc-package
DESCRIPTION="The Glasgow Haskell Compiler"
HOMEPAGE="http://www.haskell.org/ghc/"
# discover if this is a snapshot release
IS_SNAPSHOT="${PV%%*pre*}" # zero if snapshot
MY_PV="${PV/_pre/.}"
MY_P="${PN}-${MY_PV}"
EXTRA_SRC_URI="${MY_PV}"
[[ -z "${IS_SNAPSHOT}" ]] && EXTRA_SRC_URI="stable/dist"
SRC_URI="!binary? ( http://haskell.org/ghc/dist/${EXTRA_SRC_URI}/${MY_P}-src.tar.bz2 )
doc? ( mirror://gentoo/${P}-libraries.tar.gz
mirror://gentoo/${P}-users_guide.tar.gz )
alpha? ( mirror://gentoo/ghc-bin-${PV}-alpha.tbz2 )
amd64? ( mirror://gentoo/ghc-bin-${PV}-amd64.tbz2 )
hppa? ( mirror://gentoo/ghc-bin-${PV}-hppa.tbz2 )
ia64? ( mirror://gentoo/ghc-bin-${PV}-ia64.tbz2 )
ppc? ( mirror://gentoo/ghc-bin-${PV}-ppc.tbz2 )
ppc64? ( mirror://gentoo/ghc-bin-${PV}-ppc64.tbz2 )
sparc? ( mirror://gentoo/ghc-bin-${PV}-sparc.tbz2 )
x86? ( mirror://gentoo/ghc-bin-${PV}-x86.tbz2 )
x86-fbsd? ( mirror://gentoo/ghc-bin-${PV}-x86-fbsd.tbz2 )
test? ( http://haskell.org/ghc/dist/ghc-testsuite-${MY_PV}.tar.gz )
mirror://gentoo/${P}-alut.patch.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 hppa ~ia64 ppc ppc64 sparc x86 ~x86-fbsd"
IUSE="binary doc ghcbootstrap test X opengl openal"
LOC="/opt/ghc" # location for installation of binary version
S="${WORKDIR}/${MY_P}"
RDEPEND="
!dev-lang/ghc-bin
>=sys-devel/gcc-2.95.3
>=sys-devel/binutils-2.17
>=dev-lang/perl-5.6.1
>=dev-libs/gmp-4.1
=sys-libs/readline-5*
X? ( x11-libs/libX11 )
opengl? ( virtual/opengl
virtual/glu virtual/glut
openal? ( media-libs/openal media-libs/freealut ) )"
DEPEND="${RDEPEND}"
# In the ghcbootstrap case we rely on the developer having
# >=ghc-5.04.3 on their $PATH already
PDEPEND=">=dev-haskell/cabal-1.1.4"
append-ghc-cflags() {
local flag compile assemble link
for flag in $*; do
case ${flag} in
compile) compile="yes";;
assemble) assemble="yes";;
link) link="yes";;
*)
[[ ${compile} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optc${flag}"
[[ ${assemble} ]] && GHC_CFLAGS="${GHC_CFLAGS} -opta${flag}"
[[ ${link} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optl${flag}";;
esac
done
}
ghc_setup_cflags() {
# 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
filter-flags -fPIC
GHC_CFLAGS=""
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};;
# Debugging flags don't help either. You can't debug Haskell code
# at the C source level and the mangler discards the debug info.
-g*) ;;
# Ignore all other flags, including all -f* flags
esac
done
# hardened-gcc needs to be disabled, because the mangler doesn't accept
# its output.
gcc-specs-pie && append-ghc-cflags compile link -nopie
gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
# We also add -Wa,--noexecstack to get ghc to generate .o files with
# non-exectable stack. This it a hack until ghc does it itself properly.
append-ghc-cflags assemble "-Wa,--noexecstack"
}
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 for"
ewarn "use with the ghc ebuild's USE=\"binary\" feature."
use binary && \
die "USE=\"ghcbootstrap binary\" is not a valid combination."
use doc && \
die "USE=\"ghcbootstrap doc\" is not a valid combination"
[[ -z $(type -P ghc) ]] && \
die "Could not find a ghc to bootstrap with."
fi
if use openal && ! use opengl; then
ewarn "The OpenAL bindings require the OpenGL bindings, however"
ewarn "USE=\"-opengl\" so the OpenAL bindings will not be built."
ewarn "To build the OpenAL bindings emerge with USE=\"openal opengl\""
fi
if use binary; then
if use opengl || use openal || use X || use test; then
ewarn "The binary build does not include the X, OpenGL"
ewarn "or OpenAL bindings and does not support the testsuite."
ewarn "If you want those features, emerge with USE=\"-binary\""
fi
fi
set_config
}
set_config() {
# make this a separate function and call it several times as portage doesn't
# remember the variables properly between the fuctions.
use binary && GHC_PREFIX="/opt/ghc" || GHC_PREFIX="/usr"
}
src_unpack() {
# Create the ${S} dir if we're using the binary version
use binary && mkdir "${S}"
base_src_unpack
ghc_setup_cflags
if use binary; then
# Move unpacked files to the expected place
mv "${WORKDIR}/usr" "${S}"
# Relocate from /usr to /opt/ghc
sed -i -e "s|/usr|${LOC}|g" \
"${S}/usr/bin/ghc-${PV}" \
"${S}/usr/bin/ghci-${PV}" \
"${S}/usr/bin/ghc-pkg-${PV}" \
"${S}/usr/bin/hsc2hs" \
"${S}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to /opt/ghc failed"
# fix docs
if use doc; then
# correct the documentation and .haddock files path
sed -i -e \
"s|/opt/ghc/share/doc/${P}/html/libraries|/usr/share/doc/${P}/html/libraries|g" \
"${S}/usr/$(get_libdir)/${P}/package.conf"
else
# remove all doc stuff from package.conf
sed -i \
-e 's|haddockInterfaces = \[[^]]*\]|haddockInterfaces = \[\]|g' \
-e "s|haddockHTMLs = \[[^]]*\]|haddockHTMLs = \[\]|g" \
"${S}/usr/$(get_libdir)/${P}/package.conf"
fi
sed -i -e "s|/usr/$(get_libdir)|${LOC}/$(get_libdir)|" \
"${S}/usr/bin/ghcprof"
else
cd "${S}"
epatch "${WORKDIR}/${P}-alut.patch"
epatch "${FILESDIR}/${P}-sparc32plus.patch"
epatch "${FILESDIR}/${P}-sparcmangler.patch"
# Modify the ghc driver script to use GHC_CFLAGS
echo "SCRIPT_SUBST_VARS += GHC_CFLAGS" >> "${S}/ghc/driver/ghc/Makefile"
echo "GHC_CFLAGS = ${GHC_CFLAGS}" >> "${S}/ghc/driver/ghc/Makefile"
sed -i -e 's|$TOPDIROPT|$TOPDIROPT $GHC_CFLAGS|' "${S}/ghc/driver/ghc/ghc.sh"
if ! use ghcbootstrap; then
# Relocate from /usr to ${WORKDIR}/usr
sed -i -e "s|/usr|${WORKDIR}/usr|g" \
"${WORKDIR}/usr/bin/ghc-${PV}" \
"${WORKDIR}/usr/bin/ghci-${PV}" \
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
"${WORKDIR}/usr/bin/hsc2hs" \
"${WORKDIR}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to workdir failed"
fi
# If we're using the testsuite then move it to into the build tree
use test && mv "${WORKDIR}/testsuite" "${S}/"
# Patch to fix a mis-compilation in the rts due to strict aliasing,
# should be fixed upstream for 6.4.3 and 6.6. Fixes bug #135651.
echo 'GC_HC_OPTS += -optc-fno-strict-aliasing' >> "${S}/ghc/rts/Makefile"
# Don't strip binaries on install. See QA warnings in bug #140369.
sed -i -e 's/SRC_INSTALL_BIN_OPTS += -s//' "${S}/mk/config.mk.in"
fi
}
src_compile() {
if ! use binary; then
# initialize build.mk
echo '# Gentoo changes' > mk/build.mk
# We also need to use the GHC_CFLAGS flags when building ghc itself
echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk
echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk
# If you need to do a quick build then enable this bit and add debug to IUSE
#if use debug; then
# echo "SRC_HC_OPTS = -H32m -O -fasm" >> mk/build.mk
# echo "GhcLibHcOpts =" >> mk/build.mk
# echo "GhcLibWays =" >> mk/build.mk
# echo "SplitObjs = NO" >> mk/build.mk
#fi
# We can't depend on haddock so we never build docs
# and we rely on pre-built ones instead
echo SGMLDocWays="" >> mk/build.mk
# needed to prevent haddock from being called
echo NO_HADDOCK_DOCS=YES >> mk/build.mk
# circumvent a very strange bug that seems related with ghc producing too much
# output while being filtered through tee (e.g. due to portage logging)
# reported as bug #111183
echo "SRC_HC_OPTS+=-fno-warn-deprecations" >> mk/build.mk
# And some arches used to work ok, but bork with recent gcc versions
# See bug #145466 for ppc64.
if use ia64 || use ppc64; then
echo "GhcUnregisterised=YES" >> mk/build.mk
echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
echo "GhcWithInterpreter=NO" >> mk/build.mk
echo "SplitObjs=NO" >> mk/build.mk
echo "GhcRTSWays := debug" >> mk/build.mk
fi
# We've patched some configure.ac files to fix the OpenAL/ALUT bindings.
# So we need to autoreconf.
eautoreconf
# Get ghc from the unpacked binary .tbz2
# except when bootstrapping we just pick ghc up off the path
use ghcbootstrap || \
export PATH="${WORKDIR}/usr/bin:${PATH}"
econf \
$(use_enable opengl opengl) \
$(use_enable opengl glut) \
$(use openal && use opengl \
&& echo --enable-openal --enable-alut \
|| echo --disable-openal --disable-alut) \
$(use_enable X x11) \
$(use_enable X hgl) \
|| die "econf failed"
emake all datadir="/usr/share/doc/${P}" || die "make failed"
# the explicit datadir is required to make the haddock entries
# in the package.conf file point to the right place ...
fi # ! use binary
}
src_install() {
if use binary; then
mkdir "${D}/opt"
mv "${S}/usr" "${D}/opt/ghc"
cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \
|| die "failed to copy package.conf"
doenvd "${FILESDIR}/10ghc"
else
# the libdir0 setting is needed for amd64, and does not
# harm for other arches
#TODO: are any of these overrides still required? isn't econf enough?
emake -j1 install \
prefix="${D}/usr" \
datadir="${D}/usr/share/doc/${PF}" \
infodir="${D}/usr/share/info" \
mandir="${D}/usr/share/man" \
libdir0="${D}/usr/$(get_libdir)" \
|| die "make install failed"
cd "${S}/ghc"
dodoc README ANNOUNCE VERSION
dosbin "${FILESDIR}/ghc-updater"
cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \
|| die "failed to copy package.conf"
fi
if use doc; then
docinto "html/libraries"
dohtml -A haddock -r "${WORKDIR}/libraries/"* \
|| die "installing library docs failed"
docinto "html/users_guide"
dohtml -r "${WORKDIR}/users_guide/"* \
|| die "installing user guide failed"
docinto ""
fi
}
pkg_postinst () {
ebegin "Unregistering ghc's built-in cabal "
$(ghc-getghcpkg) unregister Cabal > /dev/null
eend $?
ghc-reregister
if use binary; then
elog "The envirenment has been set to use the binary distribution of"
elog "GHC. In order to activate it please run:"
elog " env-update && source /etc/profile"
elog "Otherwise this setting will become active the next time you login"
fi
ewarn "IMPORTANT:"
ewarn "If you have upgraded from another version of ghc or"
ewarn "if you have switched between binary and source versions"
ewarn "of ghc, please run:"
if use binary; then
ewarn " /opt/ghc/sbin/ghc-updater"
else
ewarn " /usr/sbin/ghc-updater"
fi
ewarn "to re-merge all ghc-based Haskell libraries."
}
pkg_prerm() {
# Overwrite the (potentially) modified package.conf with a copy of the
# original one, so that it will be removed during uninstall.
set_config # load GHC_PREFIX
PKG="${ROOT}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"
cp -p "${PKG}"{.shipped,}
[[ -f ${PKG}.old ]] && rm "${PKG}.old"
}
src_test() {
if use test; then
local summary
summary="${T}/testsuite-summary.txt"
make -C "${S}/testsuite/" boot || die "Preparing the testsuite failed"
make -C "${S}/testsuite/tests/ghc-regress" \
TEST_HC="${S}/ghc/compiler/stage2/ghc-inplace" \
EXTRA_RUNTEST_OPTS="--output-summary=${summary}"
if grep -q ' 0 unexpected failures' "${summary}"; then
einfo "All tests passed ok"
else
ewarn "Some tests failed, for a summary see: ${summary}"
fi
else
ewarn "Sadly, due to some portage limitations you need both"
ewarn "USE=test and FEATURES=test to run the ghc testsuite"
fi
}
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.6.1.ebuild,v 1.17 2008/03/01 11:43:34 armin76 Exp $
# Brief explanation of the bootstrap logic:
#
# Previous ghc ebuilds have been split into two: ghc and ghc-bin,
# where ghc-bin was primarily used for bootstrapping purposes.
# From now on, these two ebuilds have been combined, with the
# binary USE flag used to determine whether or not the pre-built
# binary package should be emerged or whether ghc should be compiled
# from source. If the latter, then the relevant ghc-bin for the
# arch in question will be used in the working directory to compile
# ghc from source.
# Note to users of hardened gcc-3.x:
#
# If you emerge ghc with hardened gcc it should work fine (because we
# turn off the hardened features that would otherwise break ghc).
# However, emerging ghc while using a vanilla gcc and then switching to
# hardened gcc (using gcc-config) will leave you with a broken ghc. To
# fix it you would need to either switch back to vanilla gcc or re-emerge
# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and
# you switch to gcc-4.x that this will also break ghc and you'll need to
# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between
# gcc-3.x and 4.x with no problems.
inherit base bash-completion eutils flag-o-matic toolchain-funcs ghc-package versionator
DESCRIPTION="The Glasgow Haskell Compiler"
HOMEPAGE="http://www.haskell.org/ghc/"
# discover if this is a snapshot release
IS_SNAPSHOT="${PV%%*pre*}" # zero if snapshot
MY_PV="${PV/_pre/.}"
MY_P="${PN}-${MY_PV}"
EXTRA_SRC_URI="${MY_PV}"
[[ -z "${IS_SNAPSHOT}" ]] && EXTRA_SRC_URI="current/dist"
SRC_URI="!binary? ( http://haskell.org/ghc/dist/${EXTRA_SRC_URI}/${MY_P}-src.tar.bz2 )
alpha? ( mirror://gentoo/ghc-bin-${PV}-alpha.tbz2 )
amd64? ( mirror://gentoo/ghc-bin-${PV}-amd64.tbz2 )
hppa? ( mirror://gentoo/ghc-bin-${PV}-hppa.tbz2 )
ia64? ( mirror://gentoo/ghc-bin-${PV}-ia64.tbz2 )
ppc? ( mirror://gentoo/ghc-bin-${PV}-ppc.tbz2 )
sparc? ( mirror://gentoo/ghc-bin-${PV}-sparc.tbz2 )
x86? ( mirror://gentoo/ghc-bin-${PV}-x86.tbz2 )"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 hppa ~ia64 ppc sparc x86"
IUSE="binary doc ghcbootstrap"
LOC="/opt/ghc" # location for installation of binary version
S="${WORKDIR}/${MY_P}"
RDEPEND="
!dev-lang/ghc-bin
>=sys-devel/gcc-2.95.3
>=sys-devel/binutils-2.17
>=dev-lang/perl-5.6.1
>=dev-libs/gmp-4.1
=sys-libs/readline-5*"
DEPEND="${RDEPEND}
ghcbootstrap? ( doc? ( ~app-text/docbook-xml-dtd-4.2
app-text/docbook-xsl-stylesheets
>=dev-libs/libxslt-1.1.2
>=dev-haskell/haddock-0.8 ) )"
# In the ghcbootstrap case we rely on the developer having
# >=ghc-5.04.3 on their $PATH already
PDEPEND=">=dev-haskell/cabal-1.1.6.2
>=dev-haskell/filepath-1.0
>=dev-haskell/regex-base-0.72
>=dev-haskell/regex-posix-0.71
>=dev-haskell/regex-compat-0.71"
append-ghc-cflags() {
local flag compile assemble link
for flag in $*; do
case ${flag} in
compile) compile="yes";;
assemble) assemble="yes";;
link) link="yes";;
*)
[[ ${compile} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optc${flag}"
[[ ${assemble} ]] && GHC_CFLAGS="${GHC_CFLAGS} -opta${flag}"
[[ ${link} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optl${flag}";;
esac
done
}
ghc_setup_cflags() {
# 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
filter-flags -fPIC
GHC_CFLAGS=""
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};;
# Debugging flags don't help either. You can't debug Haskell code
# at the C source level and the mangler discards the debug info.
-g*) ;;
# Ignore all other flags, including all -f* flags
esac
done
# hardened-gcc needs to be disabled, because the mangler doesn't accept
# its output.
gcc-specs-pie && append-ghc-cflags compile link -nopie
gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
# We also add -Wa,--noexecstack to get ghc to generate .o files with
# non-exectable stack. This it a hack until ghc does it itself properly.
append-ghc-cflags assemble "-Wa,--noexecstack"
}
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 for"
ewarn "use with the ghc ebuild's USE=\"binary\" feature."
use binary && \
die "USE=\"ghcbootstrap binary\" is not a valid combination."
[[ -z $(type -P ghc) ]] && \
die "Could not find a ghc to bootstrap with."
elif use ppc64; then
eerror "No binary .tbz2 package available yet for these arches:"
eerror " ppc64"
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 this arch yet, USE=ghcbootstrap"
fi
set_config
}
set_config() {
# make this a separate function and call it several times as portage doesn't
# remember the variables properly between the fuctions.
use binary && GHC_PREFIX="/opt/ghc" || GHC_PREFIX="/usr"
}
src_unpack() {
# Create the ${S} dir if we're using the binary version
use binary && mkdir "${S}"
base_src_unpack
ghc_setup_cflags
if use binary; then
# Move unpacked files to the expected place
mv "${WORKDIR}/usr" "${S}"
# Relocate from /usr to /opt/ghc
sed -i -e "s|/usr|${LOC}|g" \
"${S}/usr/bin/ghc-${PV}" \
"${S}/usr/bin/ghci-${PV}" \
"${S}/usr/bin/ghc-pkg-${PV}" \
"${S}/usr/bin/hsc2hs" \
"${S}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to /opt/ghc failed"
sed -i -e "s|/usr/$(get_libdir)|${LOC}/$(get_libdir)|" \
"${S}/usr/bin/ghcprof"
else
# Modify the ghc driver script to use GHC_CFLAGS
echo "SCRIPT_SUBST_VARS += GHC_CFLAGS" >> "${S}/driver/ghc/Makefile"
echo "GHC_CFLAGS = ${GHC_CFLAGS}" >> "${S}/driver/ghc/Makefile"
sed -i -e 's|$TOPDIROPT|$TOPDIROPT $GHC_CFLAGS|' "${S}/driver/ghc/ghc.sh"
if ! use ghcbootstrap; then
# Relocate from /usr to ${WORKDIR}/usr
sed -i -e "s|/usr|${WORKDIR}/usr|g" \
"${WORKDIR}/usr/bin/ghc-${PV}" \
"${WORKDIR}/usr/bin/ghci-${PV}" \
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
"${WORKDIR}/usr/bin/hsc2hs" \
"${WORKDIR}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to workdir failed"
fi
# If we're using the testsuite then move it to into the build tree
# use test && mv "${WORKDIR}/testsuite" "${S}/"
# Don't strip binaries on install. See QA warnings in bug #140369.
sed -i -e 's/SRC_INSTALL_BIN_OPTS += -s//' "${S}/mk/config.mk.in"
# Temporary patches that needs testing before being pushed upstream:
cd "${S}"
# Fix sparc split-objs linking problem
epatch "${FILESDIR}/ghc-6.5-norelax.patch"
fi
}
src_compile() {
if ! use binary; then
# initialize build.mk
echo '# Gentoo changes' > mk/build.mk
# We also need to use the GHC_CFLAGS flags when building ghc itself
echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk
echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk
# If you need to do a quick build then enable this bit and add debug to IUSE
#if use debug; then
# echo "SRC_HC_OPTS = -H32m -O -fasm" >> mk/build.mk
# echo "GhcLibHcOpts =" >> mk/build.mk
# echo "GhcLibWays =" >> mk/build.mk
# echo "SplitObjs = NO" >> mk/build.mk
#fi
# We can't depend on haddock except when bootstrapping when we
# must build docs and include them into the binary .tbz2 package
if use ghcbootstrap && use doc; then
echo XMLDocWays="html" >> mk/build.mk
else
echo XMLDocWays="" >> mk/build.mk
# needed to prevent haddock from being called
echo NO_HADDOCK_DOCS=YES >> mk/build.mk
fi
# circumvent a very strange bug that seems related with ghc producing too much
# output while being filtered through tee (e.g. due to portage logging)
# reported as bug #111183
echo "SRC_HC_OPTS+=-fno-warn-deprecations" >> mk/build.mk
# GHC build system knows to build unregisterised on alpha and hppa,
# but we have to tell it to build unregisterised on some arches
if use alpha || use hppa || use ppc64 || use sparc; then
echo "GhcUnregisterised=YES" >> mk/build.mk
echo "GhcWithInterpreter=NO" >> mk/build.mk
fi
if use alpha || use hppa || use ppc64 || use sparc; then
echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
echo "SplitObjs=NO" >> mk/build.mk
echo "GhcRTSWays := debug" >> mk/build.mk
echo "GhcNotThreaded=YES" >> mk/build.mk
fi
# GHC <6.8 doesn't support GCC >=4.2, split objects fails.
if version_is_at_least "4.2" "$(gcc-version)"; then
echo "SplitObjs=NO" >> mk/build.mk
fi
# Get ghc from the unpacked binary .tbz2
# except when bootstrapping we just pick ghc up off the path
use ghcbootstrap || \
export PATH="${WORKDIR}/usr/bin:${PATH}"
econf || die "econf failed"
emake all datadir="/usr/share/doc/${P}" || die "make failed"
# the explicit datadir is required to make the haddock entries
# in the package.conf file point to the right place ...
fi # ! use binary
}
src_install() {
if use binary; then
mkdir "${D}/opt"
mv "${S}/usr" "${D}/opt/ghc"
# Remove the docs if not requested
if ! use doc; then
rm -rf "${D}/opt/ghc/share/doc/${P}/html" \
|| die "could not remove docs (P vs PF revision mismatch?)"
fi
# TODO: this will not be necessary after version 6.6.1 since the .tbz2
# packages will have been regenerated with package.conf.shipped files.
cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \
|| die "failed to copy package.conf"
doenvd "${FILESDIR}/10ghc"
else
local insttarget="install"
# We only built docs if we were bootstrapping, otherwise
# we copy them out of the unpacked binary .tbz2
if use doc; then
if use ghcbootstrap; then
insttarget="${insttarget} install-docs"
else
dohtml -A haddock -r "${WORKDIR}/usr/share/doc/${P}/html/"*
fi
fi
# the libdir0 setting is needed for amd64, and does not
# harm for other arches
#TODO: are any of these overrides still required? isn't econf enough?
emake -j1 ${insttarget} \
prefix="${D}/usr" \
datadir="${D}/usr/share/doc/${P}" \
infodir="${D}/usr/share/info" \
mandir="${D}/usr/share/man" \
libdir0="${D}/usr/$(get_libdir)" \
|| die "make ${insttarget} failed"
cd "${S}"
dodoc README ANNOUNCE VERSION
dosbin "${FILESDIR}/ghc-updater"
dobashcompletion "${FILESDIR}/ghc-bash-completion"
cp -p "${D}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"{,.shipped} \
|| die "failed to copy package.conf"
fi
}
pkg_postinst() {
ghc-reregister
if use binary; then
elog "The envirenment has been set to use the binary distribution of"
elog "GHC. In order to activate it please run:"
elog " env-update && source /etc/profile"
elog "Otherwise this setting will become active the next time you login"
fi
ewarn "IMPORTANT:"
ewarn "If you have upgraded from another version of ghc or"
ewarn "if you have switched between binary and source versions"
ewarn "of ghc, please run:"
if use binary; then
ewarn " /opt/ghc/sbin/ghc-updater"
else
ewarn " /usr/sbin/ghc-updater"
fi
ewarn "to re-merge all ghc-based Haskell libraries."
bash-completion_pkg_postinst
}
pkg_prerm() {
# Overwrite the (potentially) modified package.conf with a copy of the
# original one, so that it will be removed during uninstall.
set_config # load GHC_PREFIX
PKG="${ROOT}/${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"
cp -p "${PKG}"{.shipped,}
[[ -f ${PKG}.old ]] && rm "${PKG}.old"
}
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.6.ebuild,v 1.15 2008/01/26 19:53:25 dcoutts Exp $
# Brief explanation of the bootstrap logic:
#
# Previous ghc ebuilds have been split into two: ghc and ghc-bin,
# where ghc-bin was primarily used for bootstrapping purposes.
# From now on, these two ebuilds have been combined, with the
# binary USE flag used to determine whether or not the pre-built
# binary package should be emerged or whether ghc should be compiled
# from source. If the latter, then the relevant ghc-bin for the
# arch in question will be used in the working directory to compile
# ghc from source.
# Note to users of hardened gcc-3.x:
#
# If you emerge ghc with hardened gcc it should work fine (because we
# turn off the hardened features that would otherwise break ghc).
# However, emerging ghc while using a vanilla gcc and then switching to
# hardened gcc (using gcc-config) will leave you with a broken ghc. To
# fix it you would need to either switch back to vanilla gcc or re-emerge
# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and
# you switch to gcc-4.x that this will also break ghc and you'll need to
# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between
# gcc-3.x and 4.x with no problems.
inherit base eutils flag-o-matic toolchain-funcs ghc-package versionator
DESCRIPTION="The Glasgow Haskell Compiler"
HOMEPAGE="http://www.haskell.org/ghc/"
# discover if this is a snapshot release
IS_SNAPSHOT="${PV%%*pre*}" # zero if snapshot
MY_PV="${PV/_pre/.}"
MY_P="${PN}-${MY_PV}"
EXTRA_SRC_URI="${MY_PV}"
[[ -z "${IS_SNAPSHOT}" ]] && EXTRA_SRC_URI="current/dist"
SRC_URI="!binary? ( http://haskell.org/ghc/dist/${EXTRA_SRC_URI}/${MY_P}-src.tar.bz2 )
doc? ( mirror://gentoo/${P}-libraries.tar.gz
mirror://gentoo/${P}-users_guide.tar.gz )
alpha? ( mirror://gentoo/ghc-bin-${PV}-alpha.tbz2 )
amd64? ( mirror://gentoo/ghc-bin-${PV}-amd64.tbz2 )
ppc? ( mirror://gentoo/ghc-bin-${PV}-ppc.tbz2 )
sparc? ( mirror://gentoo/ghc-bin-${PV}-sparc.tbz2 )
x86? ( mirror://gentoo/ghc-bin-${PV}-x86.tbz2 )"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
#KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
IUSE="binary doc ghcbootstrap"
LOC="/opt/ghc" # location for installation of binary version
S="${WORKDIR}/${MY_P}"
RDEPEND="
!dev-lang/ghc-bin
>=sys-devel/gcc-2.95.3
>=sys-devel/binutils-2.17
>=dev-lang/perl-5.6.1
>=dev-libs/gmp-4.1
=sys-libs/readline-5*"
DEPEND="${RDEPEND}"
# In the ghcbootstrap case we rely on the developer having
# >=ghc-5.04.3 on their $PATH already
PDEPEND=">=dev-haskell/cabal-1.1.6.1"
append-ghc-cflags() {
local flag compile assemble link
for flag in $*; do
case ${flag} in
compile) compile="yes";;
assemble) assemble="yes";;
link) link="yes";;
*)
[[ ${compile} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optc${flag}"
[[ ${assemble} ]] && GHC_CFLAGS="${GHC_CFLAGS} -opta${flag}"
[[ ${link} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optl${flag}";;
esac
done
}
ghc_setup_cflags() {
# 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
filter-flags -fPIC
GHC_CFLAGS=""
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};;
# Debugging flags don't help either. You can't debug Haskell code
# at the C source level and the mangler discards the debug info.
-g*) ;;
# Ignore all other flags, including all -f* flags
esac
done
# hardened-gcc needs to be disabled, because the mangler doesn't accept
# its output.
gcc-specs-pie && append-ghc-cflags compile link -nopie
gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
# We also add -Wa,--noexecstack to get ghc to generate .o files with
# non-exectable stack. This it a hack until ghc does it itself properly.
append-ghc-cflags assemble "-Wa,--noexecstack"
}
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 for"
ewarn "use with the ghc ebuild's USE=\"binary\" feature."
use binary && \
die "USE=\"ghcbootstrap binary\" is not a valid combination."
use doc && \
die "USE=\"ghcbootstrap doc\" is not a valid combination"
[[ -z $(type -P ghc) ]] && \
die "Could not find a ghc to bootstrap with."
fi
}
src_unpack() {
# Create the ${S} dir if we're using the binary version
use binary && mkdir "${S}"
base_src_unpack
ghc_setup_cflags
if use binary; then
# Move unpacked files to the expected place
mv "${WORKDIR}/usr" "${S}"
# Relocate from /usr to /opt/ghc
sed -i -e "s|/usr|${LOC}|g" \
"${S}/usr/bin/ghc-${PV}" \
"${S}/usr/bin/ghci-${PV}" \
"${S}/usr/bin/ghc-pkg-${PV}" \
"${S}/usr/bin/hsc2hs" \
"${S}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to /opt/ghc failed"
sed -i -e "s|/usr/$(get_libdir)|${LOC}/$(get_libdir)|" \
"${S}/usr/bin/ghcprof"
else
# Modify the ghc driver script to use GHC_CFLAGS
echo "SCRIPT_SUBST_VARS += GHC_CFLAGS" >> "${S}/driver/ghc/Makefile"
echo "GHC_CFLAGS = ${GHC_CFLAGS}" >> "${S}/driver/ghc/Makefile"
sed -i -e 's|$TOPDIROPT|$TOPDIROPT $GHC_CFLAGS|' "${S}/driver/ghc/ghc.sh"
if ! use ghcbootstrap; then
# Relocate from /usr to ${WORKDIR}/usr
sed -i -e "s|/usr|${WORKDIR}/usr|g" \
"${WORKDIR}/usr/bin/ghc-${PV}" \
"${WORKDIR}/usr/bin/ghci-${PV}" \
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
"${WORKDIR}/usr/bin/hsc2hs" \
"${WORKDIR}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to workdir failed"
fi
# If we're using the testsuite then move it to into the build tree
# use test && mv "${WORKDIR}/testsuite" "${S}/"
# Don't strip binaries on install. See QA warnings in bug #140369.
sed -i -e 's/SRC_INSTALL_BIN_OPTS += -s//' "${S}/mk/config.mk.in"
# Temporary patches that needs testing before being pushed upstream:
cd "${S}"
# Fix sparc split-objs linking problem
epatch "${FILESDIR}/ghc-6.5-norelax.patch"
# Disable threaded runtime build to work around RTS bugs on sparc
epatch "${FILESDIR}/ghc-6.6-nothreadedrts.patch"
fi
}
src_compile() {
if ! use binary; then
# initialize build.mk
echo '# Gentoo changes' > mk/build.mk
# We also need to use the GHC_CFLAGS flags when building ghc itself
echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk
echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk
# If you need to do a quick build then enable this bit and add debug to IUSE
#if use debug; then
# echo "SRC_HC_OPTS = -H32m -O -fasm" >> mk/build.mk
# echo "GhcLibHcOpts =" >> mk/build.mk
# echo "GhcLibWays =" >> mk/build.mk
# echo "SplitObjs = NO" >> mk/build.mk
#fi
# We can't depend on haddock so we never build docs
# and we rely on pre-built ones instead
echo XMLDocWays="" >> mk/build.mk
# needed to prevent haddock from being called
echo NO_HADDOCK_DOCS=YES >> mk/build.mk
# circumvent a very strange bug that seems related with ghc producing too much
# output while being filtered through tee (e.g. due to portage logging)
# reported as bug #111183
echo "SRC_HC_OPTS+=-fno-warn-deprecations" >> mk/build.mk
# GHC build system knows to build unregisterised on alpha and hppa,
# but we have to tell it to build unregisterised on some other arches
if use ia64 || use ppc64 || use sparc; then
echo "GhcUnregisterised=YES" >> mk/build.mk
echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
echo "GhcWithInterpreter=NO" >> mk/build.mk
echo "SplitObjs=NO" >> mk/build.mk
echo "GhcRTSWays := debug" >> mk/build.mk
echo "GhcNotThreaded=YES" >> mk/build.mk
fi
# GHC <6.8 doesn't support GCC >=4.2, split objects fails.
if version_is_at_least "4.2" "$(gcc-version)"; then
echo "SplitObjs=NO" >> mk/build.mk
fi
# Get ghc from the unpacked binary .tbz2
# except when bootstrapping we just pick ghc up off the path
use ghcbootstrap || \
export PATH="${WORKDIR}/usr/bin:${PATH}"
econf || die "econf failed"
emake all datadir="/usr/share/doc/${P}" || die "make failed"
# the explicit datadir is required to make the haddock entries
# in the package.conf file point to the right place ...
fi # ! use binary
}
src_install() {
if use binary; then
mkdir "${D}/opt"
mv "${S}/usr" "${D}/opt/ghc"
doenvd "${FILESDIR}/10ghc"
else
# the libdir0 setting is needed for amd64, and does not
# harm for other arches
#TODO: are any of these overrides still required? isn't econf enough?
emake -j1 install \
prefix="${D}/usr" \
datadir="${D}/usr/share/doc/${PF}" \
infodir="${D}/usr/share/info" \
mandir="${D}/usr/share/man" \
libdir0="${D}/usr/$(get_libdir)" \
|| die "make install failed"
cd "${S}"
dodoc README ANNOUNCE VERSION
dosbin "${FILESDIR}/ghc-updater"
fi
if use doc; then
dohtml -r "${WORKDIR}/libraries/"* \
|| die "installing library docs failed"
dohtml -r "${WORKDIR}/users_guide/"* \
|| die "installing user guide failed"
fi
}
pkg_postinst() {
ebegin "Hiding ghc's built-in cabal "
$(ghc-getghcpkg) hide Cabal > /dev/null
eend $?
ghc-reregister
elog "If you have dev-lang/ghc-bin installed, you might"
elog "want to unmerge it. It is no longer needed."
elog
if use binary; then
elog "The envirenment has been set to use the binary distribution of"
elog "GHC. In order to activate it please run:"
elog " env-update && source /etc/profile"
elog "Otherwise this setting will become active the next time you login"
fi
ewarn "IMPORTANT:"
ewarn "If you have upgraded from another version of ghc or"
ewarn "if you have switched between binary and source versions"
ewarn "of ghc, please run:"
if use binary; then
ewarn " /opt/ghc/sbin/ghc-updater"
else
ewarn " /usr/sbin/ghc-updater"
fi
ewarn "to re-merge all ghc-based Haskell libraries."
}
pkg_prerm() {
# Delete the GHC package database
use binary && GHC_PREFIX="${ROOT}opt/ghc" || GHC_PREFIX="${ROOT}usr"
GHC_PKG_DB="${GHC_PREFIX}/$(get_libdir)/${P}/package.conf"
rm -f ${GHC_PKG_DB} ${GHC_PKG_DB}.old
}
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.8.2.ebuild,v 1.5 2008/04/28 17:44:23 armin76 Exp $
# Brief explanation of the bootstrap logic:
#
# Previous ghc ebuilds have been split into two: ghc and ghc-bin,
# where ghc-bin was primarily used for bootstrapping purposes.
# From now on, these two ebuilds have been combined, with the
# binary USE flag used to determine whether or not the pre-built
# binary package should be emerged or whether ghc should be compiled
# from source. If the latter, then the relevant ghc-bin for the
# arch in question will be used in the working directory to compile
# ghc from source.
#
# This solution has the advantage of allowing us to retain the one
# ebuild for both packages, and thus phase out virtual/ghc.
# Note to users of hardened gcc-3.x:
#
# If you emerge ghc with hardened gcc it should work fine (because we
# turn off the hardened features that would otherwise break ghc).
# However, emerging ghc while using a vanilla gcc and then switching to
# hardened gcc (using gcc-config) will leave you with a broken ghc. To
# fix it you would need to either switch back to vanilla gcc or re-emerge
# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and
# you switch to gcc-4.x that this will also break ghc and you'll need to
# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between
# gcc-3.x and 4.x with no problems.
inherit base bash-completion eutils flag-o-matic toolchain-funcs ghc-package versionator
DESCRIPTION="The Glasgow Haskell Compiler"
HOMEPAGE="http://www.haskell.org/ghc/"
# discover if this is a snapshot release
IS_SNAPSHOT="$(get_version_component_range 4)" # non-empty if snapshot
EXTRA_SRC_URI="${PV}"
[[ "${IS_SNAPSHOT}" ]] && EXTRA_SRC_URI="stable/dist"
SRC_URI="!binary? ( http://haskell.org/ghc/dist/${EXTRA_SRC_URI}/${P}-src.tar.bz2 )
alpha? ( mirror://gentoo/ghc-bin-${PV}-alpha.tbz2 )
amd64? ( mirror://gentoo/ghc-bin-${PV}-amd64.tbz2 )
hppa? ( mirror://gentoo/ghc-bin-${PV}-hppa.tbz2 )
ia64? ( mirror://gentoo/ghc-bin-${PV}-ia64.tbz2 )
sparc? ( mirror://gentoo/ghc-bin-${PV}-sparc.tbz2 )
x86? ( mirror://gentoo/ghc-bin-${PV}-x86.tbz2 )"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~sparc ~x86"
IUSE="binary doc ghcbootstrap"
RDEPEND="
!dev-lang/ghc-bin
>=sys-devel/gcc-2.95.3
>=sys-devel/binutils-2.17
>=dev-lang/perl-5.6.1
>=dev-libs/gmp-4.1
=sys-libs/readline-5*"
DEPEND="${RDEPEND}
ghcbootstrap? ( doc? ( ~app-text/docbook-xml-dtd-4.2
app-text/docbook-xsl-stylesheets
>=dev-libs/libxslt-1.1.2
>=dev-haskell/haddock-0.8 ) )"
# In the ghcbootstrap case we rely on the developer having
# >=ghc-5.04.3 on their $PATH already
append-ghc-cflags() {
local flag compile assemble link
for flag in $*; do
case ${flag} in
compile) compile="yes";;
assemble) assemble="yes";;
link) link="yes";;
*)
[[ ${compile} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optc${flag}"
[[ ${assemble} ]] && GHC_CFLAGS="${GHC_CFLAGS} -opta${flag}"
[[ ${link} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optl${flag}";;
esac
done
}
ghc_setup_cflags() {
# 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
filter-flags -fPIC
GHC_CFLAGS=""
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};;
# Debugging flags don't help either. You can't debug Haskell code
# at the C source level and the mangler discards the debug info.
-g*) ;;
# Ignore all other flags, including all -f* flags
esac
done
# hardened-gcc needs to be disabled, because the mangler doesn't accept
# its output.
gcc-specs-pie && append-ghc-cflags compile link -nopie
gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector
# We also add -Wa,--noexecstack to get ghc to generate .o files with
# non-exectable stack. This it a hack until ghc does it itself properly.
append-ghc-cflags assemble "-Wa,--noexecstack"
}
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 for"
ewarn "use with the ghc ebuild's USE=\"binary\" feature."
use binary && \
die "USE=\"ghcbootstrap binary\" is not a valid combination."
[[ -z $(type -P ghc) ]] && \
die "Could not find a ghc to bootstrap with."
elif use ppc || use ppc64; then
eerror "No binary .tbz2 package available yet for these arches:"
eerror " ppc, ppc64"
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 this arch yet, USE=ghcbootstrap"
fi
}
src_unpack() {
# Create the ${S} dir if we're using the binary version
use binary && mkdir "${S}"
base_src_unpack
ghc_setup_cflags
if use binary; then
# Move unpacked files to the expected place
mv "${WORKDIR}/usr" "${S}"
else
# Modify the ghc driver script to use GHC_CFLAGS
sed -i -e "s|\$\$TOPDIROPT|\$\$TOPDIROPT ${GHC_CFLAGS}|" \
"${S}/driver/ghc/Makefile"
if ! use ghcbootstrap; then
# Relocate from /usr to ${WORKDIR}/usr
sed -i -e "s|/usr|${WORKDIR}/usr|g" \
"${WORKDIR}/usr/bin/ghc-${PV}" \
"${WORKDIR}/usr/bin/ghci-${PV}" \
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \
"${WORKDIR}/usr/bin/hsc2hs" \
"${WORKDIR}/usr/$(get_libdir)/${P}/package.conf" \
|| die "Relocating ghc from /usr to workdir failed"
fi
fi
}
src_compile() {
if ! use binary; then
# initialize build.mk
echo '# Gentoo changes' > mk/build.mk
# Put docs into the right place, ie /usr/share/doc/ghc-${PV}
echo "docdir = /usr/share/doc/${P}" >> mk/build.mk
echo "htmldir = /usr/share/doc/${P}" >> mk/build.mk
# We also need to use the GHC_CFLAGS flags when building ghc itself
echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk
echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> 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
if use ghcbootstrap && use doc; then
echo XMLDocWays="html" >> mk/build.mk
echo HADDOCK_DOCS=YES >> mk/build.mk
else
echo XMLDocWays="" >> mk/build.mk
fi
# circumvent a very strange bug that seems related with ghc producing
# too much output while being filtered through tee (e.g. due to
# portage logging) reported as bug #111183
echo "SRC_HC_OPTS+=-w" >> mk/build.mk
# GHC build system knows to build unregisterised on alpha and hppa,
# but we have to tell it to build unregisterised on some arches
if use alpha || use hppa || use ppc64 || use sparc; then
echo "GhcUnregisterised=YES" >> mk/build.mk
echo "GhcWithInterpreter=NO" >> mk/build.mk
echo "GhcWithNativeCodeGen=NO" >> mk/build.mk
echo "SplitObjs=NO" >> mk/build.mk
echo "GhcRTSWays := debug" >> mk/build.mk
echo "GhcNotThreaded=YES" >> 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
econf || die "econf failed"
emake all || die "make failed"
fi # ! use binary
}
src_install() {
if use binary; then
mv "${S}/usr" "${D}"
# Remove the docs if not requested
if ! use doc; then
rm -rf "${D}/usr/share/doc/${P}/*/" \
"${D}/usr/share/doc/${P}/*.html" \
|| die "could not remove docs (P vs PF revision mismatch?)"
fi
else
local insttarget="install"
# We only built docs if we were bootstrapping, otherwise
# we copy them out of the unpacked binary .tbz2
if use doc; then
if use ghcbootstrap; then
insttarget="${insttarget} install-docs"
else
mkdir -p "${D}/usr/share/doc"
mv "${WORKDIR}/usr/share/doc/${P}" "${D}/usr/share/doc" \
|| die "failed to copy docs"
fi
fi
emake -j1 ${insttarget} \
DESTDIR="${D}" \
|| die "make ${insttarget} failed"
dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION"
dosbin "${FILESDIR}/ghc-updater"
dobashcompletion "${FILESDIR}/ghc-bash-completion"
cp -p "${D}/usr/$(get_libdir)/${P}/package.conf"{,.shipped} \
|| die "failed to copy package.conf"
fi
}
pkg_postinst() {
ghc-reregister
ewarn "IMPORTANT:"
ewarn "If you have upgraded from another version of ghc, please run:"
ewarn " /usr/sbin/ghc-updater"
ewarn "to re-merge all ghc-based Haskell libraries."
bash-completion_pkg_postinst
}
pkg_prerm() {
# Overwrite the (potentially) modified package.conf with a copy of the
# original one, so that it will be removed during uninstall.
PKG="${ROOT}/usr/$(get_libdir)/${P}/package.conf"
cp -p "${PKG}"{.shipped,}
[[ -f ${PKG}.old ]] && rm "${PKG}.old"
}