summaryrefslogtreecommitdiff
blob: 4866742ebdc8977c053d9ac454ec0a60e4ce21f1 (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
52
53
54
55
56
57
58
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hxt/hxt-4.02.ebuild,v 1.2 2005/03/19 22:09:42 kosmikus Exp $

inherit fixheadtails base eutils ghc-package

MY_P="HXT"
MY_PV=${MY_P}-${PV}

DESCRIPTION="A collection of tools for processing XML with Haskell"
HOMEPAGE="http://www.fh-wedel.de/~si/HXmlToolbox/"
SRC_URI="http://www.fh-wedel.de/~si/HXmlToolbox/${MY_PV}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~x86"
IUSE="doc"

DEPEND=">=virtual/ghc-6.2
	!>=virtual/ghc-6.4
	doc? ( >=dev-haskell/haddock-0.6-r2 )"
RDEPEND=">=virtual/ghc-6.2"

S=${WORKDIR}/${MY_PV}

src_unpack() {
	base_src_unpack
	ht_fix_file "${S}/src/Makefile"
}

src_compile() {
	emake || die "emake failed"
	if use doc; then
		emake doc || die "emake doc failed"
	fi
}

src_test() {
	make test || die "at least one test failed"
}

src_install() {
	sed -i "s:/usr/local/lib/hxt:$(ghc-libdir):" ${S}/src/{netextra,hxt}-package.conf
	sed -i "/ghc-pkg --update-package *$/d" ${S}/src/Makefile

	ghc-setup-pkg ${S}/src/netextra-package.conf ${S}/src/hxt-package.conf
	make install \
		 GHC_INSTALL_DIR="${D}$(ghc-libdir)" \
		 || die "make install failed"

	dodoc LICENSE README
	if use doc; then
		cd ${S}/doc
		dodoc thesis.ps
		dohtml -r *
	fi
	ghc-install-pkg
}