diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2015-01-02 23:50:56 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2015-01-02 23:50:56 +0000 |
commit | 9399d55e784342446b5f5261849072ee29ebdff3 (patch) | |
tree | 946156354073ea515c98ecc5c5c21c3d0dae2e44 /dev-lang | |
parent | Removing myself from maintainers (diff) | |
download | gentoo-2-9399d55e784342446b5f5261849072ee29ebdff3.tar.gz gentoo-2-9399d55e784342446b5f5261849072ee29ebdff3.tar.bz2 gentoo-2-9399d55e784342446b5f5261849072ee29ebdff3.zip |
Drop old. Seek kids: those were Great Folks to deal with.
The older 6.12 brought us The Rise of Arches where we got
back long lost lore of having haskell on alpha, ppc64,
ia64 and sparc. While younger one 7.0 was The Herald of
Haskell2010.
So far ... Good luck!
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
Diffstat (limited to 'dev-lang')
39 files changed, 45 insertions, 5360 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog index 5faf5d22ac39..7cf7ef9f0423 100644 --- a/dev-lang/ghc/ChangeLog +++ b/dev-lang/ghc/ChangeLog @@ -1,6 +1,40 @@ # ChangeLog for dev-lang/ghc -# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.272 2014/12/26 23:35:44 slyfox Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.273 2015/01/02 23:50:56 slyfox Exp $ + + 02 Jan 2015; Sergei Trofimovich <slyfox@gentoo.org> + -files/ghc-6.10.4-autoconf.patch, -files/ghc-6.10.4-disable-strip.patch, + -files/ghc-6.10.4-ia64-fixed-relax.patch, + -files/ghc-6.10.4-ia64-storage-manager-fix.patch, + -files/ghc-6.10.4-libm-detection.patch, + -files/ghc-6.10.4-ppc64-always-minimal-toc.patch, + -files/ghc-6.10.4-propagate-hc-options-to-all-libraries.patch, + -files/ghc-6.12.1-configure-CHOST.patch, + -files/ghc-6.12.2-configure-CHOST-part2.patch, + -files/ghc-6.12.3-alpha-use-libffi-for-foreign-import-wrapper.patch, + -files/ghc-6.12.3-autoconf-2.66-4252.patch, + -files/ghc-6.12.3-configure-CHOST-freebsd.patch, + -files/ghc-6.12.3-configure-CHOST-prefix.patch, + -files/ghc-6.12.3-darwin8.patch, + -files/ghc-6.12.3-ghciless-haddock-3558.patch, + -files/ghc-6.12.3-ia64-fixed-relax.patch, + -files/ghc-6.12.3-ia64-storage-manager-fix.patch, + -files/ghc-6.12.3-ia64-use-libffi-for-foreign-import-wrapper.patch, + -files/ghc-6.12.3-libffi-incorrect-detection-of-selinux.patch, + -files/ghc-6.12.3-mach-o-relocation-limit.patch, + -files/ghc-6.12.3-pic-powerpc.patch, + -files/ghc-6.12.3-powerpc-darwin-no-mmap.patch, + -files/ghc-6.12.3-ppc-use-libffi-for-foreign-import-wrapper.patch, + -files/ghc-6.12.3-ticket-2615-linker-script.patch, + -files/ghc-7.0.2-CHOST.patch, -files/ghc-7.0.4-CHOST-softfloat.patch, + -files/ghc-7.0.4-fix-ppc-linker.patch, -files/ghc-7.0.4-nxstack.patch, + -files/ghc-apply-gmp-hack, -ghc-6.12.3-r2.ebuild, -ghc-7.0.4.ebuild, + -ghc-7.4.1-r1.ebuild, -ghc-7.4.1.ebuild, -ghc-7.6.2.ebuild, -ghc-7.6.3.ebuild, + ghc-7.6.3-r1.ebuild, ghc-7.8.3.ebuild, ghc-7.8.4.ebuild: + Drop old. Seek kids: those were Great Folks to deal with. The older 6.12 + brought us The Rise of Arches where we got back long lost lore of having + haskell on alpha, ppc64, ia64 and sparc. While younger one 7.0 was The Herald + of Haskell2010. So far ... Good luck! 26 Dec 2014; Sergei Trofimovich <slyfox@gentoo.org> ghc-7.8.4.ebuild: Added alpha binary. diff --git a/dev-lang/ghc/files/ghc-6.10.4-autoconf.patch b/dev-lang/ghc/files/ghc-6.10.4-autoconf.patch deleted file mode 100644 index 57d0de55e4d0..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.4-autoconf.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/aclocal.m4 b/aclocal.m4 -index 4678774..7f947f0 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -212,7 +212,7 @@ fi - changequote([, ])dnl - ]) - FP_COMPARE_VERSIONS([$fptools_cv_greencard_version],[-lt],[$1], -- [AC_MSG_ERROR([greencard version $1 or later is required (found '$fptools_cv_greencard_version')])])[]dnl -+ [AC_MSG_ERROR([greencard version $1 or later is required (found '$fptools_cv_greencard_version')])])[] - GreenCardVersion=$fptools_cv_greencard_version - AC_SUBST(GreenCardVersion) - ]) -@@ -247,7 +247,7 @@ changequote([, ])dnl - if test ! -f compiler/parser/Parser.hs || test ! -f compiler/main/ParsePkgConf.hs || test ! -f compiler/cmm/CmmParse.hs || test ! -f compiler/parser/ParserCore.hs - then - FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-lt],[1.15], -- [AC_MSG_ERROR([Happy version 1.15 or later is required to compile GHC.])])[]dnl -+ [AC_MSG_ERROR([Happy version 1.15 or later is required to compile GHC.])])[] - fi - HappyVersion=$fptools_cv_happy_version; - AC_SUBST(HappyVersion) -@@ -282,7 +282,7 @@ changequote([, ])dnl - if test ! -f compiler/cmm/CmmLex.hs || test ! -f compiler/parser/Lexer.hs - then - FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[2.1.0], -- [AC_MSG_ERROR([Alex version 2.1.0 or later is required to compile GHC.])])[]dnl -+ [AC_MSG_ERROR([Alex version 2.1.0 or later is required to compile GHC.])])[] - fi - AlexVersion=$fptools_cv_alex_version; - AC_SUBST(AlexVersion) -diff --git a/configure.ac b/configure.ac -index 4d39e74..e3573c9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -795,7 +795,7 @@ if test "$BootingFromHc" = "NO" -a -d "$srcdir/compiler"; then - AC_MSG_ERROR([GHC is required unless bootstrapping from .hc files.]) - fi - FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[6.4], -- [AC_MSG_ERROR([GHC version 6.4 or later is required to compile GHC.])])dnl -+ [AC_MSG_ERROR([GHC version 6.4 or later is required to compile GHC.])]) - fi; - - # This uses GHC, so put it after the "GHC is required" check above: diff --git a/dev-lang/ghc/files/ghc-6.10.4-disable-strip.patch b/dev-lang/ghc/files/ghc-6.10.4-disable-strip.patch deleted file mode 100644 index 1b67a3cb0f00..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.4-disable-strip.patch +++ /dev/null @@ -1,15 +0,0 @@ -Unconditionally disable stripping of binaries. -Address https://bugs.gentoo.org/show_bug.cgi?id=299492 -diff --git a/utils/installPackage/installPackage.hs b/utils/installPackage/installPackage.hs -index 9ec7282..0174652 100644 ---- a/utils/installPackage/installPackage.hs -+++ b/utils/installPackage/installPackage.hs -@@ -38,7 +38,7 @@ parseArgs :: [String] - FilePath, -- dist prefix - Bool, -- enable shell wrappers? - Bool) -- strip exe? --parseArgs = f normal defaultDistPref False True -+parseArgs = f normal defaultDistPref False False - where f _ dp esw strip (('-':'v':val):args) - = f (readEOrFail flagToVerbosity val) dp esw strip args - f v _ esw strip ("--distpref":dp:args) = f v dp esw strip args diff --git a/dev-lang/ghc/files/ghc-6.10.4-ia64-fixed-relax.patch b/dev-lang/ghc/files/ghc-6.10.4-ia64-fixed-relax.patch deleted file mode 100644 index b9fa2925bb69..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.4-ia64-fixed-relax.patch +++ /dev/null @@ -1,35 +0,0 @@ -commit dcdb5df8bc0e973b856e88a7b78f88f947453feb -Author: Sergei Trofimovich <slyfox@gentoo.org> -Date: Tue Jul 6 11:38:47 2010 +0300 - - Fixing link failure of compiler on ia64 ('-Wl,' prefixed value passed directly to ld) - - /usr/bin/ld -Wl,--relax -r -o dist-stage1/build/HSghc-6.10.4.o \ - dist-stage1/build/BasicTypes.o dist-stage1/build/DataCon.o ... - /usr/bin/ld: unrecognized option '-Wl,--relax' - - If we just drop '-Wl,' part it will not help as '-r' and '--relax' are incompatible. - - Looks like '-Wl,--relax' was skipped by earlier binutils' ld as unknown option. - Removing ia64 specific path. - - Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> - -diff --git a/compiler/Makefile b/compiler/Makefile -index 0e7457b..17deab2 100644 ---- a/compiler/Makefile -+++ b/compiler/Makefile -@@ -130,13 +130,6 @@ ifeq "$(TargetOS_CPP)" "openbsd" - COMMON_CONFIGURE_FLAGS += --ld-options=-E - endif - --ifeq "$(GhcUnregisterised)" "NO" --ifeq "$(HOSTPLATFORM)" "ia64-unknown-linux" --# needed for generating proper relocation in large binaries: trac #856 --COMMON_CONFIGURE_FLAGS += --ld-option=-Wl,--relax --endif --endif -- - # We need to turn on profiling either if we have been asked to - # (GhcLibProfiled = YES) or if we want GHC itself to be compiled with - # profiling enabled (GhcProfiled = YES). diff --git a/dev-lang/ghc/files/ghc-6.10.4-ia64-storage-manager-fix.patch b/dev-lang/ghc/files/ghc-6.10.4-ia64-storage-manager-fix.patch deleted file mode 100644 index 37daea5d55ca..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.4-ia64-storage-manager-fix.patch +++ /dev/null @@ -1,63 +0,0 @@ -storage manager: preserve upper address bits on 64bit machines (thanks to zygoloid) - -the issue: durin ia64 ghc bootstrap (both 6.10.4 and 6.12.3) I -got the failure on stage2 phase: - "inplace/bin/ghc-stage2" -H32m -O -H64m -O0 -w ... - ghc-stage2: internal error: evacuate: strange closure type 15 - (GHC version 6.12.3 for ia64_unknown_linux) - Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug - make[1]: *** [libraries/dph/dph-base/dist-install/build/Data/Array/Parallel/Base/Hyperstrict.o] Aborted - -I attached gdb and got backtrace: - -Breakpoint 1 at 0x400000000469ec31: file rts/RtsMessages.c, line 39. -(gdb) run -B/var/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/inplace/bin --info -Starting program: /var/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/inplace/lib/ghc-stage2 -B/var/tmp/portage/dev-lang/ -ghc-6.12.3/work/ghc-6.12.3/inplace/bin --info -[Thread debugging using libthread_db enabled] - -Breakpoint 1, barf (s=0x40000000047915b0 "evacuate: strange closure type %d") at rts/RtsMessages.c:39 -39 va_start(ap,s); -(gdb) bt -#0 barf (s=0x40000000047915b0 "evacuate: strange closure type %d") at rts/RtsMessages.c:39 -#1 0x400000000474a1e0 in evacuate (p=0x6000000000147958) at rts/sm/Evac.c:756 -#2 0x40000000046d68c0 in scavenge_srt (srt=0x6000000000147958, srt_bitmap=7) at rts/sm/Scav.c:348 -... - -> 16:52:53 < zygoloid> slyfox: i'm no ghc expert but it looks like HEAP_ALLOCED_GC(q) -> is returning true for a FUN_STATIC closure -> 17:18:43 < zygoloid> try: p HEAP_ALLOCED_miss((unsigned long)(*p) >> 20, *p) -> 17:19:12 < slyfox> (gdb) p HEAP_ALLOCED_miss((unsigned long)(*p) >> 20, *p) -> 17:19:12 < slyfox> $1 = 0 -> 17:19:40 < zygoloid> i /think/ that means the mblock_cache is broken -> 17:22:45 < zygoloid> i can't help further. however i am suspicious that you seem to have pointers with similar-looking low 33 -> bits and different high 4 bits, and it looks like such pointers get put into the same bucket in -> mblock_cache. -... -> 17:36:16 < zygoloid> slyfox: try changing the definition of MbcCacheLine to StgWord64, see if that helps -> 17:36:31 < zygoloid> that's in includes/rts/storage/MBlock.h -And it helped! - -diff --git a/rts/sm/MBlock.h b/rts/sm/MBlock.h -index 516fb7f..725d32f 100644 ---- a/rts/sm/MBlock.h -+++ b/rts/sm/MBlock.h -@@ -117,7 +117,17 @@ extern StgWord8 mblock_map[]; - - #define MBC_LINE_BITS 0 - #define MBC_TAG_BITS 15 --typedef StgWord32 MbcCacheLine; // could use 16, but 32 was faster -+ -+#if x86_64_HOST_ARCH -+// 32bits are enough for 'entry' as modern amd64 boxes have -+// only 48bit sized virtual addres. -+typedef StgWord32 MbcCacheLine; -+#else -+// 32bits is not enough here as some arches (like ia64) use -+// upper address bits to distinct memory areas. -+typedef StgWord64 MbcCacheLine; -+#endif -+ - typedef StgWord8 MBlockMapLine; - - #define MBLOCK_MAP_LINE(p) (((StgWord)p & 0xffffffff) >> (MBLOCK_SHIFT + MBC_LINE_BITS)) diff --git a/dev-lang/ghc/files/ghc-6.10.4-libm-detection.patch b/dev-lang/ghc/files/ghc-6.10.4-libm-detection.patch deleted file mode 100644 index 0e90deb507f1..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.4-libm-detection.patch +++ /dev/null @@ -1,43 +0,0 @@ -Fri Dec 4 23:40:12 EET 2009 Sergei Trofimovich <slyfox@inbox.ru> - * configure.ac: fix libm checks (Trac #3730) - - libbfd pulled libm as dependency and broke LIBM= detection. - - Patch moves libm in library tests as early as possible. - Thanks to asuffield for suggesting such a simple fix. - Thanks to Roie Kerstein and Renato Gallo for finding - and tracking down the issue. - -http://bugs.gentoo.org/show_bug.cgi?id=293208 -http://hackage.haskell.org/trac/ghc/ticket/3730 -diff -rN -u old-ghc/configure.ac new-ghc/configure.ac ---- old-ghc/configure.ac 2009-12-04 23:51:06.135605014 +0200 -+++ new-ghc/configure.ac 2009-12-04 23:51:06.344604339 +0200 -@@ -713,18 +713,22 @@ - AC_DEFINE([HAVE_MINGWEX], [1], [Define to 1 if you have the mingwex library.]) - fi - --dnl ** check whether this machine has BFD and liberty installed (used for debugging) --dnl the order of these tests matters: bfd needs liberty --AC_CHECK_LIB(iberty, xmalloc) --AC_CHECK_LIB(bfd, bfd_init) -- - dnl ** check for math library -+dnl Keep that check as early as possible. -+dnl as we need to know whether we need libm -+dnl for math functions or not -+dnl (see http://hackage.haskell.org/trac/ghc/ticket/3730) - AC_CHECK_FUNC(atan,[fp_libm_not_needed=yes;LIBM=],[fp_libm_not_needed=dunno]) - if test x"$fp_libm_not_needed" = xdunno; then - AC_CHECK_LIB([m], [atan], [LIBS="-lm $LIBS"; LIBM="-lm"],[LIBM=]) - fi - AC_SUBST([LIBM]) - -+dnl ** check whether this machine has BFD and liberty installed (used for debugging) -+dnl the order of these tests matters: bfd needs liberty -+AC_CHECK_LIB(iberty, xmalloc) -+AC_CHECK_LIB(bfd, bfd_init) -+ - dnl ################################################################ - dnl Check for libraries - dnl ################################################################ diff --git a/dev-lang/ghc/files/ghc-6.10.4-ppc64-always-minimal-toc.patch b/dev-lang/ghc/files/ghc-6.10.4-ppc64-always-minimal-toc.patch deleted file mode 100644 index 8aaf594ee0f9..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.4-ppc64-always-minimal-toc.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff --git a/ghc/ghc.wrapper b/ghc/ghc.wrapper -index 71eae84..b02421d 100644 ---- a/ghc/ghc.wrapper -+++ b/ghc/ghc.wrapper -@@ -1,3 +1,3 @@ - #!/bin/sh - --exec $executablename -B$datadir -dynload wrapped ${1+"$@"} -+exec $executablename -B$datadir -optc-mminimal-toc -dynload wrapped ${1+"$@"} diff --git a/dev-lang/ghc/files/ghc-6.10.4-propagate-hc-options-to-all-libraries.patch b/dev-lang/ghc/files/ghc-6.10.4-propagate-hc-options-to-all-libraries.patch deleted file mode 100644 index 396c07974d1f..000000000000 --- a/dev-lang/ghc/files/ghc-6.10.4-propagate-hc-options-to-all-libraries.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/libraries/Makefile b/libraries/Makefile -index bf59e9a..c85df45 100644 ---- a/libraries/Makefile -+++ b/libraries/Makefile -@@ -128,7 +128,7 @@ ifeq "$(ghc_ge_605)" "NO" - CABAL_GHC_FLAGS += -cpp - endif - --BOOTSTRAPPING_FLAGS = $(CABAL_GHC_FLAGS) -DCABAL_VERSION=$(CABAL_VERSION) -odir $(HERE_ABS)/bootstrapping -hidir $(HERE_ABS)/bootstrapping -i$(HERE_ABS)/Cabal -i$(HERE_ABS)/filepath -i$(HERE_ABS)/hpc -+BOOTSTRAPPING_FLAGS = $(SRC_HC_OPTS) $(CABAL_GHC_FLAGS) -DCABAL_VERSION=$(CABAL_VERSION) -odir $(HERE_ABS)/bootstrapping -hidir $(HERE_ABS)/bootstrapping -i$(HERE_ABS)/Cabal -i$(HERE_ABS)/filepath -i$(HERE_ABS)/hpc - - .PHONY: boot - -@@ -141,19 +141,19 @@ cabal-bin: cabal-bin.hs - bootstrapping.conf: cabal-bin - echo "[]" > $@.tmp - -cd extensible-exceptions && $(CABAL) clean --distpref=dist-bootstrapping -- cd extensible-exceptions && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp -+ cd extensible-exceptions && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --ghc-options="$(BOOTSTRAPPING_FLAGS)" --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp - cd extensible-exceptions && $(CABAL) build --distpref=dist-bootstrapping - cd extensible-exceptions && $(CABAL) install --distpref=dist-bootstrapping --inplace - -cd filepath && $(CABAL) clean --distpref=dist-bootstrapping -- cd filepath && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp -+ cd filepath && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --ghc-options="$(BOOTSTRAPPING_FLAGS)" --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp - cd filepath && $(CABAL) build --distpref=dist-bootstrapping - cd filepath && $(CABAL) install --distpref=dist-bootstrapping --inplace - -cd Cabal && $(CABAL) clean --distpref=dist-bootstrapping -- cd Cabal && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp -+ cd Cabal && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --ghc-options="$(BOOTSTRAPPING_FLAGS)" --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp - cd Cabal && $(CABAL) build --distpref=dist-bootstrapping - cd Cabal && $(CABAL) install --distpref=dist-bootstrapping --inplace - -cd hpc && $(CABAL) clean --distpref=dist-bootstrapping -- cd hpc && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp -+ cd hpc && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --ghc-options="$(BOOTSTRAPPING_FLAGS)" --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp - cd hpc && $(CABAL) build --distpref=dist-bootstrapping - cd hpc && $(CABAL) install --distpref=dist-bootstrapping --inplace - mv $@.tmp $@ diff --git a/dev-lang/ghc/files/ghc-6.12.1-configure-CHOST.patch b/dev-lang/ghc/files/ghc-6.12.1-configure-CHOST.patch deleted file mode 100644 index 3369d703889d..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.1-configure-CHOST.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- old-ghc-6.12.0.20091010/configure.ac 2009-11-07 14:11:31.747192438 +0100 -+++ new-ghc-6.12.0.20091010/configure.ac 2009-11-07 14:11:31.752194402 +0100 -@@ -219,6 +219,8 @@ - exit 1 - fi - fi -+build=`echo "$build" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/'` -+[build=`echo "$build" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket - - if test "$host" = "" - then -@@ -231,6 +233,8 @@ - exit 1 - fi - fi -+host=`echo "$host" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/'` -+[host=`echo "$host" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket - - if test "$target" = "" - then -@@ -243,6 +247,8 @@ - exit 1 - fi - fi -+target=`echo "$target" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/'` -+[target=`echo "$target" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket - - exeext='' - soext='.so' diff --git a/dev-lang/ghc/files/ghc-6.12.2-configure-CHOST-part2.patch b/dev-lang/ghc/files/ghc-6.12.2-configure-CHOST-part2.patch deleted file mode 100644 index e444ccfb94e6..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.2-configure-CHOST-part2.patch +++ /dev/null @@ -1,42 +0,0 @@ -From b1b23479f676259230cc31e40cc94b60df90487e Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich <slyfox@inbox.ru> -Date: Thu, 22 Apr 2010 22:44:56 +0300 -Subject: [PATCH] aclocal.m4: mangle 'pc' to 'unknown', mangle i[3-6]86 to i386 - -Signed-off-by: Sergei Trofimovich <slyfox@community.haskell.org> ---- - aclocal.m4 | 11 +++++++++-- - 1 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/aclocal.m4 b/aclocal.m4 -index 031145d..f401860 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -1279,7 +1279,7 @@ case "$1" in - hppa*) - $2="hppa" - ;; -- i386) -+[ i[3-6]86) ] #m4 bracket escape - $2="i386" - ;; - ia64) -@@ -1332,7 +1332,14 @@ case "$1" in - # -------------------------------- - # converts vendor from gnu to ghc naming, and assigns the result to $target_var - AC_DEFUN([GHC_CONVERT_VENDOR],[ --$2="$1" -+case "$1" in -+ pc) -+ $2="unknown" -+ ;; -+ *) -+ $2="$1" -+ ;; -+ esac - ]) - - # GHC_CONVERT_OS(os, target_var) --- -1.6.4.4 - diff --git a/dev-lang/ghc/files/ghc-6.12.3-alpha-use-libffi-for-foreign-import-wrapper.patch b/dev-lang/ghc/files/ghc-6.12.3-alpha-use-libffi-for-foreign-import-wrapper.patch deleted file mode 100644 index 4df29fdaee61..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-alpha-use-libffi-for-foreign-import-wrapper.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/compiler/typecheck/TcForeign.lhs b/compiler/typecheck/TcForeign.lhs -index 073ca25..75e42ef 100644 ---- a/compiler/typecheck/TcForeign.lhs -+++ b/compiler/typecheck/TcForeign.lhs -@@ -30,10 +30,6 @@ import TcEnv - import ForeignCall - import ErrUtils - import Id --#if alpha_TARGET_ARCH --import Type --import SMRep --#endif - import Name - import TcType - import DynFlags -@@ -113,7 +109,6 @@ tcCheckFIType sig_ty arg_tys res_ty idecl@(CImport cconv safety _ CWrapper) = do - [arg1_ty] -> do checkForeignArgs isFFIExternalTy arg1_tys - checkForeignRes nonIOok isFFIExportResultTy res1_ty - checkForeignRes mustBeIO isFFIDynResultTy res_ty -- checkFEDArgs arg1_tys - where - (arg1_tys, res1_ty) = tcSplitFunTys arg1_ty - _ -> addErrTc (illegalForeignTyErr empty sig_ty) -@@ -175,31 +170,6 @@ checkMissingAmpersand dflags arg_tys res_ty - = return () - \end{code} - --On an Alpha, with foreign export dynamic, due to a giant hack when --building adjustor thunks, we only allow 4 integer arguments with --foreign export dynamic (i.e., 32 bytes of arguments after padding each --argument to a quadword, excluding floating-point arguments). -- --The check is needed for both via-C and native-code routes -- --\begin{code} --#include "nativeGen/NCG.h" -- --checkFEDArgs :: [Type] -> TcM () --#if alpha_TARGET_ARCH --checkFEDArgs arg_tys -- = check (integral_args <= 32) err -- where -- integral_args = sum [ (widthInBytes . argMachRep . primRepToCgRep) prim_rep -- | prim_rep <- map typePrimRep arg_tys, -- primRepHint prim_rep /= FloatHint ] -- err = ptext (sLit "On Alpha, I can only handle 32 bytes of non-floating-point arguments to foreign export dynamic") --#else --checkFEDArgs _ = return () --#endif --\end{code} -- -- - %************************************************************************ - %* * - \subsection{Exports} -diff --git a/mk/config.mk.in b/mk/config.mk.in -index 7399de0..a9e875c 100644 ---- a/mk/config.mk.in -+++ b/mk/config.mk.in -@@ -176,7 +176,7 @@ endif - # Whether to use libffi for adjustors (foreign import "wrapper") or - # not. If we have built-in support (rts/Adjustor.c) then we use that, - # otherwise we fall back on libffi, which is slightly slower. --ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 alpha powerpc ia64,),YES,NO)) -+ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 powerpc ia64,),YES,NO)) - ifeq "$(ArchHasAdjustorSupport)" "YES" - UseLibFFIForAdjustors=NO - else diff --git a/dev-lang/ghc/files/ghc-6.12.3-autoconf-2.66-4252.patch b/dev-lang/ghc/files/ghc-6.12.3-autoconf-2.66-4252.patch deleted file mode 100644 index 7341ca35c97a..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-autoconf-2.66-4252.patch +++ /dev/null @@ -1,20 +0,0 @@ -https://bugs.gentoo.org/show_bug.cgi?id=337025 -http://hackage.haskell.org/trac/ghc/ticket/4252 -Mon Aug 16 17:24:42 EEST 2010 Ross Paterson <ross@soi.city.ac.uk> - * fix FP_CHECK_ALIGNMENT for autoconf 2.66 (fixes #4252) - - Recent versions of AS_LITERAL_IF don't like *'s. Fix from - - http://blog.gmane.org/gmane.comp.sysutils.autoconf.general/month=20100701 -diff -rN -u old-ghc/aclocal.m4 new-ghc/aclocal.m4 ---- old-ghc/aclocal.m4 2010-09-13 21:00:36.288338228 +0300 -+++ new-ghc/aclocal.m4 2010-09-13 21:00:37.209338228 +0300 -@@ -141,7 +141,7 @@ - # A variation of AC_CHECK_SIZEOF for computing the alignment restrictions of a - # given type. Defines ALIGNMENT_TYPE. - AC_DEFUN([FP_CHECK_ALIGNMENT], --[AS_LITERAL_IF([$1], [], -+[AS_LITERAL_IF(m4_translit([[$1]], [*], [p]), [], - [AC_FATAL([$0: requires literal arguments])])[]dnl - AC_CHECK_TYPE([$1], [], [], [$3])[]dnl - m4_pushdef([fp_Cache], [AS_TR_SH([fp_cv_alignment_$1])])[]dnl diff --git a/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-freebsd.patch b/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-freebsd.patch deleted file mode 100644 index 3600a5833de4..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-freebsd.patch +++ /dev/null @@ -1,58 +0,0 @@ -gcc on FreeBSD/Gentoo/x86 has 'i686-gentoo-freebsd7.2' triplet, but ghc likes 'i386-unknown-freebsd' -Mangle -gentoo- to -unknown-, mangle '-freebsd7.2' (and other numerics) to '-freebsd' -Thanks to naota for the report and testing. -diff --git a/aclocal.m4 b/aclocal.m4 -index f401860..7f93ebf 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -1333,7 +1333,7 @@ case "$1" in - # converts vendor from gnu to ghc naming, and assigns the result to $target_var - AC_DEFUN([GHC_CONVERT_VENDOR],[ - case "$1" in -- pc) -+ pc|gentoo) - $2="unknown" - ;; - *) -@@ -1354,6 +1354,10 @@ case "$1" in - freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku) - $2="$1" - ;; -+ # for things like freebsd7.2 -+ freebsd*) -+ $2="freebsd" -+ ;; - *) - echo "Unknown OS $1" - exit 1 -diff --git a/configure.ac b/configure.ac -index 0360fa5..0a1ce25 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -225,7 +225,7 @@ then - echo "Bootstrapping GHC is a cross compiler. This probably isn't going to work" - fi - fi --build=`echo "$build" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/'` -+build=`echo "$build" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'` - [build=`echo "$build" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket - - # We have to run these unconditionally, but we may discard their -@@ -260,7 +260,7 @@ else - GHC_CONVERT_VENDOR([$build_vendor], [BuildVendor]) - GHC_CONVERT_OS([$build_os], [BuildOS]) - fi --host=`echo "$host" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/'` -+host=`echo "$host" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'` - [host=`echo "$host" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket - - if test "$host_alias" = "" -@@ -282,7 +282,7 @@ else - GHC_CONVERT_VENDOR([$host_vendor], [HostVendor]) - GHC_CONVERT_OS([$host_os], [HostOS]) - fi --target=`echo "$target" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/'` -+target=`echo "$target" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'` - [target=`echo "$target" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket - - if test "$target_alias" = "" diff --git a/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-prefix.patch b/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-prefix.patch deleted file mode 100644 index 926237ba8064..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-configure-CHOST-prefix.patch +++ /dev/null @@ -1,43 +0,0 @@ -Strip versioning components from *HOST for Darwin and Solaris - ---- aclocal.m4 -+++ aclocal.m4 -@@ -1358,6 +1358,12 @@ - freebsd*) - $2="freebsd" - ;; -+ darwin*) -+ $2="darwin" -+ ;; -+ solaris2.*) -+ $2="solaris2" -+ ;; - *) - echo "Unknown OS $1" - exit 1 ---- configure.ac -+++ configure.ac -@@ -227,6 +227,7 @@ - fi - build=`echo "$build" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'` - [build=`echo "$build" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket -+build=`echo "$build" | sed -e 's/-darwin.*$/-darwin/' -e 's/-solaris2.*$/-solaris/'` - - # We have to run these unconditionally, but we may discard their - # results in the following code -@@ -262,6 +263,7 @@ - fi - host=`echo "$host" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'` - [host=`echo "$host" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket -+host=`echo "$host" | sed -e 's/-darwin.*$/-darwin/' -e 's/-solaris2.*$/-solaris/'` - - if test "$host_alias" = "" - then -@@ -284,6 +286,7 @@ - fi - target=`echo "$target" | sed -e 's/linux-gnu/linux/' -e 's/-pc-/-unknown-/' -e 's/-gentoo-/-unknown-/' -e 's/freebsd.*$/freebsd/'` - [target=`echo "$target" | sed -e 's/i[4-6]86/i386/'`] # escaping square bracket -+target=`echo "$target" | sed -e 's/-darwin.*$/-darwin/' -e 's/-solaris2.*$/-solaris/'` - - if test "$target_alias" = "" - then diff --git a/dev-lang/ghc/files/ghc-6.12.3-darwin8.patch b/dev-lang/ghc/files/ghc-6.12.3-darwin8.patch deleted file mode 100644 index c971eb25eed6..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-darwin8.patch +++ /dev/null @@ -1,18 +0,0 @@ -Workaround headers problem in Darwin 8 as well. - ---- rts/PosixSource.h -+++ rts/PosixSource.h -@@ -11,6 +11,13 @@ - - #include <ghcplatform.h> - -+#if defined(darwin_HOST_OS) -+/* unfortunately the hack below only works for Darwin 9 and -+ * above, so as hack include sys/types early (before setting -+ * _POSIX_C_SOURCE) (this obviously obsoletes the hack below) */ -+#include <sys/types.h> -+#endif -+ - #define _POSIX_SOURCE 1 - #define _POSIX_C_SOURCE 199506L - #define _XOPEN_SOURCE 500 diff --git a/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch b/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch deleted file mode 100644 index 0a25d72b5ad0..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch +++ /dev/null @@ -1,224 +0,0 @@ -commit c7d5e1322f54b5387767c15788d8372705b8981b -Author: Sergei Trofimovich <slyfox@gentoo.org> -Date: Sun Oct 3 22:32:12 2010 +0300 - - Sat Jul 31 14:55:06 EEST 2010 Ian Lynagh <igloo@earth.li> - * Expose the functions haddock needs even when haddock is disabled; #3558 ---- - compiler/main/GHC.hs | 13 +++++++++++-- - compiler/main/InteractiveEval.hs | 9 --------- - compiler/typecheck/TcRnDriver.lhs | 24 +++++++++++++++--------- - 3 files changed, 26 insertions(+), 20 deletions(-) - -diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs -index be7d574..2f25cbe 100644 ---- a/compiler/main/GHC.hs -+++ b/compiler/main/GHC.hs -@@ -111,13 +111,13 @@ module GHC ( - showModule, - isModuleInterpreted, - InteractiveEval.compileExpr, HValue, dynCompileExpr, -- lookupName, - GHC.obtainTermFromId, GHC.obtainTermFromVal, reconstructType, - modInfoModBreaks, - ModBreaks(..), BreakIndex, - BreakInfo(breakInfo_number, breakInfo_module), - BreakArray, setBreakOn, setBreakOff, getBreak, - #endif -+ lookupName, - - -- * Abstract syntax elements - -@@ -243,9 +243,9 @@ import Linker ( HValue ) - import ByteCodeInstr - import BreakArray - import InteractiveEval --import TcRnDriver - #endif - -+import TcRnDriver - import TcIface - import TcRnTypes hiding (LIE) - import TcRnMonad ( initIfaceCheck ) -@@ -2711,3 +2711,12 @@ obtainTermFromId bound force id = - liftIO $ InteractiveEval.obtainTermFromId hsc_env bound force id - - #endif -+ -+-- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any -+-- entity known to GHC, including 'Name's defined using 'runStmt'. -+lookupName :: GhcMonad m => Name -> m (Maybe TyThing) -+lookupName name = withSession $ \hsc_env -> do -+ mb_tything <- ioMsg $ tcRnLookupName hsc_env name -+ return mb_tything -+ -- XXX: calls panic in some circumstances; is that ok? -+ -diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs -index 352fbf0..3339313 100644 ---- a/compiler/main/InteractiveEval.hs -+++ b/compiler/main/InteractiveEval.hs -@@ -29,7 +29,6 @@ module InteractiveEval ( - showModule, - isModuleInterpreted, - compileExpr, dynCompileExpr, -- lookupName, - Term(..), obtainTermFromId, obtainTermFromVal, reconstructType, - skolemiseSubst, skolemiseTy - #endif -@@ -922,14 +921,6 @@ parseName str = withSession $ \hsc_env -> do - (L _ rdr_name) <- hscParseIdentifier (hsc_dflags hsc_env) str - ioMsgMaybe $ tcRnLookupRdrName hsc_env rdr_name - ---- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any ---- entity known to GHC, including 'Name's defined using 'runStmt'. --lookupName :: GhcMonad m => Name -> m (Maybe TyThing) --lookupName name = withSession $ \hsc_env -> do -- mb_tything <- ioMsg $ tcRnLookupName hsc_env name -- return mb_tything -- -- XXX: calls panic in some circumstances; is that ok? -- - -- ----------------------------------------------------------------------------- - -- Getting the type of an expression - -diff --git a/compiler/typecheck/TcRnDriver.lhs b/compiler/typecheck/TcRnDriver.lhs -index 323a167..342763d 100644 ---- a/compiler/typecheck/TcRnDriver.lhs -+++ b/compiler/typecheck/TcRnDriver.lhs -@@ -9,10 +9,10 @@ module TcRnDriver ( - #ifdef GHCI - tcRnStmt, tcRnExpr, tcRnType, - tcRnLookupRdrName, -- tcRnLookupName, -- tcRnGetInfo, - getModuleExports, - #endif -+ tcRnLookupName, -+ tcRnGetInfo, - tcRnModule, - tcTopSrcDecls, - tcRnExtCore -@@ -71,6 +71,7 @@ import Outputable - import DataCon - import Type - import Class -+import TcType - import Data.List ( sortBy ) - - #ifdef GHCI -@@ -83,7 +84,6 @@ import IfaceEnv - import MkId - import BasicTypes - import TidyPgm ( globaliseAndTidyId ) --import TcType ( isUnitTy, isTauTy, tyClsNamesOfDFunHead ) - import TysWiredIn ( unitTy, mkListTy ) - #endif - -@@ -1015,7 +1015,6 @@ get two defns for 'main' in the interface file! - %********************************************************* - - \begin{code} --#ifdef GHCI - setInteractiveContext :: HscEnv -> InteractiveContext -> TcRn a -> TcRn a - setInteractiveContext hsc_env icxt thing_inside - = let -- Initialise the tcg_inst_env with instances from all home modules. -@@ -1046,6 +1045,7 @@ setInteractiveContext hsc_env icxt thing_inside - - - \begin{code} -+#ifdef GHCI - tcRnStmt :: HscEnv - -> InteractiveContext - -> LStmt RdrName -@@ -1401,6 +1401,7 @@ lookup_rdr_name rdr_name = do { - - return good_names - } -+#endif - - tcRnLookupName :: HscEnv -> Name -> IO (Messages, Maybe TyThing) - tcRnLookupName hsc_env name -@@ -1421,8 +1422,8 @@ tcRnLookupName' name = do - _ -> panic "tcRnLookupName'" - - tcRnGetInfo :: HscEnv -- -> Name -- -> IO (Messages, Maybe (TyThing, Fixity, [Instance])) -+ -> Name -+ -> IO (Messages, Maybe (TyThing, Fixity, [Instance])) - - -- Used to implement :info in GHCi - -- -@@ -1432,8 +1433,14 @@ tcRnGetInfo :: HscEnv - -- *and* as a type or class constructor; - -- hence the call to dataTcOccs, and we return up to two results - tcRnGetInfo hsc_env name -- = initTcPrintErrors hsc_env iNTERACTIVE $ -- let ictxt = hsc_IC hsc_env in -+ = initTcPrintErrors hsc_env iNTERACTIVE $ -+ tcRnGetInfo' hsc_env name -+ -+tcRnGetInfo' :: HscEnv -+ -> Name -+ -> TcRn (TyThing, Fixity, [Instance]) -+tcRnGetInfo' hsc_env name -+ = let ictxt = hsc_IC hsc_env in - setInteractiveContext hsc_env ictxt $ do - - -- Load the interface for all unqualified types and classes -@@ -1482,7 +1489,6 @@ loadUnqualIfaces ictxt - isTcOcc (nameOccName name), -- Types and classes only - unQualOK gre ] -- In scope unqualified - doc = ptext (sLit "Need interface for module whose export(s) are in scope unqualified") --#endif /* GHCI */ - \end{code} - - %************************************************************************ - -commit 83d056a7e15e3253c446d896707d0b012f9cf8b3 -Author: Sergei Trofimovich <slyfox@gentoo.org> -Date: Sun Oct 3 22:30:53 2010 +0300 - - Sat Jul 31 02:50:01 EEST 2010 Ian Lynagh <igloo@earth.li> - - * Always haddock by default - Revert this patch: - Matthias Kilian <kili@outback.escape.de>**20090920181319 - Don't build haddock if HADDOC_DOCS = NO, and disable HADDOC_DOCS - if GhcWithInterpreter = NO - Haddock uses TcRnDriver.tcRnGetInfo, which is only available if - GHCI is built. Set HADDOC_DOCS to NO if GhcWithInterpreter is NO, - and disable the haddock build if HADDOC_DOCS = NO. ---- - ghc.mk | 2 -- - mk/config.mk.in | 2 +- - 2 files changed, 1 insertions(+), 3 deletions(-) - -diff --git a/ghc.mk b/ghc.mk -index 9193f46..1b5d1f9 100644 ---- a/ghc.mk -+++ b/ghc.mk -@@ -529,11 +529,9 @@ BUILD_DIRS += \ - $(GHC_GENAPPLY_DIR) - endif - --ifneq "$(HADDOCK_DOCS)" "NO" - BUILD_DIRS += \ - utils/haddock \ - utils/haddock/doc --endif - - ifneq "$(CLEANING)" "YES" - BUILD_DIRS += \ -diff --git a/mk/config.mk.in b/mk/config.mk.in -index 7399de0..55a9f19 100644 ---- a/mk/config.mk.in -+++ b/mk/config.mk.in -@@ -736,7 +736,7 @@ SRC_ALEX_OPTS = -g - HSTAGS = @HstagsCmd@ - - # Should we build haddock docs? --HADDOCK_DOCS = $(GhcWithInterpreter) -+HADDOCK_DOCS = YES - # And HsColour the sources? - ifeq "$(HSCOLOUR)" "" - HSCOLOUR_SRCS = NO diff --git a/dev-lang/ghc/files/ghc-6.12.3-ia64-fixed-relax.patch b/dev-lang/ghc/files/ghc-6.12.3-ia64-fixed-relax.patch deleted file mode 100644 index 37bfab110fd0..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-ia64-fixed-relax.patch +++ /dev/null @@ -1,35 +0,0 @@ -commit 7b45030b81fb0588b858400c051f9f7c10ef2760 -Author: Sergei Trofimovich <slyfox@gentoo.org> -Date: Tue Jul 6 11:39:18 2010 +0300 - - Fixing link failure of compiler on ia64 ('-Wl,' prefixed value passed directly to ld) - - /usr/bin/ld -Wl,--relax -r -o dist-stage1/build/HSghc-6.10.4.o \ - dist-stage1/build/BasicTypes.o dist-stage1/build/DataCon.o ... - /usr/bin/ld: unrecognized option '-Wl,--relax' - - If we just drop '-Wl,' part it will not help as '-r' and '--relax' are incompatible. - - Looks like '-Wl,--relax' was skipped by earlier binutils' ld as unknown option. - Removing ia64 specific path. - - Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> - -diff --git a/compiler/ghc.mk b/compiler/ghc.mk -index 6b25efa..29d3ade 100644 ---- a/compiler/ghc.mk -+++ b/compiler/ghc.mk -@@ -337,13 +337,6 @@ ifeq "$(TargetOS_CPP)" "openbsd" - compiler_CONFIGURE_OPTS += --ld-options=-E - endif - --ifeq "$(GhcUnregisterised)" "NO" --ifeq "$(HOSTPLATFORM)" "ia64-unknown-linux" --# needed for generating proper relocation in large binaries: trac #856 --compiler_CONFIGURE_OPTS += --ld-option=-Wl,--relax --endif --endif -- - # We need to turn on profiling either if we have been asked to - # (GhcLibProfiled = YES) or if we want GHC itself to be compiled with - # profiling enabled (GhcProfiled = YES). diff --git a/dev-lang/ghc/files/ghc-6.12.3-ia64-storage-manager-fix.patch b/dev-lang/ghc/files/ghc-6.12.3-ia64-storage-manager-fix.patch deleted file mode 100644 index 1458dcc7d8b6..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-ia64-storage-manager-fix.patch +++ /dev/null @@ -1,62 +0,0 @@ -storage manager: preserve upper address bits on 64bit machines (thanks to zygoloid) - -the issue: durin ia64 ghc bootstrap (both 6.10.4 and 6.12.3) I -got the failure on stage2 phase: - "inplace/bin/ghc-stage2" -H32m -O -H64m -O0 -w ... - ghc-stage2: internal error: evacuate: strange closure type 15 - (GHC version 6.12.3 for ia64_unknown_linux) - Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug - make[1]: *** [libraries/dph/dph-base/dist-install/build/Data/Array/Parallel/Base/Hyperstrict.o] Aborted - -I attached gdb and got backtrace: - -Breakpoint 1 at 0x400000000469ec31: file rts/RtsMessages.c, line 39. -(gdb) run -B/var/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/inplace/bin --info -Starting program: /var/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/inplace/lib/ghc-stage2 -B/var/tmp/portage/dev-lang/ghc-6.12.3/work/ghc-6.12.3/inplace/bin --info -[Thread debugging using libthread_db enabled] - -Breakpoint 1, barf (s=0x40000000047915b0 "evacuate: strange closure type %d") at rts/RtsMessages.c:39 -39 va_start(ap,s); -(gdb) bt -#0 barf (s=0x40000000047915b0 "evacuate: strange closure type %d") at rts/RtsMessages.c:39 -#1 0x400000000474a1e0 in evacuate (p=0x6000000000147958) at rts/sm/Evac.c:756 -#2 0x40000000046d68c0 in scavenge_srt (srt=0x6000000000147958, srt_bitmap=7) at rts/sm/Scav.c:348 -... - -> 16:52:53 < zygoloid> slyfox: i'm no ghc expert but it looks like HEAP_ALLOCED_GC(q) -> is returning true for a FUN_STATIC closure -> 17:18:43 < zygoloid> try: p HEAP_ALLOCED_miss((unsigned long)(*p) >> 20, *p) -> 17:19:12 < slyfox> (gdb) p HEAP_ALLOCED_miss((unsigned long)(*p) >> 20, *p) -> 17:19:12 < slyfox> $1 = 0 -> 17:19:40 < zygoloid> i /think/ that means the mblock_cache is broken -> 17:22:45 < zygoloid> i can't help further. however i am suspicious that you seem to have pointers with similar-looking low 33 -> bits and different high 4 bits, and it looks like such pointers get put into the same bucket in -> mblock_cache. -... -> 17:36:16 < zygoloid> slyfox: try changing the definition of MbcCacheLine to StgWord64, see if that helps -> 17:36:31 < zygoloid> that's in includes/rts/storage/MBlock.h -And it helped! - -diff --git a/includes/rts/storage/MBlock.h b/includes/rts/storage/MBlock.h -index 0943d4c..a113498 100644 ---- a/includes/rts/storage/MBlock.h -+++ b/includes/rts/storage/MBlock.h -@@ -126,7 +126,17 @@ extern StgWord8 mblock_map[]; - - #define MBC_LINE_BITS 0 - #define MBC_TAG_BITS 15 --typedef StgWord32 MbcCacheLine; // could use 16, but 32 was faster -+ -+#if x86_64_HOST_ARCH -+// 32bits are enough for 'entry' as modern amd64 boxes have -+// only 48bit sized virtual addres. -+typedef StgWord32 MbcCacheLine; -+#else -+// 32bits is not enough here as some arches (like ia64) use -+// upper address bits to distinct memory areas. -+typedef StgWord64 MbcCacheLine; -+#endif -+ - typedef StgWord8 MBlockMapLine; - - #define MBLOCK_MAP_LINE(p) (((StgWord)p & 0xffffffff) >> (MBLOCK_SHIFT + MBC_LINE_BITS)) diff --git a/dev-lang/ghc/files/ghc-6.12.3-ia64-use-libffi-for-foreign-import-wrapper.patch b/dev-lang/ghc/files/ghc-6.12.3-ia64-use-libffi-for-foreign-import-wrapper.patch deleted file mode 100644 index 5eb68348b07b..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-ia64-use-libffi-for-foreign-import-wrapper.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -rN -u old-ghc/mk/config.mk.in new-ghc/mk/config.mk.in ---- old-ghc/mk/config.mk.in 2010-07-10 00:22:07.583742895 +0300 -+++ new-ghc/mk/config.mk.in 2010-07-10 00:22:08.049743314 +0300 -@@ -177,7 +177,7 @@ - # Whether to use libffi for adjustors (foreign import "wrapper") or - # not. If we have built-in support (rts/Adjustor.c) then we use that, - # otherwise we fall back on libffi, which is slightly slower. --ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 powerpc ia64,),YES,NO)) -+ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 powerpc,),YES,NO)) - ifeq "$(ArchHasAdjustorSupport)" "YES" - UseLibFFIForAdjustors=NO - else diff --git a/dev-lang/ghc/files/ghc-6.12.3-libffi-incorrect-detection-of-selinux.patch b/dev-lang/ghc/files/ghc-6.12.3-libffi-incorrect-detection-of-selinux.patch deleted file mode 100644 index 9d839fc7b3e3..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-libffi-incorrect-detection-of-selinux.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 6d011f0865dc99d9306b5768ccd1eaa0355d994e Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich <slyfox@gentoo.org> -Date: Sat, 5 Feb 2011 11:53:33 +0200 -Subject: [PATCH] libffi: backport incorrect detection of selinux - -This patch unbreaks ghci on GRSEC kernels hardened with -TPE (Trusted Path Execution) protection. - -TPE forbids mmap('rwx') files opened for writes: - fd = open (a_file_in_tmp, O_RDWR); - mmap (..., PROT_READ | PROT_WRITE | PROT_EXEC, fd); - -while allows anonymous RWX mappings: - mmap (...MAP_ANONYMOUS , PROT_READ | PROT_WRITE | PROT_EXEC, -1); - -Thanks to klondike for finding it out. - -Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> ---- - libffi/ghc.mk | 2 ++ - libffi/libffi.selinux-detection-3.0.8.patch | 15 +++++++++++++++ - 2 files changed, 17 insertions(+), 0 deletions(-) - create mode 100644 libffi/libffi.selinux-detection-3.0.8.patch - -diff --git a/libffi/ghc.mk b/libffi/ghc.mk -index 1b1b118..a40f23c 100644 ---- a/libffi/ghc.mk -+++ b/libffi/ghc.mk -@@ -117,6 +117,8 @@ $(libffi_STAMP_CONFIGURE): - # This patch is just the resulting delta from running - # automake && autoreconf && libtoolize --force --copy - cd libffi/build && "$(PATCH)" -p1 < ../libffi.autotools-update-3.0.8.patch -+ # don't report nonselinux systems as selinux -+ cd libffi/build && "$(PATCH)" -p0 < ../libffi.selinux-detection-3.0.8.patch - - # Because -Werror may be in SRC_CC_OPTS/SRC_LD_OPTS, we need to turn - # warnings off or the compilation of libffi might fail due to warnings -diff --git a/libffi/libffi.selinux-detection-3.0.8.patch b/libffi/libffi.selinux-detection-3.0.8.patch -new file mode 100644 -index 0000000..a919f28 ---- /dev/null -+++ b/libffi/libffi.selinux-detection-3.0.8.patch -@@ -0,0 +1,15 @@ -+src/closures.c (selinux_enabled_check): Fix strncmp usage bug. -+ -+http://github.com/atgreen/libffi/commit/eaf444eabc4c78703c0f98ac0197b1619c1b1bef -+ -+--- src/closures.c -++++ src/closures.c -+@@ -146,7 +146,7 @@ -+ p = strchr (p + 1, ' '); -+ if (p == NULL) -+ break; -+- if (strncmp (p + 1, "selinuxfs ", 10) != 0) -++ if (strncmp (p + 1, "selinuxfs ", 10) == 0) -+ { -+ free (buf); -+ fclose (f); --- -1.7.3.4 - diff --git a/dev-lang/ghc/files/ghc-6.12.3-mach-o-relocation-limit.patch b/dev-lang/ghc/files/ghc-6.12.3-mach-o-relocation-limit.patch deleted file mode 100644 index 93752ea76f7e..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-mach-o-relocation-limit.patch +++ /dev/null @@ -1,34 +0,0 @@ -http://hackage.haskell.org/trac/ghc/attachment/ticket/3260/mach-o-relocation-limit.patch - -Sat May 8 23:24:11 JST 2010 pho@cielonegro.org - * Work around for Mach-O relocation limit - - Mach-O has a limitation on the length of relocation addresses. No - segments can be larger than 2^24 - 1 bytes (approx 16 MiB; See - /usr/include/mach-o/reloc.h). Static GHCi libraries are merged large - objects so they tend to exceed this limit. - ---- rules/build-package-way.mk -+++ rules/build-package-way.mk -@@ -83,8 +83,21 @@ - ifneq "$4" "0" - BINDIST_LIBS += $$($1_$2_GHCI_LIB) - endif -+ -+ifeq "$$(darwin_HOST_OS)" "1" -+# Mach-O has a limitation on the length of relocation addresses. No -+# segments can be larger than 2^24 - 1 bytes (approx 16 MiB; See -+# /usr/include/mach-o/reloc.h). Static GHCi libraries are merged large -+# objects so they tend to exceed this limit. -+$$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) -+ "$$(LD)" -r -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` $$($1_$2_EXTRA_OBJS) \ -+ || ( echo "Warning: creating dummy $$@" && \ -+ touch empty.c && \ -+ "$(CC)" $(SRC_CC_OPTS) $(CONF_CC_OPTS) -c empty.c -o $$@ ) -+else - $$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) - "$$(LD)" -r -o $$@ $$(EXTRA_LD_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` $$($1_$2_EXTRA_OBJS) -+endif - - $(call all-target,$1_$2,$$($1_$2_GHCI_LIB)) - endif diff --git a/dev-lang/ghc/files/ghc-6.12.3-pic-powerpc.patch b/dev-lang/ghc/files/ghc-6.12.3-pic-powerpc.patch deleted file mode 100644 index e71109920820..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-pic-powerpc.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 1414e10a1470061e850b7ce2aa6350a428ade2e9 Mon Sep 17 00:00:00 2001 -From: pho@cielonegro.org <unknown> -Date: Sat, 8 May 2010 14:39:00 +0000 -Subject: [PATCH] PIC support for PowerPC - -PPC.CodeGen.getRegister was not properly handling PicBaseReg. -It seems working with this patch, but I'm not sure this change is correct. ---- - compiler/nativeGen/PPC/CodeGen.hs | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - -diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs -index 1215b2e..a1b55ce 100644 ---- a/compiler/nativeGen/PPC/CodeGen.hs -+++ b/compiler/nativeGen/PPC/CodeGen.hs -@@ -377,6 +377,11 @@ iselExpr64 expr - - getRegister :: CmmExpr -> NatM Register - -+getRegister (CmmReg (CmmGlobal PicBaseReg)) -+ = do -+ reg <- getPicBaseNat archWordSize -+ return (Fixed archWordSize reg nilOL) -+ - getRegister (CmmReg reg) - = return (Fixed (cmmTypeSize (cmmRegType reg)) - (getRegisterReg reg) nilOL) --- -1.7.4.1 - diff --git a/dev-lang/ghc/files/ghc-6.12.3-powerpc-darwin-no-mmap.patch b/dev-lang/ghc/files/ghc-6.12.3-powerpc-darwin-no-mmap.patch deleted file mode 100644 index a438c0d57b90..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-powerpc-darwin-no-mmap.patch +++ /dev/null @@ -1,37 +0,0 @@ -Tue Nov 30 06:30:14 PST 2010 pho@cielonegro.org - * FIX #1845 (unconditional relative branch out of range) - - Don't use mmap on powerpc-apple-darwin as mmap doesn't support - reallocating but we need to allocate jump islands just after each - object images. Otherwise relative branches to jump islands can fail - due to 24-bits displacement overflow. -diff -rN -u old-ghc/rts/Linker.c new-ghc/rts/Linker.c ---- old-ghc/rts/Linker.c 2011-04-19 01:37:03.000000000 -0700 -+++ new-ghc/rts/Linker.c 2011-04-19 01:37:04.000000000 -0700 -@@ -69,7 +69,15 @@ - #include <sys/wait.h> - #endif - --#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(darwin_HOST_OS) -+#if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \ -+ defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \ -+ defined(openbsd_HOST_OS ) || \ -+ ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) ) -+/* Don't use mmap on powerpc-apple-darwin as mmap doesn't support -+ * reallocating but we need to allocate jump islands just after each -+ * object images. Otherwise relative branches to jump islands can fail -+ * due to 24-bits displacement overflow. -+ */ - #define USE_MMAP - #include <fcntl.h> - #include <sys/mman.h> -@@ -1841,6 +1849,9 @@ - int fd; - #else - FILE *f; -+# if defined(darwin_HOST_OS) -+ int misalignment; -+# endif - #endif - IF_DEBUG(linker, debugBelch("loadObj %s\n", path)); - diff --git a/dev-lang/ghc/files/ghc-6.12.3-ppc-use-libffi-for-foreign-import-wrapper.patch b/dev-lang/ghc/files/ghc-6.12.3-ppc-use-libffi-for-foreign-import-wrapper.patch deleted file mode 100644 index bd712e3b5563..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-ppc-use-libffi-for-foreign-import-wrapper.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/mk/config.mk.in b/mk/config.mk.in -index 3fcc0f0..496a6f7 100644 ---- a/mk/config.mk.in -+++ b/mk/config.mk.in -@@ -176,7 +176,7 @@ endif - # Whether to use libffi for adjustors (foreign import "wrapper") or - # not. If we have built-in support (rts/Adjustor.c) then we use that, - # otherwise we fall back on libffi, which is slightly slower. --ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 powerpc,),YES,NO)) -+ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64,),YES,NO)) - ifeq "$(ArchHasAdjustorSupport)" "YES" - UseLibFFIForAdjustors=NO - else diff --git a/dev-lang/ghc/files/ghc-6.12.3-ticket-2615-linker-script.patch b/dev-lang/ghc/files/ghc-6.12.3-ticket-2615-linker-script.patch deleted file mode 100644 index 96fdcb6a8091..000000000000 --- a/dev-lang/ghc/files/ghc-6.12.3-ticket-2615-linker-script.patch +++ /dev/null @@ -1,278 +0,0 @@ -Wed Dec 16 19:51:55 CET 2009 howard_b_golden@yahoo.com - * FIX #2615 (linker scripts in .so files) - This patch does not apply to Windows. It only applies to systems with - ELF binaries. - - This is a patch to rts/Linker.c to recognize linker scripts in .so - files and find the real target .so shared library for loading. -diff -rN -u old-ghc/rts/Linker.c new-ghc/rts/Linker.c ---- old-ghc/rts/Linker.c 2010-07-28 22:59:33.532759118 +0200 -+++ new-ghc/rts/Linker.c 2010-07-28 22:59:34.853759052 +0200 -@@ -39,6 +39,8 @@ - - #include <stdlib.h> - #include <string.h> -+#include <stdio.h> -+#include <assert.h> - - #ifdef HAVE_SYS_STAT_H - #include <sys/stat.h> -@@ -79,6 +81,8 @@ - - #if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) - # define OBJFORMAT_ELF -+# include <regex.h> // regex is already used by dlopen() so this is OK -+ // to use here without requiring an additional lib - #elif defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS) - # define OBJFORMAT_PEi386 - # include <windows.h> -@@ -1095,12 +1099,19 @@ - - #if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO) - static void *dl_prog_handle; -+static regex_t re_invalid; -+static regex_t re_realso; -+static void initLinkerCleanup( void ); -+#ifdef THREADED_RTS -+static Mutex dl_mutex; // mutex to protect dlopen/dlerror critical section -+#endif - #endif - - void - initLinker( void ) - { - RtsSymbolVal *sym; -+ int compileResult; - - /* Make initLinker idempotent, so we can call it - before evey relevant operation; that means we -@@ -1109,6 +1120,9 @@ - linker_init_done = 1; - } - -+#ifdef THREADED_RTS -+ initMutex(&dl_mutex); -+#endif - stablehash = allocStrHashTable(); - symhash = allocStrHashTable(); - -@@ -1127,6 +1141,15 @@ - # else - dl_prog_handle = dlopen(NULL, RTLD_LAZY); - # endif /* RTLD_DEFAULT */ -+ -+ compileResult = regcomp(&re_invalid, -+ "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*invalid ELF header", -+ REG_EXTENDED); -+ ASSERT( compileResult == 0 ); -+ compileResult = regcomp(&re_realso, -+ "GROUP *\\( *(([^ )])+)", -+ REG_EXTENDED); -+ ASSERT( compileResult == 0 ); - # endif - - #if defined(x86_64_HOST_ARCH) -@@ -1147,6 +1170,19 @@ - #endif - } - -+void -+exitLinker( void ) { -+#if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO) -+ if (linker_init_done == 1) { -+ regfree(&re_invalid); -+ regfree(&re_realso); -+#ifdef THREADED_RTS -+ closeMutex(&dl_mutex); -+#endif -+ } -+#endif -+} -+ - /* ----------------------------------------------------------------------------- - * Loading DLL or .so dynamic libraries - * ----------------------------------------------------------------------------- -@@ -1182,29 +1218,112 @@ - static OpenedDLL* opened_dlls = NULL; - #endif - --const char * --addDLL( char *dll_name ) --{ - # if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO) -- /* ------------------- ELF DLL loader ------------------- */ -- void *hdl; -- const char *errmsg; - -- initLinker(); -+static char * -+internal_dlopen(const char *dll_name) -+{ -+ void *hdl; -+ char *errmsg, *errmsg_copy; - - // omitted: RTLD_NOW - // see http://www.haskell.org/pipermail/cvs-ghc/2007-September/038570.html -- hdl= dlopen(dll_name, RTLD_LAZY | RTLD_GLOBAL); -+ IF_DEBUG(linker, -+ debugBelch("internal_dlopen: dll_name = '%s'\n", dll_name)); - -+ //-------------- Begin critical section ------------------ -+ // This critical section is necessary because dlerror() is not -+ // required to be reentrant (see POSIX -- IEEE Std 1003.1-2008) -+ // Also, the error message returned must be copied to preserve it -+ // (see POSIX also) -+ -+ ACQUIRE_LOCK(&dl_mutex); -+ hdl = dlopen(dll_name, RTLD_LAZY | RTLD_GLOBAL); -+ -+ errmsg = NULL; - if (hdl == NULL) { - /* dlopen failed; return a ptr to the error msg. */ - errmsg = dlerror(); - if (errmsg == NULL) errmsg = "addDLL: unknown error"; -- return errmsg; -- } else { -+ errmsg_copy = stgMallocBytes(strlen(errmsg)+1, "addDLL"); -+ strcpy(errmsg_copy, errmsg); -+ errmsg = errmsg_copy; -+ } -+ RELEASE_LOCK(&dl_mutex); -+ //--------------- End critical section ------------------- -+ -+ return errmsg; -+} -+# endif -+ -+const char * -+addDLL( char *dll_name ) -+{ -+# if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO) -+ /* ------------------- ELF DLL loader ------------------- */ -+ -+#define NMATCH 5 -+ regmatch_t match[NMATCH]; -+ char *errmsg; -+ FILE* fp; -+ size_t match_length; -+#define MAXLINE 1000 -+ char line[MAXLINE]; -+ int result; -+ -+ initLinker(); -+ -+ IF_DEBUG(linker, debugBelch("addDLL: dll_name = '%s'\n", dll_name)); -+ errmsg = internal_dlopen(dll_name); -+ -+ if (errmsg == NULL) { - return NULL; - } -- /*NOTREACHED*/ -+ -+ // GHC Trac ticket #2615 -+ // On some systems (e.g., Gentoo Linux) dynamic files (e.g. libc.so) -+ // contain linker scripts rather than ELF-format object code. This -+ // code handles the situation by recognizing the real object code -+ // file name given in the linker script. -+ // -+ // If an "invalid ELF header" error occurs, it is assumed that the -+ // .so file contains a linker script instead of ELF object code. -+ // In this case, the code looks for the GROUP ( ... ) linker -+ // directive. If one is found, the first file name inside the -+ // parentheses is treated as the name of a dynamic library and the -+ // code attempts to dlopen that file. If this is also unsuccessful, -+ // an error message is returned. -+ -+ // see if the error message is due to an invalid ELF header -+ IF_DEBUG(linker, debugBelch("errmsg = '%s'\n", errmsg)); -+ result = regexec(&re_invalid, errmsg, (size_t) NMATCH, match, 0); -+ IF_DEBUG(linker, debugBelch("result = %i\n", result)); -+ if (result == 0) { -+ // success -- try to read the named file as a linker script -+ match_length = (size_t) stg_min((match[1].rm_eo - match[1].rm_so), -+ MAXLINE-1); -+ strncpy(line, (errmsg+(match[1].rm_so)),match_length); -+ line[match_length] = '\0'; // make sure string is null-terminated -+ IF_DEBUG(linker, debugBelch ("file name = '%s'\n", line)); -+ if ((fp = fopen(line, "r")) == NULL) { -+ return errmsg; // return original error if open fails -+ } -+ // try to find a GROUP ( ... ) command -+ while (fgets(line, MAXLINE, fp) != NULL) { -+ IF_DEBUG(linker, debugBelch("input line = %s", line)); -+ if (regexec(&re_realso, line, (size_t) NMATCH, match, 0) == 0) { -+ // success -- try to dlopen the first named file -+ IF_DEBUG(linker, debugBelch("match%s\n","")); -+ line[match[1].rm_eo] = '\0'; -+ errmsg = internal_dlopen(line+match[1].rm_so); -+ break; -+ } -+ // if control reaches here, no GROUP ( ... ) directive was found -+ // and the original error message is returned to the caller -+ } -+ fclose(fp); -+ } -+ return errmsg; - - # elif defined(OBJFORMAT_PEi386) - /* ------------------- Win32 DLL loader ------------------- */ -@@ -4195,7 +4314,7 @@ - i++; - } - #endif -- else -+ else - { - barf ("Don't know how to handle this Mach-O " - "scattered relocation entry: " -@@ -4204,7 +4323,7 @@ - oc->fileName, scat->r_type, scat->r_address); - return 0; - } -- -+ - #ifdef powerpc_HOST_ARCH - if(scat->r_type == GENERIC_RELOC_VANILLA - || scat->r_type == PPC_RELOC_SECTDIFF) -@@ -4250,8 +4369,8 @@ - "object file %s; entry type %ld; address %#lx\n", - oc->fileName, scat->r_type, scat->r_address); - return 0; -- } -- -+ } -+ - } - else /* !(relocs[i].r_address & R_SCATTERED) */ - { -diff -rN -u old-ghc/rts/LinkerInternals.h new-ghc/rts/LinkerInternals.h ---- old-ghc/rts/LinkerInternals.h 2010-07-28 22:59:33.532759118 +0200 -+++ new-ghc/rts/LinkerInternals.h 2010-07-28 22:59:34.854758341 +0200 -@@ -109,4 +109,6 @@ - - extern ObjectCode *objects; - -+void exitLinker( void ); -+ - #endif /* LINKERINTERNALS_H */ -diff -rN -u old-ghc/rts/RtsStartup.c new-ghc/rts/RtsStartup.c ---- old-ghc/rts/RtsStartup.c 2010-07-28 22:59:33.537758009 +0200 -+++ new-ghc/rts/RtsStartup.c 2010-07-28 22:59:34.859758558 +0200 -@@ -34,6 +34,7 @@ - #include "Profiling.h" - #include "Timer.h" - #include "Globals.h" -+void exitLinker( void ); // there is no Linker.h file to include - - #if defined(RTS_GTK_FRONTPANEL) - #include "FrontPanel.h" -@@ -388,6 +389,9 @@ - /* free shared Typeable store */ - exitGlobalStore(); - -+ /* free linker data */ -+ exitLinker(); -+ - /* free file locking tables, if necessary */ - #if !defined(mingw32_HOST_OS) - freeFileLocking(); diff --git a/dev-lang/ghc/files/ghc-7.0.2-CHOST.patch b/dev-lang/ghc/files/ghc-7.0.2-CHOST.patch deleted file mode 100644 index 7479149a9efa..000000000000 --- a/dev-lang/ghc/files/ghc-7.0.2-CHOST.patch +++ /dev/null @@ -1,89 +0,0 @@ -Tue Mar 1 08:41:08 EET 2011 Sergei Trofimovich <slyfox@community.haskell.org> - * configure: triplet: accept i486 CPU (and more), more vendors and OSes - - Gentoo has interesting ports: - - - freebsd with following triplet: - ./configure --build=i686-gentoo-freebsd8 --host=i686-gentoo-freebsd8 --host=i686-gentoo-freebsd8 - should be recognized as 'i386-unknown-freebsd' - - 'pc' vendor along with non-'i386' is very common: - ./configure --build=i486-pc-linux-gnu --i486-pc-linux-gnu --host=i486-pc-linux-gnu - ./configure --build=i686-pc-linux-gnu --i686-pc-linux-gnu --host=i686-pc-linux-gnu - should be recognized as 'i386-unknown-linux' - - Patch adds: - - - 'pc' vendor (maps to 'unknown') - - 'gentoo' vendor (maps to 'unknown') - - 'i486', 'i586', 'i686' CPUs (maps to 'i386') - - 'freebsd8' OS (maps to 'freebsd') -diff -rN -u old-ghc/aclocal.m4 new-ghc/aclocal.m4 ---- old-ghc/aclocal.m4 2011-03-04 13:26:18.512776569 +0200 -+++ new-ghc/aclocal.m4 2011-03-04 13:26:18.606776569 +0200 -@@ -1458,7 +1458,7 @@ - hppa*) - $2="hppa" - ;; -- i386) -+ i386|i486|i586|i686) - $2="i386" - ;; - ia64) -@@ -1511,7 +1511,15 @@ - # -------------------------------- - # converts vendor from gnu to ghc naming, and assigns the result to $target_var - AC_DEFUN([GHC_CONVERT_VENDOR],[ --$2="$1" -+ case "$1" in -+ pc|gentoo) # like i686-pc-linux-gnu and i686-gentoo-freebsd8 -+ $2="unknown" -+ ;; -+ *) -+ #pass thru by default -+ $2="$1" -+ ;; -+ esac - ]) - - # GHC_CONVERT_OS(os, target_var) -@@ -1526,6 +1534,9 @@ - freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku) - $2="$1" - ;; -+ freebsd8) # like i686-gentoo-freebsd8 -+ $2="freebsd" -+ ;; - *) - echo "Unknown OS $1" - exit 1 -Tue Mar 1 21:40:18 EET 2011 Sergei Trofimovich <slyfox@community.haskell.org> - * configure: amend sanity check - - As we perform some mangling of original --build/--host/--target - params we should check the result of mangling against desired triplet, - not originally passed by user. - - Patch also adds mangled triplets to the output. -diff -rN -u old-ghc/configure.ac new-ghc/configure.ac ---- old-ghc/configure.ac 2011-03-04 13:26:20.005776569 +0200 -+++ new-ghc/configure.ac 2011-03-04 13:26:20.319776569 +0200 -@@ -288,7 +288,7 @@ - - # Verify that the installed (bootstrap) GHC is capable of generating - # code for the requested build platform. --if test "$build" != "$bootstrap_target" -+if test "$BuildPlatform" != "$bootstrap_target" - then - echo "This GHC (${WithGhc}) does not generate code for the build platform" - echo " GHC target platform : $bootstrap_target" -@@ -296,6 +296,10 @@ - exit 1 - fi - -+echo "GHC build : $BuildPlatform" -+echo "GHC host : $HostPlatform" -+echo "GHC target : $TargetPlatform" -+ - AC_SUBST(BuildPlatform) - AC_SUBST(HostPlatform) - AC_SUBST(TargetPlatform) diff --git a/dev-lang/ghc/files/ghc-7.0.4-CHOST-softfloat.patch b/dev-lang/ghc/files/ghc-7.0.4-CHOST-softfloat.patch deleted file mode 100644 index 7b726d2f2116..000000000000 --- a/dev-lang/ghc/files/ghc-7.0.4-CHOST-softfloat.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/aclocal.m4 b/aclocal.m4 -index b10eeec..13988fe 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -1487,6 +1487,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[ - pc|gentoo) # like i686-pc-linux-gnu and i686-gentoo-freebsd8 - $2="unknown" - ;; -+ softfloat) # like armv5tel-softfloat-linux-gnueabi -+ $2="unknown" -+ ;; - *) - #pass thru by default - $2="$1" diff --git a/dev-lang/ghc/files/ghc-7.0.4-fix-ppc-linker.patch b/dev-lang/ghc/files/ghc-7.0.4-fix-ppc-linker.patch deleted file mode 100644 index 42caa7f7db88..000000000000 --- a/dev-lang/ghc/files/ghc-7.0.4-fix-ppc-linker.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit 243c304273a1254418aeacf4d81cadb2d59945ad -Author: Erik de Castro Lopo <erikd@mega-nerd.com> -Date: Mon Apr 4 22:40:15 2011 +1000 - - Fix compiling on linux-powerpc. - -diff --git a/rts/Linker.c b/rts/Linker.c -index 5285ec6..c840857 100644 ---- a/rts/Linker.c -+++ b/rts/Linker.c -@@ -2572,7 +2572,11 @@ static void - ocFlushInstructionCache( ObjectCode *oc ) - { - /* The main object code */ -- ocFlushInstructionCacheFrom(oc->image + oc->misalignment, oc->fileSize); -+ ocFlushInstructionCacheFrom(oc->image -+#ifdef darwin_HOST_OS -+ + oc->misalignment -+#endif -+ , oc->fileSize); - - /* Jump Islands */ - ocFlushInstructionCacheFrom(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras); diff --git a/dev-lang/ghc/files/ghc-7.0.4-nxstack.patch b/dev-lang/ghc/files/ghc-7.0.4-nxstack.patch deleted file mode 100644 index 791e8defb90a..000000000000 --- a/dev-lang/ghc/files/ghc-7.0.4-nxstack.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 25bf3687361501e711d50a8038f0f8de4a2d2aa3 Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich <slyfox@gentoo.org> -Date: Wed, 10 Aug 2011 11:01:26 +0300 -Subject: [PATCH] Mark stack of 'rts/AdjustorAsm.S' as nonexecutable on linux - -Gentoo's scanelf program found executable stack in many resulting binaries: -* RWX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/ghc -* !WX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/libHSrts.a:AdjustorAsm.o - -More info can be found here: http://www.gentoo.org/proj/en/hardened/gnu-stack.xml - -Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> ---- - rts/AdjustorAsm.S | 4 ++++ - 1 files changed, 4 insertions(+), 0 deletions(-) - -diff --git a/rts/AdjustorAsm.S b/rts/AdjustorAsm.S -index 75b83f6..8045bfe 100644 ---- a/rts/AdjustorAsm.S -+++ b/rts/AdjustorAsm.S -@@ -192,3 +192,7 @@ adjustorCode: - ret - #endif - -+/* mark stack as nonexecutable */ -+#if defined(__linux__) && defined(__ELF__) -+.section .note.GNU-stack,"",@progbits -+#endif --- -1.7.3.4 - diff --git a/dev-lang/ghc/files/ghc-apply-gmp-hack b/dev-lang/ghc/files/ghc-apply-gmp-hack deleted file mode 100644 index 32a3a8f1f7cf..000000000000 --- a/dev-lang/ghc/files/ghc-apply-gmp-hack +++ /dev/null @@ -1,60 +0,0 @@ -# This script is expected to be sourced by ghc ebuilds built against libgmp.so.3 library -# -# What it does and why it works: -# > GMP 5.0 is upwardly source and binary compatible with 4.x, and 3.x versions, -# > except for applications that use the semi-documented mpn_bdivmod function. -# -# > The solib numbers now reflect the removal of the documented but preliminary -# > mpn_bdivmod function; we correctly flag incompatibility with GMP 4.3. -# > GMP 5.0.0 has this wrong, and should perhaps be uninstalled to avoid confusion. -# -# taken from http://gmplib.org/gmp5.0.html -# -# Luckily, ghc does not use the 'mpn_bdivmod' function, so we can easily use -# libgmp.so.10 for binaries which require libgmp.so.3 -# -# So, this script checks whether this system has libgmp.so.10 and if has -# shows it to bootstrapper-compiler via populating LD_LIBRARY_PATH -# (it actually exports function doing this) -# -# After bootstrapping resulting compiler will not depend on old libgmp -# Newer ghc binaries must be built against newer gmp -# -# Blames should be directed to Sergei Trofimovich <slyfox@gentoo.org> - -# should be used as: -# > inherit multilib -# > ... -# > # somewhere in src_unpack() { # as early as possible, right after unpacking source/binary -# > source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - -local libdir_name=$1 -# let's see if we are in affected system -if has_version '>=dev-libs/gmp-5.0.1'; then - has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" - local libgmpso3=${EROOT}/usr/$libdir_name/libgmp.so.3 - local libgmpso10=${EROOT}/usr/$libdir_name/libgmp.so.10 - - # bother user only if things won't work for him - if [[ ! -e "$libgmpso3" ]]; then - if use binary; then - eerror "You have requested precompiled binary installation, which is" - eerror "built against 'libgmp.so.3'. You can create compatibility symlink" - eerror "if you have '$libgmpso10' and wish to use installed binary:" - eerror " # ln -s libgmp.so.10 '$libgmpso3'" - die "libgmp.so.3 not found" - else - if [[ -e "$libgmpso10" ]]; then - local fake_solib_dir=${S}/fake_solibs - mkdir "$fake_solib_dir" || die "failed to make fake lib dir" - elog "Enabling libgmp hack:" - elog "| Making symlink: '$fake_solib_dir/libgmp.so.3' -> '$libgmpso10'" - ln -s "$libgmpso10" "$fake_solib_dir/libgmp.so.3" || die "failed to make fake symlink" - export LD_LIBRARY_PATH=$fake_solib_dir${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH - elog "| setting new LD_LIBRARY_PATH='$LD_LIBRARY_PATH'" - else - eerror "'$libgmpso3' and '$libgmpso10' are not found. Please, report the breakage." - fi - fi - fi -fi diff --git a/dev-lang/ghc/ghc-6.12.3-r2.ebuild b/dev-lang/ghc/ghc-6.12.3-r2.ebuild deleted file mode 100644 index cf09071523d0..000000000000 --- a/dev-lang/ghc/ghc-6.12.3-r2.ebuild +++ /dev/null @@ -1,579 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.12.3-r2.ebuild,v 1.11 2014/09/07 06:29:23 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. - -EAPI="3" - -inherit base autotools bash-completion eutils flag-o-matic multilib toolchain-funcs ghc-package versionator pax-utils - -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="http://www.haskell.org/ghc/" - -arch_binaries="" - -arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha-haddock.tbz2 )" -arch_binaries="$arch_binaries x86? ( mirror://gentoo/ghc-bin-${PV}-x86.tbz2 )" -arch_binaries="$arch_binaries amd64? ( mirror://gentoo/ghc-bin-${PV}-amd64.tbz2 )" -arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-haddock.tbz2 )" -arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries ppc64? ( mirror://gentoo/ghc-bin-${PV}-ppc64.tbz2 )" -arch_binaries="$arch_binaries ppc? ( mirror://gentoo/ghc-bin-${PV}-ppc.tbz2 )" - -# various ports: -arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# prefix ports: -arch_binaries="$arch_binaries x86-macos? ( http://www.haskell.org/ghc/dist/6.10.1/maeder/ghc-6.10.1-i386-apple-darwin.tar.bz2 )" -arch_binaries="$arch_binaries ppc-macos? ( http://www.haskell.org/ghc/dist/6.10.1/maeder/ghc-6.10.1-powerpc-apple-darwin.tar.bz2 )" -arch_binaries="$arch_binaries x86-solaris? ( http://www.haskell.org/ghc/dist/6.10.4/maeder/ghc-6.10.4-i386-unknown-solaris2.tar.bz2 )" -arch_binaries="$arch_binaries sparc-solaris? ( http://www.haskell.org/ghc/dist/6.10.4/maeder/ghc-6.10.4-sparc-sun-solaris2.tar.bz2 )" - -SRC_URI="!binary? ( http://darcs.haskell.org/download/dist/${PV}/${P}-src.tar.bz2 ) - !ghcbootstrap? ( $arch_binaries )" -LICENSE="BSD" -SLOT="0" -KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris" -IUSE="binary doc ghcbootstrap" - -RDEPEND=" - !dev-lang/ghc-bin - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 ) - kernel_linux? ( >=sys-devel/binutils-2.17 ) - kernel_SunOS? ( >=sys-devel/binutils-2.17 ) - >=dev-lang/perl-5.6.1 - >=dev-libs/gmp-4.1 - !<dev-haskell/haddock-2.4.2 - sys-libs/ncurses[unicode]" -# earlier versions than 2.4.2 of haddock only works with older ghc releases - -DEPEND="${RDEPEND} - ghcbootstrap? ( doc? ( ~app-text/docbook-xml-dtd-4.2 - app-text/docbook-xsl-stylesheets - >=dev-libs/libxslt-1.1.2 ) )" -# In the ghcbootstrap case we rely on the developer having -# >=ghc-5.04.3 on their $PATH already - -PDEPEND="!ghcbootstrap? ( || ( =app-admin/haskell-updater-1.2* =app-admin/haskell-updater-1.1* ) )" - -# use undocumented feature STRIP_MASK to fix this issue: -# http://hackage.haskell.org/trac/ghc/ticket/3580 -STRIP_MASK="*/HSffi.o" - -use binary && QA_PREBUILT="*" - -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 - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - 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 - - # prevent from failind building unregisterised ghc: - # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html - use ppc64 && append-ghc-cflags compile -mminimal-toc - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data - # currently ghc fails to build haddock - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html - use ia64 && append-ghc-cflags compile -G0 -} - -# substitutes string $1 to $2 in files $3 $4 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${PV}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${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.d/"* - - # this one we will use to regenerate cache - # so it shoult point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree - # TODO: add the same for darwin's CHOST and it's DYLD_ - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH' - sed -i -e '2i'"$new_ldpath" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "$gp_back" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - || die "Adding LD_LIBRARY_PATH for wrappers failed" - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -pkg_setup() { - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages 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}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - [[ ${CHOST} != *-darwin* ]] && \ - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - ghc_setup_cflags - - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then - # Modify the wrapper script from the binary tarball to use GHC_CFLAGS. - # See bug #313635. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_CFLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc" - fi - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-6.10.4-i386-unknown-solaris2.tar.bz2 - use ppc-macos && unpack ghc-6.10.1-powerpc-apple-darwin.tar.bz2 - use x86-macos && unpack ghc-6.10.1-i386-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-6.10.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - # http://hackage.haskell.org/trac/ghc/ticket/2942 - pushd utils/haddock/dist-install/build > /dev/null - ln -s Haddock haddock >& /dev/null # fails on IN-sensitive - popd > /dev/null - - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.3.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # much arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_CFLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was - # compiled with, by saving the path to it. The purpose is to make sure - # that GHC will use the very same gcc version when it compiles haskell - # sources, as the extra-gcc-opts files contains extra gcc options which - # match only this GCC version. - # However, this is not required in Gentoo, as only modern GCCs are used - # (>4). - # Instead, this causes trouble when for example ccache is used during - # compilation, but we don't want the wrappers to point to ccache. - # Due to the above, we simply remove GCC from the wrappers, which forces - # GHC to use GCC from the users path, like previous GHC versions did. - - # Remove path to gcc - sed -i -e '/pgmgcc/d' \ - "${S}/rules/shell-wrapper.mk" - - # Remove usage of the path to gcc - sed -i -e 's/-pgmc "$pgmgcc"//' \ - "${S}/ghc/ghc.wrapper" - - cd "${S}" # otherwise epatch will break - - epatch "${FILESDIR}/ghc-6.12.1-configure-CHOST.patch" - epatch "${FILESDIR}/ghc-6.12.2-configure-CHOST-part2.patch" - epatch "${FILESDIR}/ghc-6.12.3-configure-CHOST-freebsd.patch" - epatch "${FILESDIR}/ghc-6.12.3-configure-CHOST-prefix.patch" - - # -r and --relax are incompatible - epatch "${FILESDIR}/ghc-6.12.3-ia64-fixed-relax.patch" - - # prevent from wiping upper address bits used in cache lookup - epatch "${FILESDIR}/ghc-6.12.3-ia64-storage-manager-fix.patch" - - # fixes build failure of adjustor code - epatch "${FILESDIR}/ghc-6.12.3-alpha-use-libffi-for-foreign-import-wrapper.patch" - - # native adjustor (NA) code is broken: interactive darcs-2.4 coredumps on NA - epatch "${FILESDIR}/ghc-6.12.3-ia64-use-libffi-for-foreign-import-wrapper.patch" - - # same with NA on ppc - epatch "${FILESDIR}/ghc-6.12.3-ppc-use-libffi-for-foreign-import-wrapper.patch" - - # substitute outdated macros - epatch "${FILESDIR}/ghc-6.12.3-autoconf-2.66-4252.patch" - - # ticket 2615, linker scripts - # breaks Darwin - [[ ${CHOST} != *-darwin* ]] && \ - epatch "${FILESDIR}/ghc-6.12.3-ticket-2615-linker-script.patch" - - # export typechecker internals even if ghci is disabled - # http://hackage.haskell.org/trac/ghc/ticket/3558 - epatch "${FILESDIR}/ghc-6.12.3-ghciless-haddock-3558.patch" - - # This patch unbreaks ghci on GRSEC kernels hardened with - # TPE (Trusted Path Execution) protection. - epatch "${FILESDIR}/ghc-6.12.3-libffi-incorrect-detection-of-selinux.patch" - - epatch "${FILESDIR}"/${P}-pic-powerpc.patch - epatch "${FILESDIR}"/${P}-darwin8.patch - epatch "${FILESDIR}"/${P}-mach-o-relocation-limit.patch - epatch "${FILESDIR}"/${P}-powerpc-darwin-no-mmap.patch - - if use prefix; then - # Make configure find docbook-xsl-stylesheets from Prefix - sed -i -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' configure.ac || die - fi - - # disable bitrot bfd support, bug #522268 - sed -i -e 's/^AC_CHECK_LIB(bfd, bfd_init)$/dnl &/' configure.ac || die - - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - if ! use binary; then - - # initialize build.mk - echo '# Gentoo changes' > mk/build.mk - - # Put docs into the right place, ie /usr/share/doc/ghc-${PV} - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - - # We also need to use the GHC_CFLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk - case $($(tc-getAS) -v 2>&1 </dev/null) in - *"GNU Binutils"*) # GNU ld - echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk - ;; - esac - - # 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 "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk - echo "HADDOCK_DOCS = YES" >> mk/build.mk - else - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk - echo "HADDOCK_DOCS = NO" >> mk/build.mk - fi - - sed -e "s|utils/haddock_dist_INSTALL_SHELL_WRAPPER = YES|utils/haddock_dist_INSTALL_SHELL_WRAPPER = NO|" \ - -i utils/haddock/ghc.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+=-w" >> mk/build.mk - - # some arches do not support ELF parsing for ghci module loading - # PPC64: never worked (should be easy to implement) - # alpha: never worked - if use alpha || use ppc64; then - echo "GhcWithInterpreter=NO" >> mk/build.mk - fi - - # we have to tell it to build unregisterised on some arches - # ppc64: EvilMangler currently does not understand some TOCs - # ia64: EvilMangler bitrot - if use alpha || use ia64 || use ppc64; then - echo "GhcUnregisterised=YES" >> 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 - - # Have "ld -r --relax" problem with split-objs on sparc: - if use sparc; 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 - if ! use ghcbootstrap; then - export PATH="${WORKDIR}/usr/bin:${PATH}" - fi - - econf || die "econf failed" - fi # ! use binary -} - -src_compile() { - if ! use binary; then - # 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 -j1 all || die "make failed" - fi # ! use binary -} - -src_install() { - if use binary; then - mv "${S}/usr" "${ED}" - - # Remove the docs if not requested - if ! use doc; then - rm -rf "${ED}/usr/share/doc/${P}/*/" \ - "${ED}/usr/share/doc/${P}/*.html" \ - || die "could not remove docs (P vs PF revision mismatch?)" - fi - else - 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 - mkdir -p "${ED}/usr/share/doc" - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \ - || die "failed to copy docs" - fi - fi - - emake -j1 ${insttarget} \ - DESTDIR="${D}" \ - || die "make ${insttarget} failed" - - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - # so mark resulting binary - pax-mark -m "${ED}/usr/$(get_libdir)/${P}/ghc" - - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION" - - dobashcompletion "${FILESDIR}/ghc-bash-completion" - - fi - - # path to the package.cache - PKGCACHE="${ED}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater --upgrade'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi - - bash-completion_pkg_postinst -} - -pkg_prerm() { - # Be very careful here... Call order when upgrading is (according to PMS): - # * src_install for new package - # * pkg_preinst for new package - # * pkg_postinst for new package - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # so you'll actually be touching the new packages files, not the one you - # uninstall, due to that or installation directory ${P} will be the same for - # both packages. - - # Call order for reinstalling is (according to PMS): - # * src_install - # * pkg_preinst - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # * pkg_postinst - - # Overwrite the modified package.cache with a copy of the - # original one, so that it will be removed during uninstall. - - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} diff --git a/dev-lang/ghc/ghc-7.0.4.ebuild b/dev-lang/ghc/ghc-7.0.4.ebuild deleted file mode 100644 index 4e61efedd17a..000000000000 --- a/dev-lang/ghc/ghc-7.0.4.ebuild +++ /dev/null @@ -1,600 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.0.4.ebuild,v 1.10 2014/09/07 06:29:23 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. - -EAPI="3" - -inherit base autotools bash-completion eutils flag-o-matic multilib toolchain-funcs ghc-package versionator pax-utils - -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="http://www.haskell.org/ghc/" - -# we don't have any binaries yet -arch_binaries="" - -# sorted! -arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )" -arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )" -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )" -#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )" -arch_binaries="$arch_binaries ppc? ( mirror://gentoo/ghc-bin-${PV}-ppc.tbz2 )" -arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )" -arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )" - -# various ports: -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# 0 - yet -yet_binary() { - case "${ARCH}" in - alpha) - return 0 - ;; - arm) - ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution." - return 0 - ;; - amd64) - return 0 - ;; - ppc64) - return 0 - ;; - sparc) - return 0 - ;; - x86) - return 0 - ;; - ppc) - return 0 - ;; - *) - return 1 - ;; - esac -} - -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )" -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )" -LICENSE="BSD" -SLOT="0" -# ghc on ia64 needs gcc to support -mcmodel=medium (or some dark hackery) to avoid TOC overflow -KEYWORDS="~alpha ~amd64 -ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" -IUSE="doc ghcbootstrap llvm" -IUSE+=" binary" # don't forget about me later! - -RDEPEND=" - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 ) - kernel_linux? ( >=sys-devel/binutils-2.17 ) - kernel_SunOS? ( >=sys-devel/binutils-2.17 ) - >=dev-lang/perl-5.6.1 - >=dev-libs/gmp-5 - !<dev-haskell/haddock-2.4.2 - sys-libs/ncurses[unicode]" -# earlier versions than 2.4.2 of haddock only works with older ghc releases - -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to -# that we want the binaries to use the latest versioun available, and not to be -# built against gmp-4 - -DEPEND="${RDEPEND} - ghcbootstrap? ( doc? ( app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-stylesheets - >=dev-libs/libxslt-1.1.2 ) )" -# In the ghcbootstrap case we rely on the developer having -# >=ghc-5.04.3 on their $PATH already - -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )" -PDEPEND=" - ${PDEPEND} - dev-haskell/syb - llvm? ( sys-devel/llvm )" - -use binary && QA_PREBUILT="*" - -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_FLAGS="${GHC_FLAGS} -optc${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${assemble} ]] && GHC_FLAGS="${GHC_FLAGS} -opta${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${link} ]] && GHC_FLAGS="${GHC_FLAGS} -optl${flag}" FILTERED_LDFLAGS="${FILTERED_LDFLAGS} ${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 - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - GHC_FLAGS="" - for flag in ${CFLAGS}; do - case ${flag} in - - # Ignore extra optimisation (ghc passes -O to gcc anyway) - # -O2 and above break on too many systems - -O*) ;; - - # Arch and ABI flags are what we're really after - -m*) append-ghc-cflags compile assemble ${flag};; - - # 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 - - FILTERED_LDFLAGS="" - for flag in ${LDFLAGS}; do - case ${flag} in - # Pass the canary. we don't quite respect LDFLAGS, but we have an excuse! - "-Wl,--hash-style="*) append-ghc-cflags link ${flag};; - - # Ignore all other 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 - - # prevent from failind building unregisterised ghc: - # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html - use ppc64 && append-ghc-cflags compile -mminimal-toc - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data - # currently ghc fails to build haddock - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html - use ia64 && append-ghc-cflags compile -G0 -} - -# substitutes string $1 to $2 in files $3 $4 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${PV}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${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.d/"* - - # this one we will use to regenerate cache - # so it shoult point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree - # TODO: add the same for darwin's CHOST and it's DYLD_ - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH' - sed -i -e '2i'"$new_ldpath" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "$gp_back" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - || die "Adding LD_LIBRARY_PATH for wrappers failed" - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -pkg_setup() { - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages 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." - else - if ! yet_binary; then - eerror "Please try emerging with USE=ghcbootstrap and report build" - eerror "sucess or failure to the haskell team (haskell@gentoo.org)" - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" - fi - fi -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - [[ ${CHOST} != *-darwin* ]] && \ - source "${FILESDIR}/ghc-apply-gmp-hack" "$(get_libdir)" - - ghc_setup_cflags - - if ! use ghcbootstrap; then - # Modify the wrapper script from the binary tarball to use GHC_FLAGS. - # See bug #313635. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc" - fi - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - # UPDATE ME for ghc-7 - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-6.10.4-i386-unknown-solaris2.tar.bz2 - use ppc-macos && unpack ghc-6.10.1-powerpc-apple-darwin.tar.bz2 - use x86-macos && unpack ghc-6.10.1-i386-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-6.10.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - # http://hackage.haskell.org/trac/ghc/ticket/2942 - pushd utils/haddock/dist-install/build > /dev/null - ln -s Haddock haddock >& /dev/null # fails on IN-sensitive - popd > /dev/null - - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.3.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # much arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - cd "${S}" # otherwise epatch will break - - epatch "${FILESDIR}/ghc-7.0.2-CHOST.patch" - epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch" - epatch "${FILESDIR}/ghc-7.0.4-CHOST-softfloat.patch" - - epatch "${FILESDIR}"/${PN}-7.0.4-darwin8.patch - epatch "${FILESDIR}"/${PN}-6.12.3-mach-o-relocation-limit.patch - epatch "${FILESDIR}"/${PN}-7.0.4-nxstack.patch - epatch "${FILESDIR}/ghc-7.0.4-fix-ppc-linker.patch" - - if use prefix; then - # Make configure find docbook-xsl-stylesheets from Prefix - sed -i -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' configure.ac || die - fi - - # disable bitrot bfd support, bug #522268 - sed -i -e 's/^AC_CHECK_LIB(bfd, bfd_init)$/dnl &/' configure.ac || die - - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - if ! use binary; then - - # initialize build.mk - echo '# Gentoo changes' > mk/build.mk - - # Put docs into the right place, ie /usr/share/doc/ghc-${PV} - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - - # We also need to use the GHC_FLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk - echo "SRC_LD_OPTS+=${FILTERED_LDFLAGS}" >> mk/build.mk - - # We can't depend on haddock except when bootstrapping when we - # must build docs and include them into the binary .tbz2 package - if use ghcbootstrap && use doc; then - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk - echo "HADDOCK_DOCS = YES" >> mk/build.mk - else - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk - echo "HADDOCK_DOCS = NO" >> mk/build.mk - fi - - # 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 - - # some arches do not support ELF parsing for ghci module loading - # PPC64: never worked (should be easy to implement) - # alpha: never worked - # arm: unimplemented or never worked - if use alpha || use ppc64 || use arm; then - echo "GhcWithInterpreter=NO" >> mk/build.mk - fi - - # we have to tell it to build unregisterised on some arches - # ppc64: EvilMangler currently does not understand some TOCs - # ia64: EvilMangler bitrot - if use alpha || use ia64 || use ppc64; then - echo "GhcUnregisterised=YES" >> 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 - - # arm: no EvilMangler support, no NCG support - if use arm; then - echo "GhcUnregisterised=YES" >> mk/build.mk - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk - fi - - # Have "ld -r --relax" problem with split-objs on sparc: - if use sparc; then - echo "SplitObjs=NO" >> mk/build.mk - fi - - if ! use llvm; then - echo "GhcWithLlvmCodeGen=NO" >> 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 - - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was - # compiled with, by saving the path to it. The purpose is to make sure - # that GHC will use the very same gcc version when it compiles haskell - # sources, as the extra-gcc-opts files contains extra gcc options which - # match only this GCC version. - # However, this is not required in Gentoo, as only modern GCCs are used - # (>4). - # Instead, this causes trouble when for example ccache is used during - # compilation, but we don't want the wrappers to point to ccache. - # Due to the above, we simply set GCC to be "gcc". When compiling ghc it - # might point to ccache, once installed it will point to the users - # regular gcc. - - econf --with-gcc=gcc || die "econf failed" - fi # ! use binary -} - -src_compile() { - if ! use binary; then - # unfortunately ghc-7.0 still fails under parallel load: - # bug #326347 (and i think bug #373947) - emake -j1 all || die "make failed" - fi # ! use binary -} - -src_install() { - if use binary; then - use prefix && mkdir -p "${ED}" - mv "${S}/usr" "${ED}" - - # Remove the docs if not requested - if ! use doc; then - rm -rf "${ED}/usr/share/doc/${P}/*/" \ - "${ED}/usr/share/doc/${P}/*.html" \ - || die "could not remove docs (P vs PF revision mismatch?)" - fi - else - 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 - mkdir -p "${ED}/usr/share/doc" - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \ - || die "failed to copy docs" - fi - fi - - emake -j1 ${insttarget} \ - DESTDIR="${D}" \ - || die "make ${insttarget} failed" - - # remove wrapper and linker - rm -f "${ED}"/usr/bin/haddock* - - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - # so mark resulting binary - pax-mark -m "${ED}/usr/$(get_libdir)/${P}/ghc" - - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION" - - dobashcompletion "${FILESDIR}/ghc-bash-completion" - - fi - - # path to the package.cache - PKGCACHE="${ED}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater --upgrade'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi - - bash-completion_pkg_postinst -} - -pkg_prerm() { - # Be very careful here... Call order when upgrading is (according to PMS): - # * src_install for new package - # * pkg_preinst for new package - # * pkg_postinst for new package - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # so you'll actually be touching the new packages files, not the one you - # uninstall, due to that or installation directory ${P} will be the same for - # both packages. - - # Call order for reinstalling is (according to PMS): - # * src_install - # * pkg_preinst - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # * pkg_postinst - - # Overwrite the modified package.cache with a copy of the - # original one, so that it will be removed during uninstall. - - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} diff --git a/dev-lang/ghc/ghc-7.4.1-r1.ebuild b/dev-lang/ghc/ghc-7.4.1-r1.ebuild deleted file mode 100644 index 3c513599377c..000000000000 --- a/dev-lang/ghc/ghc-7.4.1-r1.ebuild +++ /dev/null @@ -1,603 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.4.1-r1.ebuild,v 1.5 2014/02/15 08:52:36 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. - -EAPI="4" - -inherit base autotools bash-completion-r1 eutils flag-o-matic multilib toolchain-funcs ghc-package versionator pax-utils - -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="http://www.haskell.org/ghc/" - -# we don't have any binaries yet -arch_binaries="" - -# sorted! -arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )" -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )" -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )" -#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )" -arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )" -arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )" -arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )" - -# various ports: -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# prefix ports: -arch_binaries="$arch_binaries x86-macos? ( http://www.haskell.org/ghc/dist/7.4.1/ghc-7.4.1-i386-apple-darwin.tar.bz2 )" -arch_binaries="$arch_binaries x64-macos? ( http://www.haskell.org/ghc/dist/7.4.1/ghc-7.4.1-x86_64-apple-darwin.tar.bz2 )" -arch_binaries="$arch_binaries x86-solaris? ( http://www.haskell.org/ghc/dist/7.0.3/maeder/ghc-7.0.3-i386-unknown-solaris2.tar.bz2 )" -# need 6.12.3 to bootstrap this -#arch_binaries="$arch_binaries sparc-solaris? ( http://www.haskell.org/ghc/dist/6.10.4/maeder/ghc-6.10.4-sparc-sun-solaris2.tar.bz2 )" - -# 0 - yet -yet_binary() { - case "${ARCH}" in - alpha) return 0 ;; - #arm) - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution." - # return 0 - #;; - amd64) return 0 ;; - ppc) return 0 ;; - ppc64) return 0 ;; - sparc) return 0 ;; - x86) return 0 ;; - x86-macos) return 0 ;; - x64-macos) return 0 ;; - x86-solaris) return 0 ;; - *) return 1 ;; - esac -} - -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )" -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )" -LICENSE="BSD" -SLOT="0" -# ghc on ia64 needs gcc to support -mcmodel=medium (or some dark hackery) to avoid TOC overflow -KEYWORDS="~alpha ~amd64 -ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris" -IUSE="doc ghcbootstrap llvm" -IUSE+=" binary" # don't forget about me later! - -RDEPEND=" - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 ) - kernel_linux? ( >=sys-devel/binutils-2.17 ) - kernel_SunOS? ( >=sys-devel/binutils-2.17 ) - >=dev-lang/perl-5.6.1 - >=dev-libs/gmp-5 - virtual/libffi - !<dev-haskell/haddock-2.4.2 - sys-libs/ncurses[unicode]" -# earlier versions than 2.4.2 of haddock only works with older ghc releases - -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to -# that we want the binaries to use the latest versioun available, and not to be -# built against gmp-4 - -DEPEND="${RDEPEND} - ghcbootstrap? ( >=dev-haskell/alex-2.3 - >=dev-haskell/happy-1.18 - doc? ( app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-stylesheets - >=dev-libs/libxslt-1.1.2 ) )" -# In the ghcbootstrap case we rely on the developer having -# >=ghc-5.04.3 on their $PATH already - -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )" -PDEPEND=" - ${PDEPEND} - llvm? ( sys-devel/llvm )" - -use binary && QA_PREBUILT="*" - -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_FLAGS="${GHC_FLAGS} -optc${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${assemble} ]] && GHC_FLAGS="${GHC_FLAGS} -opta${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${link} ]] && GHC_FLAGS="${GHC_FLAGS} -optl${flag}" FILTERED_LDFLAGS="${FILTERED_LDFLAGS} ${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 - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - GHC_FLAGS="" - for flag in ${CFLAGS}; do - case ${flag} in - - # Ignore extra optimisation (ghc passes -O to gcc anyway) - # -O2 and above break on too many systems - -O*) ;; - - # Arch and ABI flags are what we're really after - -m*) append-ghc-cflags compile assemble ${flag};; - - # 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 - - FILTERED_LDFLAGS="" - for flag in ${LDFLAGS}; do - case ${flag} in - # Pass the canary. we don't quite respect LDFLAGS, but we have an excuse! - "-Wl,--hash-style="*) append-ghc-cflags link ${flag};; - - # Ignore all other 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 - - # prevent from failind building unregisterised ghc: - # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html - use ppc64 && append-ghc-cflags compile -mminimal-toc - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data - # currently ghc fails to build haddock - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html - use ia64 && append-ghc-cflags compile -G0 - - # Unfortunately driver/split/ghc-split.lprl is dumb - # enough to preserve stack marking for each split object - # and it flags stack marking violation: - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__1.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__2.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__3.o - case $($(tc-getAS) -v 2>&1 </dev/null) in - *"GNU Binutils"*) # GNU ld - append-ghc-cflags compile assemble -Wa,--noexecstack - ;; - esac -} - -# substitutes string $1 to $2 in files $3 $4 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${PV}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${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.d/"* - - # this one we will use to regenerate cache - # so it shoult point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree - # TODO: add the same for darwin's CHOST and it's DYLD_ - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH' - sed -i -e '2i'"$new_ldpath" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "$gp_back" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - || die "Adding LD_LIBRARY_PATH for wrappers failed" - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -pkg_setup() { - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages 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." - else - if ! yet_binary; then - eerror "Please try emerging with USE=ghcbootstrap and report build" - eerror "sucess or failure to the haskell team (haskell@gentoo.org)" - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" - fi - fi -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - ghc_setup_cflags - - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then - # Modify the wrapper script from the binary tarball to use GHC_FLAGS. - # See bug #313635. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc" - fi - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.10.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # much arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - cd "${S}" # otherwise epatch will break - - epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch - epatch "${FILESDIR}"/${PN}-7.4-rc2-macos-prefix-respect-gcc.patch - epatch "${FILESDIR}"/${PN}-7.4.1-darwin-CHOST.patch - epatch "${FILESDIR}"/${PN}-7.2.1-freebsd-CHOST.patch - - # one mode external depend with unstable ABI be careful to stash it - epatch "${FILESDIR}"/${PN}-7.4.2-system-libffi.patch - - if use prefix; then - # Make configure find docbook-xsl-stylesheets from Prefix - sed -i -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' utils/haddock/doc/configure.ac || die - fi - - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - if ! use binary; then - - # initialize build.mk - echo '# Gentoo changes' > mk/build.mk - - # Put docs into the right place, ie /usr/share/doc/ghc-${PV} - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - - # We also need to use the GHC_FLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk - echo "SRC_LD_OPTS+=${FILTERED_LDFLAGS}" >> mk/build.mk - - # We can't depend on haddock except when bootstrapping when we - # must build docs and include them into the binary .tbz2 package - if use ghcbootstrap && use doc; then - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk - echo "HADDOCK_DOCS = YES" >> mk/build.mk - else - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk - echo "HADDOCK_DOCS = NO" >> mk/build.mk - fi - - # 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 - - # some arches do not support ELF parsing for ghci module loading - # PPC64: never worked (should be easy to implement) - # alpha: never worked - # arm: unimplemented or never worked - if use alpha || use ppc64 || use arm; then - echo "GhcWithInterpreter=NO" >> mk/build.mk - fi - - # we have to tell it to build unregisterised on some arches - # ppc64: EvilMangler currently does not understand some TOCs - # ia64: EvilMangler bitrot - if use alpha || use ia64 || use ppc64; then - echo "GhcUnregisterised=YES" >> 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 - - # arm: no EvilMangler support, no NCG support - if use arm; then - echo "GhcUnregisterised=YES" >> mk/build.mk - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk - fi - - # Have "ld -r --relax" problem with split-objs on sparc: - if use sparc; then - echo "SplitObjs=NO" >> mk/build.mk - fi - - if ! use llvm; then - echo "GhcWithLlvmCodeGen=NO" >> 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 - - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was - # compiled with, by saving the path to it. The purpose is to make sure - # that GHC will use the very same gcc version when it compiles haskell - # sources, as the extra-gcc-opts files contains extra gcc options which - # match only this GCC version. - # However, this is not required in Gentoo, as only modern GCCs are used - # (>4). - # Instead, this causes trouble when for example ccache is used during - # compilation, but we don't want the wrappers to point to ccache. - # Due to the above, we simply set GCC to be "gcc". When compiling ghc it - # might point to ccache, once installed it will point to the users - # regular gcc. - - econf --with-gcc=gcc || die "econf failed" - fi # ! use binary -} - -src_compile() { - if ! use binary; then - limit_jobs() { - if [[ -n ${I_DEMAND_MY_CORES_LOADED} ]]; then - ewarn "You have requested parallel build which is known to break." - ewarn "Please report all breakages upstream." - return - fi - echo $@ - } - # ghc massively parallel make: #409631, #409873 - # but let users screw it by setting 'I_DEMAND_MY_CORES_LOADED' - emake $(limit_jobs -j1) all - fi # ! use binary -} - -src_install() { - if use binary; then - use prefix && mkdir -p "${ED}" - mv "${S}/usr" "${ED}" - - # Remove the docs if not requested - if ! use doc; then - rm -rf "${ED}/usr/share/doc/${P}/*/" \ - "${ED}/usr/share/doc/${P}/*.html" \ - || die "could not remove docs (P vs PF revision mismatch?)" - fi - else - 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 - mkdir -p "${ED}/usr/share/doc" - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \ - || die "failed to copy docs" - fi - fi - - emake -j1 ${insttarget} \ - DESTDIR="${D}" \ - || die "make ${insttarget} failed" - - # remove wrapper and linker - rm -f "${ED}"/usr/bin/haddock* - - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - # so mark resulting binary - pax-mark -m "${ED}/usr/$(get_libdir)/${P}/ghc" - - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION" - - dobashcomp "${FILESDIR}/ghc-bash-completion" - - fi - - # path to the package.cache - PKGCACHE="${ED}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater --upgrade'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi -} - -pkg_prerm() { - # Be very careful here... Call order when upgrading is (according to PMS): - # * src_install for new package - # * pkg_preinst for new package - # * pkg_postinst for new package - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # so you'll actually be touching the new packages files, not the one you - # uninstall, due to that or installation directory ${P} will be the same for - # both packages. - - # Call order for reinstalling is (according to PMS): - # * src_install - # * pkg_preinst - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # * pkg_postinst - - # Overwrite the modified package.cache with a copy of the - # original one, so that it will be removed during uninstall. - - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} diff --git a/dev-lang/ghc/ghc-7.4.1.ebuild b/dev-lang/ghc/ghc-7.4.1.ebuild deleted file mode 100644 index b0ad6ec2a6c6..000000000000 --- a/dev-lang/ghc/ghc-7.4.1.ebuild +++ /dev/null @@ -1,590 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.4.1.ebuild,v 1.6 2014/02/15 08:52:36 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. - -EAPI="4" - -inherit base autotools bash-completion-r1 eutils flag-o-matic multilib toolchain-funcs ghc-package versionator pax-utils - -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="http://www.haskell.org/ghc/" - -# we don't have any binaries yet -arch_binaries="" - -# sorted! -arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )" -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )" -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )" -#arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64-fixed-fiw.tbz2 )" -arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )" -arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )" -arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )" - -# various ports: -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# 0 - yet -yet_binary() { - case "${ARCH}" in - alpha) return 0 ;; - #arm) - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution." - # return 0 - #;; - amd64) return 0 ;; - ppc) return 0 ;; - ppc64) return 0 ;; - sparc) return 0 ;; - x86) return 0 ;; - *) return 1 ;; - esac -} - -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )" -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )" -LICENSE="BSD" -SLOT="0" -# ghc on ia64 needs gcc to support -mcmodel=medium (or some dark hackery) to avoid TOC overflow -KEYWORDS="~alpha ~amd64 -ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris" -IUSE="doc ghcbootstrap llvm" -IUSE+=" binary" # don't forget about me later! - -RDEPEND=" - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 ) - kernel_linux? ( >=sys-devel/binutils-2.17 ) - kernel_SunOS? ( >=sys-devel/binutils-2.17 ) - >=dev-lang/perl-5.6.1 - >=dev-libs/gmp-5 - !<dev-haskell/haddock-2.4.2 - sys-libs/ncurses[unicode]" -# earlier versions than 2.4.2 of haddock only works with older ghc releases - -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to -# that we want the binaries to use the latest versioun available, and not to be -# built against gmp-4 - -DEPEND="${RDEPEND} - ghcbootstrap? ( >=dev-haskell/alex-2.3 - >=dev-haskell/happy-1.18 - doc? ( app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-stylesheets - >=dev-libs/libxslt-1.1.2 ) )" -# In the ghcbootstrap case we rely on the developer having -# >=ghc-5.04.3 on their $PATH already - -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )" -PDEPEND=" - ${PDEPEND} - llvm? ( sys-devel/llvm )" - -use binary && QA_PREBUILT="*" - -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_FLAGS="${GHC_FLAGS} -optc${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${assemble} ]] && GHC_FLAGS="${GHC_FLAGS} -opta${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${link} ]] && GHC_FLAGS="${GHC_FLAGS} -optl${flag}" FILTERED_LDFLAGS="${FILTERED_LDFLAGS} ${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 - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - GHC_FLAGS="" - for flag in ${CFLAGS}; do - case ${flag} in - - # Ignore extra optimisation (ghc passes -O to gcc anyway) - # -O2 and above break on too many systems - -O*) ;; - - # Arch and ABI flags are what we're really after - -m*) append-ghc-cflags compile assemble ${flag};; - - # 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 - - FILTERED_LDFLAGS="" - for flag in ${LDFLAGS}; do - case ${flag} in - # Pass the canary. we don't quite respect LDFLAGS, but we have an excuse! - "-Wl,--hash-style="*) append-ghc-cflags link ${flag};; - - # Ignore all other 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 - - # prevent from failind building unregisterised ghc: - # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html - use ppc64 && append-ghc-cflags compile -mminimal-toc - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data - # currently ghc fails to build haddock - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html - use ia64 && append-ghc-cflags compile -G0 - - # Unfortunately driver/split/ghc-split.lprl is dumb - # enough to preserve stack marking for each split object - # and it flags stack marking violation: - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__1.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__2.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__3.o - case $($(tc-getAS) -v 2>&1 </dev/null) in - *"GNU Binutils"*) # GNU ld - append-ghc-cflags compile assemble -Wa,--noexecstack - ;; - esac -} - -# substitutes string $1 to $2 in files $3 $4 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${PV}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${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.d/"* - - # this one we will use to regenerate cache - # so it shoult point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree - # TODO: add the same for darwin's CHOST and it's DYLD_ - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH' - sed -i -e '2i'"$new_ldpath" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "$gp_back" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - || die "Adding LD_LIBRARY_PATH for wrappers failed" - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -pkg_setup() { - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages 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." - else - if ! yet_binary; then - eerror "Please try emerging with USE=ghcbootstrap and report build" - eerror "sucess or failure to the haskell team (haskell@gentoo.org)" - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" - fi - fi -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - ghc_setup_cflags - - if ! use ghcbootstrap; then - # Modify the wrapper script from the binary tarball to use GHC_FLAGS. - # See bug #313635. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc" - fi - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - # UPDATE ME for ghc-7 - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-6.10.4-i386-unknown-solaris2.tar.bz2 - use ppc-macos && unpack ghc-6.10.1-powerpc-apple-darwin.tar.bz2 - use x86-macos && unpack ghc-6.10.1-i386-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-6.10.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - # http://hackage.haskell.org/trac/ghc/ticket/2942 - pushd utils/haddock/dist-install/build > /dev/null - ln -s Haddock haddock >& /dev/null # fails on IN-sensitive - popd > /dev/null - - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.3.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # much arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - cd "${S}" # otherwise epatch will break - - epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch" - - epatch "${FILESDIR}"/${PN}-7.0.4-darwin8.patch - # failed to apply. FIXME - #epatch "${FILESDIR}"/${PN}-6.12.3-mach-o-relocation-limit.patch - - epatch "${FILESDIR}"/${PN}-7.4-rc2-macos-prefix-respect-gcc.patch - epatch "${FILESDIR}"/${PN}-7.2.1-freebsd-CHOST.patch - - if use prefix; then - # Make configure find docbook-xsl-stylesheets from Prefix - sed -i -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' utils/haddock/doc/configure.ac || die - fi - - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - if ! use binary; then - - # initialize build.mk - echo '# Gentoo changes' > mk/build.mk - - # Put docs into the right place, ie /usr/share/doc/ghc-${PV} - echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - - # We also need to use the GHC_FLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk - echo "SRC_LD_OPTS+=${FILTERED_LDFLAGS}" >> mk/build.mk - - # We can't depend on haddock except when bootstrapping when we - # must build docs and include them into the binary .tbz2 package - if use ghcbootstrap && use doc; then - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk - echo "HADDOCK_DOCS = YES" >> mk/build.mk - else - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk - echo "HADDOCK_DOCS = NO" >> mk/build.mk - fi - - # 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 - - # some arches do not support ELF parsing for ghci module loading - # PPC64: never worked (should be easy to implement) - # alpha: never worked - # arm: unimplemented or never worked - if use alpha || use ppc64 || use arm; then - echo "GhcWithInterpreter=NO" >> mk/build.mk - fi - - # we have to tell it to build unregisterised on some arches - # ppc64: EvilMangler currently does not understand some TOCs - # ia64: EvilMangler bitrot - if use alpha || use ia64 || use ppc64; then - echo "GhcUnregisterised=YES" >> 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 - - # arm: no EvilMangler support, no NCG support - if use arm; then - echo "GhcUnregisterised=YES" >> mk/build.mk - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk - fi - - # Have "ld -r --relax" problem with split-objs on sparc: - if use sparc; then - echo "SplitObjs=NO" >> mk/build.mk - fi - - if ! use llvm; then - echo "GhcWithLlvmCodeGen=NO" >> 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 - - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was - # compiled with, by saving the path to it. The purpose is to make sure - # that GHC will use the very same gcc version when it compiles haskell - # sources, as the extra-gcc-opts files contains extra gcc options which - # match only this GCC version. - # However, this is not required in Gentoo, as only modern GCCs are used - # (>4). - # Instead, this causes trouble when for example ccache is used during - # compilation, but we don't want the wrappers to point to ccache. - # Due to the above, we simply set GCC to be "gcc". When compiling ghc it - # might point to ccache, once installed it will point to the users - # regular gcc. - - econf --with-gcc=gcc || die "econf failed" - fi # ! use binary -} - -src_compile() { - if ! use binary; then - # ghc massively parallel make: #409631, #409873 - emake -j1 all || die "make failed" - fi # ! use binary -} - -src_install() { - if use binary; then - use prefix && mkdir -p "${ED}" - mv "${S}/usr" "${ED}" - - # Remove the docs if not requested - if ! use doc; then - rm -rf "${ED}/usr/share/doc/${P}/*/" \ - "${ED}/usr/share/doc/${P}/*.html" \ - || die "could not remove docs (P vs PF revision mismatch?)" - fi - else - 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 - mkdir -p "${ED}/usr/share/doc" - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \ - || die "failed to copy docs" - fi - fi - - emake -j1 ${insttarget} \ - DESTDIR="${D}" \ - || die "make ${insttarget} failed" - - # remove wrapper and linker - rm -f "${ED}"/usr/bin/haddock* - - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - # so mark resulting binary - pax-mark -m "${ED}/usr/$(get_libdir)/${P}/ghc" - - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION" - - dobashcomp "${FILESDIR}/ghc-bash-completion" - - fi - - # path to the package.cache - PKGCACHE="${ED}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater --upgrade'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi -} - -pkg_prerm() { - # Be very careful here... Call order when upgrading is (according to PMS): - # * src_install for new package - # * pkg_preinst for new package - # * pkg_postinst for new package - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # so you'll actually be touching the new packages files, not the one you - # uninstall, due to that or installation directory ${P} will be the same for - # both packages. - - # Call order for reinstalling is (according to PMS): - # * src_install - # * pkg_preinst - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # * pkg_postinst - - # Overwrite the modified package.cache with a copy of the - # original one, so that it will be removed during uninstall. - - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} diff --git a/dev-lang/ghc/ghc-7.6.2.ebuild b/dev-lang/ghc/ghc-7.6.2.ebuild deleted file mode 100644 index 2eb594a74dd2..000000000000 --- a/dev-lang/ghc/ghc-7.6.2.ebuild +++ /dev/null @@ -1,713 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.6.2.ebuild,v 1.4 2014/02/15 08:52:36 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. - -EAPI="5" - -# to make make a crosscompiler use crossdev and symlink ghc tree into -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc' -# -# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass' -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} = ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -inherit base autotools bash-completion-r1 eutils flag-o-matic multilib toolchain-funcs ghc-package versionator pax-utils - -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="http://www.haskell.org/ghc/" - -# we don't have any binaries yet -arch_binaries="" - -# sorted! -#arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )" -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )" -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )" -arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64.tbz2 )" -#arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )" -#arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )" -#arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )" - -# various ports: -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# 0 - yet -yet_binary() { - case "${ARCH}" in - #alpha) return 0 ;; - #arm) - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution." - # return 0 - #;; - amd64) return 0 ;; - ia64) return 0 ;; - #ppc) return 0 ;; - #ppc64) return 0 ;; - #sparc) return 0 ;; - x86) return 0 ;; - *) return 1 ;; - esac -} - -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )" -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )" -LICENSE="BSD" -SLOT="0/${PV}" -# ghc on ia64 needs gcc to support -mcmodel=medium (or some dark hackery) to avoid TOC overflow -KEYWORDS="~amd64 ~ia64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris" -IUSE="doc ghcbootstrap ghcmakebinary +gmp llvm" -IUSE+=" binary" # don't forget about me later! -IUSE+=" elibc_glibc" # system stuff - -RDEPEND=" - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 ) - kernel_linux? ( >=sys-devel/binutils-2.17 ) - kernel_SunOS? ( >=sys-devel/binutils-2.17 ) - >=dev-lang/perl-5.6.1 - >=dev-libs/gmp-5 - virtual/libffi - !<dev-haskell/haddock-2.4.2 - sys-libs/ncurses[unicode]" -# earlier versions than 2.4.2 of haddock only works with older ghc releases - -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to -# that we want the binaries to use the latest versioun available, and not to be -# built against gmp-4 - -# similar for glibc. we have bootstrapped binaries against glibc-2.14 -DEPEND="${RDEPEND} - ghcbootstrap? ( >=dev-haskell/alex-2.3 - >=dev-haskell/happy-1.18 - doc? ( app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-stylesheets - >=dev-libs/libxslt-1.1.2 ) ) - !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.15 ) ) )" - -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )" -PDEPEND=" - ${PDEPEND} - llvm? ( sys-devel/llvm )" - -# ia64 fails to return from STG GMP primitives (stage2 always SIGSEGVs) -REQUIRED_USE="ia64? ( !gmp )" - -use binary && QA_PREBUILT="*" - -is_crosscompile() { - [[ ${CHOST} != ${CTARGET} ]] -} - -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_FLAGS="${GHC_FLAGS} -optc${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${assemble} ]] && GHC_FLAGS="${GHC_FLAGS} -opta${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${link} ]] && GHC_FLAGS="${GHC_FLAGS} -optl${flag}" FILTERED_LDFLAGS="${FILTERED_LDFLAGS} ${flag}";; - esac - done -} - -ghc_setup_cflags() { - if is_crosscompile; then - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"} - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"} - einfo "Crosscompiling mode:" - einfo " CHOST: ${CHOST}" - einfo " CTARGET: ${CTARGET}" - einfo " CFLAGS: ${CFLAGS}" - einfo " LDFLAGS: ${LDFLAGS}" - return - fi - # We need to be very careful with the CFLAGS we ask ghc to pass through to - # gcc. There are plenty of flags which will make gcc produce output that - # breaks ghc in various ways. The main ones we want to pass through are - # -mcpu / -march flags. These are important for arches like alpha & sparc. - # We also use these CFLAGS for building the C parts of ghc, ie the rts. - strip-flags - strip-unsupported-flags - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - GHC_FLAGS="" - for flag in ${CFLAGS}; do - case ${flag} in - - # Ignore extra optimisation (ghc passes -O to gcc anyway) - # -O2 and above break on too many systems - -O*) ;; - - # Arch and ABI flags are what we're really after - -m*) append-ghc-cflags compile assemble ${flag};; - - # Sometimes it's handy to see backtrace of RTS - # to get an idea what happens there - -g*) append-ghc-cflags compile ${flag};; - - # Ignore all other flags, including all -f* flags - esac - done - - FILTERED_LDFLAGS="" - for flag in ${LDFLAGS}; do - case ${flag} in - # Pass the canary. we don't quite respect LDFLAGS, but we have an excuse! - "-Wl,--hash-style="*) append-ghc-cflags link ${flag};; - - # Ignore all other 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 - - # prevent from failind building unregisterised ghc: - # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html - use ppc64 && append-ghc-cflags compile -mminimal-toc - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data - # currently ghc fails to build haddock - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html - use ia64 && append-ghc-cflags compile -G0 -Os - - # Unfortunately driver/split/ghc-split.lprl is dumb - # enough to preserve stack marking for each split object - # and it flags stack marking violation: - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__1.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__2.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__3.o - case $($(tc-getAS) -v 2>&1 </dev/null) in - *"GNU Binutils"*) # GNU ld - append-ghc-cflags compile assemble -Wa,--noexecstack - ;; - esac -} - -# substitutes string $1 to $2 in files $3 $4 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${PV}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${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.d/"* - - # this one we will use to regenerate cache - # so it shoult point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree - # TODO: add the same for darwin's CHOST and it's DYLD_ - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH' - sed -i -e '2i'"$new_ldpath" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "$gp_back" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - || die "Adding LD_LIBRARY_PATH for wrappers failed" - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -pkg_setup() { - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages 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." - else - if ! yet_binary; then - eerror "Please try emerging with USE=ghcbootstrap and report build" - eerror "sucess or failure to the haskell team (haskell@gentoo.org)" - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" - fi - fi -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - ghc_setup_cflags - - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then - # Modify the wrapper script from the binary tarball to use GHC_FLAGS. - # See bug #313635. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc" - fi - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - # UPDATE ME for ghc-7 - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.10.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # much arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - cd "${S}" # otherwise epatch will break - - epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch" - - # epatch "${FILESDIR}"/${PN}-7.0.4-darwin8.patch - # failed to apply. FIXME - #epatch "${FILESDIR}"/${PN}-6.12.3-mach-o-relocation-limit.patch - - # epatch "${FILESDIR}"/${PN}-7.4-rc2-macos-prefix-respect-gcc.patch - # epatch "${FILESDIR}"/${PN}-7.2.1-freebsd-CHOST.patch - - we_want_libffi_workaround() { - use ghcmakebinary && return 1 - - # pick only registerised arches - # http://bugs.gentoo.org/463814 - use amd64 && return 0 - use x86 && return 0 - return 1 - } - # one mode external depend with unstable ABI be careful to stash it - # avoid external libffi runtime when we build binaries - we_want_libffi_workaround && epatch "${FILESDIR}"/${PN}-7.5.20120505-system-libffi.patch - - epatch "${FILESDIR}"/${PN}-7.4.1-ticket-7339-fix-unaligned-unreg.patch - epatch "${FILESDIR}"/${PN}-7.6.2-integer-simple-div-mod.patch - - if use prefix; then - # Make configure find docbook-xsl-stylesheets from Prefix - sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \ - -i utils/haddock/doc/configure.ac || die - fi - - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - GHC_PV=${PV} # overrided in live ebuilds - - 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 = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - - # We also need to use the GHC_FLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk - echo "SRC_LD_OPTS+=${FILTERED_LDFLAGS}" >> mk/build.mk - - # We can't depend on haddock except when bootstrapping when we - # must build docs and include them into the binary .tbz2 package - # app-text/dblatex is not in portage, can not build PDF or PS - if use ghcbootstrap && use doc; then - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk - if is_crosscompile; then - # TODO this is a workaround for this build error with the live ebuild with haddock: - # make[1]: *** No rule to make target `compiler/stage2/build/Module.hi', - # needed by `utils/haddock/dist/build/Main.o'. Stop. - echo "HADDOCK_DOCS = NO" >> mk/build.mk - else - echo "HADDOCK_DOCS = YES" >> mk/build.mk - fi - else - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk - echo "HADDOCK_DOCS = NO" >> mk/build.mk - fi - - # 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 - - # some arches do not support ELF parsing for ghci module loading - # PPC64: never worked (should be easy to implement) - # alpha: never worked - # arm: http://hackage.haskell.org/trac/ghc/changeset/27302c9094909e04eb73f200d52d5e9370c34a8a - if use alpha || use ppc64; then - echo "GhcWithInterpreter=NO" >> mk/build.mk - fi - - # we have to tell it to build unregisterised on some arches - # ppc64: EvilMangler currently does not understand some TOCs - # ia64: EvilMangler bitrot - # set GHC_IS_UNREG if you like to build slow unregisterised - # host compiler. Handy if you plan to user resulting - # host compiler as a booting compiler for crosscompiler - # which can work only in unregisterised mode. - if use alpha || use ia64 || use ppc64 || [[ -n ${GHC_IS_UNREG} ]]; then - echo "GhcUnregisterised=YES" >> 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 - - # arm: no EvilMangler support, no NCG support - if use arm; then - echo "GhcUnregisterised=YES" >> mk/build.mk - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk - fi - - # Have "ld -r --relax" problem with split-objs on sparc: - if use sparc; then - echo "SplitObjs=NO" >> mk/build.mk - fi - - if ! use llvm; then - echo "GhcWithLlvmCodeGen=NO" >> mk/build.mk - fi - - # allows overriding build flavours for libraries: - # v - vanilla (static libs) - # p - profiled - # dyn - shared libraries - # example: GHC_LIBRARY_WAYS="v dyn" - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk - fi - - # Get ghc from the unpacked binary .tbz2 - # except when bootstrapping we just pick ghc up off the path - if ! use ghcbootstrap; then - export PATH="${WORKDIR}/usr/bin:${PATH}" - fi - - if use gmp; then - echo "INTEGER_LIBRARY=integer-gmp" >> mk/build.mk - else - echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk - fi - - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was - # compiled with, by saving the path to it. The purpose is to make sure - # that GHC will use the very same gcc version when it compiles haskell - # sources, as the extra-gcc-opts files contains extra gcc options which - # match only this GCC version. - # However, this is not required in Gentoo, as only modern GCCs are used - # (>4). - # Instead, this causes trouble when for example ccache is used during - # compilation, but we don't want the wrappers to point to ccache. - # Due to the above, we simply set GCC to be "gcc". When compiling ghc it - # might point to ccache, once installed it will point to the users - # regular gcc. - - local econf_args=() - - is_crosscompile || econf_args+=--with-gcc=${CHOST}-gcc - - econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot \ - || die "econf failed" - - [[ ${PV} == *9999* ]] && GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" - GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" - fi # ! use binary -} - -src_compile() { - if ! use binary; then - #limit_jobs() { - # if [[ -n ${I_DEMAND_MY_CORES_LOADED} ]]; then - # ewarn "You have requested parallel build which is known to break." - # ewarn "Please report all breakages upstream." - # return - # fi - # echo $@ - #} - # ghc massively parallel make: #409631, #409873 - # but let users screw it by setting 'I_DEMAND_MY_CORES_LOADED' - #emake $(limit_jobs -j1) all - # ^ above seems to be fixed. - emake all - - if is_crosscompile; then - # runghc does not work for a stage1 compiler, we can build it anyway - # so it will print the error message: not built for interactive use - pushd "${S}/utils/runghc" || die "Could not cd to utils/runghc" - if [ ! -f Setup.hs ]; then - echo 'import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks' \ - > Setup.hs || die "failed to create default Setup.hs" - fi - ghc -o setup --make Setup.hs || die "setup build failed" - ./setup configure || die "runghc configure failed" - sed -e "s@VERSION@\"${GHC_PV}\"@" -i runghc.hs - ./setup build || die "runghc build failed" - popd - fi - fi # ! use binary -} - -src_install() { - if use binary; then - use prefix && mkdir -p "${ED}" - mv "${S}/usr" "${ED}" - - # Remove the docs if not requested - if ! use doc; then - rm -rf "${ED}/usr/share/doc/${P}/*/" \ - "${ED}/usr/share/doc/${P}/*.html" \ - || die "could not remove docs (P vs PF revision mismatch?)" - fi - else - local insttarget="install" - - # We only built docs if we were bootstrapping, otherwise - # we copy them out of the unpacked binary .tbz2 - if use doc && ! use ghcbootstrap; then - mkdir -p "${ED}/usr/share/doc" - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \ - || die "failed to copy docs" - else - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION" - fi - - emake -j1 ${insttarget} \ - DESTDIR="${D}" \ - || die "make ${insttarget} failed" - - # remove wrapper and linker - rm -f "${ED}"/usr/bin/haddock* - - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - # so mark resulting binary - pax-mark -m "${ED}/usr/$(get_libdir)/${P}/ghc" - - if [[ ! -f "${S}/VERSION" ]]; then - echo "${GHC_PV}" > "${S}/VERSION" \ - || die "Could not create file ${S}/VERSION" - fi - dobashcomp "${FILESDIR}/ghc-bash-completion" - - fi - - # path to the package.cache - local package_confdir="${ED}/usr/$(get_libdir)/${PN}-${GHC_PV}/package.conf.d" - PKGCACHE="${package_confdir}"/package.cache - # copy the package.conf.d, including timestamp, save it so we can help - # users that have a broken package.conf.d - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater --upgrade'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi - if is_crosscompile; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "GHC built as a cross compiler. The interpreter, ghci and runghc, do" - ewarn "not work for a cross compiler." - ewarn "For the ghci error: \"<command line>: not built for interactive use\" see:" - ewarn "http://www.haskell.org/haskellwiki/GHC:FAQ#When_I_try_to_start_ghci_.28probably_one_I_compiled_myself.29_it_says_ghc-5.02:_not_built_for_interactive_use" - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi -} - -pkg_prerm() { - # Be very careful here... Call order when upgrading is (according to PMS): - # * src_install for new package - # * pkg_preinst for new package - # * pkg_postinst for new package - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # so you'll actually be touching the new packages files, not the one you - # uninstall, due to that or installation directory ${P} will be the same for - # both packages. - - # Call order for reinstalling is (according to PMS): - # * src_install - # * pkg_preinst - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # * pkg_postinst - - # Overwrite the modified package.cache with a copy of the - # original one, so that it will be removed during uninstall. - - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} diff --git a/dev-lang/ghc/ghc-7.6.3-r1.ebuild b/dev-lang/ghc/ghc-7.6.3-r1.ebuild index bb6db572da32..58bdc7a60680 100644 --- a/dev-lang/ghc/ghc-7.6.3-r1.ebuild +++ b/dev-lang/ghc/ghc-7.6.3-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.6.3-r1.ebuild,v 1.14 2014/08/01 20:33:54 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.6.3-r1.ebuild,v 1.15 2015/01/02 23:50:56 slyfox Exp $ # Brief explanation of the bootstrap logic: # @@ -417,7 +417,7 @@ src_prepare() { cd "${S}" # otherwise epatch will break - epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch" + epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch # epatch "${FILESDIR}"/${PN}-7.0.4-darwin8.patch # failed to apply. FIXME diff --git a/dev-lang/ghc/ghc-7.6.3.ebuild b/dev-lang/ghc/ghc-7.6.3.ebuild deleted file mode 100644 index c753567d095e..000000000000 --- a/dev-lang/ghc/ghc-7.6.3.ebuild +++ /dev/null @@ -1,737 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.6.3.ebuild,v 1.4 2014/02/15 08:52:36 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. - -EAPI="5" - -# to make make a crosscompiler use crossdev and symlink ghc tree into -# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc' -# -# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass' -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} = ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} - fi -fi - -inherit base autotools bash-completion-r1 eutils flag-o-matic multilib toolchain-funcs ghc-package versionator pax-utils - -DESCRIPTION="The Glasgow Haskell Compiler" -HOMEPAGE="http://www.haskell.org/ghc/" - -# we don't have any binaries yet -arch_binaries="" - -# sorted! -arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )" -#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )" -arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PV}-amd64.tbz2 )" -arch_binaries="$arch_binaries ia64? ( http://code.haskell.org/~slyfox/ghc-ia64/ghc-bin-${PV}-ia64.tbz2 )" -#arch_binaries="$arch_binaries ppc? ( http://code.haskell.org/~slyfox/ghc-ppc/ghc-bin-${PV}-ppc.tbz2 )" -#arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )" -#arch_binaries="$arch_binaries sparc? ( http://code.haskell.org/~slyfox/ghc-sparc/ghc-bin-${PV}-sparc.tbz2 )" -arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~slyfox/ghc-x86/ghc-bin-${PV}-x86.tbz2 )" - -# various ports: -#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )" - -# 0 - yet -yet_binary() { - case "${ARCH}" in - alpha) return 0 ;; - #arm) - # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution." - # return 0 - #;; - amd64) return 0 ;; - ia64) return 0 ;; - #ppc) return 0 ;; - #ppc64) return 0 ;; - #sparc) return 0 ;; - x86) return 0 ;; - *) return 1 ;; - esac -} - -SRC_URI="!binary? ( http://www.haskell.org/ghc/dist/${PV}/${P}-src.tar.bz2 )" -[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )" -LICENSE="BSD" -SLOT="0/${PV}" -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris" -IUSE="doc ghcbootstrap ghcmakebinary +gmp llvm" -IUSE+=" binary" # don't forget about me later! -IUSE+=" elibc_glibc" # system stuff - -RDEPEND=" - !kernel_Darwin? ( >=sys-devel/gcc-2.95.3 ) - kernel_linux? ( >=sys-devel/binutils-2.17 ) - kernel_SunOS? ( >=sys-devel/binutils-2.17 ) - >=dev-lang/perl-5.6.1 - >=dev-libs/gmp-5 - virtual/libffi - !<dev-haskell/haddock-2.4.2 - sys-libs/ncurses[unicode]" -# earlier versions than 2.4.2 of haddock only works with older ghc releases - -# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to -# that we want the binaries to use the latest versioun available, and not to be -# built against gmp-4 - -# similar for glibc. we have bootstrapped binaries against glibc-2.14 -DEPEND="${RDEPEND} - ghcbootstrap? ( >=dev-haskell/alex-2.3 - >=dev-haskell/happy-1.18 - doc? ( app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-stylesheets - >=dev-libs/libxslt-1.1.2 ) ) - !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.15 ) ) )" - -PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )" -PDEPEND=" - ${PDEPEND} - llvm? ( sys-devel/llvm )" - -# ia64 fails to return from STG GMP primitives (stage2 always SIGSEGVs) -REQUIRED_USE="ia64? ( !gmp )" - -use binary && QA_PREBUILT="*" - -is_crosscompile() { - [[ ${CHOST} != ${CTARGET} ]] -} - -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_FLAGS="${GHC_FLAGS} -optc${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${assemble} ]] && GHC_FLAGS="${GHC_FLAGS} -opta${flag}" CFLAGS="${CFLAGS} ${flag}" - [[ ${link} ]] && GHC_FLAGS="${GHC_FLAGS} -optl${flag}" FILTERED_LDFLAGS="${FILTERED_LDFLAGS} ${flag}";; - esac - done -} - -ghc_setup_cflags() { - if is_crosscompile; then - export CFLAGS=${GHC_CFLAGS-"-O2 -pipe"} - export LDFLAGS=${GHC_LDFLAGS-"-Wl,-O1"} - einfo "Crosscompiling mode:" - einfo " CHOST: ${CHOST}" - einfo " CTARGET: ${CTARGET}" - einfo " CFLAGS: ${CFLAGS}" - einfo " LDFLAGS: ${LDFLAGS}" - return - fi - # We need to be very careful with the CFLAGS we ask ghc to pass through to - # gcc. There are plenty of flags which will make gcc produce output that - # breaks ghc in various ways. The main ones we want to pass through are - # -mcpu / -march flags. These are important for arches like alpha & sparc. - # We also use these CFLAGS for building the C parts of ghc, ie the rts. - strip-flags - strip-unsupported-flags - - # Cmm can't parse line numbers #482086 - replace-flags -ggdb[3-9] -ggdb2 - - GHC_FLAGS="" - for flag in ${CFLAGS}; do - case ${flag} in - - # Ignore extra optimisation (ghc passes -O to gcc anyway) - # -O2 and above break on too many systems - -O*) ;; - - # Arch and ABI flags are what we're really after - -m*) append-ghc-cflags compile assemble ${flag};; - - # Sometimes it's handy to see backtrace of RTS - # to get an idea what happens there - -g*) append-ghc-cflags compile ${flag};; - - # Ignore all other flags, including all -f* flags - esac - done - - FILTERED_LDFLAGS="" - for flag in ${LDFLAGS}; do - case ${flag} in - # Pass the canary. we don't quite respect LDFLAGS, but we have an excuse! - "-Wl,--hash-style="*) append-ghc-cflags link ${flag};; - - # Ignore all other 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 - - # prevent from failind building unregisterised ghc: - # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html - use ppc64 && append-ghc-cflags compile -mminimal-toc - # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data - # currently ghc fails to build haddock - # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html - use ia64 && append-ghc-cflags compile -G0 -Os - - # Unfortunately driver/split/ghc-split.lprl is dumb - # enough to preserve stack marking for each split object - # and it flags stack marking violation: - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__1.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__2.o - # * !WX --- --- usr/lib64/ghc-7.4.1/base-4.5.0.0/libHSbase-4.5.0.0.a:Fingerprint__3.o - case $($(tc-getAS) -v 2>&1 </dev/null) in - *"GNU Binutils"*) # GNU ld - append-ghc-cflags compile assemble -Wa,--noexecstack - ;; - esac -} - -# substitutes string $1 to $2 in files $3 $4 ... -relocate_path() { - local from=$1 - local to=$2 - shift 2 - local file= - for file in "$@" - do - sed -i -e "s|$from|$to|g" \ - "$file" || die "path relocation failed for '$file'" - done -} - -# changes hardcoded ghc paths and updates package index -# $1 - new absolute root path -relocate_ghc() { - local to=$1 - - # libdir for prebuilt binary and for current system may mismatch - # It does for prefix installation for example: bug #476998 - local bin_ghc_prefix=${WORKDIR}/usr - local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*) - local bin_libdir=${bin_libpath#${bin_ghc_prefix}/} - - # backup original script to use it later after relocation - local gp_back="${T}/ghc-pkg-${PV}-orig" - cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper" - - if [[ ${bin_libdir} != $(get_libdir) ]]; then - einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)" - # moving the dir itself is not strictly needed - # but then USE=binary would result in installing - # in '${bin_libdir}' - mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die - - relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - "${WORKDIR}/usr/bin/runghc-${PV}" \ - "$gp_back" \ - "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"* - fi - - # Relocate from /usr to ${EPREFIX}/usr - relocate_path "/usr" "${to}/usr" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - "${WORKDIR}/usr/bin/runghc-${PV}" \ - "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"* - - # this one we will use to regenerate cache - # so it should point to current tree location - relocate_path "/usr" "${WORKDIR}/usr" "$gp_back" - - if use prefix; then - # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree - # TODO: add the same for darwin's CHOST and it's DYLD_ - local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH' - sed -i -e '2i'"$new_ldpath" \ - "${WORKDIR}/usr/bin/ghc-${PV}" \ - "${WORKDIR}/usr/bin/ghci-${PV}" \ - "${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ - "${WORKDIR}/usr/bin/hsc2hs" \ - "${WORKDIR}/usr/bin/runghc-${PV}" \ - "$gp_back" \ - || die "Adding LD_LIBRARY_PATH for wrappers failed" - fi - - # regenerate the binary package cache - "$gp_back" recache || die "failed to update cache after relocation" - rm "$gp_back" -} - -pkg_setup() { - if use ghcbootstrap; then - ewarn "You requested ghc bootstrapping, this is usually only used" - ewarn "by Gentoo developers to make binary .tbz2 packages 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." - else - if ! yet_binary; then - eerror "Please try emerging with USE=ghcbootstrap and report build" - eerror "sucess or failure to the haskell team (haskell@gentoo.org)" - die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap" - fi - fi -} - -src_unpack() { - # Create the ${S} dir if we're using the binary version - use binary && mkdir "${S}" - - # the Solaris and Darwin binaries from ghc (maeder) need to be - # unpacked separately, so prevent them from being unpacked - local ONLYA=${A} - case ${CHOST} in - *-darwin* | *-solaris*) ONLYA=${P}-src.tar.bz2 ;; - esac - unpack ${ONLYA} -} - -src_prepare() { - ghc_setup_cflags - - if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then - # Modify the wrapper script from the binary tarball to use GHC_FLAGS. - # See bug #313635. - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${WORKDIR}/usr/bin/ghc-${PV}" - - # allow hardened users use vanilla binary to bootstrap ghc - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - pax-mark -m "${WORKDIR}/usr/$(get_libdir)/${P}/ghc" - fi - - if use binary; then - if use prefix; then - relocate_ghc "${EPREFIX}" - fi - - # Move unpacked files to the expected place - mv "${WORKDIR}/usr" "${S}" - else - if ! use ghcbootstrap; then - case ${CHOST} in - *-darwin* | *-solaris*) - # UPDATE ME for ghc-7 - mkdir "${WORKDIR}"/ghc-bin-installer || die - pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die - use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2 - use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2 - use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2 - use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2 - popd > /dev/null - - pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die - # fix the binaries so they run, on Solaris we need an - # LD_LIBRARY_PATH which has our prefix libdirs, on - # Darwin we need to replace the frameworks with our libs - # from the prefix fix before installation, because some - # of the tools are actually used during configure/make - if [[ ${CHOST} == *-solaris* ]] ; then - export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}" - elif [[ ${CHOST} == *-darwin* ]] ; then - local readline_framework=GNUreadline.framework/GNUreadline - local gmp_framework=/opt/local/lib/libgmp.10.dylib - local ncurses_file=/opt/local/lib/libncurses.5.dylib - for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do - install_name_tool -change \ - ${readline_framework} \ - "${EPREFIX}"/lib/libreadline.dylib \ - ${binary} || die - install_name_tool -change \ - ${gmp_framework} \ - "${EPREFIX}"/usr/lib/libgmp.dylib \ - ${binary} || die - install_name_tool -change \ - ${ncurses_file} \ - "${EPREFIX}"/usr/lib/libncurses.dylib \ - ${binary} || die - done - # we don't do frameworks! - sed -i \ - -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \ - -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \ - rts/package.conf.in || die - fi - - # it is autoconf, but we really don't want to give it too - # much arguments, in fact we do the make in-place anyway - ./configure --prefix="${WORKDIR}"/usr || die - make install || die - popd > /dev/null - ;; - *) - relocate_ghc "${WORKDIR}" - ;; - esac - fi - - sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_FLAGS}|" \ - "${S}/ghc/ghc.wrapper" - - cd "${S}" # otherwise epatch will break - - epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch" - - # epatch "${FILESDIR}"/${PN}-7.0.4-darwin8.patch - # failed to apply. FIXME - #epatch "${FILESDIR}"/${PN}-6.12.3-mach-o-relocation-limit.patch - - # epatch "${FILESDIR}"/${PN}-7.4-rc2-macos-prefix-respect-gcc.patch - # epatch "${FILESDIR}"/${PN}-7.2.1-freebsd-CHOST.patch - - we_want_libffi_workaround() { - use ghcmakebinary && return 1 - - # pick only registerised arches - # http://bugs.gentoo.org/463814 - use amd64 && return 0 - use x86 && return 0 - return 1 - } - # one mode external depend with unstable ABI be careful to stash it - # avoid external libffi runtime when we build binaries - we_want_libffi_workaround && epatch "${FILESDIR}"/${PN}-7.5.20120505-system-libffi.patch - - epatch "${FILESDIR}"/${PN}-7.4.1-ticket-7339-fix-unaligned-unreg.patch - epatch "${FILESDIR}"/${PN}-7.6.2-integer-simple-div-mod.patch - - if use prefix; then - # Make configure find docbook-xsl-stylesheets from Prefix - sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \ - -i utils/haddock/doc/configure.ac || die - fi - - # as we have changed the build system - eautoreconf - fi -} - -src_configure() { - GHC_PV=${PV} # overrided in live ebuilds - - 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 = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk - - # We also need to use the GHC_FLAGS flags when building ghc itself - echo "SRC_HC_OPTS+=${GHC_FLAGS}" >> mk/build.mk - echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk - echo "SRC_LD_OPTS+=${FILTERED_LDFLAGS}" >> mk/build.mk - - # We can't depend on haddock except when bootstrapping when we - # must build docs and include them into the binary .tbz2 package - # app-text/dblatex is not in portage, can not build PDF or PS - if use ghcbootstrap && use doc; then - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk - if is_crosscompile; then - # TODO this is a workaround for this build error with the live ebuild with haddock: - # make[1]: *** No rule to make target `compiler/stage2/build/Module.hi', - # needed by `utils/haddock/dist/build/Main.o'. Stop. - echo "HADDOCK_DOCS = NO" >> mk/build.mk - else - echo "HADDOCK_DOCS = YES" >> mk/build.mk - fi - else - echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk - echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk - echo "HADDOCK_DOCS = NO" >> mk/build.mk - fi - - # 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 - - # some arches do not support ELF parsing for ghci module loading - # PPC64: never worked (should be easy to implement) - # alpha: never worked - # arm: http://hackage.haskell.org/trac/ghc/changeset/27302c9094909e04eb73f200d52d5e9370c34a8a - if use alpha || use ppc64; then - echo "GhcWithInterpreter=NO" >> mk/build.mk - fi - - # we have to tell it to build unregisterised on some arches - # ppc64: EvilMangler currently does not understand some TOCs - # ia64: EvilMangler bitrot - # set GHC_IS_UNREG if you like to build slow unregisterised - # host compiler. Handy if you plan to user resulting - # host compiler as a booting compiler for crosscompiler - # which can work only in unregisterised mode. - if use alpha || use ia64 || use ppc64 || [[ -n ${GHC_IS_UNREG} ]]; then - echo "GhcUnregisterised=YES" >> 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 - - # arm: no EvilMangler support, no NCG support - if use arm; then - echo "GhcUnregisterised=YES" >> mk/build.mk - echo "GhcWithNativeCodeGen=NO" >> mk/build.mk - fi - - # Have "ld -r --relax" problem with split-objs on sparc: - if use sparc; then - echo "SplitObjs=NO" >> mk/build.mk - fi - - if ! use llvm; then - echo "GhcWithLlvmCodeGen=NO" >> mk/build.mk - fi - - # allows overriding build flavours for libraries: - # v - vanilla (static libs) - # p - profiled - # dyn - shared libraries - # example: GHC_LIBRARY_WAYS="v dyn" - if [[ -n ${GHC_LIBRARY_WAYS} ]]; then - echo "GhcLibWays=${GHC_LIBRARY_WAYS}" >> mk/build.mk - fi - - # Get ghc from the unpacked binary .tbz2 - # except when bootstrapping we just pick ghc up off the path - if ! use ghcbootstrap; then - export PATH="${WORKDIR}/usr/bin:${PATH}" - fi - - if use gmp; then - echo "INTEGER_LIBRARY=integer-gmp" >> mk/build.mk - else - echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk - fi - - # Since GHC 6.12.2 the GHC wrappers store which GCC version GHC was - # compiled with, by saving the path to it. The purpose is to make sure - # that GHC will use the very same gcc version when it compiles haskell - # sources, as the extra-gcc-opts files contains extra gcc options which - # match only this GCC version. - # However, this is not required in Gentoo, as only modern GCCs are used - # (>4). - # Instead, this causes trouble when for example ccache is used during - # compilation, but we don't want the wrappers to point to ccache. - # Due to the above, we simply set GCC to be "gcc". When compiling ghc it - # might point to ccache, once installed it will point to the users - # regular gcc. - - local econf_args=() - - is_crosscompile || econf_args+=--with-gcc=${CHOST}-gcc - - econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot \ - || die "econf failed" - - [[ ${PV} == *9999* ]] && GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" - GHC_TPF="$(grep 'S\[\"TargetPlatformFull\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')" - fi # ! use binary -} - -src_compile() { - if ! use binary; then - #limit_jobs() { - # if [[ -n ${I_DEMAND_MY_CORES_LOADED} ]]; then - # ewarn "You have requested parallel build which is known to break." - # ewarn "Please report all breakages upstream." - # return - # fi - # echo $@ - #} - # ghc massively parallel make: #409631, #409873 - # but let users screw it by setting 'I_DEMAND_MY_CORES_LOADED' - #emake $(limit_jobs -j1) all - # ^ above seems to be fixed. - emake all V=1 - - if is_crosscompile; then - # runghc does not work for a stage1 compiler, we can build it anyway - # so it will print the error message: not built for interactive use - pushd "${S}/utils/runghc" || die "Could not cd to utils/runghc" - if [ ! -f Setup.hs ]; then - echo 'import Distribution.Simple; main = defaultMainWithHooks defaultUserHooks' \ - > Setup.hs || die "failed to create default Setup.hs" - fi - ghc -o setup --make Setup.hs || die "setup build failed" - ./setup configure || die "runghc configure failed" - sed -e "s@VERSION@\"${GHC_PV}\"@" -i runghc.hs - ./setup build || die "runghc build failed" - popd - fi - fi # ! use binary -} - -src_install() { - if use binary; then - use prefix && mkdir -p "${ED}" - mv "${S}/usr" "${ED}" - - # Remove the docs if not requested - if ! use doc; then - rm -rf "${ED}/usr/share/doc/${P}/*/" \ - "${ED}/usr/share/doc/${P}/*.html" \ - || die "could not remove docs (P vs PF revision mismatch?)" - fi - else - local insttarget="install" - - # We only built docs if we were bootstrapping, otherwise - # we copy them out of the unpacked binary .tbz2 - if use doc && ! use ghcbootstrap; then - mkdir -p "${ED}/usr/share/doc" - mv "${WORKDIR}/usr/share/doc/${P}" "${ED}/usr/share/doc" \ - || die "failed to copy docs" - else - dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION" - fi - - emake -j1 ${insttarget} \ - DESTDIR="${D}" \ - || die "make ${insttarget} failed" - - # remove wrapper and linker - rm -f "${ED}"/usr/bin/haddock* - - # ghci uses mmap with rwx protection at it implements dynamic - # linking on it's own (bug #299709) - # so mark resulting binary - pax-mark -m "${ED}/usr/$(get_libdir)/${P}/ghc" - - if [[ ! -f "${S}/VERSION" ]]; then - echo "${GHC_PV}" > "${S}/VERSION" \ - || die "Could not create file ${S}/VERSION" - fi - dobashcomp "${FILESDIR}/ghc-bash-completion" - - fi - - # path to the package.cache - local package_confdir="${ED}/usr/$(get_libdir)/${PN}-${GHC_PV}/package.conf.d" - PKGCACHE="${package_confdir}"/package.cache - # copy the package.conf.d, including timestamp, save it so we can help - # users that have a broken package.conf.d - cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d" - - # copy the package.conf, including timestamp, save it so we later can put it - # back before uninstalling, or when upgrading. - cp -p "${PKGCACHE}"{,.shipped} \ - || die "failed to copy package.conf.d/package.cache" -} - -pkg_preinst() { - # have we got an earlier version of ghc installed? - if has_version "<${CATEGORY}/${PF}"; then - haskell_updater_warn="1" - fi -} - -pkg_postinst() { - ghc-reregister - - # path to the package.cache - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - - # give the cache a new timestamp, it must be as recent as - # the package.conf.d directory. - touch "${PKGCACHE}" - - if [[ "${haskell_updater_warn}" == "1" ]]; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "You have just upgraded from an older version of GHC." - ewarn "You may have to run" - ewarn " 'haskell-updater --upgrade'" - ewarn "to rebuild all ghc-based Haskell libraries." - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi - if is_crosscompile; then - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - ewarn "GHC built as a cross compiler. The interpreter, ghci and runghc, do" - ewarn "not work for a cross compiler." - ewarn "For the ghci error: \"<command line>: not built for interactive use\" see:" - ewarn "http://www.haskell.org/haskellwiki/GHC:FAQ#When_I_try_to_start_ghci_.28probably_one_I_compiled_myself.29_it_says_ghc-5.02:_not_built_for_interactive_use" - ewarn - ewarn "\e[1;31m************************************************************************\e[0m" - ewarn - fi -} - -pkg_prerm() { - # Be very careful here... Call order when upgrading is (according to PMS): - # * src_install for new package - # * pkg_preinst for new package - # * pkg_postinst for new package - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # so you'll actually be touching the new packages files, not the one you - # uninstall, due to that or installation directory ${P} will be the same for - # both packages. - - # Call order for reinstalling is (according to PMS): - # * src_install - # * pkg_preinst - # * pkg_prerm for the package being replaced - # * pkg_postrm for the package being replaced - # * pkg_postinst - - # Overwrite the modified package.cache with a copy of the - # original one, so that it will be removed during uninstall. - - PKGCACHE="${EROOT}/usr/$(get_libdir)/${P}/package.conf.d/package.cache" - rm -rf "${PKGCACHE}" - - cp -p "${PKGCACHE}"{.shipped,} -} diff --git a/dev-lang/ghc/ghc-7.8.3.ebuild b/dev-lang/ghc/ghc-7.8.3.ebuild index 4166a885ffef..11fb5b94efd8 100644 --- a/dev-lang/ghc/ghc-7.8.3.ebuild +++ b/dev-lang/ghc/ghc-7.8.3.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.8.3.ebuild,v 1.10 2014/09/05 10:40:45 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.8.3.ebuild,v 1.11 2015/01/02 23:50:56 slyfox Exp $ EAPI=5 @@ -390,7 +390,7 @@ src_prepare() { cd "${S}" # otherwise epatch will break - epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch" + epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch epatch "${FILESDIR}"/${PN}-7.8.1_rc1-libbfd.patch diff --git a/dev-lang/ghc/ghc-7.8.4.ebuild b/dev-lang/ghc/ghc-7.8.4.ebuild index b681da74a2ff..181762b617e6 100644 --- a/dev-lang/ghc/ghc-7.8.4.ebuild +++ b/dev-lang/ghc/ghc-7.8.4.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.8.4.ebuild,v 1.3 2014/12/26 23:35:44 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.8.4.ebuild,v 1.4 2015/01/02 23:50:56 slyfox Exp $ EAPI=5 @@ -390,7 +390,7 @@ src_prepare() { cd "${S}" # otherwise epatch will break - epatch "${FILESDIR}/ghc-7.0.4-CHOST-prefix.patch" + epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch epatch "${FILESDIR}"/${PN}-7.8.1_rc1-libbfd.patch |