/[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.3 Revision 1.5
1# Copyright 1999-2005 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.3 2006/02/16 12:32:53 dcoutts Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.5 2006/03/01 12:54:35 dcoutts 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#
124cabal-configure() { 124cabal-configure() {
125 if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then 125 if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then
126 cabalconf="${cabalconf} --enable-executable-profiling"; 126 cabalconf="${cabalconf} --enable-executable-profiling";
127 cabalconf="${cabalconf} --enable-library-profiling" 127 cabalconf="${cabalconf} --enable-library-profiling"
128 fi 128 fi
129 # Don't build GHCi libs for arches that do not support GHCi.
130 # Also building GHCi libs on ppc64 causes "TOC overflow".
131 if use alpha || use ppc64; then
132 cabalconf="${cabalconf} --disable-library-for-ghci"
133 fi
129 134
130 ./setup configure \ 135 ./setup configure \
131 --ghc --prefix=/usr \ 136 --ghc --prefix=/usr \
132 --with-compiler="$(ghc-getghc)" \ 137 --with-compiler="$(ghc-getghc)" \
133 --with-hc-pkg="$(ghc-getghcpkg)" \ 138 --with-hc-pkg="$(ghc-getghcpkg)" \
162 # of ghc-pkg. So it just leaves the .installed-pkg-config and we can 167 # of ghc-pkg. So it just leaves the .installed-pkg-config and we can
163 # register that ourselves (if it exists). 168 # register that ourselves (if it exists).
164 local result 169 local result
165 local err 170 local err
166 171
172 if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then
167 sed -i 's:ghc-pkg:/usr/bin/true:' .setup-config 173 sed -i 's:ghc-pkg:/usr/bin/true:' .setup-config
168 result="$(./setup register 2>&1)" 174 ./setup register || die "setup register failed"
169 err="$?"
170 if ! echo ${result} | grep -q "no library to register"; then
171 $(exit "${err}") || die "setup register failed"
172 fi
173 if [[ -f .installed-pkg-config ]]; then 175 if [[ -f .installed-pkg-config ]]; then
174 ghc-setup-pkg .installed-pkg-config 176 ghc-setup-pkg .installed-pkg-config
175 ghc-install-pkg 177 ghc-install-pkg
178 else
179 die "setup register has not generated a package configuration file"
180 fi
176 fi 181 fi
177} 182}
178 183
179# exported function: check if cabal is correctly installed for 184# exported function: check if cabal is correctly installed for
180# the currently active ghc (we cannot guarantee this with portage) 185# the currently active ghc (we cannot guarantee this with portage)
183 eerror "The package dev-haskell/cabal is not correctly installed for" 188 eerror "The package dev-haskell/cabal is not correctly installed for"
184 eerror "the currently active version of ghc ($(ghc-version)). Please" 189 eerror "the currently active version of ghc ($(ghc-version)). Please"
185 eerror "run ghc-updater or re-emerge dev-haskell/cabal." 190 eerror "run ghc-updater or re-emerge dev-haskell/cabal."
186 die "cabal is not correctly installed" 191 die "cabal is not correctly installed"
187 fi 192 fi
193 if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then
194 eerror "QA: Neither bin nor lib are in CABAL_FEATURES."
195 fi
188 if [[ -n "${CABAL_UNKNOWN}" ]]; then 196 if [[ -n "${CABAL_UNKNOWN}" ]]; then
189 ewarn "Unknown entry in CABAL_FEATURES: ${CABAL_UNKNONW}" 197 ewarn "Unknown entry in CABAL_FEATURES: ${CABAL_UNKNONW}"
190 fi 198 fi
191} 199}
192 200

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20