summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2016-05-31 22:35:32 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2016-05-31 22:37:16 +0100
commit2db4176c329e5e99e68f47dcb058c55d434bb64e (patch)
tree8a268a63179d05ab2d6dece7fc640483aecee27f /eclass/haskell-cabal.eclass
parentdev-python/pyudev: Version bump to 0.20.0 (diff)
downloadgentoo-2db4176c329e5e99e68f47dcb058c55d434bb64e.tar.gz
gentoo-2db4176c329e5e99e68f47dcb058c55d434bb64e.tar.bz2
gentoo-2db4176c329e5e99e68f47dcb058c55d434bb64e.zip
haskell-cabal.eclass: add basic support for ROOT!=/, bug #534194
Reported-by: Dennis Schridde Bug: https://bugs.gentoo.org/534194 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/haskell-cabal.eclass')
-rw-r--r--eclass/haskell-cabal.eclass26
1 files changed, 22 insertions, 4 deletions
diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass
index 373507995f36..a568bf4337b1 100644
--- a/eclass/haskell-cabal.eclass
+++ b/eclass/haskell-cabal.eclass
@@ -59,6 +59,13 @@ inherit eutils ghc-package multilib multiprocessing
# linking 'setup' faster.
: ${GHC_BOOTSTRAP_FLAGS:=}
+# @ECLASS-VARIABLE: CABAL_EXTRA_TEST_FLAGS
+# @DESCRIPTION:
+# User-specified additional parameters passed to 'setup test'.
+# example: /etc/portage/make.conf:
+# CABAL_EXTRA_TEST_FLAGS="-v3 --show-details=streaming"
+: ${CABAL_EXTRA_TEST_FLAGS:=}
+
# @ECLASS-VARIABLE: CABAL_DEBUG_LOOSENING
# @DESCRIPTION:
# Show debug output for 'cabal_chdeps' function if set.
@@ -118,8 +125,7 @@ if [[ -n "${CABAL_USE_HSCOLOUR}" ]]; then
fi
if [[ -n "${CABAL_USE_HOOGLE}" ]]; then
- # enabled only in ::haskell
- CABAL_USE_HOOGLE=
+ IUSE="${IUSE} hoogle"
fi
if [[ -n "${CABAL_USE_ALEX}" ]]; then
@@ -169,7 +175,7 @@ cabal-version() {
else
# We ask portage, not ghc, so that we only pick up
# portage-installed cabal versions.
- _CABAL_VERSION_CACHE="$(ghc-extractportageversion dev-haskell/cabal)"
+ _CABAL_VERSION_CACHE="$(ROOT=$(ghc-host-root) ghc-extractportageversion dev-haskell/cabal)"
fi
fi
echo "${_CABAL_VERSION_CACHE}"
@@ -602,13 +608,25 @@ haskell-cabal_src_compile() {
}
haskell-cabal_src_test() {
+ local cabaltest=()
+
pushd "${S}" > /dev/null || die
if cabal-is-dummy-lib; then
einfo ">>> No tests for dummy library: ${CATEGORY}/${PF}"
else
einfo ">>> Test phase [cabal test]: ${CATEGORY}/${PF}"
- set -- test "$@"
+
+ # '--show-details=streaming' appeared in Cabal-1.20
+ if ./setup test --help | grep -q -- "'streaming'"; then
+ cabaltest+=(--show-details=streaming)
+ fi
+
+ set -- test \
+ "${cabaltest[@]}" \
+ ${CABAL_TEST_FLAGS} \
+ ${CABAL_EXTRA_TEST_FLAGS} \
+ "$@"
echo ./setup "$@"
./setup "$@" || die "cabal test failed"
fi