summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorLennart Kolmodin <kolmodin@gentoo.org>2010-08-07 12:06:27 +0000
committerLennart Kolmodin <kolmodin@gentoo.org>2010-08-07 12:06:27 +0000
commite331299c8ea20e5c13eea7fd3a847f251cb9bc43 (patch)
tree405346f43001ec7494365358c091eaa049637608 /eclass
parentRemove the hscolour CABAL_FEATURES flag, not supported in portage yet. (diff)
downloadgentoo-2-e331299c8ea20e5c13eea7fd3a847f251cb9bc43.tar.gz
gentoo-2-e331299c8ea20e5c13eea7fd3a847f251cb9bc43.tar.bz2
gentoo-2-e331299c8ea20e5c13eea7fd3a847f251cb9bc43.zip
Allow USE=hscolour for dev-haskell packages that have
CABAL_FEATURES="hscolour" (none yet in portage).
Diffstat (limited to 'eclass')
-rw-r--r--eclass/haskell-cabal.eclass31
1 files changed, 29 insertions, 2 deletions
diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass
index 6328c1a51442..bbb8a12ea9e2 100644
--- a/eclass/haskell-cabal.eclass
+++ b/eclass/haskell-cabal.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.20 2010/03/30 22:18:37 kolmodin Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.21 2010/08/07 12:06:27 kolmodin Exp $
#
# Original authors: Andres Loeh <kosmikus@gentoo.org>
# Duncan Coutts <dcoutts@gentoo.org>
@@ -18,6 +18,7 @@
#
# Currently supported features:
# haddock -- for documentation generation
+# hscolour -- generation of colourised sources
# alex -- lexer/scanner generator
# happy -- parser generator
# c2hs -- C interface generator
@@ -57,6 +58,7 @@ EXPORT_FUNCTIONS ${HASKELL_CABAL_EXPF}
for feature in ${CABAL_FEATURES}; do
case ${feature} in
haddock) CABAL_USE_HADDOCK=yes;;
+ hscolour) CABAL_USE_HSCOLOUR=yes;;
alex) CABAL_USE_ALEX=yes;;
happy) CABAL_USE_HAPPY=yes;;
c2hs) CABAL_USE_C2HS=yes;;
@@ -75,6 +77,11 @@ if [[ -n "${CABAL_USE_HADDOCK}" ]]; then
DEPEND="${DEPEND} doc? ( dev-haskell/haddock )"
fi
+if [[ -n "${CABAL_USE_HSCOLOUR}" ]]; then
+ IUSE="${IUSE} hscolour"
+ DEPEND="${DEPEND} hscolour? ( dev-haskell/hscolour )"
+fi
+
if [[ -n "${CABAL_USE_ALEX}" ]]; then
DEPEND="${DEPEND} dev-haskell/alex"
cabalconf="${cabalconf} --with-alex=/usr/bin/alex"
@@ -187,10 +194,19 @@ cabal-mksetup() {
> $setupdir/Setup.hs
}
+cabal-hscolour() {
+ ./setup hscolour || die "setup hscolour failed"
+}
+
cabal-haddock() {
./setup haddock || die "setup haddock failed"
}
+cabal-hscolour-haddock() {
+ # --hyperlink-source implies calling 'setup hscolour'
+ ./setup haddock --hyperlink-source || die "setup haddock failed"
+}
+
cabal-configure() {
if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then
cabalconf="${cabalconf} --with-haddock=/usr/bin/haddock"
@@ -349,7 +365,18 @@ cabal_src_compile() {
cabal-build
if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then
- cabal-haddock
+ if [[ -n "${CABAL_USE_HSCOLOUR}" ]] && use hscolour; then
+ # hscolour and haddock
+ cabal-hscolour-haddock
+ else
+ # just haddock
+ cabal-haddock
+ fi
+ else
+ if [[ -n "${CABAL_USE_HSCOLOUR}" ]] && use hscolour; then
+ # just hscolour
+ cabal-hscolour
+ fi
fi
fi
}