/[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.5 Revision 1.8
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.5 2006/03/01 12:54:35 dcoutts Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.8 2006/10/04 17:49:20 kosmikus 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#
34# 34#
35# Many Cabal packages require S to be manually set. 35# Many Cabal packages require S to be manually set.
36# 36#
37# Conforming Cabal packages don't require any function definitions 37# Conforming Cabal packages don't require any function definitions
38# in the ebuild. 38# in the ebuild.
39#
40# Special flags to Cabal Configure can now be set by using
41# CABAL_CONFIGURE_FLAGS
39 42
40inherit ghc-package 43inherit ghc-package
41 44
42 45
43for feature in ${CABAL_FEATURES}; do 46for feature in ${CABAL_FEATURES}; do
124cabal-configure() { 127cabal-configure() {
125 if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then 128 if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then
126 cabalconf="${cabalconf} --enable-executable-profiling"; 129 cabalconf="${cabalconf} --enable-executable-profiling";
127 cabalconf="${cabalconf} --enable-library-profiling" 130 cabalconf="${cabalconf} --enable-library-profiling"
128 fi 131 fi
129 # Don't build GHCi libs for arches that do not support GHCi.
130 # Also building GHCi libs on ppc64 causes "TOC overflow". 132 # Building GHCi libs on ppc64 causes "TOC overflow".
131 if use alpha || use ppc64; then 133 if use ppc64; then
132 cabalconf="${cabalconf} --disable-library-for-ghci" 134 cabalconf="${cabalconf} --disable-library-for-ghci"
133 fi 135 fi
134 136
135 ./setup configure \ 137 ./setup configure \
136 --ghc --prefix=/usr \ 138 --ghc --prefix=/usr \
137 --with-compiler="$(ghc-getghc)" \ 139 --with-compiler="$(ghc-getghc)" \
138 --with-hc-pkg="$(ghc-getghcpkg)" \ 140 --with-hc-pkg="$(ghc-getghcpkg)" \
139 ${cabalconf} \ 141 ${cabalconf} \
142 ${CABAL_CONFIGURE_FLAGS} \
140 "$@" || die "setup configure failed" 143 "$@" || die "setup configure failed"
141} 144}
142 145
143cabal-build() { 146cabal-build() {
144 ./setup build \ 147 ./setup build \
168 # register that ourselves (if it exists). 171 # register that ourselves (if it exists).
169 local result 172 local result
170 local err 173 local err
171 174
172 if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then 175 if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then
173 sed -i 's:ghc-pkg:/usr/bin/true:' .setup-config 176 sed -i "s|$(ghc-getghcpkg)|/usr/bin/true|" .setup-config
174 ./setup register || die "setup register failed" 177 ./setup register || die "setup register failed"
175 if [[ -f .installed-pkg-config ]]; then 178 if [[ -f .installed-pkg-config ]]; then
176 ghc-setup-pkg .installed-pkg-config 179 ghc-setup-pkg .installed-pkg-config
177 ghc-install-pkg 180 ghc-install-pkg
178 else 181 else
216cabal_src_install() { 219cabal_src_install() {
217 cabal-copy 220 cabal-copy
218 cabal-pkg 221 cabal-pkg
219 222
220 if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then 223 if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then
221 dohtml dist/doc/html/* 224 dohtml -r dist/doc/html/*
222 fi 225 fi
223} 226}
224haskell-cabal_src_install() { 227haskell-cabal_src_install() {
225 cabal_src_install 228 cabal_src_install
226} 229}

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

  ViewVC Help
Powered by ViewVC 1.1.20