From 597400fa82416e580386c4126848ba620b6d1dc5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 20 Jul 2015 15:05:49 +0000 Subject: Workaround upstream cabal tests hangup bug #537500 by Michael Orlitzky; use ghc's haddock for doc generation. --- eclass/ChangeLog | 6 +++++- eclass/haskell-cabal.eclass | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'eclass') diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 09817635a702..44bc41f0936f 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1722 2015/07/19 15:46:03 mpagano Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1723 2015/07/20 15:05:49 slyfox Exp $ + + 20 Jul 2015; Sergei Trofimovich haskell-cabal.eclass: + Workaround upstream cabal tests hangup bug #537500 by Michael Orlitzky; use + ghc's haddock for doc generation. 19 Jul 2015; Mike Pagano kernel-2.eclass: Change kernel upgrade http link and remove reference to deblob in elog diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index 7f733725af97..22239bb46eef 100644 --- a/eclass/haskell-cabal.eclass +++ b/eclass/haskell-cabal.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.51 2015/04/04 20:33:05 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.52 2015/07/20 15:05:49 slyfox Exp $ # @ECLASS: haskell-cabal.eclass # @MAINTAINER: @@ -172,6 +172,8 @@ cabal-version() { cabal-bootstrap() { local setupmodule local cabalpackage + local setup_bootstrap_args=() + if [[ -f "${S}/Setup.lhs" ]]; then setupmodule="${S}/Setup.lhs" elif [[ -f "${S}/Setup.hs" ]]; then @@ -192,8 +194,16 @@ cabal-bootstrap() { cabalpackage=Cabal-$(cabal-version) einfo "Using cabal-$(cabal-version)." + if $(ghc-supports-threaded-runtime); then + # Cabal has a bug that deadlocks non-threaded RTS: + # https://bugs.gentoo.org/537500 + # https://github.com/haskell/cabal/issues/2398 + setup_bootstrap_args+=(-threaded) + fi + make_setup() { set -- -package "${cabalpackage}" --make "${setupmodule}" \ + ${setup_bootstrap_args} \ ${HCFLAGS} \ ${GHC_BOOTSTRAP_FLAGS} \ "$@" \ @@ -311,7 +321,15 @@ cabal-configure() { has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= if [[ -n "${CABAL_USE_HADDOCK}" ]] && use doc; then - cabalconf+=(--with-haddock=${EPREFIX}/usr/bin/haddock) + # We use the bundled with GHC version if exists + # Haddock is very picky about index files + # it generates for ghc's base and other packages. + local p=${EPREFIX}/usr/bin/haddock-ghc-$(ghc-version) + if [[ -f $p ]]; then + cabalconf+=(--with-haddock="${p}") + else + cabalconf+=(--with-haddock=${EPREFIX}/usr/bin/haddock) + fi fi if [[ -n "${CABAL_USE_PROFILE}" ]] && use profile; then cabalconf+=(--enable-library-profiling) -- cgit v1.2.3-65-gdbad