1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit multilib eutils
8 DESCRIPTION="OCaml tool to find/use non-standard packages"
9 HOMEPAGE="http://projects.camlcity.org/projects/findlib.html"
10 SRC_URI="http://download.camlcity.org/download/${P}.tar.gz"
11 IUSE="doc +ocamlopt tk"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
18 # it does not compile with ocaml-4.09 (bug #708696)
19 DEPEND="<dev-lang/ocaml-4.09:=[ocamlopt?]
20 tk? ( dev-ml/labltk:= )"
24 epatch "${FILESDIR}/externalmeta6.patch"
25 export ocamlfind_destdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
26 export stublibs="${ocamlfind_destdir}/stublibs"
31 use tk && myconf="-with-toolbox"
32 ./configure -bindir "${EPREFIX}"/usr/bin -mandir "${EPREFIX}"/usr/share/man \
33 -sitelib ${ocamlfind_destdir} \
34 -config ${ocamlfind_destdir}/findlib/findlib.conf \
36 ${myconf} || die "configure failed"
42 emake -j1 opt # optimized code
47 emake prefix="${D}" install
49 dodir "${stublibs#${EPREFIX}}"
52 dodoc QUICKSTART README DOCINFO
53 use doc && dohtml -r ref-html guide-html
57 local ocaml_stdlib=`ocamlc -where`
58 local ldconf="${ocaml_stdlib}/ld.conf"
62 echo "${ocaml_stdlib}" > ${ldconf}
63 echo "${ocaml_stdlib}/stublibs" >> ${ldconf}
66 if [ -z `grep -e ${stublibs} ${ldconf}` ]
68 echo ${stublibs} >> ${ldconf}