1 | # Copyright 1999-2012 Gentoo Foundation |
1 | # Copyright 1999-2012 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.32 2012/04/19 17:33:19 slyfox Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.33 2012/07/08 19:16:46 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: |
… | |
… | |
350 | # However portage still records the dependency and we can upgrade the package |
350 | # However portage still records the dependency and we can upgrade the package |
351 | # to a later one that's not included with ghc. |
351 | # to a later one that's not included with ghc. |
352 | # You can also put a space separated list, eg CABAL_CORE_LIB_GHC_PV="6.6 6.6.1". |
352 | # You can also put a space separated list, eg CABAL_CORE_LIB_GHC_PV="6.6 6.6.1". |
353 | cabal-is-dummy-lib() { |
353 | cabal-is-dummy-lib() { |
354 | for version in ${CABAL_CORE_LIB_GHC_PV[*]}; do |
354 | for version in ${CABAL_CORE_LIB_GHC_PV[*]}; do |
355 | [[ "$(ghc-version)" == "$version" ]] && return 0 |
355 | [[ "$(ghc-version)" == ${version} ]] && return 0 |
356 | done |
356 | done |
357 | return 1 |
357 | return 1 |
358 | } |
358 | } |
359 | |
359 | |
360 | # exported function: check if cabal is correctly installed for |
360 | # exported function: check if cabal is correctly installed for |
… | |
… | |
459 | local ghc_confdir_with_prefix="$(ghc-confdir)" |
459 | local ghc_confdir_with_prefix="$(ghc-confdir)" |
460 | # remove EPREFIX |
460 | # remove EPREFIX |
461 | dodir ${ghc_confdir_with_prefix#${EPREFIX}} |
461 | dodir ${ghc_confdir_with_prefix#${EPREFIX}} |
462 | local conf_file="${D}/$(ghc-confdir)/$(ghc-localpkgconf)" |
462 | local conf_file="${D}/$(ghc-confdir)/$(ghc-localpkgconf)" |
463 | [[ -e $conf_file ]] || echo '[]' > "$conf_file" || die |
463 | [[ -e $conf_file ]] || echo '[]' > "$conf_file" || die |
|
|
464 | |
|
|
465 | # make sure installed packages do not destroy ghc's |
|
|
466 | # bundled packages |
|
|
467 | local initial_pkg_db=${ROOT}/$(ghc-libdir)/package.conf.d.initial |
|
|
468 | if [[ -e ${initial_pkg_db} ]]; then |
|
|
469 | local checked_pkg |
|
|
470 | for checked_pkg in $(ghc-listpkg "${conf_file}") |
|
|
471 | do |
|
|
472 | local initial_pkg |
|
|
473 | for initial_pkg in $(ghc-listpkg "${initial_pkg_db}"); do |
|
|
474 | if [[ ${checked_pkg} = ${initial_pkg} ]]; then |
|
|
475 | eerror "Package ${checked_pkg} is shipped with $(ghc-version)." |
|
|
476 | eerror "Ebuild author forgot CABAL_CORE_LIB_GHC_PV entry." |
|
|
477 | eerror "Found in ${initial_pkg_db}." |
|
|
478 | die |
|
|
479 | fi |
|
|
480 | done |
|
|
481 | done |
|
|
482 | fi |
464 | } |
483 | } |
465 | |
484 | |
466 | haskell-cabal_src_install() { |
485 | haskell-cabal_src_install() { |
467 | pushd "${S}" > /dev/null |
486 | pushd "${S}" > /dev/null |
468 | |
487 | |