• [gentoo-dev] [PATCH] eclass/dune.eclass: introduce edune and dune-compi

    From =?UTF-8?q?Maciej=20Bar=C4=87?=@21:1/5 to All on Mon Jan 2 22:40:02 2023
    edune is a thin wrapper for dune, which will help to run special,
    uncommon dune commands;
    dune-compile is a function to selectively pick which packages will be
    compiled "for-release" (as dune call it);
    dune-compile without any arguments replaces the current dune_src_compile

    Signed-off-by: Maciej Barć <xgqt@gentoo.org>
    ---
    eclass/dune.eclass | 47 ++++++++++++++++++++++++++++++++++++++++++----
    1 file changed, 43 insertions(+), 4 deletions(-)

    diff --git a/eclass/dune.eclass b/eclass/dune.eclass
    index 4bc73eda8..6c760accd 100644
    --- a/eclass/dune.eclass
    +++ b/eclass/dune.eclass
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2022 Gentoo Authors
    +# Copyright 1999-2023 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: dune.eclass
    @@ -44,15 +44,54 @@ BDEPEND="
    dev-ml/dune
    "

    +# @FUNCTION: edune
    +# @USAGE: <arg> ...
    +# @DESCRIPTION:
    +# A thin wrapper for the `dune` command.
    +# Runs `dune` with given arguments and dies on failure.
    +#
    +# Example use:
    +# @CODE
    +# edune clean
    +# @CODE
    +edune() {
    + debug-print-function ${FUNCNAME} "${@}"
    +
    + dune "${@}" || die "dune call failed, given arguments: ${@}"
    +}
    +
    +# @FUNCTION: dune-compile
    +# @USAGE: [package] ...
    +# @DESCRIPTION:
    +# Compiles either all of packages sources in current directory or selected
    +# packages.
  • From =?UTF-8?q?Maciej=20Bar=C4=87?=@21:1/5 to All on Tue Jan 3 00:30:01 2023
    edune is a thin wrapper for dune, which will help to run special,
    uncommon dune commands;
    dune-compile is a function to selectively pick which packages will be
    compiled "for-release" (as dune call it);
    dune-compile without any arguments replaces the current dune_src_compile

    Signed-off-by: Maciej Barć <xgqt@gentoo.org>
    ---
    eclass/dune.eclass | 49 +++++++++++++++++++++++++++++++++++++++++-----
    1 file changed, 44 insertions(+), 5 deletions(-)

    diff --git a/eclass/dune.eclass b/eclass/dune.eclass
    index 4bc73eda8..384908a40 100644
    --- a/eclass/dune.eclass
    +++ b/eclass/dune.eclass
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2022 Gentoo Authors
    +# Copyright 1999-2023 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: dune.eclass
    @@ -29,7 +29,7 @@ _DUNE_ECLASS=1
    # Set before inheriting the eclass.
    : ${DUNE_PKG_NAME:=${PN}}

    -inherit multiprocessing
    +inherit edo multiprocessing

    # Do not complain about CFLAGS etc since ml projects do not use them.
    QA_FLAGS_IGNORED='.*'
    @@ -44,15 +44,54 @@ BDEPEND="
    dev-ml/dune
    "

    +# @FUNCTION: edune
    +# @USAGE: <arg> ...
    +# @DESCRIPTION:
    +# A thin wrapper for the `dune` command.
    +# Runs `dune` with given arguments and dies on failure.
    +#
    +# Example use:
    +# @CODE
    +# edune clean
    +# @CODE
    +edune() {
    + debug-print-function
  • From =?UTF-8?q?Maciej=20Bar=C4=87?=@21:1/5 to All on Wed Jan 4 20:10:01 2023
    edune is a thin wrapper for dune, which will help to run special,
    uncommon dune commands;
    dune-compile is a function to selectively pick which packages will be
    compiled "for-release" (as dune call it);
    dune-compile without any arguments replaces the current dune_src_compile

    Signed-off-by: Maciej Barć <xgqt@gentoo.org>
    ---
    eclass/dune.eclass | 114 ++++++++++++++++++++++++++++++++++++++++-----
    1 file changed, 103 insertions(+), 11 deletions(-)

    diff --git a/eclass/dune.eclass b/eclass/dune.eclass
    index 4bc73eda8..655a41be8 100644
    --- a/eclass/dune.eclass
    +++ b/eclass/dune.eclass
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2022 Gentoo Authors
    +# Copyright 1999-2023 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: dune.eclass
    @@ -29,7 +29,7 @@ _DUNE_ECLASS=1
    # Set before inheriting the eclass.
    : ${DUNE_PKG_NAME:=${PN}}

    -inherit multiprocessing
    +inherit edo multiprocessing

    # Do not complain about CFLAGS etc since ml projects do not use them.
    QA_FLAGS_IGNORED='.*'
    @@ -44,16 +44,108 @@ BDEPEND="
    dev-ml/dune
    "

    +# @FUNCTION: edune
    +# @USAGE: <arg> ...
    +# @DESCRIPTION:
    +# A thin wrapper for the `dune` command.
    +# Runs `dune` with given arguments and dies on failure.
    +#
    +# Example use:
    +# @CODE
    +# edune clean
    +# @CODE
    +edune() {
    + debug-print-funct