1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: findlib.eclass
6 # maintainer-needed@gentoo.org
8 # Original author: Matthieu Sozeau <mattam@gentoo.org> (retired)
9 # @BLURB: ocamlfind (a.k.a. findlib) eclass
11 # ocamlfind (a.k.a. findlib) eclass
15 # From this findlib version there is proper stublibs support.
16 DEPEND=">=dev-ml/findlib-1.0.4-r1"
17 [[ ${FINDLIB_USE} ]] && DEPEND="${FINDLIB_USE}? ( ${DEPEND} )"
20 if [ ! -x "${EPREFIX}"/usr/bin/ocamlfind ]
22 eerror "In findlib.eclass: could not find the ocamlfind executable"
23 eerror "Please report this bug on gentoo's bugzilla, assigning to ml@gentoo.org"
24 die "ocamlfind executabled not found"
28 # @FUNCTION: findlib_src_preinst
30 # Prepare the image for a findlib installation.
31 # We use the stublibs style, so no ld.conf needs to be
32 # updated when a package installs C shared libraries.
33 findlib_src_preinst() {
34 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
35 has "${EAPI:-0}" 0 1 2 && use !prefix && ED="${D}"
38 # destdir is the ocaml sitelib
39 local destdir=`ocamlfind printconf destdir`
42 destdir=${destdir#${EPREFIX}}
44 dodir ${destdir} || die "dodir failed"
45 export OCAMLFIND_DESTDIR=${ED}${destdir}
48 dodir ${destdir}/stublibs || die "dodir failed"
49 export OCAMLFIND_LDCONF=ignore
52 # @FUNCTION: findlib_src_install
54 # Install with a properly setup findlib
55 findlib_src_install() {
57 make DESTDIR="${D}" "$@" install || die "make failed"