• [gentoo-dev] [PATCH 0/2] Introduce rebar3.eclass

    From Florian Schmaus@21:1/5 to All on Tue Jul 16 11:40:01 2024
    [This patchset was initially send with the wrong 'from' address to gentoo-dev@ and therefore never arrived at this mailing list]

    The Erlang/OTP ecosystem, or at least parts of it, are moving away
    from Rebar2 and towards Rebar3. While Rebar3 is packaged in Gentoo as dev-util/rebar:3, the current rebar.eclass only supports building
    projects with Rebar2.

    This is becoming more and more of a problem.

    For example, Ejabberd upstream is so kind to support building with
    Rebar2 and Rebar3. However, I've been told by upstream that sooner or
    later, probably sooner rather than later, support for Rebar2 will be
    dropped.

    We should prepare for this future and support Rebar3 via an eclass.

    Fortunately, ::guru already has a rebar3.eclass, which was used as
    starting point for this patchset. Not much needed to be changed, and
    tests in an overlay showed that, for example, ejabberd could be simply
    build by swapping rebar.eclass with rebar3.eclass (no further changes
    where necessary).

    I briefly considered adding support for Rebar3 to rebar.eclass,
    however, after examining the eclass' code and considering the
    consequences of doing so, I concluded that a new rebar3.eclass is the
    best approach.

    Florian Schmaus (2):
    rebar.eclass: factor out common functions into rebar-utils.eclass
    rebar3.eclass: add new eclass

    eclass/rebar-utils.eclass | 154 ++++++++++++++++++++++++++++
    eclass/rebar.eclass | 99 +-----------------
    eclass/rebar3.eclass | 204 ++++++++++++++++++++++++++++++++++++++
    3 files changed, 361 insertions(+), 96 deletions(-)
    create mode 100644 eclass/rebar-utils.eclass
    create mode 100644 eclass/rebar3.eclass

    --
    2.44.2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Florian Schmaus@21:1/5 to All on Tue Jul 16 11:40:02 2024
    Add a new eclass for dev-util/rebar:3, based on the work of Anna
    Vyalkova in ::guru (thanks!).

    The Erlang/OTP ecosystem is moving to Rebar3. Upstreams start to drop
    support for Rebar2, or at least consider it.

    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/rebar3.eclass | 194 +++++++++++++++++++++++++++++++++++++++++++
    1 file changed, 194 insertions(+)
    create mode 100644 eclass/rebar3.eclass

    diff --git a/eclass/rebar3.eclass b/eclass/rebar3.eclass
    new file mode 100644
    index 000000000000..f6383b9c8cdd
    --- /dev/null
    +++ b/eclass/rebar3.eclass
    @@ -0,0 +1,194 @@
    +# Copyright 1999-2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: rebar3.eclass
    +# @MAINTAINER:
    +# Florian Schmaus <flow@gentoo.org>
    +# @AUTHOR:
    +# Amadeusz Żołnowski <aidecoe@gentoo.org>
    +# Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
    +# @SUPPORTED_EAPIS: 8
    +# @PROVIDES: rebar-utils
    +# @BLURB: Build Erlang/OTP projects using dev-util/rebar:3.
    +# @DESCRIPTION:
    +# An eclass providing functions to build Erlang/OTP projects using
    +# dev-util/rebar:3.
    +#
    +# rebar is a tool which tries to resolve dependencies itself which is by
    +# cloning remote git repositories. Dependent projects are usually expected to +
  • From Florian Schmaus@21:1/5 to All on Tue Jul 16 11:40:01 2024
    In preperation for rebar3.eclass, factor out common functions into rebar-utils.eclass.

    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/rebar-utils.eclass | 160 ++++++++++++++++++++++++++++++++++++++
    eclass/rebar.eclass | 112 +-------------------------
    2 files changed, 163 insertions(+), 109 deletions(-)
    create mode 100644 eclass/rebar-utils.eclass

    diff --git a/eclass/rebar-utils.eclass b/eclass/rebar-utils.eclass
    new file mode 100644
    index 000000000000..5657908eb8e9
    --- /dev/null
    +++ b/eclass/rebar-utils.eclass
    @@ -0,0 +1,160 @@
    +# Copyright 1999-2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: rebar-utils.eclass
    +# @MAINTAINER:
    +# Florian Schmaus <flow@gentoo.org>
    +# @AUTHOR:
    +# Amadeusz Żołnowski <aidecoe@gentoo.org>
    +# @SUPPORTED_EAPIS: 7 8
    +# @BLURB: Auxiliary functions for using dev-util/rebar.
    +# @DESCRIPTION:
    +# This eclass provides a set of axiliary functions commonly needed
    +# when building Erlang/OTP packages with rebar.
    +
    +case ${EAPI} in
    + 7|8) ;;
    + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
    +esac
    +
    +if [[ -z ${_R