1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit multilib findlib
8 IUSE="debug examples glade gnomecanvas sourceview +ocamlopt opengl spell svg"
10 DESCRIPTION="Objective CAML interface for Gtk+2"
11 HOMEPAGE="http://lablgtk.forge.ocamlcore.org/"
12 SRC_URI="https://github.com/garrigue/lablgtk/releases/download/lablgtk2188/${P}.tar.gz"
13 LICENSE="LGPL-2.1-with-linking-exception examples? ( lablgtk-examples )"
15 RDEPEND=">=x11-libs/gtk+-2.10:2
16 >=dev-lang/ocaml-3.10:=[ocamlopt?]
17 svg? ( >=gnome-base/librsvg-2.2:2 )
18 glade? ( >=gnome-base/libglade-2.0.1 )
19 gnomecanvas? ( >=gnome-base/libgnomecanvas-2.2 )
20 opengl? ( >=dev-ml/lablgl-0.98:=
21 >=x11-libs/gtkglarea-1.9:2 )
22 spell? ( app-text/gtkspell:2 )
23 sourceview? ( x11-libs/gtksourceview:2.0 )
30 KEYWORDS="~amd64 ~x86"
33 econf $(use_enable debug) \
34 $(use_with svg rsvg) \
38 $(use_with opengl gl) \
39 $(use_with spell gtkspell) \
40 --without-gtksourceview \
41 $(use_with sourceview gtksourceview2) \
42 $(use_with gnomecanvas)
53 insinto /usr/share/doc/${P}/examples
54 doins examples/*.ml examples/*.rgb examples/*.png examples/*.xpm
56 # Install examples for optional components
57 use gnomecanvas && insinto /usr/share/doc/${PF}/examples/canvas && doins examples/canvas/*.ml examples/canvas/*.png
58 use svg && insinto /usr/share/doc/${PF}/examples/rsvg && doins examples/rsvg/*.ml examples/rsvg/*.svg
59 use glade && insinto /usr/share/doc/${PF}/examples/glade && doins examples/glade/*.ml examples/glade/*.glade*
60 use sourceview && insinto /usr/share/doc/${PF}/examples/sourceview && doins examples/sourceview/*.ml examples/sourceview/*.lang
61 use opengl && insinto /usr/share/doc/${PF}/examples/GL && doins examples/GL/*.ml
63 docompress -x /usr/share/doc/${PF}/examples
68 export OCAMLPATH="${OCAMLFIND_DESTDIR}"
69 emake install DESTDIR="${D}"
71 rm -f "${ED}/usr/$(get_libdir)/ocaml/ld.conf"
73 dodoc CHANGES README CHANGES.API
74 use examples && install_examples
79 elog "To run the examples you can use the lablgtk2 toplevel."
80 elog "e.g: lablgtk2 /usr/share/doc/${PF}/examples/testgtk.ml"