1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit multilib eutils toolchain-funcs
8 IUSE="doc glut +ocamlopt tk"
10 DESCRIPTION="Objective CAML interface for OpenGL"
11 HOMEPAGE="http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html"
15 >=dev-lang/ocaml-3.10.2:=[ocamlopt?]
22 glut? ( media-libs/freeglut )
32 SRC_URI="http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/${P}.tar.gz"
34 KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
37 # make configuration file
38 echo "BINDIR=/usr/bin" > Makefile.config
39 echo "GLLIBS = -lGL -lGLU" >> Makefile.config
41 echo "GLUTLIBS = -lglut" >> Makefile.config
43 echo "GLUTLIBS = " >> Makefile.config
45 echo "XLIBS = -lXext -lXmu -lX11" >> Makefile.config
46 echo "RANLIB = $(tc-getRANLIB)" >> Makefile.config
47 echo 'COPTS = -c -O $(CFLAGS)' >> Makefile.config
48 echo 'INCLUDES = $(TKINCLUDES) $(GLINCLUDES) $(XINCLUDES)' >> Makefile.config
73 # Makefile do not use mkdir so the library is not installed
74 # but copied as a 'stublibs' file.
75 dodir /usr/$(get_libdir)/ocaml/stublibs
77 # Same for lablglut's toplevel
81 BASE=${ED}/usr/$(get_libdir)/ocaml
82 emake BINDIR="${BINDIR}" INSTALLDIR="${BASE}/lablGL" DLLDIR="${BASE}/stublibs" install
87 insinto /usr/share/doc/${PF}
88 mv Togl/examples{,.togl}
89 doins -r Togl/examples.togl
91 mv LablGlut/examples{,.glut}
92 doins -r LablGlut/examples.glut