mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-24 06:48:18 -07:00
eclass/opam.eclass: Changes from ml-overlay
Co-Author: Alexis Ballier <aballier@gentoo.org> Signed-off-by: Mark Wright <gienah@gentoo.org>
This commit is contained in:
@@ -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}" \
|
||||
|
||||
Reference in New Issue
Block a user