1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 # Gentoo ML Project <ml@gentoo.org>
8 # Alexis Ballier <aballier@gentoo.org>
9 # @BLURB: Provides functions for installing opam packages.
11 # Provides dependencies on opam and ocaml, opam-install and a default
12 # src_install for opam-based packages.
15 0|1|2|3|4) die "You need at least EAPI-5 to use opam.eclass";;
19 RDEPEND=">=dev-lang/ocaml-4:="
23 # @FUNCTION: opam-install
24 # @USAGE: <list of packages>
26 # Installs the opam packages given as arguments. For each "${pkg}" element in
27 # that list, "${pkg}.install" must be readable from current working directory.
33 --libdir="${D}$(ocamlc -where)" \
34 --docdir="${ED}usr/share/doc/${PF}" \
35 --mandir="${ED}usr/share/man" \
36 "${pkg}.install" || die
41 local pkg="${1:-${PN}}"
43 # Handle opam putting doc in a subdir
44 if [ -d "${ED}usr/share/doc/${PF}/${pkg}" ] ; then
45 mv "${ED}usr/share/doc/${PF}/${pkg}/"* "${ED}usr/share/doc/${PF}/" || die
46 rmdir "${ED}usr/share/doc/${PF}/${pkg}" || die
50 EXPORT_FUNCTIONS src_install