summaryrefslogtreecommitdiff
blob: b2c1894d19cb7a652ef84489dd078e38145ec52a (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-haskell/happy/happy-1.15.ebuild,v 1.3 2005/03/19 13:12:49 kosmikus Exp $

inherit base eutils

DESCRIPTION="A yacc-like parser generator for Haskell"
HOMEPAGE="http://haskell.org/happy/"
SRC_URI="http://haskell.cs.yale.edu/happy/dist/${PV}/${P}-src.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="doc java"

DEPEND=">=virtual/ghc-5.04
	doc? (  ~app-text/docbook-xml-dtd-4.2
		app-text/docbook-xsl-stylesheets
		java? ( >=dev-java/fop-0.20.5 ) )"
RDEPEND=""

src_unpack() {
	base_src_unpack
}

src_compile() {
	econf || die "configure failed"
	if has_version '>=dev-lang/ghc-6.4'; then
		echo "SRC_HC_OPTS += -ignore-package util" >> mk/build.mk
	fi
	emake -j1 || die "make failed"
	if use doc; then
		emake -j1 html || die "make html failed"
		if use java; then
			emake -j1 ps || die "make ps failed"
		fi
	fi
}

src_install() {
	local docways
	if use doc; then
		docways="html"
		use java && docways="${docways} ps"
	else
		docways=""
	fi
	# the libdir0 setting is needed for amd64, and does not
	# harm for other arches; einstall doesn't seem to work
	make install install-docs XMLDocWays="${docways}" \
		prefix="${D}/usr" \
		datadir="${D}/usr/share/${P}" \
		infodir="${D}/usr/share/info" \
		mandir="${D}/usr/share/man" \
		libdir0="${D}/usr/$(get_libdir)" \
		|| die "installation failed"
}