summaryrefslogtreecommitdiff
path: root/eclass/haskell-cabal.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
commit7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch)
tree4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /eclass/haskell-cabal.eclass
parentb284a3168fa91a038925d2ecf5e4791011ea5e7d (diff)
gentoo resync : 15.12.2019
Diffstat (limited to 'eclass/haskell-cabal.eclass')
-rw-r--r--eclass/haskell-cabal.eclass25
1 files changed, 19 insertions, 6 deletions
diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass
index edfdfae5cda3..2fc797e764cb 100644
--- a/eclass/haskell-cabal.eclass
+++ b/eclass/haskell-cabal.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: haskell-cabal.eclass
@@ -66,6 +66,14 @@ inherit eutils ghc-package multilib toolchain-funcs
# Needs working 'diff'.
: ${CABAL_DEBUG_LOOSENING:=}
+# @ECLASS-VARIABLE: CABAL_REPORT_OTHER_BROKEN_PACKAGES
+# @DESCRIPTION:
+# Show other broken packages if 'cabal configure' fails.
+# It should be normally enabled unless you know you are about
+# to try to compile a lot of broken packages. Default value: 'yes'
+# Set to anything else to disable.
+: ${CABAL_REPORT_OTHER_BROKEN_PACKAGES:=yes}
+
HASKELL_CABAL_EXPF="pkg_setup src_compile src_test src_install pkg_postinst pkg_postrm"
# 'dev-haskell/cabal' passes those options with ./configure-based
@@ -129,6 +137,7 @@ fi
if [[ -n "${CABAL_TEST_SUITE}" ]]; then
IUSE="${IUSE} test"
+ RESTRICT+=" !test? ( test )"
fi
# returns the version of cabal currently in use.
@@ -271,6 +280,8 @@ cabal-die-if-nonempty() {
}
cabal-show-brokens() {
+ [[ ${CABAL_REPORT_OTHER_BROKEN_PACKAGES} != yes ]] && return 0
+
elog "ghc-pkg check: 'checking for other broken packages:'"
# pretty-printer
$(ghc-getghcpkg) check 2>&1 \
@@ -283,6 +294,8 @@ cabal-show-brokens() {
}
cabal-show-old() {
+ [[ ${CABAL_REPORT_OTHER_BROKEN_PACKAGES} != yes ]] && return 0
+
cabal-die-if-nonempty 'outdated' \
$("${EPREFIX}"/usr/sbin/haskell-updater --quiet --upgrade --list-only)
}
@@ -395,14 +408,14 @@ cabal-configure() {
--datasubdir=${P}/ghc-$(ghc-version) \
"${cabalconf[@]}" \
${CABAL_CONFIGURE_FLAGS} \
- ${CABAL_EXTRA_CONFIGURE_FLAGS} \
- "$@"
+ "$@" \
+ ${CABAL_EXTRA_CONFIGURE_FLAGS}
echo ./setup "$@"
./setup "$@" || cabal-show-brokens-and-die "setup configure failed"
}
cabal-build() {
- set -- build ${CABAL_EXTRA_BUILD_FLAGS} "$@"
+ set -- build "$@" ${CABAL_EXTRA_BUILD_FLAGS}
echo ./setup "$@"
./setup "$@" \
|| die "setup build failed"
@@ -570,8 +583,8 @@ haskell-cabal_src_test() {
set -- test \
"${cabaltest[@]}" \
${CABAL_TEST_FLAGS} \
- ${CABAL_EXTRA_TEST_FLAGS} \
- "$@"
+ "$@" \
+ ${CABAL_EXTRA_TEST_FLAGS}
echo ./setup "$@"
./setup "$@" || die "cabal test failed"
fi