/[gentoo-x86]/eclass/haskell-cabal.eclass
Gentoo

Diff of /eclass/haskell-cabal.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.16 Revision 1.18
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.16 2009/09/09 18:40:11 kolmodin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.18 2010/01/26 20:50:40 kolmodin Exp $
4# 4#
5# Original authors: Andres Loeh <kosmikus@gentoo.org> 5# Original authors: Andres Loeh <kosmikus@gentoo.org>
6# Duncan Coutts <dcoutts@gentoo.org> 6# Duncan Coutts <dcoutts@gentoo.org>
7# Maintained by: Haskell herd <haskell@gentoo.org> 7# Maintained by: Haskell herd <haskell@gentoo.org>
8# 8#
111 if [[ -z "${_CABAL_VERSION_CACHE}" ]]; then 111 if [[ -z "${_CABAL_VERSION_CACHE}" ]]; then
112 if [[ "${CABAL_BOOTSTRAP}" ]]; then 112 if [[ "${CABAL_BOOTSTRAP}" ]]; then
113 # We're bootstrapping cabal, so the cabal version is the version 113 # We're bootstrapping cabal, so the cabal version is the version
114 # of this package itself. 114 # of this package itself.
115 _CABAL_VERSION_CACHE="${PV}" 115 _CABAL_VERSION_CACHE="${PV}"
116 elif [[ "${CABAL_FROM_GHC}" ]]; then
117 # We can't assume there's a version of Cabal installed by ebuild as
118 # this might be a first time install of GHC (for packages that
119 # use the shipped Cabal like haskell-updater).
120
121 # The user is likely to only have one version of Cabal, provided
122 # by GHC. Note that dev-haskell/cabal can be a dummy package, only
123 # using the version provided by GHC. If the user has another version
124 # of Cabal too (more recent than the one GHC provides through
125 # dev-haskell/cabal, or possibly older if he used an old
126 # Cabal package) the most recent is used (expected to be the last
127 # one in the ghc-pkg output).
128 _CABAL_VERSION_CACHE="$(ghc-pkg field Cabal version | tail -n 1)"
129
130 # Strip out the "version: " prefix
131 _CABAL_VERSION_CACHE="${_CABAL_VERSION_CACHE#"version: "}"
116 else 132 else
117 # We ask portage, not ghc, so that we only pick up 133 # We ask portage, not ghc, so that we only pick up
118 # portage-installed cabal versions. 134 # portage-installed cabal versions.
119 _CABAL_VERSION_CACHE="$(ghc-extractportageversion dev-haskell/cabal)" 135 _CABAL_VERSION_CACHE="$(ghc-extractportageversion dev-haskell/cabal)"
120 fi 136 fi
175 cabalconf="${cabalconf} --enable-library-profiling" 191 cabalconf="${cabalconf} --enable-library-profiling"
176 fi 192 fi
177 # Building GHCi libs on ppc64 causes "TOC overflow". 193 # Building GHCi libs on ppc64 causes "TOC overflow".
178 if use ppc64; then 194 if use ppc64; then
179 cabalconf="${cabalconf} --disable-library-for-ghci" 195 cabalconf="${cabalconf} --disable-library-for-ghci"
196 fi
197
198 if version_is_at_least "1.4" "$(cabal-version)"; then
199 # disable executable stripping for the executables, as portage will
200 # strip by itself, and pre-stripping gives a QA warning.
201 # cabal versions previous to 1.4 does not strip executables, and does
202 # not accept the flag.
203 # this fixes numerous bugs, amongst them;
204 # bug #251881, bug #251882, bug #251884, bug #251886, bug #299494
205 cabalconf="${cabalconf} --disable-executable-stripping"
180 fi 206 fi
181 207
182 if version_is_at_least "1.2.0" "$(cabal-version)"; then 208 if version_is_at_least "1.2.0" "$(cabal-version)"; then
183 cabalconf="${cabalconf} --docdir=/usr/share/doc/${PF}" 209 cabalconf="${cabalconf} --docdir=/usr/share/doc/${PF}"
184 # As of Cabal 1.2, configure is quite quiet. For diagnostic purposes 210 # As of Cabal 1.2, configure is quite quiet. For diagnostic purposes

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20