summaryrefslogtreecommitdiff
blob: 177bedbf0550e2c67457933e44a4d80f39fcc579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-haskell/c2hs/c2hs-0.13.1.ebuild,v 1.5 2005/03/14 18:52:06 kosmikus Exp $

DESCRIPTION="An interface generator for Haskell"
HOMEPAGE="http://www.cse.unsw.edu.au/~chak/haskell/c2hs/"
SRC_URI="http://www.cse.unsw.edu.au/~chak/haskell/c2hs/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"

KEYWORDS="~x86"

IUSE=""

DEPEND=">=virtual/ghc-6.2
	!>=virtual/ghc-6.4"

src_unpack() {
	unpack ${A}
	# package config file apparently missing haskell98 dependency
	sed -i "s:lang\":lang\",\"haskell98\":" ${S}/c2hs/c2hs.conf.in
}

src_compile() {
	econf --disable-add-package || die "configure failed"
	# tested emake; doesn't work
	emake -j1 || die "make failed"
}

src_install() {
	make DESTDIR=${D} install || die "make install failed"
}

pkg_postinst() {
	einfo "Registering c2hs package"
	/usr/bin/c2hs-config --package-conf \
		| ghc-pkg -u --auto-ghci-libs
}

pkg_postrm() {
	# check if another version is still there
	has_version "<${CATEGORY}/${PF}" \
		|| has_version ">${CATEGORY}/${PF}" \
		|| unregister_ghc_packages
}

unregister_ghc_packages() {
	einfo "Unregistering c2hs package"
	/usr/bin/ghc-pkg -r c2hs
}