From: Florian Schmaus <flo@geekplace.eu>
To: gentoo-dev@lists.gentoo.org
Cc: Florian Schmaus <flo@geekplace.eu>
Subject: [gentoo-dev] [PATCH 3/3] rebar.eclass: add support for EAPI 7
Date: Mon, 12 Apr 2021 10:29:02 +0200 [thread overview]
Message-ID: <20210412082902.162091-3-flo@geekplace.eu> (raw)
In-Reply-To: <20210412082902.162091-1-flo@geekplace.eu>
Thanks To Sam James for reviewing this and providing feedback.
Closes: https://bugs.gentoo.org/770283
Signed-off-by: Florian Schmaus <flo@geekplace.eu>
---
eclass/rebar.eclass | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/eclass/rebar.eclass b/eclass/rebar.eclass
index 2ec255486463..c6781b211470 100644
--- a/eclass/rebar.eclass
+++ b/eclass/rebar.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: rebar.eclass
@@ -6,7 +6,7 @@
# maintainer-needed@gentoo.org
# @AUTHOR:
# Amadeusz Żołnowski <aidecoe@gentoo.org>
-# @SUPPORTED_EAPIS: 6
+# @SUPPORTED_EAPIS: 6 7
# @BLURB: Build Erlang/OTP projects using dev-util/rebar.
# @DESCRIPTION:
# An eclass providing functions to build Erlang/OTP projects using
@@ -23,7 +23,7 @@ case "${EAPI:-0}" in
0|1|2|3|4|5)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
- 6)
+ 6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@@ -33,9 +33,14 @@ esac
EXPORT_FUNCTIONS src_prepare src_compile src_test src_install
RDEPEND="dev-lang/erlang:="
-DEPEND="${RDEPEND}
+DEPEND="${RDEPEND}"
+BDEPEND="
dev-util/rebar
- >=sys-apps/gawk-4.1"
+ >=sys-apps/gawk-4.1
+"
+if [[ ${EAPI} == 6 ]]; then
+ DEPEND+="${BDEPEND}"
+fi
# @ECLASS-VARIABLE: REBAR_APP_SRC
# @DESCRIPTION:
@@ -63,7 +68,7 @@ _rebar_find_dep() {
local p
local result
- pushd "${EPREFIX}$(get_erl_libs)" >/dev/null || return 1
+ pushd "${EPREFIX%/}/$(get_erl_libs)" >/dev/null || return 1
for p in ${pn} ${pn}-*; do
if [[ -d ${p} ]]; then
# Ensure there's at most one matching.
@@ -102,7 +107,7 @@ erebar() {
(( $# > 0 )) || die "erebar: at least one target is required"
- local -x ERL_LIBS="${EPREFIX}$(get_erl_libs)"
+ local -x ERL_LIBS="${EPREFIX%/}/$(get_erl_libs)"
[[ ${1} == eunit ]] && local -x ERL_LIBS="."
rebar -v skip_deps=true "$@" || die -n "rebar $@ failed"
@@ -123,7 +128,7 @@ rebar_fix_include_path() {
local pn="${1}"
local rebar_config="${2:-rebar.config}"
- local erl_libs="${EPREFIX}$(get_erl_libs)"
+ local erl_libs="${EPREFIX%/}/$(get_erl_libs)"
local p
p="$(_rebar_find_dep "${pn}")" \
@@ -212,7 +217,7 @@ rebar_src_prepare() {
rebar_src_configure() {
debug-print-function ${FUNCNAME} "${@}"
- local -x ERL_LIBS="${EPREFIX}$(get_erl_libs)"
+ local -x ERL_LIBS="${EPREFIX%/}/$(get_erl_libs)"
default
}
@@ -252,7 +257,7 @@ rebar_src_install() {
[[ -d bin ]] && for bin in bin/*; do dobin "$bin"; done
if [[ -d priv ]]; then
- cp -pR priv "${ED}${dest}/" || die "failed to install priv/"
+ cp -pR priv "${ED%/}/${dest}/" || die "failed to install priv/"
fi
einstalldocs
--
2.30.2
next prev parent reply other threads:[~2021-04-12 8:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 8:29 [gentoo-dev] [PATCH 1/3] rebar.eclass: fix @RETURN argument Florian Schmaus
2021-04-12 8:29 ` [gentoo-dev] [PATCH 2/3] rebar.eclass: s,$1,${1}, Florian Schmaus
2021-04-12 8:29 ` Florian Schmaus [this message]
2021-04-12 10:30 ` [gentoo-dev] [PATCH 1/3] rebar.eclass: fix @RETURN argument Ulrich Mueller
2021-04-14 20:09 ` [gentoo-dev] [PATCH v2] " Florian Schmaus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210412082902.162091-3-flo@geekplace.eu \
--to=flo@geekplace.eu \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox