• [gentoo-dev] [PATCH 1/5] out-of-source-utils.eclass: New utility eclass

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sun Jan 1 17:10:01 2023
    Introduce a new out-of-source-utils.eclass to carry run_in_build_dir()
    helper function. This function used to be defined in multibuild.eclass
    and indirectly exposed through the eclasses using it. However, it is
    used rather rarely and it is technically also useful for
    out-of-source.eclass, so it makes more sense for it to be standalone.
    In the end, eclasses are cheap.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/out-of-source-utils.eclass | 43 +++++++++++++++++++++++++++++++
    1 file changed, 43 insertions(+)
    create mode 100644 eclass/out-of-source-utils.eclass

    diff --git a/eclass/out-of-source-utils.eclass b/eclass/out-of-source-utils.eclass
    new file mode 100644
    index 000000000000..450237b224b3
    --- /dev/null
    +++ b/eclass/out-of-source-utils.eclass
    @@ -0,0 +1,43 @@
    +# Copyright 2022 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: out-of-source-utils.eclass
    +# @MAINTAINER:
    +# Michał Górny <mgorny@gentoo.org>
    +# @AUTHOR:
    +# Michał Górny <mgorny@gentoo.org>
    +# @SUPPORTED_EAPIS: 6 7 8
    +# @BLURB: Utility functions for building packages out-of-source
    +# @DESCRIPTION:
    +# This eclass provides a run_in_build_dir() helper that can be used
    +# to execute specified command inside BUILD_DIR.
    +
    +case ${EAPI} in
    + 6|7|8) ;;
    + *) die "${ECLASS}: EAPI ${EAPI} unsupported."
    +esac
    +
    +if [[ ! ${_OUT_OF_SOURCE_UTILS_ECLASS} ]]; then
    +_OUT_OF_S
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sun Jan 1 17:10:01 2023
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/out-of-source.eclass | 7 +++++++
    1 file changed, 7 insertions(+)

    diff --git a/eclass/out-of-source.eclass b/eclass/out-of-source.eclass
    index 81e03f3894db..406d252621c3 100644
    --- a/eclass/out-of-source.eclass
    +++ b/eclass/out-of-source.eclass
    @@ -40,6 +40,13 @@ esac
    if [[ ! ${_OUT_OF_SOURCE_ECLASS} ]]; then
    _OUT_OF_SOURCE_ECLASS=1

    +# @ECLASS_VARIABLE: BUILD_DIR
    +# @OUTPUT_VARIABLE
    +# @DEFAULT_UNSET
    +# @DESCRIPTION:
    +# The current build directory. Defaults to ${WORKDIR}/${P}_build
    +# if unset.
    +
    # @FUNCTION: out-of-source_src_configure
    # @DESCRIPTION:
    # The default src_configure() implementation establishes a BUILD_DIR,
    --
    2.39.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sun Jan 1 17:10:02 2023
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/multilib-build.eclass | 1 -
    1 file changed, 1 deletion(-)

    diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
    index 40cc426a1359..8984600055a5 100644
    --- a/eclass/multilib-build.eclass
    +++ b/eclass/multilib-build.eclass
    @@ -7,7 +7,6 @@
    # @AUTHOR:
    # Author: Michał Górny <mgorny@gentoo.org>
    # @SUPPORTED_EAPIS: 6 7 8
    -# @PROVIDES: multibuild
    # @BLURB: flags and utility functions for building multilib packages
    # @DESCRIPTION:
    # The multilib-build.eclass exports USE flags and utility functions
    --
    2.39.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Mon Jan 2 10:30:01 2023
    On Sun, 01 Jan 2023, Michał Górny wrote:

    +case ${EAPI} in
    + 6|7|8) ;;
    + *) die "${ECLASS}: EAPI ${EAPI} unsupported."

    Are you sure that this will work without the final ;; terminator?
    (Bash documentation says that a terminator is mandatory.)

    Apart from that, I'd suggest to use the standard clause as in other
    eclasses:

    *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;

    +esac

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmOyovUPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uqLcH/RWQe52D/bj3zyu8tZxJv88nfQNcMkEC6FZV ImlC6TJEFASgnHM2VvKWgoE4OFsJo7Vab3s0sT8Bwyc2tQL7PwlfvJ38C38zXIPz /sMfBV567beTZ97ASFB2ZB9Z39KV24MoOKwJJvhevO9tkUgdMiVvr7iXQ0yWLAIv aI7ojshL0oLuOxnukaCpCs9jPuKW4hW995C5SRn3M2wUycTu8qQVL1TZTIs0Ku8C FjdlfDb5vbCI5+od7e+fY45EoAdBokQWfET5knR37xNPnbnwmKq1htgfO85DCrlF 00SJoblxnJv17HYTggtnL/ViEUq3R+PKKzM0XAcoYmW3xFPunTs³KN
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Ulrich Mueller on Mon Jan 2 13:30:02 2023
    On Mon, 2023-01-02 at 10:25 +0100, Ulrich Mueller wrote:
    On Sun, 01 Jan 2023, Michał Górny wrote:

    +case ${EAPI} in
    + 6|7|8) ;;
    + *) die "${ECLASS}: EAPI ${EAPI} unsupported."

    Are you sure that this will work without the final ;; terminator?
    (Bash documentation says that a terminator is mandatory.)

    Interesting enough, it does work.

    Apart from that, I'd suggest to use the standard clause as in other
    eclasses:

    *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;


    Actually, this is what app-vim/gentoo-syntax spews by default. I guess
    I need to change it.

    Anyway, replaced by your snippet. I suppose it's fine if I don't
    resubmit the batch for this change.

    --
    Best regards,
    Michał Górny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)