sys-process/glances: revbump 3.1.4.1, add missing doc dep
[gentoo.git] / dev-ml / cairo-ocaml / cairo-ocaml-1.2.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit eutils findlib autotools
7
8 DESCRIPTION="Ocaml bindings for the cairo vector graphics library"
9 HOMEPAGE="https://www.cairographics.org/cairo-ocaml/"
10 SRC_URI="https://cgit.freedesktop.org/cairo-ocaml/snapshot/${P}.tar.bz2"
11
12 LICENSE="LGPL-2.1"
13 SLOT="0/${PV}"
14 KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
15 IUSE="doc examples gtk pango"
16
17 RDEPEND="dev-lang/ocaml:=
18         x11-libs/cairo
19         gtk? ( dev-ml/lablgtk:2= )
20         pango? ( x11-libs/pango )"
21 DEPEND="${RDEPEND}"
22
23 src_prepare() {
24         # 3 patches from debian and one for automagic on libsvg-cairo
25         epatch \
26                 "${FILESDIR}"/0001-Add-missing-libraries-used-by-the-stubs-to-CAIRO_LIB.patch \
27                 "${FILESDIR}"/0002-Fix-Makefile-to-avoid-recompiling-files-in-usr.patch \
28                 "${FILESDIR}"/0003-Fix-FTBFS-on-bytecode-architectures.patch \
29                 "${FILESDIR}"/0004-no-automagic.patch
30         AT_M4DIR=support eautoreconf
31 }
32
33 src_configure() {
34         econf \
35                 $(use_with gtk) \
36                 $(use_with pango pango-cairo) \
37                 --without-svg-cairo
38 }
39
40 src_compile() {
41         emake -j1
42         use doc && emake doc
43 }
44
45 src_install() {
46         findlib_src_install
47         dodoc README ChangeLog
48         if use examples; then
49                 insinto /usr/share/doc/${PF}/examples
50                 doins test/*.ml
51         fi
52         # ocamlfind support
53         cat <<-EOF > META
54                 name = "${PN}"
55                 description = "${DESCRIPTION}"
56                 requires = "bigarray"
57                 version = "${PV}"
58                 archive(byte) = "cairo.cma"
59                 archive(native) = "cairo.cmxa"
60         EOF
61         if use gtk; then
62                 cat <<-EOF >> META
63                         package "lablgtk2" (
64                                 requires = "cairo lablgtk2"
65                                 archive(byte) = "cairo_lablgtk.cma"
66                                 archive(native) = "cairo_lablgtk.cmxa"
67                         )
68                 EOF
69         fi
70         if use pango; then
71                 cat <<-EOF >> META
72                         package "pango" (
73                                 requires = "cairo"
74                                 archive(byte) = "pango_cairo.cma"
75                                 archive(native) = "pango_cairo.cmxa"
76                         )
77                 EOF
78         fi
79         insinto /usr/$(get_libdir)/ocaml/cairo
80         doins META
81 }