Gentoo Archives: gentoo-dev

From: David Seifert <soap@g.o>
To: gentoo-dev@l.g.o
Cc: David Seifert <soap@g.o>
Subject: [gentoo-dev] [PATCH 1/2] opam.eclass: remove EAPI 5 and 6
Date: Sun, 24 Jul 2022 21:07:23
Message-Id: 20220724210659.5947-1-soap@gentoo.org
1 Signed-off-by: David Seifert <soap@g.o>
2 ---
3 eclass/opam.eclass | 33 +++++++++++++--------------------
4 1 file changed, 13 insertions(+), 20 deletions(-)
5
6 diff --git a/eclass/opam.eclass b/eclass/opam.eclass
7 index 3edc2aa8691..b667bf31f15 100644
8 --- a/eclass/opam.eclass
9 +++ b/eclass/opam.eclass
10 @@ -7,15 +7,15 @@
11 # ML <ml@g.o>
12 # @AUTHOR:
13 # Alexis Ballier <aballier@g.o>
14 -# @SUPPORTED_EAPIS: 5 6 7
15 +# @SUPPORTED_EAPIS: 7
16 # @BLURB: Provides functions for installing opam packages.
17 # @DESCRIPTION:
18 # Provides dependencies on opam and ocaml, opam-install and a default
19 # src_install for opam-based packages.
20
21 -case ${EAPI:-0} in
22 - 5|6|7) ;;
23 - *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
24 +case ${EAPI} in
25 + 7) ;;
26 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
27 esac
28
29 # Do not complain about CFLAGS etc since ml projects do not use them.
30 @@ -28,15 +28,8 @@ QA_FLAGS_IGNORED='.*'
31 : ${OPAM_INSTALLER_DEP:="dev-ml/opam-installer"}
32
33 RDEPEND=">=dev-lang/ocaml-4:="
34 -case ${EAPI:-0} in
35 - 5|6)
36 - DEPEND="${RDEPEND} ${OPAM_INSTALLER_DEP}"
37 - ;;
38 - *)
39 - BDEPEND="${OPAM_INSTALLER_DEP} dev-lang/ocaml"
40 - DEPEND="${RDEPEND}"
41 - ;;
42 -esac
43 +BDEPEND="${OPAM_INSTALLER_DEP} dev-lang/ocaml"
44 +DEPEND="${RDEPEND}"
45
46 # @ECLASS_VARIABLE: OPAM_INSTALLER
47 # @DESCRIPTION:
48 @@ -52,10 +45,10 @@ opam-install() {
49 local pkg
50 for pkg ; do
51 ${OPAM_INSTALLER} -i \
52 - --prefix="${ED%/}/usr" \
53 - --libdir="${D%/}/$(ocamlc -where)" \
54 - --docdir="${ED%/}/usr/share/doc/${PF}" \
55 - --mandir="${ED%/}/usr/share/man" \
56 + --prefix="${ED}/usr" \
57 + --libdir="${D}/$(ocamlc -where)" \
58 + --docdir="${ED}/usr/share/doc/${PF}" \
59 + --mandir="${ED}/usr/share/man" \
60 "${pkg}.install" || die
61 done
62 }
63 @@ -64,9 +57,9 @@ opam_src_install() {
64 local pkg="${1:-${PN}}"
65 opam-install "${pkg}"
66 # Handle opam putting doc in a subdir
67 - if [[ -d ${ED%/}/usr/share/doc/${PF}/${pkg} ]] ; then
68 - mv "${ED%/}/usr/share/doc/${PF}/${pkg}/"* "${ED%/}/usr/share/doc/${PF}/" || die
69 - rmdir "${ED%/}/usr/share/doc/${PF}/${pkg}" || die
70 + if [[ -d ${ED}/usr/share/doc/${PF}/${pkg} ]] ; then
71 + mv "${ED}/usr/share/doc/${PF}/${pkg}/"* "${ED}/usr/share/doc/${PF}/" || die
72 + rmdir "${ED}/usr/share/doc/${PF}/${pkg}" || die
73 fi
74 }
75
76 --
77 2.35.1

Replies