Gentoo Archives: gentoo-dev

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-dev@l.g.o
Cc: Georgy Yakovlev <gyakovlev@g.o>
Subject: [gentoo-dev] [PATCH 2/2] opam.eclass: check only for known EAPI, die otherwise
Date: Sun, 03 Feb 2019 05:41:28
Message-Id: 20190203054013.62447-2-gyakovlev@gentoo.org
In Reply to: [gentoo-dev] [PATCH] opam.eclass: unbreak on EAPI=7 by Georgy Yakovlev
1 Signed-off-by: Georgy Yakovlev <gyakovlev@g.o>
2 ---
3 eclass/opam.eclass | 4 ++--
4 1 file changed, 2 insertions(+), 2 deletions(-)
5
6 diff --git a/eclass/opam.eclass b/eclass/opam.eclass
7 index 03ffc027641..c742ff7e936 100644
8 --- a/eclass/opam.eclass
9 +++ b/eclass/opam.eclass
10 @@ -1,51 +1,51 @@
11 # Copyright 1999-2017 Gentoo Foundation
12 # Distributed under the terms of the GNU General Public License v2
13
14 # @ECLASS: opam.eclass
15 # @MAINTAINER:
16 # Gentoo ML Project <ml@g.o>
17 # @AUTHOR:
18 # Alexis Ballier <aballier@g.o>
19 # @SUPPORTED_EAPIS: 5 6 7
20 # @BLURB: Provides functions for installing opam packages.
21 # @DESCRIPTION:
22 # Provides dependencies on opam and ocaml, opam-install and a default
23 # src_install for opam-based packages.
24
25 case ${EAPI:-0} in
26 - 0|1|2|3|4) die "You need at least EAPI-5 to use opam.eclass";;
27 - *) ;;
28 + 5|6|7) ;;
29 + *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
30 esac
31
32 RDEPEND=">=dev-lang/ocaml-4:="
33 DEPEND="${RDEPEND}
34 dev-ml/opam"
35
36 # @FUNCTION: opam-install
37 # @USAGE: <list of packages>
38 # @DESCRIPTION:
39 # Installs the opam packages given as arguments. For each "${pkg}" element in
40 # that list, "${pkg}.install" must be readable from current working directory.
41 opam-install() {
42 local pkg
43 for pkg ; do
44 opam-installer -i \
45 --prefix="${ED%/}/usr" \
46 --libdir="${D%/}/$(ocamlc -where)" \
47 --docdir="${ED%/}/usr/share/doc/${PF}" \
48 --mandir="${ED%/}/usr/share/man" \
49 "${pkg}.install" || die
50 done
51 }
52
53 opam_src_install() {
54 local pkg="${1:-${PN}}"
55 opam-install "${pkg}"
56 # Handle opam putting doc in a subdir
57 if [ -d "${ED%/}/usr/share/doc/${PF}/${pkg}" ] ; then
58 mv "${ED%/}/usr/share/doc/${PF}/${pkg}/"* "${ED%/}/usr/share/doc/${PF}/" || die
59 rmdir "${ED%/}/usr/share/doc/${PF}/${pkg}" || die
60 fi
61 }
62
63 EXPORT_FUNCTIONS src_install
64 --
65 2.20.1