| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 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.8 2006/10/04 17:49:20 kosmikus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.9 2007/01/15 13:58:13 kosmikus Exp $ |
| 4 | # |
4 | # |
| 5 | # Original authors: Andres Loeh <kosmikus@gentoo.org> |
5 | # Original authors: Andres Loeh <kosmikus@gentoo.org> |
| 6 | # Duncan Coutts <dcoutts@gentoo.org> |
6 | # Duncan Coutts <dcoutts@gentoo.org> |
| 7 | # Maintained by: Haskell herd <haskell@gentoo.org> |
7 | # Maintained by: Haskell herd <haskell@gentoo.org> |
| 8 | # |
8 | # |
| … | |
… | |
| 164 | chmod +x "${D}/usr/bin/"* |
164 | chmod +x "${D}/usr/bin/"* |
| 165 | fi |
165 | fi |
| 166 | } |
166 | } |
| 167 | |
167 | |
| 168 | cabal-pkg() { |
168 | cabal-pkg() { |
| 169 | # This does not actually register since we're using /usr/bin/true instead |
169 | # This does not actually register since we're using true instead |
| 170 | # of ghc-pkg. So it just leaves the .installed-pkg-config and we can |
170 | # of ghc-pkg. So it just leaves the .installed-pkg-config and we can |
| 171 | # register that ourselves (if it exists). |
171 | # register that ourselves (if it exists). |
| 172 | local result |
172 | local result |
| 173 | local err |
173 | local err |
| 174 | |
174 | |
| 175 | if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then |
175 | if [[ -n ${CABAL_HAS_LIBRARIES} ]]; then |
| 176 | sed -i "s|$(ghc-getghcpkg)|/usr/bin/true|" .setup-config |
176 | sed -i "s|$(ghc-getghcpkg)|$(which true)|" .setup-config |
| 177 | ./setup register || die "setup register failed" |
177 | ./setup register || die "setup register failed" |
| 178 | if [[ -f .installed-pkg-config ]]; then |
178 | if [[ -f .installed-pkg-config ]]; then |
| 179 | ghc-setup-pkg .installed-pkg-config |
179 | ghc-setup-pkg .installed-pkg-config |
| 180 | ghc-install-pkg |
180 | ghc-install-pkg |
| 181 | else |
181 | else |
| … | |
… | |
| 185 | } |
185 | } |
| 186 | |
186 | |
| 187 | # exported function: check if cabal is correctly installed for |
187 | # exported function: check if cabal is correctly installed for |
| 188 | # the currently active ghc (we cannot guarantee this with portage) |
188 | # the currently active ghc (we cannot guarantee this with portage) |
| 189 | haskell-cabal_pkg_setup() { |
189 | haskell-cabal_pkg_setup() { |
|
|
190 | ghc-package_pkg_setup |
| 190 | if [[ -z "${CABAL_BOOTSTRAP}" ]] && ! ghc-sanecabal "1.1.3"; then |
191 | if [[ -z "${CABAL_BOOTSTRAP}" ]] && ! ghc-sanecabal "1.1.3"; then |
| 191 | eerror "The package dev-haskell/cabal is not correctly installed for" |
192 | eerror "The package dev-haskell/cabal is not correctly installed for" |
| 192 | eerror "the currently active version of ghc ($(ghc-version)). Please" |
193 | eerror "the currently active version of ghc ($(ghc-version)). Please" |
| 193 | eerror "run ghc-updater or re-emerge dev-haskell/cabal." |
194 | eerror "run ghc-updater or re-emerge dev-haskell/cabal." |
| 194 | die "cabal is not correctly installed" |
195 | die "cabal is not correctly installed" |