summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/ghc')
-rw-r--r--dev-lang/ghc/Manifest5
-rw-r--r--dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch26
-rw-r--r--dev-lang/ghc/files/ghc-7.10.3-relnotes.patch45
-rw-r--r--dev-lang/ghc/ghc-7.10.3.ebuild672
4 files changed, 748 insertions, 0 deletions
diff --git a/dev-lang/ghc/Manifest b/dev-lang/ghc/Manifest
index 2b1151c56a63..1f076a7bbaa0 100644
--- a/dev-lang/ghc/Manifest
+++ b/dev-lang/ghc/Manifest
@@ -1,5 +1,7 @@
DIST binary-0.7.5.0.tar.gz 45764 SHA256 4709c5aa7cc99cb4a465a68de1648968208d0c60c368e2fece476d977530ef19 SHA512 232e7c3da1c0055f3e9f211a86e81c76bc44ab1b70cabd23c93634dbaa42eed8bd9314fbedc16b9703d3ca92b0bbf232e6c30bb1384687dad0e6e85c9abb8947 WHIRLPOOL 1d8dcf9d5125ff398375f4024c0e43fa168004811db7824e2739ec5c0451b38dae9ad74f757c7708427deed0044580b182e35d1c7ecffec25f7b10c70bd32075
+DIST binary-0.7.6.1.tar.gz 47086 SHA256 8f85cafc15be660757878a665d024ce595d4422fead174e20a501c9ec8f81067 SHA512 655daa93a52b845a85d440810452933d7bc3398ad1b51e1e955b2d19a0a32679325a0d1751ad50d252531e493528262e14dab32af4b9a515855fe7f64e0730b2 WHIRLPOOL 6853eb2c817e8ae792226c6c7764ce495833f965c3d503fe7e39c0502019d12f7bd46309b72dfdb276c7dbce8c004cb59fdea4936d69ede0a7c8b487acda2702
DIST ghc-7.10.2-src.tar.bz2 12651156 SHA256 908a01ca86238318f4e880fda400ea399d0a0008d699c912b85d0e0f746e5689 SHA512 e3f99a9e848c12b728212da24bf9029ec8cde88cdfa7eeb4ee2ea223ad8bcaae3e7c27456d09d60a3d21efa8f907ccd2490caf5630ca5fe3ce87f04901275a66 WHIRLPOOL dee757e79de8ac6bcf127212703985282ce96d050be50e78c3f249f13dc0212c9fd96899502748ceb26b9fc3a804379a456e19a9bedfef72f6890992b00492da
+DIST ghc-7.10.3-src.tar.bz2 13281867 SHA256 3e29a56a74ed6a74d3ee2a6db9389f2462837da46ca6dce9d2965f9c152f0c15 SHA512 97a8282d8a75399c78d85d6faab7ac253a993dc69f1840358572f1878b8fd1a527c28801e5823c8200b5690e268e4a0c00941945ada13790852c75a83b612c17 WHIRLPOOL 04af6ea2738a1cc9e266efbb0e1b41b70d4cd915b48ca1265fade62b1c56cd51056fd1a82fc14cebc19a0c16782609a991c1a181ebe59574f1a10b4f26ad830d
DIST ghc-7.4.2-src.tar.bz2 25836446 SHA256 f2ee1289a33cc70539287129841acc7eaf16112bb60c59b5a6ee91887bfd836d SHA512 5a3d06a36702fa7e337b482c9de92ce1f84a68f18d8560bcc11f3617d6d46f93167fee27e786de6483a9ef0eab3b1ac6909a71dd53908d36156df4e465075050 WHIRLPOOL 61865eed2bf92728e7c4c4a0c48be44081bf728cfd824760d643e2fad838d96c19e173052d3aac073e0795b5efa3720ba5ddf13cca1ec7952b7524bbe1f204bc
DIST ghc-7.6.3-src.tar.bz2 110763823 SHA256 bd43823d31f6b5d0b2ca7b74151a8f98336ab0800be85f45bb591c9c26aac998 SHA512 ac86f18b4feeb0bdc9e867261600b210caf62740d73ae657259bbe8149b8c2c4f5a73d09d74d944d4e50f85cc87503485365f0a0ae65befe8d2b6844e5e1253a WHIRLPOOL 0fe1f5f2987699067494559e6a679d28f027eee8fb2a00c683161dbce5443b1faeebfb51572209b75231cee24c7f0c929cabbc82a93f70e16d05e351fdfe2eaf
DIST ghc-7.8.3-src.tar.xz 9160092 SHA256 b0cd96a549ba3b5e512847a4a8cd1a3174e4b2b75dadfc41c568fb812887b958 SHA512 2cc8c2aa6f18ba565c1e2aa637045e246f1214c2a77e95c2a97dfb97203b8983e4ad3cc13178b4b51aff70c58d59a1f68f94cd813d043745cb02411bad04bb00 WHIRLPOOL 3a2e8eea0db7a150e4732efed488a3a5eb56da00a9a90a3379afcb4090323925a2a7485fec6676e784139f112d7c825e8d18a576c34c760af4a7f3adb22c021a
@@ -9,6 +11,8 @@ DIST ghc-bin-7.10.2-amd64.tbz2 112028560 SHA256 536297ac402da44ec1aafb1a93796088
DIST ghc-bin-7.10.2-r1-amd64-noncurses.tbz2 111863814 SHA256 782a68a13343ac8d6ed97540b411f714c4e826ccc3d152724198548c9240aceb SHA512 b154dbd7fb4fefc4283ec337b0c6ce6b6b6b3a62e9d889ca9c5dd5b5e5987f811a1c87845239ca94941afea630fc8bf1d8db94eb11a4023abd4b1d772dfb17c1 WHIRLPOOL 1e1f1ec82c831d115cd5f0b27f1914da94d92a9eca9af634210eb5f72b54281de6e08ea8e304bebaec8a456659b40866b9f0e24ef0e72c3f5a63d85296eb172a
DIST ghc-bin-7.10.2-r1-x86-noncurses.tbz2 113572461 SHA256 3ad1e2888d26b6858cd1efe0e9863bc325b97c47be19fdd2e8dd5bbc86f7266b SHA512 573b7228b576a47ca1c3796cc2d4180a6c9dcaff58555cf52fc85a9b487920fc19487ff9ee8e0b6c33d6196ba05b9908f0d984bf3a4c0d91f52667e7389580a5 WHIRLPOOL 2c8cda95d04e9f345aa2f20fe8758761dd35648b788b7bf9b8f571687a8aae92456552883684d83ec2d2acaf22a002121643316df3c82349400c7de3d0300f7d
DIST ghc-bin-7.10.2-x86.tbz2 113900477 SHA256 eefb7a3002e3dcdd6d936b2b2826eadf3cd100352babad4c9a355b944064240a SHA512 61dae4b9c80bfef6b1e0550c77b70f25d11f4a9fbe3b57d6c4ad451b4b584884432405d39dc32b9f85f3a5ad9d02657356ae0ebd99518848f3d330314c74b595 WHIRLPOOL da0d7eb62d2ee2aeb80a3f495da2ff123e29151b7517fbcd212f83ab3722638f10019511f4f237e8e001c68dd957ed2817fb0f1a2b42c2710239343f1d801496
+DIST ghc-bin-7.10.3-amd64.tbz2 112040431 SHA256 c3c71aff288f7de2785d1c3d54f0fd636144eb3dcb590bdda087b0775203e517 SHA512 e1554b3944edbe8e16537de5a29132dc6a22d780d9a700cdc9b76387b94191164398d6f2242bf8199527802572e2bb02545569d4f0930a0ee0dbfdeb25978558 WHIRLPOOL c2497a9565abf7d37e7928f508f7bf7241dd529aa252da708517f9f067e3d016341b7a73cac34888b99c9b84a8d01fd9e8d76f2b332d53e0d708b078f20ee807
+DIST ghc-bin-7.10.3-x86.tbz2 113877175 SHA256 a06d54e7256292123b49c4d429761794b53d2440d2efeb98bcfe79920c65b044 SHA512 75096fe9106d975c15e646b0a559c544621fd02791f491bce54926efabf0e55b97150069ddfa7a9f02cc30bb6975d3d3121a82207a9f67b8dda5ebfe17ec4744 WHIRLPOOL 63fea83be14ae317f313251b7c952c974a8e4f9671d78d1b3ef77c3ab317d2194faddc8d71431c5e1fc42215abed1842913f2f40ba383288784e984c47cd27f0
DIST ghc-bin-7.4.2-alpha.tbz2 130483507 SHA256 cd8e72e569574f137bf10fcdb4337bb0dc320deb2a2c4d72529a821735c53ae6 SHA512 6fb99dea706965afa60f4aeb68da3da1c69dda477f5fcfb4e67b73d75b78583193148ce9f623a356679a57f1a740f8010f28a22f08e56ace50f3fcd42142f83f WHIRLPOOL e5ec69ab24dc963ac709f13928c0e35931d5d50ca6b21dfb0aa79f9088c0ce1196b64bb4d9668e35d73dcdf9e2df9c3da59c95eaf3db8b793a6bb65b1f4ba6c0
DIST ghc-bin-7.4.2-amd64-stable-glibc.tbz2 93139900 SHA256 f06dff00585cc1a8ecc8ac29aeca7fdc601d272eed29d7613f7a2f2924cad585 SHA512 9b725f2613dd9013851a16eaea4000ea424c51cbafa97d3860f120fdb9936247f8c65208775a80a2f49b74946ddda2e843a54dec00b78c521197374aa3dd2d50 WHIRLPOOL 9e2630b1de40a059c324be38a1fe68b16ea484bc7afc2a397ea05192263d1964aed1d29fde543622ceab12ed2df111204576fdc72b7e35b2bbf9c6b9519901d1
DIST ghc-bin-7.4.2-ia64.tbz2 155787636 SHA256 a1d89221645832cc5d11cde4937cce75d564e6a79eba334b92a4c465eb3f161f SHA512 c7138ed8eaf40ee7e7559b6063096351b64fc35cbd1adb4c734b2f2c6b77fb98368b1296fcb67c1a0b21b0faf053a82f8f98c3656b89c593e677ce78165d0c74 WHIRLPOOL 7ff2db2932a6d56961dcca386c9ec8f8eb1ee12e1b84230fbb089ff137eeb216117eecaa37b33b4c037ebee0063a07cd380077b754e64ef0219759b54a4f7fe2
@@ -33,4 +37,5 @@ DIST ghc-bin-7.8.4-ppc64.tbz2 129284515 SHA256 1e8a350af39d1db1e58a74c9bc4a4c577
DIST ghc-bin-7.8.4-sparc.tbz2 147340595 SHA256 1cde749ce3c47016c5c7a7179423d0aa2b174ddae4af0392ae3b7f57b098ec0c SHA512 ee5f0b2f1cf2693a0f2be9df71ef61b52bc2327225d40b8be955c1584b9901ffc6aaab63c1e46bf9bb352633b605c98378f8fd3e6cd71aef1c089007e4110217 WHIRLPOOL 27d55a016ffb49852553f920c29929c3bdf383e28b4b806ceb9ffc8b46a59b438801101402e498b069aa6eb56870b70a00ba7b1f4098f3fd8d8ddf1b20caa626
DIST ghc-bin-7.8.4-x86.tbz2 102312459 SHA256 4c53148836e5a1ba55b8db5bb7c3eb915103e0955fb503b2facdc5a72f12a974 SHA512 cabc5bd6d8760ce4120e7053f6c1dffca7d161ba454b6201087760096c037c932e3ff8c82e53346c8278855bf0cff1c2f5fb8046242ca4d8307355b060a9556e WHIRLPOOL 0171d67dc1b63381a491e1577a783eb0e8f53cb579ba96a9b4fdf6685d494d78eb2be780f77ff33422d3b7c320ed102d9b48f6e954f8fee5532982575001a4a5
DIST hoopl-3.10.1.0.tar.gz 241582 SHA256 7af615dfd4051670dccf31e5a7e1e71a9ae5f301e6a0668557fd84f61f6bc2d4 SHA512 943fe7034c89f4f914617cf1bccf7f66c3e660328fbbd9ae40f78a3f78a4a5b6fdd86c2afd40c11d4c4c4a34bc8fd47ab7e6227cdf9f3f4887b5cc796720e7aa WHIRLPOOL 3a410081f70c4ebbb563a48d71ec6f1e226a13b965ea12d01ca521b32041308394c7da6d3b3e36e75d1322c188b81fc08f4b2bf6037df5d8ac4998a944326be2
+DIST hoopl-3.10.2.0.tar.gz 241940 SHA256 6740814c774e51815e8260ae1b4ac8af6ab69f02e112904450f689c4792f1121 SHA512 083baa8a5eb53247aff8d5b9b2144e0f63adb9400934297bbd80bfcec607dd90a34def4301045a60472ef10b0fb90ab84692fc08f786e7f806c28afdab1ef66a WHIRLPOOL 761e7440d2bc32b594ab55ea967c5b075bb638b2fdba6606beaf9c31a90e20031e914146828004b3d11203668210a6994be9fabc3b0ebb428d516b57cae9ee68
DIST transformers-0.4.3.0.tar.gz 28632 SHA256 b3d0a797e815ca50d411e20c02f781efe7751308007d880af7f0b5c4365c3a9d SHA512 c3ec0893ebba4fbd6087c3202e919552c4a9bff3350b5c0589e7ebb18751a515d98b8cac15b0a3252906ea72b5a0eb09b7fe88c8da88b09d6ce4fbf0f50b2780 WHIRLPOOL 89591781926b1d025056dedcfc5de61705056c1e3a8eba72f2e89789e78d2ed4d8909f84d6560dfc66bc0b360f98cb3dc3835f3a05c2325f747498373c88aa4b
diff --git a/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch b/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch
new file mode 100644
index 000000000000..106d07aa31c8
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.10.3-hardfloat.patch
@@ -0,0 +1,26 @@
+commit 5cc08ebf2f346992a0abd4440252165c90b5ec05
+Author: Sergei Trofimovich <siarheit@google.com>
+Date: Sat Jun 20 12:23:00 2015 +0100
+
+ Recognise 'hardhloat' as a valid vendor in a host tuple
+
+ Observed on a tuple armv7a-hardfloat-linux-gnueabi:
+ > Unknown vendor hardfloat
+
+ Reported-by: Sergey Alirzaev
+ Signed-off-by: Sergei Trofimovich <siarheit@google.com>
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 590edb0..958622c 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -1966,6 +1966,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[
+ softfloat) # like armv5tel-softfloat-linux-gnueabi
+ $2="unknown"
+ ;;
++ hardfloat) # like armv7a-hardfloat-linux-gnueabi
++ $2="unknown"
++ ;;
+ *)
+ #pass thru by default
+ $2="$1"
diff --git a/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch b/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch
new file mode 100644
index 000000000000..675037946e75
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.10.3-relnotes.patch
@@ -0,0 +1,45 @@
+diff --git a/ANNOUNCE b/ANNOUNCE
+index 7812eba..0018b37 100644
+--- a/ANNOUNCE
++++ b/ANNOUNCE
+@@ -1,6 +1,6 @@
+
+ ==============================================================
+- The (Interactive) Glasgow Haskell Compiler -- version 7.10.2
++ The (Interactive) Glasgow Haskell Compiler -- version 7.10.3
+ ==============================================================
+
+ The GHC Team is pleased to announce a new minor release of GHC. This is a
+@@ -29,7 +29,7 @@ bug-fix release and contains a number of important fixes,
+ A more thorough list of the changes in the release can be found in the release
+ notes,
+
+- http://haskell.org/ghc/docs/7.10.2/html/users_guide/release-7-10-2.html
++ http://haskell.org/ghc/docs/7.10.3/html/users_guide/release-7-10-3.html
+
+
+ How to get it
+diff --git a/docs/users_guide/intro.xml b/docs/users_guide/intro.xml
+index 3292334..fb7116e 100644
+--- a/docs/users_guide/intro.xml
++++ b/docs/users_guide/intro.xml
+@@ -309,6 +309,7 @@
+
+ &relnotes1;
+ &relnotes2;
++&relnotes3;
+
+ </chapter>
+
+diff --git a/docs/users_guide/ug-ent.xml.in b/docs/users_guide/ug-ent.xml.in
+index b696aad..3629e93 100644
+--- a/docs/users_guide/ug-ent.xml.in
++++ b/docs/users_guide/ug-ent.xml.in
+@@ -5,6 +5,7 @@
+ <!ENTITY intro SYSTEM "intro.xml" >
+ <!ENTITY relnotes1 SYSTEM "7.10.1-notes.xml" >
+ <!ENTITY relnotes2 SYSTEM "7.10.2-notes.xml" >
++<!ENTITY relnotes3 SYSTEM "7.10.3-notes.xml" >
+ <!ENTITY using SYSTEM "using.xml" >
+ <!ENTITY code-gens SYSTEM "codegens.xml" >
+ <!ENTITY runtime SYSTEM "runtime_control.xml" >
diff --git a/dev-lang/ghc/ghc-7.10.3.ebuild b/dev-lang/ghc/ghc-7.10.3.ebuild
new file mode 100644
index 000000000000..d05233d89b56
--- /dev/null
+++ b/dev-lang/ghc/ghc-7.10.3.ebuild
@@ -0,0 +1,672 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# to make make a crosscompiler use crossdev and symlink ghc tree into
+# cross overlay. result would look like 'cross-sparc-unknown-linux-gnu/ghc'
+#
+# 'CTARGET' definition and 'is_crosscompile' are taken from 'toolchain.eclass'
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} = ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+
+inherit autotools bash-completion-r1 eutils flag-o-matic ghc-package
+inherit multilib pax-utils toolchain-funcs versionator
+
+DESCRIPTION="The Glasgow Haskell Compiler"
+HOMEPAGE="http://www.haskell.org/ghc/"
+
+# we don't have any binaries yet
+arch_binaries=""
+
+# sorted!
+#arch_binaries="$arch_binaries alpha? ( http://code.haskell.org/~slyfox/ghc-alpha/ghc-bin-${PV}-alpha.tbz2 )"
+#arch_binaries="$arch_binaries arm? ( http://code.haskell.org/~slyfox/ghc-arm/ghc-bin-${PV}-arm.tbz2 )"
+arch_binaries="$arch_binaries amd64? ( http://code.haskell.org/~slyfox/ghc-amd64/ghc-bin-${PVR}-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-${PVR}-x86.tbz2 )"
+
+# various ports:
+#arch_binaries="$arch_binaries x86-fbsd? ( http://code.haskell.org/~slyfox/ghc-x86-fbsd/ghc-bin-${PV}-x86-fbsd.tbz2 )"
+
+# 0 - yet
+yet_binary() {
+ case "${ARCH}" in
+ #alpha) return 0 ;;
+ #arm)
+ # ewarn "ARM binary is built on armv5tel-eabi toolchain. Use with caution."
+ # return 0
+ #;;
+ amd64) return 0 ;;
+ #ia64) return 0 ;;
+ #ppc) return 0 ;;
+ #ppc64) return 0 ;;
+ #sparc) return 0 ;;
+ x86) return 0 ;;
+ *) return 1 ;;
+ esac
+}
+
+GHC_PV=${PV}
+#GHC_PV=7.10.2.20151030 # uncomment only for -rc ebuilds
+GHC_P=${PN}-${GHC_PV} # using ${P} is almost never correct
+
+SRC_URI="!binary? ( http://downloads.haskell.org/~ghc/${PV/_rc/-rc}/${GHC_P}-src.tar.bz2 )"
+S="${WORKDIR}"/${GHC_P}
+
+[[ -n $arch_binaries ]] && SRC_URI+=" !ghcbootstrap? ( $arch_binaries )"
+
+BUMP_LIBRARIES=(
+ # "hackage-name hackage-version"
+ "binary 0.7.6.1"
+ "hoopl 3.10.2.0"
+ "transformers 0.4.3.0"
+)
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc ghcbootstrap ghcmakebinary +gmp"
+IUSE+=" binary"
+IUSE+=" elibc_glibc" # system stuff
+
+RDEPEND="
+ >=dev-lang/perl-5.6.1
+ >=dev-libs/gmp-5:=
+ sys-libs/ncurses:=[unicode]
+ !ghcmakebinary? ( virtual/libffi:= )
+ !kernel_Darwin? ( >=sys-devel/gcc-2.95.3:* )
+ kernel_linux? ( >=sys-devel/binutils-2.17:* )
+ kernel_SunOS? ( >=sys-devel/binutils-2.17:* )
+"
+
+# force dependency on >=gmp-5, even if >=gmp-4.1 would be enough. this is due to
+# that we want the binaries to use the latest versioun available, and not to be
+# built against gmp-4
+
+# similar for glibc. we have bootstrapped binaries against glibc-2.17
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ >=dev-libs/libxslt-1.1.2 )
+ !ghcbootstrap? ( !prefix? ( elibc_glibc? ( >=sys-libs/glibc-2.17 ) ) )"
+
+PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.2* )"
+
+REQUIRED_USE="?? ( ghcbootstrap binary )"
+
+# haskell libraries built with cabal in configure mode, #515354
+QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# returns tool prefix for crosscompiler.
+# Example:
+# CTARGET=armv7a-unknown-linux-gnueabi
+# CHOST=x86_64-pc-linux-gnu
+# "armv7a-unknown-linux-gnueabi-"
+# CTARGET=${CHOST}
+# ""
+# Used in tools and library prefix:
+# "${ED}"/usr/bin/$(cross)haddock
+# "${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
+
+cross() {
+ if is_crosscompile; then
+ echo "${CTARGET}-"
+ else
+ echo ""
+ fi
+}
+
+append-ghc-cflags() {
+ local persistent compile assemble link
+ local flag ghcflag
+
+ for flag in $*; do
+ case ${flag} in
+ persistent) persistent="yes";;
+ compile) compile="yes";;
+ assemble) assemble="yes";;
+ link) link="yes";;
+ *)
+ [[ ${compile} ]] && ghcflag="-optc${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
+ [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
+ [[ ${assemble} ]] && ghcflag="-opta${flag}" CFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
+ [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
+ [[ ${link} ]] && ghcflag="-optl${flag}" LDFLAGS+=" ${flag}" && GHC_FLAGS+=" ${ghcflag}" &&
+ [[ ${persistent} ]] && GHC_PERSISTENT_FLAGS+=" ${ghcflag}"
+ ;;
+ esac
+ done
+}
+
+# $1 - lib name (under libraries/)
+# $2 - lib version
+# example: bump_lib "transformers" "0.4.2.0"
+bump_lib() {
+ local pn=$1 pv=$2
+ local p=${pn}-${pv}
+ local f
+
+ einfo "Bumping ${pn} up to ${pv}"
+
+ for f in ghc.mk GNUmakefile; do
+ mv libraries/"${pn}"/$f "${WORKDIR}"/"${p}"/$f || die
+ done
+ mv libraries/"${pn}" "${WORKDIR}"/"${pn}".old || die
+ mv "${WORKDIR}"/"${p}" libraries/"${pn}" || die
+}
+
+update_SRC_URI() {
+ local p pn pv
+ for p in "${BUMP_LIBRARIES[@]}"; do
+ set -- $p
+ pn=$1 pv=$2
+
+ SRC_URI+=" mirror://hackage/package/${pn}/${pn}-${pv}.tar.gz"
+ done
+}
+
+update_SRC_URI
+
+bump_libs() {
+ local p pn pv
+ for p in "${BUMP_LIBRARIES[@]}"; do
+ set -- $p
+ pn=$1 pv=$2
+
+ bump_lib "${pn}" "${pv}"
+ 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}"
+ einfo " prefix: $(cross)"
+ return
+ fi
+ # We need to be very careful with the CFLAGS we ask ghc to pass through to
+ # gcc. There are plenty of flags which will make gcc produce output that
+ # breaks ghc in various ways. The main ones we want to pass through are
+ # -mcpu / -march flags. These are important for arches like alpha & sparc.
+ # We also use these CFLAGS for building the C parts of ghc, ie the rts.
+ strip-flags
+ strip-unsupported-flags
+
+ # Cmm can't parse line numbers #482086
+ replace-flags -ggdb[3-9] -ggdb2
+
+ GHC_FLAGS=""
+ GHC_PERSISTENT_FLAGS=""
+ for flag in ${CFLAGS}; do
+ case ${flag} in
+
+ # Ignore extra optimisation (ghc passes -O to gcc anyway)
+ # -O2 and above break on too many systems
+ -O*) ;;
+
+ # Arch and ABI flags are what we're really after
+ -m*) append-ghc-cflags compile assemble ${flag};;
+
+ # Sometimes it's handy to see backtrace of RTS
+ # to get an idea what happens there
+ -g*) append-ghc-cflags compile ${flag};;
+
+ # Ignore all other flags, including all -f* flags
+ esac
+ done
+
+ for flag in ${LDFLAGS}; do
+ append-ghc-cflags link ${flag}
+ done
+
+ # hardened-gcc needs to be disabled, because the mangler doesn't accept
+ # its output.
+ gcc-specs-pie && append-ghc-cflags persistent compile link -nopie
+ gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector
+
+ # prevent from failind building unregisterised ghc:
+ # http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
+ use ppc64 && append-ghc-cflags persistent compile -mminimal-toc
+ # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
+ # currently ghc fails to build haddock
+ # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
+ use ia64 && append-ghc-cflags persistent compile -G0
+}
+
+# substitutes string $1 to $2 in files $3 $4 ...
+relocate_path() {
+ local from=$1
+ local to=$2
+ shift 2
+ local file=
+ for file in "$@"
+ do
+ sed -i -e "s|$from|$to|g" \
+ "$file" || die "path relocation failed for '$file'"
+ done
+}
+
+# changes hardcoded ghc paths and updates package index
+# $1 - new absolute root path
+relocate_ghc() {
+ local to=$1
+
+ # libdir for prebuilt binary and for current system may mismatch
+ # It does for prefix installation for example: bug #476998
+ local bin_ghc_prefix=${WORKDIR}/usr
+ local bin_libpath=$(echo "${bin_ghc_prefix}"/lib*)
+ local bin_libdir=${bin_libpath#${bin_ghc_prefix}/}
+
+ # backup original script to use it later after relocation
+ local gp_back="${T}/ghc-pkg-${GHC_PV}-orig"
+ cp "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
+
+ if [[ ${bin_libdir} != $(get_libdir) ]]; then
+ einfo "Relocating '${bin_libdir}' to '$(get_libdir)' (bug #476998)"
+ # moving the dir itself is not strictly needed
+ # but then USE=binary would result in installing
+ # in '${bin_libdir}'
+ mv "${bin_ghc_prefix}/${bin_libdir}" "${bin_ghc_prefix}/$(get_libdir)" || die
+
+ relocate_path "/usr/${bin_libdir}" "/usr/$(get_libdir)" \
+ "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)ghci-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)hsc2hs" \
+ "${WORKDIR}/usr/bin/$(cross)runghc-${GHC_PV}" \
+ "$gp_back" \
+ "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/"*
+ fi
+
+ # Relocate from /usr to ${EPREFIX}/usr
+ relocate_path "/usr" "${to}/usr" \
+ "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)ghci-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)hsc2hs" \
+ "${WORKDIR}/usr/bin/$(cross)runghc-${GHC_PV}" \
+ "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/"*
+
+ # this one we will use to regenerate cache
+ # so it should point to current tree location
+ relocate_path "/usr" "${WORKDIR}/usr" "$gp_back"
+
+ if use prefix; then
+ # and insert LD_LIBRARY_PATH entry to EPREFIX dir tree
+ # TODO: add the same for darwin's CHOST and it's DYLD_
+ local new_ldpath='LD_LIBRARY_PATH="'${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir)'${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"\nexport LD_LIBRARY_PATH'
+ sed -i -e '2i'"$new_ldpath" \
+ "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)ghci-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)ghc-pkg-${GHC_PV}" \
+ "${WORKDIR}/usr/bin/$(cross)hsc2hs" \
+ "${WORKDIR}/usr/bin/$(cross)runghc-${GHC_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() {
+ # quiet portage about prebuilt binaries
+ use binary && QA_PREBUILT="*"
+
+ [[ ${MERGE_TYPE} == binary ]] && return
+
+ if use ghcbootstrap; then
+ ewarn "You requested ghc bootstrapping, this is usually only used"
+ ewarn "by Gentoo developers to make binary .tbz2 packages."
+
+ [[ -z $(type -P ghc) ]] && \
+ die "Could not find a ghc to bootstrap with."
+ else
+ if ! yet_binary; then
+ eerror "Please try emerging with USE=ghcbootstrap and report build"
+ eerror "sucess or failure to the haskell team (haskell@gentoo.org)"
+ die "No binary available for '${ARCH}' arch yet, USE=ghcbootstrap"
+ fi
+ fi
+}
+
+src_unpack() {
+ # Create the ${S} dir if we're using the binary version
+ use binary && mkdir "${S}"
+
+ # the Solaris and Darwin binaries from ghc (maeder) need to be
+ # unpacked separately, so prevent them from being unpacked
+ local ONLYA=${A}
+ case ${CHOST} in
+ *-darwin* | *-solaris*) ONLYA=${GHC_P}-src.tar.bz2 ;;
+ esac
+ unpack ${ONLYA}
+
+ if [[ -d "${S}"/libraries/dph ]]; then
+ # Sometimes dph libs get accidentally shipped with ghc
+ # but they are not installed unless user requests it.
+ # We never install them.
+ elog "Removing 'libraries/dph'"
+ rm -rf "${S}"/libraries/dph
+ fi
+}
+
+src_prepare() {
+ ghc_setup_cflags
+
+ if ! use ghcbootstrap && [[ ${CHOST} != *-darwin* && ${CHOST} != *-solaris* ]]; then
+ # Modify the wrapper script from the binary tarball to use GHC_PERSISTENT_FLAGS.
+ # See bug #313635.
+ sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
+ "${WORKDIR}/usr/bin/$(cross)ghc-${GHC_PV}"
+
+ # allow hardened users use vanilla binary to bootstrap ghc
+ # ghci uses mmap with rwx protection at it implements dynamic
+ # linking on it's own (bug #299709)
+ pax-mark -m "${WORKDIR}/usr/$(get_libdir)/$(cross)${GHC_P}/bin/ghc"
+ fi
+
+ if use binary; then
+ if use prefix; then
+ relocate_ghc "${EPREFIX}"
+ fi
+
+ # Move unpacked files to the expected place
+ mv "${WORKDIR}/usr" "${S}"
+ else
+ if ! use ghcbootstrap; then
+ case ${CHOST} in
+ *-darwin* | *-solaris*)
+ # UPDATE ME for ghc-7
+ mkdir "${WORKDIR}"/ghc-bin-installer || die
+ pushd "${WORKDIR}"/ghc-bin-installer > /dev/null || die
+ use sparc-solaris && unpack ghc-6.10.4-sparc-sun-solaris2.tar.bz2
+ use x86-solaris && unpack ghc-7.0.3-i386-unknown-solaris2.tar.bz2
+ use x86-macos && unpack ghc-7.4.1-i386-apple-darwin.tar.bz2
+ use x64-macos && unpack ghc-7.4.1-x86_64-apple-darwin.tar.bz2
+ popd > /dev/null
+
+ pushd "${WORKDIR}"/ghc-bin-installer/ghc-[67].?*.? > /dev/null || die
+ # fix the binaries so they run, on Solaris we need an
+ # LD_LIBRARY_PATH which has our prefix libdirs, on
+ # Darwin we need to replace the frameworks with our libs
+ # from the prefix fix before installation, because some
+ # of the tools are actually used during configure/make
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ export LD_LIBRARY_PATH="${EPREFIX}/$(get_libdir):${EPREFIX}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ local readline_framework=GNUreadline.framework/GNUreadline
+ local gmp_framework=/opt/local/lib/libgmp.10.dylib
+ local ncurses_file=/opt/local/lib/libncurses.5.dylib
+ for binary in $(scanmacho -BRE MH_EXECUTE -F '%F' .) ; do
+ install_name_tool -change \
+ ${readline_framework} \
+ "${EPREFIX}"/lib/libreadline.dylib \
+ ${binary} || die
+ install_name_tool -change \
+ ${gmp_framework} \
+ "${EPREFIX}"/usr/lib/libgmp.dylib \
+ ${binary} || die
+ install_name_tool -change \
+ ${ncurses_file} \
+ "${EPREFIX}"/usr/lib/libncurses.dylib \
+ ${binary} || die
+ done
+ # we don't do frameworks!
+ sed -i \
+ -e 's/\(frameworks = \)\["GMP"\]/\1[]/g' \
+ -e 's/\(extraLibraries = \)\["m"\]/\1["m","gmp"]/g' \
+ rts/package.conf.in || die
+ fi
+
+ # it is autoconf, but we really don't want to give it too
+ # much arguments, in fact we do the make in-place anyway
+ ./configure --prefix="${WORKDIR}"/usr || die
+ make install || die
+ popd > /dev/null
+ ;;
+ *)
+ relocate_ghc "${WORKDIR}"
+ ;;
+ esac
+ fi
+
+ sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_PERSISTENT_FLAGS}|" \
+ "${S}/ghc/ghc.wrapper"
+
+ cd "${S}" # otherwise epatch will break
+
+ epatch "${FILESDIR}"/${PN}-7.0.4-CHOST-prefix.patch
+
+ epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
+ epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
+ epatch "${FILESDIR}"/${PN}-7.10.1-rc3-ghc-7.10-bootstrap.patch
+ epatch "${FILESDIR}"/${PN}-7.10.3-relnotes.patch
+ epatch "${FILESDIR}"/${PN}-7.10.3-hardfloat.patch
+
+ # Since ${S}/packages does not include base, etc. add them to gen_contents_index
+ sed -e 's@\(for REPO in .*\)@\1 base integer-gmp integer-gmp2 integer-simple template-haskell@' \
+ -i libraries/gen_contents_index || die
+
+ 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
+
+ bump_libs
+
+ # as we have changed the build system
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ if ! use binary; then
+ # initialize build.mk
+ echo '# Gentoo changes' > mk/build.mk
+
+ # Put docs into the right place, ie /usr/share/doc/ghc-${GHC_PV}
+ echo "docdir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
+ echo "htmldir = ${EPREFIX}/usr/share/doc/${P}" >> mk/build.mk
+
+ # We also need to use the GHC_FLAGS flags when building ghc itself
+ echo "SRC_HC_OPTS+=${HCFLAGS} ${GHC_FLAGS}" >> mk/build.mk
+ echo "SRC_CC_OPTS+=${CFLAGS}" >> mk/build.mk
+ echo "SRC_LD_OPTS+=${LDFLAGS}" >> mk/build.mk
+
+ # We can't depend on haddock except when bootstrapping when we
+ # must build docs and include them into the binary .tbz2 package
+ # app-text/dblatex is not in portage, can not build PDF or PS
+ echo "BUILD_DOCBOOK_PDF = NO" >> mk/build.mk
+ echo "BUILD_DOCBOOK_PS = NO" >> mk/build.mk
+ if use doc; then
+ echo "BUILD_DOCBOOK_HTML = YES" >> mk/build.mk
+ else
+ echo "BUILD_DOCBOOK_HTML = NO" >> mk/build.mk
+ fi
+
+ # this controls presence on 'xhtml' and 'haddock' in final install
+ echo "HADDOCK_DOCS = YES" >> mk/build.mk
+
+ # 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-gmp2" >> mk/build.mk
+ else
+ echo "INTEGER_LIBRARY=integer-simple" >> mk/build.mk
+ fi
+
+ # don't strip anything. Very useful when stage2 SIGSEGVs on you
+ echo "STRIP_CMD = :" >> mk/build.mk
+
+ local econf_args=()
+
+ # GHC embeds 'gcc' it was built by and uses it later.
+ # Don't allow things like ccache or versioned binary slip.
+ # We use stable thing across gcc upgrades.
+ is_crosscompile || econf_args+=(--with-gcc=${CHOST}-gcc)
+
+ if use ghcmakebinary; then
+ # When building booting libary we are trying to
+ # bundle or restrict most of external depends
+ # with unstable ABI:
+ # - embed libffi (default GHC behaviour)
+ # - disable ncurses support for ghci (via haskeline)
+ # https://bugs.gentoo.org/557478
+ # - disable ncurses support for ghc-pkg
+ echo "libraries/haskeline_CONFIGURE_OPTS += --flag=-terminfo" >> mk/build.mk
+ echo "utils/ghc-pkg_HC_OPTS += -DBOOTSTRAPPING" >> mk/build.mk
+ else
+ econf_args+=(--with-system-libffi)
+ econf_args+=(--with-ffi-includes=$(pkg-config libffi --cflags-only-I | sed -e 's@^-I@@'))
+ fi
+
+ elog "Final mk/build.mk:"
+ cat mk/build.mk || die
+
+ econf ${econf_args[@]} --enable-bootstrap-with-devel-snapshot
+
+ if [[ ${PV} == *9999* ]]; then
+ GHC_PV="$(grep 'S\[\"PACKAGE_VERSION\"\]' config.status | sed -e 's@^.*=\"\(.*\)\"@\1@')"
+ GHC_P=${PN}-${GHC_PV}
+ fi
+ fi # ! use binary
+}
+
+src_compile() {
+ if ! use binary; then
+ # 1. build compiler binary first
+ emake ghc/stage2/build/tmp/ghc-stage2
+ # 2. pax-mark (bug #516430)
+ pax-mark -m ghc/stage2/build/tmp/ghc-stage2
+ # 3. and then all the rest
+ emake all
+ fi # ! use binary
+}
+
+src_install() {
+ if use binary; then
+ use prefix && mkdir -p "${ED}"
+ mv "${S}/usr" "${ED}"
+ else
+
+ emake -j1 install DESTDIR="${D}"
+ dodoc "distrib/README" "ANNOUNCE" "LICENSE" "VERSION"
+
+ # rename ghc-shipped files to avoid collision
+ # of external packages. Motivating example:
+ # user had installed:
+ # dev-lang/ghc-7.8.4-r0 (with transformers-0.3.0.0)
+ # dev-haskell/transformers-0.4.2.0
+ # then user tried to update to
+ # dev-lang/ghc-7.8.4-r1 (with transformers-0.4.2.0)
+ # this will lead to single .conf file collision.
+ local shipped_conf renamed_conf
+ local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
+ for shipped_conf in "${package_confdir}"/*.conf; do
+ # rename 'pkg-ver-id.conf' to 'pkg-ver-id-gentoo-${PF}.conf'
+ renamed_conf=${shipped_conf%.conf}-gentoo-${PF}.conf
+ mv "${shipped_conf}" "${renamed_conf}" || die
+ done
+
+ # remove link, but leave 'haddock-${GHC_P}'
+ rm -f "${ED}"/usr/bin/$(cross)haddock
+
+ if [[ ! -f "${S}/VERSION" ]]; then
+ echo "${GHC_PV}" > "${S}/VERSION" \
+ || die "Could not create file ${S}/VERSION"
+ fi
+ if ! is_crosscompile; then
+ newbashcomp "${FILESDIR}"/ghc-bash-completion ghc-pkg
+ newbashcomp utils/completion/ghc.bash ghc
+ fi
+ fi
+
+ # path to the package.cache
+ local package_confdir="${ED}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d"
+ PKGCACHE="${package_confdir}"/package.cache
+ # copy the package.conf.d, including timestamp, save it so we can help
+ # users that have a broken package.conf.d
+ cp -pR "${package_confdir}"{,.initial} || die "failed to backup intial package.conf.d"
+
+ # copy the package.conf, including timestamp, save it so we later can put it
+ # back before uninstalling, or when upgrading.
+ cp -p "${PKGCACHE}"{,.shipped} \
+ || die "failed to copy package.conf.d/package.cache"
+}
+
+pkg_preinst() {
+ # have we got an earlier version of ghc installed?
+ if has_version "<${CATEGORY}/${PF}"; then
+ haskell_updater_warn="1"
+ fi
+}
+
+pkg_postinst() {
+ ghc-reregister
+
+ # path to the package.cache
+ PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
+
+ # give the cache a new timestamp, it must be as recent as
+ # the package.conf.d directory.
+ touch "${PKGCACHE}"
+
+ if [[ "${haskell_updater_warn}" == "1" ]]; then
+ ewarn
+ ewarn "\e[1;31m************************************************************************\e[0m"
+ ewarn
+ ewarn "You have just upgraded from an older version of GHC."
+ ewarn "You may have to run"
+ ewarn " 'haskell-updater'"
+ ewarn "to rebuild all ghc-based Haskell libraries."
+ ewarn
+ ewarn "\e[1;31m************************************************************************\e[0m"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ PKGCACHE="${EROOT}/usr/$(get_libdir)/$(cross)${GHC_P}/package.conf.d/package.cache"
+ rm -rf "${PKGCACHE}"
+
+ cp -p "${PKGCACHE}"{.shipped,}
+}
+
+pkg_postrm() {
+ ghc-package_pkg_postrm
+}