summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMark Wright <gienah@gentoo.org>2020-10-10 23:38:04 +1100
committerMark Wright <gienah@gentoo.org>2020-10-13 23:52:57 +1100
commit4c76d728b442d8fdd49ec05e97e074de0e5aef77 (patch)
tree2bef07ffc68c5d463d7cf6154d52baeaccdd6109 /eclass
parentdev-lang/ocaml: Bump to 4.11.1 (diff)
downloadgentoo-4c76d728b442d8fdd49ec05e97e074de0e5aef77.tar.gz
gentoo-4c76d728b442d8fdd49ec05e97e074de0e5aef77.tar.bz2
gentoo-4c76d728b442d8fdd49ec05e97e074de0e5aef77.zip
eclass/opam.eclass: Changes from ml-overlay
Co-Author: Alexis Ballier <aballier@gentoo.org> Signed-off-by: Mark Wright <gienah@gentoo.org>
Diffstat (limited to '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 382dc00e511..0420b99f71c 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}" \