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 DEPEND=">=dev-lang/ocaml-4.02.3-r1:=[ocamlopt?]
19 tk? ( dev-ml/labltk:= )"
23 sed -i 's/\$llabltk \$lcamlp4 \$lobuild//' configure || die "Unable to make meta external."
24 export ocamlfind_destdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
25 export stublibs="${ocamlfind_destdir}/stublibs"
30 use tk && myconf="-with-toolbox"
31 ./configure -bindir "${EPREFIX}"/usr/bin -mandir "${EPREFIX}"/usr/share/man \
32 -sitelib ${ocamlfind_destdir} \
33 -config ${ocamlfind_destdir}/findlib/findlib.conf \
35 ${myconf} || die "configure failed"
41 emake -j1 opt # optimized code
46 emake prefix="${D}" install
48 dodir "${stublibs#${EPREFIX}}"
51 dodoc QUICKSTART README DOCINFO
52 use doc && dohtml -r ref-html guide-html
56 local ocaml_stdlib=`ocamlc -where`
57 local ldconf="${ocaml_stdlib}/ld.conf"
61 echo "${ocaml_stdlib}" > ${ldconf}
62 echo "${ocaml_stdlib}/stublibs" >> ${ldconf}
65 if [ -z `grep -e ${stublibs} ${ldconf}` ]
67 echo ${stublibs} >> ${ldconf}