summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2016-09-13 22:21:29 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2016-09-13 22:26:38 +0100
commita2d669ef498c0372a1792d97a3084c82e3278e38 (patch)
tree3a7e4f11c680537a851473f69836c983a662b150 /eclass/ghc-package.eclass
parentlxde-base/lxappearance: Remove old versions (diff)
downloadgentoo-a2d669ef498c0372a1792d97a3084c82e3278e38.tar.gz
gentoo-a2d669ef498c0372a1792d97a3084c82e3278e38.tar.bz2
gentoo-a2d669ef498c0372a1792d97a3084c82e3278e38.zip
haskell-cabal.eclass: drop unused CABAL_FEATURES="alex happy c2hs cpphs"
While at it: - dropped internal 'ghc-sanecabal()' helper - factored out parallelism setup to new 'ghc-make-args()' function - building initial Setup binary now also uses 'ghc-make-args()' - dropped unused CABAL_MIN_VERSION global variable Fixed bug in 'ghc-make-args()' to work on NOSMP ports of GHC: We use 'qb0' to enable parallel GC. Parallel GC requires SMP support and threaded runtime. Reported by iota__ on arm/ghc-8 where there is support for parallel make but not the SMP support: ,("Host platform","arm-unknown-linux") ,("Support SMP","NO") ,("Support parallel --make","YES") ,("RTS ways","l debug thr... Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/ghc-package.eclass')
-rw-r--r--eclass/ghc-package.eclass35
1 files changed, 20 insertions, 15 deletions
diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass
index 5466c0b5b20d..7efa2c838449 100644
--- a/eclass/ghc-package.eclass
+++ b/eclass/ghc-package.eclass
@@ -11,7 +11,7 @@
# @DESCRIPTION:
# Helper eclass to handle ghc installation/upgrade/deinstallation process.
-inherit versionator
+inherit multiprocessing versionator
# @FUNCTION: ghc-getghc
# @DESCRIPTION:
@@ -106,20 +106,6 @@ ghc-cabal-version() {
fi
}
-# @FUNCTION: ghc-sanecabal
-# @DESCRIPTION:
-# check if a standalone Cabal version is available for the
-# currently used ghc; takes minimal version of Cabal as
-# an optional argument
-ghc-sanecabal() {
- local f
- local version
- if [[ -z "$1" ]]; then version="1.0.1"; else version="$1"; fi
- for f in $(ghc-confdir)/cabal-*; do
- [[ -f "${f}" ]] && version_is_at_least "${version}" "${f#*cabal-}" && return
- done
- return 1
-}
# @FUNCTION: ghc-is-dynamic
# @DESCRIPTION:
# checks if ghc is built against dynamic libraries
@@ -193,6 +179,25 @@ ghc-libdir() {
echo "${_GHC_LIBDIR_CACHE}"
}
+# @FUNCTION: ghc-make-args
+# @DESCRIPTION:
+# Returns default arguments passed along 'ghc --make'
+# build mode. Used mainly to enable parallel build mode.
+ghc-make-args() {
+ local ghc_make_args=()
+ # parallel on all available cores
+ if ghc-supports-smp && ghc-supports-parallel-make; then
+ # It should have been just -j$(makeopts_jobs)
+ # but GHC does not yet have nice defaults:
+ # https://ghc.haskell.org/trac/ghc/ticket/9221#comment:57
+ # SMP is a requirement for parallel GC's gen0
+ # 'qb' balancing.
+ echo "-j$(makeopts_jobs) +RTS -A256M -qb0 -RTS"
+ ghc_make_args=()
+ fi
+ echo "${ghc_make_args[@]}"
+}
+
# @FUNCTION: ghc-confdir
# @DESCRIPTION:
# returns the (Gentoo) library configuration directory, we