bed3712e2d4b15bce2780ab07c1fb4cb44132e43
[gentoo.git] / dev-ml / lablgtk / lablgtk-2.18.8-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 DESCRIPTION="Objective CAML interface for Gtk+2"
7 HOMEPAGE="http://lablgtk.forge.ocamlcore.org"
8 SRC_URI="https://github.com/garrigue/lablgtk/releases/download/lablgtk2188/${P}.tar.gz"
9
10 LICENSE="LGPL-2.1-with-linking-exception examples? ( lablgtk-examples )"
11 SLOT="2/${PV}"
12 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
13 IUSE="debug examples glade gnomecanvas +ocamlopt opengl sourceview spell svg"
14
15 DEPEND="dev-lang/ocaml:=[ocamlopt?]
16         dev-ml/camlp4:=
17         x11-libs/gtk+:2
18         glade? ( gnome-base/libglade )
19         gnomecanvas? ( gnome-base/libgnomecanvas )
20         opengl? (
21                 dev-ml/lablgl:=
22                 x11-libs/gtkglarea:2
23         )
24         sourceview? ( x11-libs/gtksourceview:2.0 )
25         spell? ( app-text/gtkspell:2 )
26         svg? ( gnome-base/librsvg:2 )"
27 RDEPEND="${DEPEND}"
28 BDEPEND="dev-ml/findlib
29         virtual/pkgconfig"
30
31 DOCS=( CHANGES README CHANGES.API )
32
33 src_configure() {
34         local myeconfargs=(
35                 $(use_enable debug)
36                 $(use_with svg rsvg)
37                 $(use_with glade)
38                 --without-gnomeui
39                 --without-panel
40                 $(use_with opengl gl)
41                 $(use_with spell gtkspell)
42                 --without-gtksourceview
43                 $(use_with sourceview gtksourceview2)
44                 $(use_with gnomecanvas)
45         )
46
47         econf "${myeconfargs[@]}"
48 }
49
50 src_compile() {
51         # parallel build crashes
52         emake -j1 all
53         if use ocamlopt; then
54                 emake -j1 opt
55         fi
56 }
57
58 src_install () {
59         local destdir="$(ocamlfind printconf destdir || die)"
60         dodir "${destdir}/stublibs"
61         export OCAMLFIND_DESTDIR=${ED}"${destdir}"
62         export OCAMLPATH="${ED}${destdir}"
63         export OCAMLFIND_LDCONF=ignore
64
65         default
66         rm "${ED}/usr/$(get_libdir)/ocaml/ld.conf" || die
67
68         if use examples; then
69                 dodoc -r examples/
70                 docompress -x /usr/share/doc/${PF}/examples
71         fi
72 }