summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/opam.eclass')
-rw-r--r--eclass/opam.eclass22
1 files changed, 17 insertions, 5 deletions
diff --git a/eclass/opam.eclass b/eclass/opam.eclass
index 382dc00e511b..0420b99f71c5 100644
--- a/eclass/opam.eclass
+++ b/eclass/opam.eclass
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: opam.eclass
# @MAINTAINER:
-# maintainer-needed@gentoo.org
+# Mark Wright <gienah@gentoo.org>
# @AUTHOR:
# Alexis Ballier <aballier@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7
@@ -17,9 +17,21 @@ case ${EAPI:-0} in
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
+# @ECLASS-VARIABLE: OPAM_INSTALLER_DEP
+# @DESCRIPTION:
+# Override dependency for OPAM_INSTALLER
+: ${OPAM_INSTALLER_DEP:="dev-ml/opam-installer"}
+
RDEPEND=">=dev-lang/ocaml-4:="
-DEPEND="${RDEPEND}
- dev-ml/opam"
+case ${EAPI:-0} in
+ 0|1|2|3|4|5|6) DEPEND="${RDEPEND} ${OPAM_INSTALLER_DEP}";;
+ *) BDEPEND="${OPAM_INSTALLER_DEP} dev-lang/ocaml"; DEPEND="${RDEPEND}" ;;
+esac
+
+# @ECLASS-VARIABLE: OPAM_INSTALLER
+# @DESCRIPTION:
+# Eclass can use different opam-installer binary than the one provided in by system.
+: ${OPAM_INSTALLER:=opam-installer}
# @FUNCTION: opam-install
# @USAGE: <list of packages>
@@ -29,7 +41,7 @@ DEPEND="${RDEPEND}
opam-install() {
local pkg
for pkg ; do
- opam-installer -i \
+ ${OPAM_INSTALLER} -i \
--prefix="${ED%/}/usr" \
--libdir="${D%/}/$(ocamlc -where)" \
--docdir="${ED%/}/usr/share/doc/${PF}" \