summaryrefslogtreecommitdiff
blob: de3fdb0ada84bbcd9c0c38cbce5c046a43205feb (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/bnfc/bnfc-2.4_beta.ebuild,v 1.4 2009/09/23 17:40:59 patrick Exp $

inherit base ghc-package eutils

MY_PN="BNFC"
MY_PV="${PV%%_beta*}"

IS_BETA="${PV%%*_beta*}"
[[ -z "${IS_BETA}" ]] && MY_PV+=b

DESCRIPTION="BNF Converter -- a sophisticated parser generator"
HOMEPAGE="http://www.cs.chalmers.se/~markus/BNFC/"
SRC_URI="http://www.cs.chalmers.se/Cs/Research/Language-technology/BNFC/download/${MY_PN}-${MY_PV}.tgz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~ppc ~amd64"

IUSE="doc"

DEPEND=">=dev-lang/ghc-6.6
	doc? ( virtual/latex-base )
	dev-haskell/mtl"

RDEPEND=""

S="${WORKDIR}/${MY_PN}"

src_compile() {
	emake GHC="$(ghc-getghc) -O" || die "emake failed"
	if use doc ; then
		cd doc
		VARTEXFONTS="${T}"/fonts pdflatex LBNF-report.tex
		VARTEXFONTS="${T}"/fonts pdflatex LBNF-report.tex
	fi
}

src_install() {
	dobin bnfc
	if use doc ; then
		cd doc
		insinto "/usr/share/doc/${P}"
		doins LBNF-report.pdf
	fi
}