diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2011-06-05 16:27:38 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2011-06-05 16:27:38 +0000 |
commit | eeca45ffcca5ab6068e824c0e59b31ffe6cb589a (patch) | |
tree | 1a7f583905b51fede897a57d923574e91f180bf8 /dev-lang | |
parent | Removed old. (diff) | |
download | gentoo-2-eeca45ffcca5ab6068e824c0e59b31ffe6cb589a.tar.gz gentoo-2-eeca45ffcca5ab6068e824c0e59b31ffe6cb589a.tar.bz2 gentoo-2-eeca45ffcca5ab6068e824c0e59b31ffe6cb589a.zip |
Remove old ghc versions. Many of them are very hard to impossible to build/use.
(Portage version: 2.1.9.50/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/ghc/ChangeLog | 11 | ||||
-rw-r--r-- | dev-lang/ghc/files/10ghc | 2 | ||||
-rw-r--r-- | dev-lang/ghc/files/depsort.py | 65 | ||||
-rw-r--r-- | dev-lang/ghc/files/ghc-6.10.2-readline.patch | 216 | ||||
-rw-r--r-- | dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch | 12 | ||||
-rw-r--r-- | dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch | 13 | ||||
-rw-r--r-- | dev-lang/ghc/files/ghc-6.5-norelax.patch | 15 | ||||
-rw-r--r-- | dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch | 24 | ||||
-rwxr-xr-x | dev-lang/ghc/files/ghc-updater | 335 | ||||
-rw-r--r-- | dev-lang/ghc/ghc-6.2.2.ebuild | 319 | ||||
-rw-r--r-- | dev-lang/ghc/ghc-6.4.2.ebuild | 410 | ||||
-rw-r--r-- | dev-lang/ghc/ghc-6.6.1.ebuild | 370 | ||||
-rw-r--r-- | dev-lang/ghc/ghc-6.6.ebuild | 327 | ||||
-rw-r--r-- | dev-lang/ghc/ghc-6.8.2-r1.ebuild | 275 | ||||
-rw-r--r-- | dev-lang/ghc/ghc-6.8.2.ebuild | 282 |
15 files changed, 10 insertions, 2666 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog index 458e5b7ee165..746564ea3939 100644 --- a/dev-lang/ghc/ChangeLog +++ b/dev-lang/ghc/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for dev-lang/ghc # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.204 2011/04/25 17:55:08 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.205 2011/06/05 16:27:38 slyfox Exp $ + + 05 Jun 2011; Sergei Trofimovich <slyfox@gentoo.org> -files/10ghc, + -ghc-6.2.2.ebuild, -ghc-6.4.2.ebuild, -files/ghc-6.4.2-sparc32plus.patch, + -files/ghc-6.4.2-sparcmangler.patch, -files/ghc-6.5-norelax.patch, + -ghc-6.6.ebuild, -ghc-6.6.1.ebuild, -files/ghc-6.6-nothreadedrts.patch, + -ghc-6.8.2.ebuild, -ghc-6.8.2-r1.ebuild, -files/ghc-6.10.2-readline.patch, + -files/depsort.py, -files/ghc-updater: + Remove old ghc versions. Many of them are very hard to impossible to + build/use. *ghc-6.12.3-r2 (25 Apr 2011) diff --git a/dev-lang/ghc/files/10ghc b/dev-lang/ghc/files/10ghc deleted file mode 100644 index 064cfb79d5bd..000000000000 --- a/dev-lang/ghc/files/10ghc +++ /dev/null @@ -1,2 +0,0 @@ -PATH=/opt/ghc/bin -ROOTPATH=/opt/ghc/bin diff --git a/dev-lang/ghc/files/depsort.py b/dev-lang/ghc/files/depsort.py deleted file mode 100644 index 4c3cb7bc84ab..000000000000 --- a/dev-lang/ghc/files/depsort.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python - -# tries to reorder the deps of a given list of packages so they -# are merged in order - liquidx@g.o (09 Oct 03) - -import portage -import sys, string - -fakedbapi = portage.fakedbapi() -varapi = portage.db["/"]["vartree"].dbapi - -pkgs_to_reorder = sys.argv[1:] -pkgs_ordered = [] - -# key = catpkgver -# value = dependencies -dep_cache = {} - - -# very simply, we extract the dependencies for each package -for pkg in pkgs_to_reorder: - try: - deps, slot = varapi.aux_get(pkg, ["DEPEND", "SLOT"]) - except ValueError: - sys.stderr.write("Error getting dependency information off " + pkg + "\n") - continue - try: - realdeps = portage.dep_check(deps, fakedbapi) - except TypeError: - # we're probably running >=portage-2.0.50 - pkgsettings = portage.config(clone=portage.settings) - realdeps = portage.dep_check(deps, fakedbapi, pkgsettings) - - vardeps = [] - # match() finds the versions of all those that are installed - for dep in realdeps[1]: - vardeps = vardeps + varapi.match(dep) - dep_cache[pkg] = vardeps - -# topsort takes a graph (given as a dictionary with the nodes -# as keys and the outgoing edges as values), and returns a -# list of nodes that is topologically sorted -def topsort (graph) : - visited = dict([(node,False) for node in graph.keys()]) - result = [] - - def dfs_single (node) : - visited[node] = True - for adj in graph[node]: - # we ignore dependencies that are not nodes in the graph - if adj in graph.keys() and not visited[adj]: - dfs_single (adj) - result.append(node) - - for node in graph.keys(): - if not visited[node]: - dfs_single (node) - - return result - -pkgs_final_order = topsort(dep_cache) - -print string.join(pkgs_final_order, "\n") -#print portage.dep_expand("=dev-python/sip-3.8", portage.portdb) -#print portage.dep_check("X? ( >=dev-python/sip-3.8 )", fakedbapi) diff --git a/dev-lang/ghc/files/ghc-6.10.2-readline.patch b/dev-lang/ghc/files/ghc-6.10.2-readline.patch deleted file mode 100644 index 315d800ac57b..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.2-readline.patch +++ /dev/null @@ -1,216 +0,0 @@ -Lennart Kolmodin <kolmodin@gentoo.org> 2009 -Make GHC 6.10.2 use readline instead of editline - -diff -rN -u old-ghc-6.10.2/aclocal.m4 new-ghc-6.10.2/aclocal.m4 ---- old-ghc-6.10.2/aclocal.m4 2009-04-02 22:56:21.000000000 +0200 -+++ new-ghc-6.10.2/aclocal.m4 2009-04-02 22:56:23.000000000 +0200 -@@ -900,18 +900,18 @@ - fi])# FP_PROG_GHC_PKG - - --# FP_GHC_HAS_EDITLINE -+# FP_GHC_HAS_READLINE - # ------------------- --AC_DEFUN([FP_GHC_HAS_EDITLINE], -+AC_DEFUN([FP_GHC_HAS_READLINE], - [AC_REQUIRE([FP_PROG_GHC_PKG]) --AC_CACHE_CHECK([whether ghc has editline package], [fp_cv_ghc_has_editline], --[if "${GhcPkgCmd-ghc-pkg}" --show-package editline >/dev/null 2>&1; then -- fp_cv_ghc_has_editline=yes -+AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline], -+[if "${GhcPkgCmd-ghc-pkg}" describe readline >/dev/null 2>&1; then -+ fp_cv_ghc_has_readline=yes - else -- fp_cv_ghc_has_editline=no -+ fp_cv_ghc_has_readline=no - fi]) --AC_SUBST([GhcHasEditline], [`echo $fp_cv_ghc_has_editline | sed 'y/yesno/YESNO/'`]) --])# FP_GHC_HAS_EDITLINE -+AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`]) -+])# FP_GHC_HAS_READLINE - - - # FP_GCC_EXTRA_FLAGS -diff -rN -u old-ghc-6.10.2/compiler/ghc.cabal.in new-ghc-6.10.2/compiler/ghc.cabal.in ---- old-ghc-6.10.2/compiler/ghc.cabal.in 2009-04-02 22:56:21.000000000 +0200 -+++ new-ghc-6.10.2/compiler/ghc.cabal.in 2009-04-02 22:56:23.000000000 +0200 -@@ -28,8 +28,8 @@ - Default: False - Manual: True - --Flag editline -- Description: Use editline -+Flag readline -+ Description: Use readline - Default: False - Manual: True - -@@ -71,8 +71,8 @@ - else - Build-Depends: unix - -- if flag(editline) -- Build-Depends: editline -+ if flag(readline) -+ Build-Depends: readline - CPP-Options: -DUSE_EDITLINE - - GHC-Options: -Wall -fno-warn-name-shadowing -fno-warn-orphans -diff -rN -u old-ghc-6.10.2/compiler/ghci/InteractiveUI.hs new-ghc-6.10.2/compiler/ghci/InteractiveUI.hs ---- old-ghc-6.10.2/compiler/ghci/InteractiveUI.hs 2009-04-02 22:56:21.000000000 +0200 -+++ new-ghc-6.10.2/compiler/ghci/InteractiveUI.hs 2009-04-02 22:56:23.000000000 +0200 -@@ -66,7 +66,7 @@ - - #ifdef USE_EDITLINE - import Control.Concurrent ( yield ) -- Used in readline loop --import System.Console.Editline.Readline as Readline -+import System.Console.Readline as Readline - #endif - - --import SystemExts -@@ -96,6 +96,10 @@ - - import Data.IORef ( IORef, readIORef, writeIORef ) - -+#ifdef USE_EDITLINE -+import System.Posix.Internals ( setNonBlockingFD ) -+#endif -+ - ----------------------------------------------------------------------------- - - ghciWelcomeMsg :: String -@@ -322,10 +326,6 @@ - when is_tty $ withReadline $ do - Readline.initialize - -- withGhcAppData -- (\dir -> Readline.readHistory (dir </> "ghci_history")) -- (return True) -- - Readline.setAttemptedCompletionFunction (Just completeWord) - --Readline.parseAndBind "set show-all-if-ambiguous 1" - -@@ -360,9 +360,6 @@ - - #ifdef USE_EDITLINE - liftIO $ do -- Readline.stifleHistory 100 -- withGhcAppData (\dir -> Readline.writeHistory (dir </> "ghci_history")) -- (return True) - Readline.resetTerminal Nothing - #endif - -@@ -634,11 +631,9 @@ - return (Just str) - - withReadline :: IO a -> IO a --withReadline = bracket_ stopTimer startTimer -- -- editline doesn't handle some of its system calls returning -- -- EINTR, so our timer signal confuses it, hence we turn off -- -- the timer signal when making calls to editline. (#2277) -- -- If editline is ever fixed, we can remove this. -+withReadline = flip finally (setNonBlockingFD 0) -+ -- 1. readline sometimes puts stdin into blocking mode, -+ -- so we need to put it back for the IO library - - -- These come from the RTS - foreign import ccall unsafe startTimer :: IO () -diff -rN -u old-ghc-6.10.2/compiler/ghci/Linker.lhs new-ghc-6.10.2/compiler/ghci/Linker.lhs ---- old-ghc-6.10.2/compiler/ghci/Linker.lhs 2009-04-02 22:56:21.000000000 +0200 -+++ new-ghc-6.10.2/compiler/ghci/Linker.lhs 2009-04-02 22:56:23.000000000 +0200 -@@ -953,7 +953,7 @@ - partOfGHCi - | isWindowsTarget || isDarwinTarget = [] - | otherwise = map PackageName -- ["base", "haskell98", "template-haskell", "editline"] -+ ["base", "haskell98", "template-haskell", "readline"] - - showLS :: LibrarySpec -> String - showLS (Object nm) = "(static) " ++ nm -diff -rN -u old-ghc-6.10.2/compiler/Makefile new-ghc-6.10.2/compiler/Makefile ---- old-ghc-6.10.2/compiler/Makefile 2009-04-02 22:56:21.000000000 +0200 -+++ new-ghc-6.10.2/compiler/Makefile 2009-04-02 22:56:23.000000000 +0200 -@@ -118,15 +118,15 @@ - CONFIGURE_FLAGS_STAGE2 += --ghc-option=-DDEBUGGER - endif - --# Enable editline if: --# - we're building stage 2/3, and we have built the editline package -+# Enable readline if: -+# - we're building stage 2/3, and we have built the readline package - # --# But we don't enable editline on Windows, as Windows terminals have --# editline-like support builtin. -+# But we don't enable readline on Windows, as Windows terminals have -+# readline-like support builtin. - # - ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32" --ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/editline/unbuildable)" "" --CONFIGURE_FLAGS_STAGE2 += --flags=editline -+ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/readline/unbuildable)" "" -+CONFIGURE_FLAGS_STAGE2 += --flags=readline - endif - endif - endif -diff -rN -u old-ghc-6.10.2/configure.ac new-ghc-6.10.2/configure.ac ---- old-ghc-6.10.2/configure.ac 2009-04-02 22:56:21.000000000 +0200 -+++ new-ghc-6.10.2/configure.ac 2009-04-02 22:56:23.000000000 +0200 -@@ -679,8 +679,8 @@ - AC_SUBST(ghc_ge_609)dnl - fi - --# Check whether this GHC has editline installed --FP_GHC_HAS_EDITLINE -+# Check whether this GHC has readline installed -+FP_GHC_HAS_READLINE - - # Dummy arguments to print help for --with-editline-* arguments. - # Those are actually passed to the editline package's configure script -diff -rN -u old-ghc-6.10.2/libraries/ifBuildable.hs new-ghc-6.10.2/libraries/ifBuildable.hs ---- old-ghc-6.10.2/libraries/ifBuildable.hs 2009-04-02 22:56:22.000000000 +0200 -+++ new-ghc-6.10.2/libraries/ifBuildable.hs 2009-04-02 22:56:23.000000000 +0200 -@@ -36,5 +36,5 @@ - requiredLines = filter ((3 == ) . length) $ map words nonCommentLines - requiredLibraries = [ x | 'l':'i':'b':'r':'a':'r':'i':'e':'s':'/':x - <- map head requiredLines ] -- return $ filter ("editline" /=) requiredLibraries -+ return $ filter ("readline" /=) requiredLibraries - -diff -rN -u old-ghc-6.10.2/libraries/Makefile new-ghc-6.10.2/libraries/Makefile ---- old-ghc-6.10.2/libraries/Makefile 2009-04-02 22:56:22.000000000 +0200 -+++ new-ghc-6.10.2/libraries/Makefile 2009-04-02 22:56:23.000000000 +0200 -@@ -46,7 +46,7 @@ - ifeq "$(Windows)" "YES" - SUBDIRS += $(wildcard Win32) - endif --SUBDIRS += directory process pretty hpc template-haskell editline Cabal random haskell98 -+SUBDIRS += directory process pretty hpc template-haskell readline Cabal random haskell98 - - # Set GhcBootLibs=YES from the command line to work with just the libraries - # needed to bootstrap GHC. -diff -rN -u old-ghc-6.10.2/Makefile new-ghc-6.10.2/Makefile ---- old-ghc-6.10.2/Makefile 2009-04-02 22:56:21.000000000 +0200 -+++ new-ghc-6.10.2/Makefile 2009-04-02 22:56:23.000000000 +0200 -@@ -393,7 +393,7 @@ - echo "HaveLibGmp = $(HaveLibGmp)" >> $(BIN_DIST_VARFILE) - echo "GhcLibsWithUnix = $(GhcLibsWithUnix)" >> $(BIN_DIST_VARFILE) - echo "GhcWithInterpreter = $(GhcWithInterpreter)" >> $(BIN_DIST_VARFILE) -- echo "GhcHasEditline = $(GhcHasEditline)" >> $(BIN_DIST_VARFILE) -+ echo "GhcHasReadline = $(GhcHasReadline)" >> $(BIN_DIST_VARFILE) - echo "BootingFromHc = $(BootingFromHc)" >> $(BIN_DIST_VARFILE) - echo "XMLDocWays = $(XMLDocWays)" >> $(BIN_DIST_VARFILE) - # We won't actually use xsltproc, but we need to know if it's "" or not -diff -rN -u old-ghc-6.10.2/mk/config.mk.in new-ghc-6.10.2/mk/config.mk.in ---- old-ghc-6.10.2/mk/config.mk.in 2009-04-02 22:56:22.000000000 +0200 -+++ new-ghc-6.10.2/mk/config.mk.in 2009-04-02 22:56:23.000000000 +0200 -@@ -891,8 +891,8 @@ - GHC = @WithGhc@ - GhcDir = $(dir $(GHC)) - --# Set to YES if $(GHC) has the editline package installed --GhcHasEditline = @GhcHasEditline@ -+# Set to YES if $(GHC) has the readline package installed -+GhcHasReadline = @GhcHasReadline@ - - HBC = @HBC@ - NHC = @NHC@ diff --git a/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch b/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch deleted file mode 100644 index 709f3db52b1d..000000000000 --- a/dev-lang/ghc/files/ghc-6.4.2-sparc32plus.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ghc-6.4.2/ghc/rts/Linker.c 2006-01-04 15:24:10.000000000 +0000 -+++ ghc-6.4.2.new/ghc/rts/Linker.c 2006-05-15 21:06:45.000000000 +0100 -@@ -2695,6 +2695,9 @@ - IF_DEBUG(linker,debugBelch( "Architecture is " )); - switch (ehdr->e_machine) { - case EM_386: IF_DEBUG(linker,debugBelch( "x86" )); break; -+#ifdef EM_SPARC32PLUS -+ case EM_SPARC32PLUS: -+#endif - case EM_SPARC: IF_DEBUG(linker,debugBelch( "sparc" )); break; - #ifdef EM_IA_64 - case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break; diff --git a/dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch b/dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch deleted file mode 100644 index 7431ffb5a5fe..000000000000 --- a/dev-lang/ghc/files/ghc-6.4.2-sparcmangler.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- ghc/driver/mangler/ghc-asm.lprl- 2006-08-23 14:24:27.000000000 +0000 -+++ ghc/driver/mangler/ghc-asm.lprl 2006-08-23 14:25:46.000000000 +0000 -@@ -417,8 +417,8 @@ - $T_CONST_LBL = '^\.LLC(\d+):$'; # regexp for what such a lbl looks like - $T_POST_LBL = ':'; - -- $T_MOVE_DIRVS = '^((\s+\.align\s+\d+|\s+\.proc\s+\d+|\s+\.global\s+\S+|\.text|\.data|\.seg|\.stab.*|\s+?\.section.*|\s+\.type.*|\s+\.size.*)\n)'; -- $T_COPY_DIRVS = '\.(global|globl|proc|stab)'; -+ $T_MOVE_DIRVS = '^((\s+\.align\s+\d+|\s+\.proc\s+\d+|\s+\.global\s+\S+|\s+\.local\s+\S+|\.text|\.data|\.seg|\.stab.*|\s+?\.section.*|\s+\.type.*|\s+\.size.*)\n)'; -+ $T_COPY_DIRVS = '\.(global|local|globl|proc|stab)'; - - $T_DOT_WORD = '\.(long|word|nword|xword|byte|half|short|skip|uahalf|uaword)'; - $T_DOT_GLOBAL = '^\t\.global'; diff --git a/dev-lang/ghc/files/ghc-6.5-norelax.patch b/dev-lang/ghc/files/ghc-6.5-norelax.patch deleted file mode 100644 index 1941757b19f3..000000000000 --- a/dev-lang/ghc/files/ghc-6.5-norelax.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -rN -u old-ghc-1/compiler/main/DriverPipeline.hs new-ghc/compiler/main/DriverPipeline.hs ---- old-ghc-1/compiler/main/DriverPipeline.hs 2006-09-13 10:33:23.000000000 +0200 -+++ new-ghc/compiler/main/DriverPipeline.hs 2006-09-13 10:33:23.000000000 +0200 -@@ -1014,6 +1014,10 @@ - let ld_r args = SysTools.runLink dflags ([ - SysTools.Option "-nostdlib", - SysTools.Option "-nodefaultlibs", -+#ifdef sparc_TARGET_ARCH -+ -- options '--relax' and '-r' are incompatible -+ SysTools.Option "-mno-relax", -+#endif - SysTools.Option "-Wl,-r", - SysTools.Option ld_x_flag, - SysTools.Option "-o", - diff --git a/dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch b/dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch deleted file mode 100644 index 24224203189f..000000000000 --- a/dev-lang/ghc/files/ghc-6.6-nothreadedrts.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- ghc-6.6/compiler/Makefile 2006-10-10 14:03:51.000000000 -0500 -+++ ghc-6.6.patched/compiler/Makefile 2007-04-04 11:57:06.000000000 -0500 -@@ -415,7 +415,9 @@ - PKG_DEPENDS += template-haskell - - # Use threaded RTS with GHCi, so threads don't get blocked at the prompt. -+ifneq "$(GhcNotThreaded)" "YES" - SRC_HC_OPTS += -threaded -+endif - - ALL_DIRS += ghci - ---- ghc-6.6/compiler/Makefile.ghcbin 2006-10-10 14:03:52.000000000 -0500 -+++ ghc-6.6.patched/compiler/Makefile.ghcbin 2007-04-04 11:57:30.000000000 -0500 -@@ -26,7 +26,9 @@ - SRC_HC_OPTS += -DGHCI -DBREAKPOINT - endif - -+ifneq "$(GhcNotThreaded)" "YES" - SRC_HC_OPTS += -threaded -+endif - - odir=stage$(stage) - diff --git a/dev-lang/ghc/files/ghc-updater b/dev-lang/ghc/files/ghc-updater deleted file mode 100755 index 727089509eb6..000000000000 --- a/dev-lang/ghc/files/ghc-updater +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# -# This script has been modified by kosmikus and is based on -# python-updater by liquidx. -# -# It tries to update any package that provides a ghc library. -# This script can be run as many times as you like. It will log the -# results in /var/log/ghc-updater.log -# -# NEW_GHC_VER = new ghc version we are upgrading to -# PKGS_EXCEPTIONS = packages that should NOT be re-emerged for any reason -# PKGS_MANUAL = packages that should be re-emerged even if they don't -# fit the criteria -# -# Runtime Variables: -# -# PKGS_TO_REMERGE = list of packages we deem to need re-emerging -# PKGS_OK = list of packages that should be merged without any problems -# PKGS_MISSING = list of packages that are installed, but cannot be merged -# because they have been pruned from portage -# PKGS_MASKED = list of packages that are installed, but masked. -# - -shopt -s nullglob - -# fix the PATH to include the dirs where portage installs ghc -PATH="/usr/bin:/opt/ghc/bin:${PATH}" - -NEW_GHC_VER=$(ghc --version | sed 's:^.*version ::') -NEW_GHC_LIBDIR=$(ghc --print-libdir) - -PKGS_EXCEPTIONS="dev-lang/ghc dev-lang/ghc-bin" -PKGS_MANUAL="" -LOGFILE="/var/log/ghc-updater.log" - -# portage variables -PKG_DBDIR=/var/db/pkg - -# moved the portageq checks into a function to make command -# line parsing immediate - -setup_portdir() { - PORTDIR=`portageq portdir` - PORTDIR_OVERLAYS=`portageq portdir_overlay` -} - -PRETEND=0 -PKGS_TO_REMERGE="" -PKGS_COUNT_REMERGE=0 -PORTAGE_PYTHON="/usr/bin/python" - -usage() { - echo "usage: ghc-updater [options]" - echo " -h, -?, --help help" - echo " -p, --pretend pretend (don't do anything)" -} - -# -# -# Command Line Parsing -# -# -while [ -n "$1" ]; do - case "$1" in - -h | -\? | --help) - usage - exit 0 - ;; - -p | --pretend) - PRETEND=1 - ;; - *) - usage - echo "unrecognised option: $1" - ;; - esac - shift -done - -# load the gentoo-style info macros, but hack to get around -# it thinking this is an rc script -EBUILD="1" - -# /etc/init.d/functions.sh always points to the correct functions.sh no -# matter which version of baselayout -source /etc/init.d/functions.sh - -# misc helper functions -eloginfo() { - einfo $* - DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` - (echo "${DATESTRING} - ${*}" >> ${LOGFILE}) 2>/dev/null -} - -elogecho() { - echo -n " " - echo $* - DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` - (echo "${DATESTRING} - ${*}" >> ${LOGFILE}) 2>/dev/null -} - -elogerr() { - eerror $* - DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` - (echo "${DATESTRING} ! ${*}" >> ${LOGFILE}) 2>/dev/null -} - -elog() { - DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` - (echo "${DATESTRING} - ${*}" >> ${LOGFILE}) 2>/dev/null -} - -# -# Sanity check -# - -setup_portdir - -find_in_portdir() { - local f - for f in ${PORTDIR} ${PORTDIR_OVERLAYS}; do - if [[ -f "${f}/${1}" ]]; then - echo "${f}/${1}" - return 0 - fi - done - return 1 -} - -if [ -z "${PORTDIR}" ]; then - eerror "Unable to proceed. Can not find PORTDIR. Make sure the command:" - eerror " " - eerror " portageq portdir" - eerror " " - eerror "returns a value. If it doesn't, make sure you have updated to" - eerror "latest portage version." - eerror " " - eerror "Report bugs to http://bugs.gentoo.org/" - exit 1 -fi - -# -# -# Find all packages that have installed something in -# directories of the form -# /usr/lib/ghc-<version> -# or similar. -# -# /usr/lib/ghc-bin-<version> -# is included because an old ghc-bin ebuild was buggy and -# installed to a wrong dir. -# -OLD_PACKAGES_DIR="" -# Exclude new library dir and lib symlinks: -for d in /{usr,opt/ghc}/lib{,64}/ghc{,-bin}-*; do - [[ "${d}" == ${NEW_GHC_LIBDIR} ]] || [[ -L ${d%/*} ]] || OLD_PACKAGES_DIR="${OLD_PACKAGES_DIR}${d} " -done - -eloginfo "Starting GHC Updater to $(which ghc), version ${NEW_GHC_VER} :" -eloginfo "Searching for packages with files in the directories:" -eloginfo "${OLD_PACKAGES_DIR}" - -# iterate thru all the installed package's contents -for content in `find ${PKG_DBDIR} -name CONTENTS`; do - # extract the category, package name and package version - CATPKGVER=$(echo ${content} | sed "s:${PKG_DBDIR}/\(.*\)/CONTENTS:\1:") - - # exclude packages that are an exception, like portage and python itself. - exception=0 - for exp in ${PKGS_EXCEPTIONS}; do - if [ -n "$(echo ${CATPKGVER} | grep ${exp})" ]; then - exception=1 - break; - fi - done - - if [ ${exception} = 1 ]; then - continue; - fi - - for d in ${OLD_PACKAGES_DIR}; do - if fgrep "${d}/" ${content} > /dev/null; then - PKGS_TO_REMERGE="${PKGS_TO_REMERGE} ${CATPKGVER}" - elogecho "${CATPKGVER} has files in ${d}" - fi - done -done - -# now we have to do each emerge seperately because if an installed version -# does not have the corresponding ebuild in portage, then it will bail. - -eloginfo "Calculating Upgrade Package List .." - -PKGS_OK="" -PKGS_MASKED="" -PKGS_BLOCKED="" -PKGS_MISSING="" - -MASKED_STRING="been masked" -BLOCKED_STRING="is blocking" -MISSING_STRING='there are no ebuilds to satisfy' - -for pkg in ${PKGS_TO_REMERGE}; do - emerge_output="$(emerge -p '>='$pkg 2>&1)" - if $(echo "${emerge_output}" | grep "${MASKED_STRING}" > /dev/null); then - PKGS_MASKED="${PKGS_MASKED} $pkg" - elogecho ">=$pkg is masked" - elif $(echo "${emerge_output}" | grep "${BLOCKED_STRING}" > /dev/null); then - PKGS_BLOCKED="${PKGS_BLOCKED} $pkg" - elogecho ">=$pkg is blocked" - elif $(echo "${emerge_output}" | grep "${MISSING_STRING}" > /dev/null); then - PKGS_MISSING="${PKGS_MISSING} $pkg" - elogecho ">=$pkg is missing from portage" - else - PKGS_OK="${PKGS_OK} $pkg" - PKGS_COUNT_REMERGE=$((PKGS_COUNT_REMERGE + 1)) - fi -done - -# -# Use my super dumb package reordering algorithm that works most of the time -# - -eloginfo "Re-ordering packages to merge .." - -DEPSORT=$(find_in_portdir "dev-lang/ghc/files/depsort.py") -if [[ -z ${DEPSORT} ]]; then - eerror "Fatal error: File dev-lang/ghc/files/depsort.py not in portage tree." - exit 1 -fi -PKGS_OK_SORTED="$(${PORTAGE_PYTHON} ${DEPSORT} ${PKGS_OK} | xargs)" - -if [[ -n ${PRETEND} ]]; then - eloginfo "These are the packages that would be merged, in order:" -else - eloginfo "Preparing to merge these packages in this order:" -fi -for pkg in $PKGS_OK_SORTED; do - elogecho ">=$pkg" -done - -# we emerge each package seperately to ensure we know exactly which ones might -# cause an error, and then report it at the end - -COUNT=1 -PKGS_FAILED="" -if [ "${PRETEND}" != "1" ]; then - for pkg in ${PKGS_OK_SORTED}; do - eloginfo "Starting to merge ($COUNT/$PKGS_COUNT_REMERGE) $pkg .." - if ! emerge --oneshot --nodeps '>='$pkg; then - PKGS_FAILED="${PKGS_FAILED} $pkg" - elogerr "Failed merging $pkg ($COUNT/$PKGS_COUNT_REMERGE)!" - fi - COUNT=$((COUNT+1)) - done -fi - -# final output stuff -OUTPUT_PKGS_MASKED="" -for pkg in ${PKGS_MASKED}; do OUTPUT_PKGS_MASKED="${OUTPUT_PKGS_MASKED} '>='$pkg"; done -OUTPUT_PKGS_BLOCKED="" -for pkg in ${PKGS_BLOCKED}; do OUTPUT_PKGS_BLOCKED="${OUTPUT_PKGS_BLOCKED} $pkg"; done -OUTPUT_PKGS_MISSING="" -for pkg in ${PKGS_MISSING}; do OUTPUT_PKGS_MISSING="${OUTPUT_PKGS_MISSING} $pkg"; done -OUTPUT_PKGS_FAILED="" -for pkg in ${PKGS_FAILED}; do OUTPUT_PKGS_FAILED="${OUTPUT_PKGS_FAILED} '>='$pkg"; done - -if [ -n "${PKGS_FAILED}" -o -n "${PKGS_MISSING}" -o -n "${PKGS_MASKED}" ]; then - echo - ewarn "************************************************************" - ewarn "* Packages that still need to be manually emerged : *" - ewarn "************************************************************" - if [ -n "${OUTPUT_PKGS_MASKED}" ]; then - echo - ewarn " Masked Packages:" - ewarn " ----------------" - ewarn " Unmask the following packages (at your own risk) and " - ewarn " emerge them using this command after removing the '-p'" - ewarn " parameter." - echo - ewarn " emerge -p ${OUTPUT_PKGS_MASKED}" - echo - fi - if [ -n "${OUTPUT_PKGS_BLOCKED}" ]; then - echo - ewarn " Blocked Packages:" - ewarn " -----------------" - ewarn " These packages are currently blocked; they might not yet" - ewarn " be compatible with the current ghc. You can run ghc-updater" - ewarn " again at a later time." - echo - for x in ${OUTPUT_PKGS_BLOCKED}; do - echo " ${x}" - done - fi - if [ -n "${OUTPUT_PKGS_MISSING}" ]; then - echo - ewarn " Missing Packages:" - ewarn " -----------------" - ewarn " These packages cannot be updated because they do not exist" - ewarn " in portage anymore." - echo - for x in ${OUTPUT_PKGS_MISSING}; do - echo " ${x}" - done - fi - if [ -n "${OUTPUT_PKGS_FAILED}" ]; then - echo - ewarn " Failed Packages:" - ewarn " ----------------" - ewarn " These packages have failed and need to be re-emerged again." - ewarn " Alternatively, try re-running this script again to see if it" - ewarn " can be fixed." - echo - ewarn " emerge -p ${OUTPUT_PKGS_FAILED}" - echo - fi - - elog "GHC update completed with errors." - elog "Masked Packages:" - for x in ${PKGS_MASKED}; do - elog $x - done - elog "Missing Packages:" - for x in ${PKGS_MISSING}; do - elog $x - done - elog "Failed Packages:" - for x in ${PKGS_FAILED}; do - elog $x - done - elog "Update script completed." -else - eloginfo "GHC update completed successfully." -fi diff --git a/dev-lang/ghc/ghc-6.2.2.ebuild b/dev-lang/ghc/ghc-6.2.2.ebuild deleted file mode 100644 index 49d7421a73fd..000000000000 --- a/dev-lang/ghc/ghc-6.2.2.ebuild +++ /dev/null @@ -1,319 +0,0 @@ -# Copyright 1999-2010 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.30 2010/09/16 16:37:17 scarabeus 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 multilib 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 media-libs/freeglut )" - -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 - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - 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" - - # LC_ALL needs to workaround ghc's ParseCmm failure on some (es) locales - # bug #202212 / http://hackage.haskell.org/trac/ghc/ticket/4207 - # ghc-6.2.x build system does not support parallel make - LC_ALL=C 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" -} diff --git a/dev-lang/ghc/ghc-6.4.2.ebuild b/dev-lang/ghc/ghc-6.4.2.ebuild deleted file mode 100644 index 5fd95294c441..000000000000 --- a/dev-lang/ghc/ghc-6.4.2.ebuild +++ /dev/null @@ -1,410 +0,0 @@ -# Copyright 1999-2010 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.31 2010/09/16 16:37:17 scarabeus 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 multilib 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 ) - 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 ~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 media-libs/freeglut - 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 - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - 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" - - # LC_ALL needs to workaround ghc's ParseCmm failure on some (es) locales - # bug #202212 / http://hackage.haskell.org/trac/ghc/ticket/4207 - LC_ALL=C 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 -} diff --git a/dev-lang/ghc/ghc-6.6.1.ebuild b/dev-lang/ghc/ghc-6.6.1.ebuild deleted file mode 100644 index 6114b1abceb1..000000000000 --- a/dev-lang/ghc/ghc-6.6.1.ebuild +++ /dev/null @@ -1,370 +0,0 @@ -# Copyright 1999-2010 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.21 2010/07/21 21:49:33 slyfox 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 multilib 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 ) - 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 ~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/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 - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - 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, - # but we have to tell it to build unregisterised on some arches - if use alpha || use ppc64 || use sparc; then - echo "GhcUnregisterised=YES" >> mk/build.mk - echo "GhcWithInterpreter=NO" >> mk/build.mk - fi - if use alpha || 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" - - # LC_ALL needs to workaround ghc's ParseCmm failure on some (es) locales - # bug #202212 / http://hackage.haskell.org/trac/ghc/ticket/4207 - LC_ALL=C 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" -} diff --git a/dev-lang/ghc/ghc-6.6.ebuild b/dev-lang/ghc/ghc-6.6.ebuild deleted file mode 100644 index 0c3db64e1f3d..000000000000 --- a/dev-lang/ghc/ghc-6.6.ebuild +++ /dev/null @@ -1,327 +0,0 @@ -# Copyright 1999-2010 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.18 2010/07/21 21:49:33 slyfox 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 multilib 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 ~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 - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - 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, - # 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" - - # LC_ALL needs to workaround ghc's ParseCmm failure on some (es) locales - # bug #202212 / http://hackage.haskell.org/trac/ghc/ticket/4207 - LC_ALL=C 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 -} diff --git a/dev-lang/ghc/ghc-6.8.2-r1.ebuild b/dev-lang/ghc/ghc-6.8.2-r1.ebuild deleted file mode 100644 index ac257a4e5030..000000000000 --- a/dev-lang/ghc/ghc-6.8.2-r1.ebuild +++ /dev/null @@ -1,275 +0,0 @@ -# Copyright 1999-2010 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-r1.ebuild,v 1.5 2010/07/21 21:49:33 slyfox 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 multilib 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" - -# by using a bundled precompiled readline library we can use the bundled ghc -# binary to bootstrap, even if it was linked with libreadline-5 and the user has -# upgraded to libreadline-6. -READLINE_PV="5.2_p13" -READLINE_P="readline-${READLINE_PV}" - -SRC_URI="http://haskell.org/ghc/dist/${EXTRA_SRC_URI}/${P}-src.tar.bz2 - amd64? ( mirror://gentoo/ghc-bin-${PV}-amd64.tbz2 - http://haskell.org/~kolmodin/ghc-bundled-${READLINE_P}-amd64.tbz2 ) - x86? ( mirror://gentoo/ghc-bin-${PV}-x86.tbz2 - http://haskell.org/~kolmodin/ghc-bundled-${READLINE_P}-x86.tbz2 )" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="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." - [[ -z $(type -P ghc) ]] && \ - die "Could not find a ghc to bootstrap with." - fi -} - -src_unpack() { - base_src_unpack - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - ghc_setup_cflags - - # 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 -} - -src_compile() { - # find where the .so for readline-5 lives - # could either be /lib or /lib64 - for lib_path in lib{,64} ; do - if [[ -e "${WORKDIR}/${lib_path}/libreadline.so" ]]; then - # make sure ghc will find readline - export LD_LIBRARY_PATH="${WORKDIR}/${lib_path}:${LD_LIBRARY_PATH}" - export FOUND_READLINE=yes - fi - done - - if [[ -z "${FOUND_READLINE}" ]]; then - die "Could not locate bundled libreadline.so" - else - einfo "Found readline: ${LD_LIBRARY_PATH}" - fi - - # 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, - # but we have to tell it to build unregisterised on some arches - if use alpha || use ia64 || 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" - - # LC_ALL needs to workaround ghc's ParseCmm failure on some (es) locales - # bug #202212 / http://hackage.haskell.org/trac/ghc/ticket/4207 - LC_ALL=C emake all || die "make failed" -} - -src_install() { - 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" -} - -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" -} diff --git a/dev-lang/ghc/ghc-6.8.2.ebuild b/dev-lang/ghc/ghc-6.8.2.ebuild deleted file mode 100644 index 52114a3646af..000000000000 --- a/dev-lang/ghc/ghc-6.8.2.ebuild +++ /dev/null @@ -1,282 +0,0 @@ -# Copyright 1999-2010 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.16 2010/07/21 21:49:33 slyfox 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 multilib 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 ) - 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 ia64 ~ppc 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." - fi -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - base_src_unpack - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - 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, - # but we have to tell it to build unregisterised on some arches - if use alpha || use ia64 || 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" - - # LC_ALL needs to workaround ghc's ParseCmm failure on some (es) locales - # bug #202212 / http://hackage.haskell.org/trac/ghc/ticket/4207 - LC_ALL=C 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" -} |