1 |
Signed-off-by: David Seifert <soap@g.o> |
2 |
--- |
3 |
eclass/dune.eclass | 54 +++++++++++++++++++++++++--------------------- |
4 |
1 file changed, 29 insertions(+), 25 deletions(-) |
5 |
|
6 |
diff --git a/eclass/dune.eclass b/eclass/dune.eclass |
7 |
index 1061461b699..a7c0a0b652f 100644 |
8 |
--- a/eclass/dune.eclass |
9 |
+++ b/eclass/dune.eclass |
10 |
@@ -8,12 +8,20 @@ |
11 |
# ML <ml@g.o> |
12 |
# @AUTHOR: |
13 |
# Rafael Kitover <rkitover@×××××.com> |
14 |
-# @SUPPORTED_EAPIS: 6 7 8 |
15 |
+# @SUPPORTED_EAPIS: 7 8 |
16 |
# @BLURB: Provides functions for installing Dune packages. |
17 |
# @DESCRIPTION: |
18 |
# Provides dependencies on Dune and OCaml and default src_compile, src_test and |
19 |
# src_install for Dune-based packages. |
20 |
|
21 |
+case ${EAPI} in |
22 |
+ 7|8) ;; |
23 |
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
24 |
+esac |
25 |
+ |
26 |
+if [[ ! ${_DUNE_ECLASS} ]]; then |
27 |
+_DUNE_ECLASS=1 |
28 |
+ |
29 |
# @ECLASS_VARIABLE: DUNE_PKG_NAME |
30 |
# @PRE_INHERIT |
31 |
# @DESCRIPTION: |
32 |
@@ -21,28 +29,20 @@ |
33 |
# Set before inheriting the eclass. |
34 |
: ${DUNE_PKG_NAME:=${PN}} |
35 |
|
36 |
-case ${EAPI:-0} in |
37 |
- 6|7|8) ;; |
38 |
- *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; |
39 |
-esac |
40 |
- |
41 |
inherit multiprocessing |
42 |
|
43 |
# Do not complain about CFLAGS etc since ml projects do not use them. |
44 |
QA_FLAGS_IGNORED='.*' |
45 |
|
46 |
-EXPORT_FUNCTIONS src_compile src_test src_install |
47 |
- |
48 |
-RDEPEND=">=dev-lang/ocaml-4:=[ocamlopt?] dev-ml/dune:=" |
49 |
-case ${EAPI:-0} in |
50 |
- 6) |
51 |
- DEPEND="${RDEPEND} dev-ml/dune" |
52 |
- ;; |
53 |
- *) |
54 |
- BDEPEND="dev-ml/dune dev-lang/ocaml" |
55 |
- DEPEND="${RDEPEND}" |
56 |
- ;; |
57 |
-esac |
58 |
+RDEPEND=" |
59 |
+ >=dev-lang/ocaml-4:=[ocamlopt?] |
60 |
+ dev-ml/dune:= |
61 |
+" |
62 |
+DEPEND="${RDEPEND}" |
63 |
+BDEPEND=" |
64 |
+ dev-ml/dune |
65 |
+ dev-lang/ocaml |
66 |
+" |
67 |
|
68 |
dune_src_compile() { |
69 |
ebegin "Building" |
70 |
@@ -72,9 +72,9 @@ dune-install() { |
71 |
[[ ${#pkgs[@]} -eq 0 ]] && pkgs=( "${DUNE_PKG_NAME}" ) |
72 |
|
73 |
local -a myduneopts=( |
74 |
- --prefix="${ED%/}/usr" |
75 |
- --libdir="${D%/}$(ocamlc -where)" |
76 |
- --mandir="${ED%/}/usr/share/man" |
77 |
+ --prefix="${ED}/usr" |
78 |
+ --libdir="${D}$(ocamlc -where)" |
79 |
+ --mandir="${ED}/usr/share/man" |
80 |
) |
81 |
|
82 |
local pkg |
83 |
@@ -84,10 +84,10 @@ dune-install() { |
84 |
eend $? || die |
85 |
|
86 |
# Move docs to the appropriate place. |
87 |
- if [ -d "${ED%/}/usr/doc/${pkg}" ] ; then |
88 |
- mkdir -p "${ED%/}/usr/share/doc/${PF}/" || die |
89 |
- mv "${ED%/}/usr/doc/${pkg}" "${ED%/}/usr/share/doc/${PF}/" || die |
90 |
- rm -rf "${ED%/}/usr/doc" || die |
91 |
+ if [[ -d "${ED}/usr/doc/${pkg}" ]] ; then |
92 |
+ mkdir -p "${ED}/usr/share/doc/${PF}/" || die |
93 |
+ mv "${ED}/usr/doc/${pkg}" "${ED}/usr/share/doc/${PF}/" || die |
94 |
+ rm -rf "${ED}/usr/doc" || die |
95 |
fi |
96 |
done |
97 |
} |
98 |
@@ -95,3 +95,7 @@ dune-install() { |
99 |
dune_src_install() { |
100 |
dune-install ${1:-${DUNE_PKG_NAME}} |
101 |
} |
102 |
+ |
103 |
+fi |
104 |
+ |
105 |
+EXPORT_FUNCTIONS src_compile src_test src_install |
106 |
-- |
107 |
2.39.0 |