aboutsummaryrefslogtreecommitdiff
blob: d950b6f2dfd77f5e340d378532b9b3db29863f8a (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-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils autotools

DESCRIPTION="A graph library for Objective Caml"
HOMEPAGE="http://ocamlgraph.lri.fr"
SRC_URI="${HOMEPAGE}/download/${P}.tar.gz"

LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc examples gtk +ocamlopt"

DEPEND=">=dev-lang/ocaml-3.10.2[ocamlopt?]
		gtk? ( >=dev-ml/lablgtk-2.12[gnomecanvas,ocamlopt?] )"
RDEPEND="${DEPEND}"

src_prepare() {
	epatch "${FILESDIR}/${PN}-makefile.patch"

	#dirty fix for doc building
	sed -i Makefile.in -e "s/-d doc -html \$(DGRAPH_INCLUDES) \$(DOC_SRC)/-d doc -html \$(DGRAPH_INCLUDES) \$(DOC_SRC:src\/merge.mli=)/g"

	eautoreconf
}

src_compile() {
	DESTDIR="/" emake -j1 || die "emake failed"

	if use doc; then
		emake doc || die "emake doc failed"
	fi
}

src_install() {
	DESTDIR="${D}" emake install || die "emake install failed"
	dodoc CHANGES CREDITS FAQ README

	if use doc; then
		dohtml doc/*
	fi

	if use examples; then
		insinto /usr/share/doc/${PF}
		doins -r examples
	fi
}