| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 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/ghc-package.eclass,v 1.15 2005/09/13 12:51:30 kosmikus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.17 2006/06/15 11:27:38 dcoutts Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Andres Loeh <kosmikus@gentoo.org> |
5 | # Author: Andres Loeh <kosmikus@gentoo.org> |
|
|
6 | # Maintained by: Haskell herd <haskell@gentoo.org> |
| 6 | # |
7 | # |
| 7 | # This eclass helps with the Glasgow Haskell Compiler's package |
8 | # This eclass helps with the Glasgow Haskell Compiler's package |
| 8 | # configuration utility. |
9 | # configuration utility. |
| 9 | |
10 | |
| 10 | inherit versionator |
11 | inherit versionator |
| … | |
… | |
| 40 | |
41 | |
| 41 | # returns the version of ghc |
42 | # returns the version of ghc |
| 42 | _GHC_VERSION_CACHE="" |
43 | _GHC_VERSION_CACHE="" |
| 43 | ghc-version() { |
44 | ghc-version() { |
| 44 | if [[ -z "${_GHC_VERSION_CACHE}" ]]; then |
45 | if [[ -z "${_GHC_VERSION_CACHE}" ]]; then |
| 45 | _GHC_VERSION_CACHE="$($(ghc-getghc) --version | sed 's:^.*version ::')" |
46 | _GHC_VERSION_CACHE="$($(ghc-getghc) --numeric-version)" |
| 46 | fi |
47 | fi |
| 47 | echo "${_GHC_VERSION_CACHE}" |
48 | echo "${_GHC_VERSION_CACHE}" |
| 48 | } |
49 | } |
| 49 | |
50 | |
| 50 | # this function can be used to determine if ghc itself |
51 | # this function can be used to determine if ghc itself |