summaryrefslogtreecommitdiff
blob: 10d006becb16946615bb0f2c16b666598ffc0cc5 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-scheme/gauche-gtk/gauche-gtk-0.4.1.ebuild,v 1.3 2004/08/19 12:21:49 hattya Exp $

inherit eutils flag-o-matic

IUSE="glgd nls opengl"

MY_P="${P/g/G}"

DESCRIPTION="GTK2 binding for Gauche"
HOMEPAGE="http://gauche.sf.net/"
SRC_URI="mirror://sourceforge/gauche/${MY_P}.tgz"

RESTRICT="nomirror"
LICENSE="BSD"
KEYWORDS="x86 ~ppc"
SLOT="0"
S="${WORKDIR}/${MY_P}"

DEPEND="${RDEPEND}
	dev-util/pkgconfig"
RDEPEND=">=x11-libs/gtk+-2*
	>=dev-lang/gauche-0.7.4.1
	opengl? ( >=x11-libs/gtkglext-0.6.0 )"

src_compile() {

	local myconf myflags

	if use opengl; then
		if use glgd; then
			myconf="--enable-glgd"

			if use nls; then
				myconf="${myconf}-pango"
			fi
		else
			myconf="--enable-gtkgl"
		fi
	fi

	strip-flags

	myflags=${CFLAGS}
	unset CFLAGS CXXFLAGS

	econf ${myconf} || die
	emake OPTFLAGS="${myflags}" || die

}

src_install() {

	dodir $(gauche-config --syslibdir)
	dodir $(gauche-config --sysincdir)
	dodir $(gauche-config --sysarchdir)

	make DESTDIR=${D} install || die

	dodoc ChangeLog README COPYING


	docinto examples
	for f in examples/*; do
		[ -f ${f} ] && dodoc ${f}
	done

	docinto examples/gtk-tutorial
	dodoc examples/gtk-tutorial/*

	if use opengl; then
		docinto examples/gtkglext
		dodoc examples/gtkglext/*

		if use glgd; then
			docinto examples/glgd
			dodoc examples/glgd/*

			docinto
			newdoc glgd/README README.glgd
			newdoc glgd/README.eucjp README.eucjp.glgd
		fi
	fi

}

pkg_postinst() {

	if use opengl; then
		einfo "If you want to use OpenGL with Gauche, please emerge Gauche-gl."
	fi

}