/[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.51 Revision 1.52
1# Copyright 1999-2015 Gentoo Foundation 1# Copyright 1999-2015 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.51 2015/04/04 20:33:05 slyfox Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.52 2015/07/20 15:05:49 slyfox Exp $
4 4
5# @ECLASS: haskell-cabal.eclass 5# @ECLASS: haskell-cabal.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Haskell herd <haskell@gentoo.org> 7# Haskell herd <haskell@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
170} 170}
171 171
172cabal-bootstrap() { 172cabal-bootstrap() {
173 local setupmodule 173 local setupmodule
174 local cabalpackage 174 local cabalpackage
175 local setup_bootstrap_args=()
176
175 if [[ -f "${S}/Setup.lhs" ]]; then 177 if [[ -f "${S}/Setup.lhs" ]]; then
176 setupmodule="${S}/Setup.lhs" 178 setupmodule="${S}/Setup.lhs"
177 elif [[ -f "${S}/Setup.hs" ]]; then 179 elif [[ -f "${S}/Setup.hs" ]]; then
178 setupmodule="${S}/Setup.hs" 180 setupmodule="${S}/Setup.hs"
179 else 181 else
190 # We build the setup program using the latest version of 192 # We build the setup program using the latest version of
191 # cabal that we have installed 193 # cabal that we have installed
192 cabalpackage=Cabal-$(cabal-version) 194 cabalpackage=Cabal-$(cabal-version)
193 einfo "Using cabal-$(cabal-version)." 195 einfo "Using cabal-$(cabal-version)."
194 196
197 if $(ghc-supports-threaded-runtime); then
198 # Cabal has a bug that deadlocks non-threaded RTS:
199 # https://bugs.gentoo.org/537500
200 # https://github.com/haskell/cabal/issues/2398
201 setup_bootstrap_args+=(-threaded)
202 fi
203
195 make_setup() { 204 make_setup() {
196 set -- -package "${cabalpackage}" --make "${setupmodule}" \ 205 set -- -package "${cabalpackage}" --make "${setupmodule}" \
206 ${setup_bootstrap_args} \
197 ${HCFLAGS} \ 207 ${HCFLAGS} \
198 ${GHC_BOOTSTRAP_FLAGS} \ 208 ${GHC_BOOTSTRAP_FLAGS} \
199 "$@" \ 209 "$@" \
200 -o setup 210 -o setup
201 echo $(ghc-getghc) "$@" 211 echo $(ghc-getghc) "$@"
309cabal-configure() { 319cabal-configure() {
310 local cabalconf=() 320 local cabalconf=()
311 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= 321 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
312 322
313 if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then 323 if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then
324 # We use the bundled with GHC version if exists
325 # Haddock is very picky about index files
326 # it generates for ghc's base and other packages.
327 local p=${EPREFIX}/usr/bin/haddock-ghc-$(ghc-version)
328 if [[ -f $p ]]; then
329 cabalconf+=(--with-haddock="${p}")
330 else
314 cabalconf+=(--with-haddock=${EPREFIX}/usr/bin/haddock) 331 cabalconf+=(--with-haddock=${EPREFIX}/usr/bin/haddock)
332 fi
315 fi 333 fi
316 if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then 334 if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then
317 cabalconf+=(--enable-library-profiling) 335 cabalconf+=(--enable-library-profiling)
318 fi 336 fi
319 if [[ -n "${CABAL_USE_ALEX}" ]]; then 337 if [[ -n "${CABAL_USE_ALEX}" ]]; then

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

  ViewVC Help
Powered by ViewVC 1.1.20