summaryrefslogtreecommitdiff
blob: 4ffd955138e67691dd17fd106ea4420ab3c0eefc (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-ml/lablgl/lablgl-0.99.ebuild,v 1.1 2003/07/08 21:36:33 mholzer Exp $

IUSE="opengl"

DESCRIPTION="Objective CAML interface for OpenGL"
HOMEPAGE="http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html"
LICENSE="as-is"

DEPEND=">=dev-lang/ocaml-3.05
	opengl? ( virtual/opengl )"

SRC_URI="http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/${P}.tar.gz
	mirror://gentoo/LablGL-0.99-Makefile-destdir.patch
	mirror://gentoo/LablGL-0.99-Makefile.config"
S=${WORKDIR}/lablGL-${PV}
SLOT="0"
KEYWORDS="~x86 ~ppc"

#need to do some mangling to keep ebuild name lowercase
#(anyway package uses mixture of upper and lower case letters)
Name="LablGL"

pkg_setup() {
	#lablgl requires ocaml compiled with tk support while ocaml has it as an optional dependency
	#need to do some checks and correct situation as if necessary

	if ( ! which labltk && which ocaml ) || ! ( which labltk && which ocaml || use tcltk ); then
		eerror "It seems you don't have ocaml compiled with tk support"
		eerror "or you don't have ocaml installed and tcltk USE flag is"
		eerror "not defined."
		eerror ""
		eerror "lablgl requires ocaml be built with tk support."
		eerror ""
		eerror "Please make sure that ocaml is installed with tk support."
		
		false;
	else 
		echo "found tcltk USE flag, proceeding normally!"
	fi
}

src_unpack() {
	unpack ${A}
	
	# patch the makefile to include DESTDIR support
	cd ${S} || die
	patch -p0 < ${DISTDIR}/${Name}-${PV}-Makefile-destdir.patch || die
}

src_compile() {
	# make configuration file
	cp ${DISTDIR}/${Name}-${PV}-Makefile.config ${S}/Makefile.config || die
	
	# build
	make all opt || die
}

src_install () {
	make DESTDIR=${D} install || die

	dodoc README CHANGES COPYRIGHT
}