1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit multilib eutils
9 DESCRIPTION="OCaml tool to find/use non-standard packages"
10 HOMEPAGE="http://projects.camlcity.org/projects/findlib.html"
11 SRC_URI="http://download.camlcity.org/download/${P}.tar.gz"
12 IUSE="doc +ocamlopt tk"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
19 DEPEND=">=dev-lang/ocaml-4.02.3-r1:=[ocamlopt?]
20 tk? ( dev-ml/labltk:= )"
23 ocamlfind_destdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
24 stublibs="${ocamlfind_destdir}/stublibs"
27 epatch "${FILESDIR}/externalmeta3.patch" \
28 "${FILESDIR}/quoting.patch"
33 use tk && myconf="-with-toolbox"
34 ./configure -bindir "${EPREFIX}"/usr/bin -mandir "${EPREFIX}"/usr/share/man \
35 -sitelib ${ocamlfind_destdir} \
36 -config ${ocamlfind_destdir}/findlib/findlib.conf \
38 ${myconf} || die "configure failed"
44 emake -j1 opt # optimized code
49 emake prefix="${D}" install
51 dodir "${stublibs#${EPREFIX}}"
54 dodoc QUICKSTART README DOCINFO
55 use doc && dohtml -r ref-html guide-html
59 local ocaml_stdlib=`ocamlc -where`
60 local ldconf="${ocaml_stdlib}/ld.conf"
64 echo "${ocaml_stdlib}" > ${ldconf}
65 echo "${ocaml_stdlib}/stublibs" >> ${ldconf}
68 if [ -z `grep -e ${stublibs} ${ldconf}` ]
70 echo ${stublibs} >> ${ldconf}