Gentoo Archives: gentoo-commits

From: "Lennart Kolmodin (kolmodin)" <kolmodin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: haskell-cabal.eclass
Date: Wed, 09 Sep 2009 18:40:13
Message-Id: E1MlS5T-0001lT-GM@stork.gentoo.org
1 kolmodin 09/09/09 18:40:11
2
3 Modified: haskell-cabal.eclass
4 Log:
5 Updating the haskell-cabal eclass to support the CABAL_FEATURES nocabaldep
6 which is used in the dev-haskell/haskell-updater package. It enables
7 packages to use the cabal eclass without depending on cabal.
8
9 Revision Changes Path
10 1.16 eclass/haskell-cabal.eclass
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/haskell-cabal.eclass?rev=1.16&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/haskell-cabal.eclass?rev=1.16&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/haskell-cabal.eclass?r1=1.15&r2=1.16
15
16 Index: haskell-cabal.eclass
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v
19 retrieving revision 1.15
20 retrieving revision 1.16
21 diff -u -r1.15 -r1.16
22 --- haskell-cabal.eclass 27 Jul 2009 19:03:20 -0000 1.15
23 +++ haskell-cabal.eclass 9 Sep 2009 18:40:11 -0000 1.16
24 @@ -1,6 +1,6 @@
25 # Copyright 1999-2006 Gentoo Foundation
26 # Distributed under the terms of the GNU General Public License v2
27 -# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.15 2009/07/27 19:03:20 kolmodin Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.16 2009/09/09 18:40:11 kolmodin Exp $
29 #
30 # Original authors: Andres Loeh <kosmikus@g.o>
31 # Duncan Coutts <dcoutts@g.o>
32 @@ -26,6 +26,9 @@
33 # bootstrap -- only used for the cabal package itself
34 # bin -- the package installs binaries
35 # lib -- the package installs libraries
36 +# nocabaldep -- don't add dependency on cabal.
37 +# only used for packages that _must_ not pull the dependency
38 +# on cabal, but still use this eclass (e.g. haskell-updater).
39 #
40 # Dependencies on other cabal packages have to be specified
41 # correctly.
42 @@ -45,15 +48,16 @@
43
44 for feature in ${CABAL_FEATURES}; do
45 case ${feature} in
46 - haddock) CABAL_USE_HADDOCK=yes;;
47 - alex) CABAL_USE_ALEX=yes;;
48 - happy) CABAL_USE_HAPPY=yes;;
49 - c2hs) CABAL_USE_C2HS=yes;;
50 - cpphs) CABAL_USE_CPPHS=yes;;
51 - profile) CABAL_USE_PROFILE=yes;;
52 - bootstrap) CABAL_BOOTSTRAP=yes;;
53 - bin) CABAL_HAS_BINARIES=yes;;
54 - lib) CABAL_HAS_LIBRARIES=yes;;
55 + haddock) CABAL_USE_HADDOCK=yes;;
56 + alex) CABAL_USE_ALEX=yes;;
57 + happy) CABAL_USE_HAPPY=yes;;
58 + c2hs) CABAL_USE_C2HS=yes;;
59 + cpphs) CABAL_USE_CPPHS=yes;;
60 + profile) CABAL_USE_PROFILE=yes;;
61 + bootstrap) CABAL_BOOTSTRAP=yes;;
62 + bin) CABAL_HAS_BINARIES=yes;;
63 + lib) CABAL_HAS_LIBRARIES=yes;;
64 + nocabaldep) CABAL_FROM_GHC=yes;;
65 *) CABAL_UNKNOWN="${CABAL_UNKNOWN} ${feature}";;
66 esac
67 done
68 @@ -92,7 +96,7 @@
69 if [[ -z ${CABAL_MIN_VERSION} ]]; then
70 CABAL_MIN_VERSION=1.1.4
71 fi
72 -if [[ -z "${CABAL_BOOTSTRAP}" ]]; then
73 +if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]]; then
74 DEPEND="${DEPEND} >=dev-haskell/cabal-${CABAL_MIN_VERSION}"
75 fi
76
77 @@ -273,10 +277,10 @@
78 # the currently active ghc (we cannot guarantee this with portage)
79 haskell-cabal_pkg_setup() {
80 ghc-package_pkg_setup
81 - if [[ -z "${CABAL_BOOTSTRAP}" ]] && ! ghc-sanecabal "${CABAL_MIN_VERSION}"; then
82 + if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]] && ! ghc-sanecabal "${CABAL_MIN_VERSION}"; then
83 eerror "The package dev-haskell/cabal is not correctly installed for"
84 eerror "the currently active version of ghc ($(ghc-version)). Please"
85 - eerror "run ghc-updater or re-emerge dev-haskell/cabal."
86 + eerror "run ghc-updater or haskell-updater or re-build dev-haskell/cabal."
87 die "cabal is not correctly installed"
88 fi
89 if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then
90 @@ -302,6 +306,7 @@
91 fi
92 fi
93 }
94 +
95 haskell-cabal_src_compile() {
96 cabal_src_compile
97 }