/[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.36 Revision 1.38
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2013 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.36 2012/11/19 20:35:16 slyfox Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.38 2013/01/06 13:06:35 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:
130if [[ -z ${CABAL_MIN_VERSION} ]]; then 130if [[ -z ${CABAL_MIN_VERSION} ]]; then
131 CABAL_MIN_VERSION=1.1.4 131 CABAL_MIN_VERSION=1.1.4
132fi 132fi
133if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]]; then 133if [[ -z "${CABAL_BOOTSTRAP}" && -z "${CABAL_FROM_GHC}" ]]; then
134 DEPEND="${DEPEND} >=dev-haskell/cabal-${CABAL_MIN_VERSION}" 134 DEPEND="${DEPEND} >=dev-haskell/cabal-${CABAL_MIN_VERSION}"
135fi
136
137# Libraries require GHC to be installed.
138if [[ -n "${CABAL_HAS_LIBRARIES}" ]]; then
139 RDEPEND="${RDEPEND} dev-lang/ghc"
140fi 135fi
141 136
142# returns the version of cabal currently in use 137# returns the version of cabal currently in use
143_CABAL_VERSION_CACHE="" 138_CABAL_VERSION_CACHE=""
144cabal-version() { 139cabal-version() {
382} 377}
383 378
384# exported function: check if cabal is correctly installed for 379# exported function: check if cabal is correctly installed for
385# the currently active ghc (we cannot guarantee this with portage) 380# the currently active ghc (we cannot guarantee this with portage)
386haskell-cabal_pkg_setup() { 381haskell-cabal_pkg_setup() {
382 if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then
383 [[ ${RDEPEND} == *dev-lang/ghc* ]] || eqawarn "QA Notice: A library does not have runtime dependency on dev-lang/ghc."
384 fi
387 if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then 385 if [[ -z "${CABAL_HAS_BINARIES}" ]] && [[ -z "${CABAL_HAS_LIBRARIES}" ]]; then
388 eqawarn "QA Notice: Neither bin nor lib are in CABAL_FEATURES." 386 eqawarn "QA Notice: Neither bin nor lib are in CABAL_FEATURES."
389 fi 387 fi
390 if [[ -n "${CABAL_UNKNOWN}" ]]; then 388 if [[ -n "${CABAL_UNKNOWN}" ]]; then
391 eqawarn "QA Notice: Unknown entry in CABAL_FEATURES: ${CABAL_UNKNOWN}" 389 eqawarn "QA Notice: Unknown entry in CABAL_FEATURES: ${CABAL_UNKNOWN}"
512 cabal_src_install 510 cabal_src_install
513 511
514 popd > /dev/null 512 popd > /dev/null
515} 513}
516 514
515# @FUNCTION: cabal_flag
516# @DESCRIPTION:
517# ebuild.sh:use_enable() taken as base 517# ebuild.sh:use_enable() taken as base
518# 518#
519# Usage examples: 519# Usage examples:
520# 520#
521# CABAL_CONFIGURE_FLAGS=$(cabal_flag gui) 521# CABAL_CONFIGURE_FLAGS=$(cabal_flag gui)
578 orig_c=$(< "$cf") 578 orig_c=$(< "$cf")
579 579
580 while :; do 580 while :; do
581 from_pat=$1 581 from_pat=$1
582 to_str=$2 582 to_str=$2
583 einfo "CHDEP: '${from_pat}' -> '${to_str}'"
584 583
585 [[ -n ${from_pat} ]] || break 584 [[ -n ${from_pat} ]] || break
586 [[ -n ${to_str} ]] || die "'${from_str}' does not have 'to' part" 585 [[ -n ${to_str} ]] || die "'${from_str}' does not have 'to' part"
586
587 einfo "CHDEP: '${from_pat}' -> '${to_str}'"
587 588
588 # escape pattern-like symbols 589 # escape pattern-like symbols
589 from_pat=${from_pat//\*/\\*} 590 from_pat=${from_pat//\*/\\*}
590 from_pat=${from_pat//\[/\\[} 591 from_pat=${from_pat//\[/\\[}
591 592
595 echo "${orig_c}" >"${T}/${cf}".pre 596 echo "${orig_c}" >"${T}/${cf}".pre
596 echo "${new_c}" >"${T}/${cf}".post 597 echo "${new_c}" >"${T}/${cf}".post
597 diff -u "${T}/${cf}".{pre,post} 598 diff -u "${T}/${cf}".{pre,post}
598 fi 599 fi
599 600
600 [[ "${orig_c}" == "${new_c}" ]] && die "no trigger for '${from_ss}'" 601 [[ "${orig_c}" == "${new_c}" ]] && die "no trigger for '${from_pat}'"
601 orig_c=${new_c} 602 orig_c=${new_c}
602 shift 603 shift
603 shift 604 shift
604 done 605 done
605 606

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.20