• [gentoo-dev] [PATCH 0/5] Ziglang eclasses for 0.13+

    From Eric Joldasov@21:1/5 to All on Thu Oct 24 03:50:01 2024
    Hello everyone,

    This patch series adds new eclasses for packages that use Zig
    toolchain with varying level of integration. Since some projects
    or ebuilds use only Zig compiler directly, without touching Zig Build
    System, I have decided to split eclasses into 2:

    * zig-toolchain.eclass: handles dependency on Zig toolchain and
    finds appropriate versions/slots, converts C-style target tuples/triples
    to Zig format and sets environment variables to be used in other
    eclasses and ebuilds. This eclass is more low-level and intended
    to be used by programs and libraries that call "zig" commands directly,
    without having build.zig file and using "zig build" command. For example,
    authors could use "zig build-exe" and "zig test" directly in Makefile,
    or add "zig cc" and compile both C and Zig version of library etc.
    In this patchset it is also used by dev-lang/zig to convert targets
    during bootstrapping, and other logic is suppressed.
    * zig-build.eclass: handles working with "zig build" sub-command and build.zig files.
    This eclass is more high-level and for most ebuilds it's the only
    one which needs to be inherited. It sets default functions for
    ebuild phases, deals with dependencies in package manager, allows
    ebuilds and end users to configure used flags, respects multi-threading
    and verboseness preferences, has some small support for cross-compilation
    and so on.

    Github PR and discussion here: https://github.com/gentoo/gentoo/pull/37283 .
    I have also wrote small generator for Zig ebuild skeletons here: https://github.com/BratishkaErik/zig-ebuild . Example output in that PR.
    It requires dev-lang/zig:9999 to compile, but at runtime it works
    with any version supported by eclass (currently 0.13 and 9999).

    P.S.: I have not used "git format-patch" and "git send-email" for
    a long time, please forgive me and direct if I did something wrong with mail.

    Eric Joldasov (5):
    zig-toolchain.eclass: new eclass
    zig-build.eclass: new eclass
    dev-lang/zig: add 0.13.0-r1
    dev-lang/zig: sync 9999 with 0.13.0-r1
    sys-fs/ncdu: add 2.6-r1

    .../zig-0.13.0-skip-test-stack_iterator.patch | 32 +
    dev-lang/zig/zig-0.13.0-r1.ebuild | 242 ++++++++
    dev-lang/zig/zig-9999.ebuild | 239 ++++----
    eclass/zig-build.eclass | 572 ++++++++++++++++++
    eclass/zig-toolchain.eclass | 325 ++++++++++
    sys-fs/ncdu/ncdu-2.6-r1.ebuild | 50 ++
    6 files changed, 1342 insertions(+), 118 deletions(-)
    create mode 100644 dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch
    create mode 100644 dev-lang/zig/zig-0.13.0-r1.ebuild
    create mode 100644 eclass/zig-build.eclass
    create mode 100644 eclass/zig-toolchain.eclass
    create mode 100644 sys-fs/ncdu/ncdu-2.6-r1.ebuild

    --
    2.47.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric Joldasov@21:1/5 to All on Thu Oct 24 03:50:01 2024
    Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
    ---
    eclass/zig-build.eclass | 572 ++++++++++++++++++++++++++++++++++++++++
    1 file changed, 572 insertions(+)
    create mode 100644 eclass/zig-build.eclass

    diff --git a/eclass/zig-build.eclass b/eclass/zig-build.eclass
    new file mode 100644
    index 000000000000..b1fc89e38d9d
    --- /dev/null
    +++ b/eclass/zig-build.eclass
    @@ -0,0 +1,572 @@
    +# Copyright 2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: zig-build.eclass
    +# @MAINTAINER:
    +# Eric Joldasov <bratishkaerik@landless-city.net>
    +# @AUTHOR:
    +# Alfred Wingate <parona@protonmail.com>
    +# Violet Purcell <vimproved@inventati.org>
    +# Eric Joldasov <bratishkaerik@landless-city.net>
    +# @SUPPORTED_EAPIS: 8
    +# @PROVIDES: zig-toolchain
    +# @BLURB: Functions for working with ZBS (Zig Build System).
    +# @DESCRIPTION:
    +# Functions for working with Zig build system and package manager.
    +# Supports Zig 0.13+. Exports default functions for convenience.
    +#
    +# Note that zig-build.eclass is mostly tailor
  • From Eric Joldasov@21:1/5 to All on Fri Oct 25 23:30:02 2024
    Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
    ---
    eclass/zig-build.eclass | 580 ++++++++++++++++++++++++++++++++++++++++
    1 file changed, 580 insertions(+)
    create mode 100644 eclass/zig-build.eclass

    diff --git a/eclass/zig-build.eclass b/eclass/zig-build.eclass
    new file mode 100644
    index 000000000000..ffa075043cde
    --- /dev/null
    +++ b/eclass/zig-build.eclass
    @@ -0,0 +1,580 @@
    +# Copyright 2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: zig-build.eclass
    +# @MAINTAINER:
    +# Eric Joldasov <bratishkaerik@landless-city.net>
    +# @AUTHOR:
    +# Alfred Wingate <parona@protonmail.com>
    +# Violet Purcell <vimproved@inventati.org>
    +# Eric Joldasov <bratishkaerik@landless-city.net>
    +# @SUPPORTED_EAPIS: 8
    +# @PROVIDES: zig-toolchain
    +# @BLURB: Functions for working with ZBS (Zig Build System)
    +# @DESCRIPTION:
    +# Functions for working with Zig build system and package manager.
    +# Supports Zig 0.13+. Exports default functions for convenience.
    +#
    +# Note that zig-build.eclass is mostly tailor
  • From Eric Joldasov@21:1/5 to All on Fri Oct 25 23:30:02 2024
    Hello everyone,

    This patch series adds new eclasses for packages that use Zig
    toolchain with varying level of integration. Since some projects
    or ebuilds use only Zig compiler directly, without touching Zig Build
    System, I have decided to split eclasses into 2:

    * zig-toolchain.eclass: handles dependency on Zig toolchain and
    finds appropriate versions/slots, converts C-style target tuples/triples
    to Zig format and sets environment variables to be used in other
    eclasses and ebuilds. This eclass is more low-level and intended
    to be used by programs and libraries that call "zig" commands directly,
    without having build.zig file and using "zig build" command. For example,
    authors could use "zig build-exe" and "zig test" directly in Makefile,
    or add "zig cc" and compile both C and Zig version of library etc.
    In this patchset it is also used by dev-lang/zig to convert targets
    during bootstrapping, and other logic is suppressed.
    * zig-build.eclass: handles working with "zig build" sub-command and build.zig files.
    This eclass is more high-level and for most ebuilds it's the only
    one which needs to be inherited. It sets default functions for
    ebuild phases, deals with dependencies in package manager, allows
    ebuilds and end users to configure used flags, respects multi-threading
    and verboseness preferences, has some small support for cross-compilation
    and so on.

    Github PR and discussion here: https://github.com/gentoo/gentoo/pull/37283 .
    I have also wrote small generator for Zig ebuild skeletons here: https://github.com/BratishkaErik/zig-ebuild . Example output in that PR.
    It requires dev-lang/zig:9999 to compile, but at runtime it works
    with any version supported by eclass (currently 0.13 and 9999).

    In "v2" revision, including suggestions on mailing list:
    * Move EAPI check after inherit guard
    * Change BDEPEND from "+=" to "=" and remove initial space here,
    * Keep length below 80 characters, and add 2 spaces after full stop,
    * Align lines in switch cases (according to Neovim, on nano I had
    not noticed it before),
    * Add "die -n" to ezig(),
    * Move and rewrite TODO comments in zig-build_start_base_args to be
    shorter and move less relevant information to patch itself.

    ...and GitHub. Also remove old leftovers of Zig 0.12 compatibility.

    Eric Joldasov (5):
    zig-toolchain.eclass: new eclass
    zig-build.eclass: new eclass
    dev-lang/zig: add 0.13.0-r1
    dev-lang/zig: sync 9999 with 0.13.0-r1
    sys-fs/ncdu: add 2.6-r1

    .../zig-0.13.0-skip-test-stack_iterator.patch | 32 +
    dev-lang/zig/zig-0.13.0-r1.ebuild | 245 ++++++++
    dev-lang/zig/zig-9999.ebuild | 244 ++++----
    eclass/zig-build.eclass | 580 ++++++++++++++++++
    eclass/zig-toolchain.eclass | 375 +++++++++++
    sys-fs/ncdu/ncdu-2.6-r1.ebuild | 50 ++
    6 files changed, 1407 insertions(+), 119 deletions(-)
    create mode 100644 dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch
    create mode 100644 dev-lang/zig/zig-0.13.0-r1.ebuild
    create mode 100644 eclass/zig-build.eclass
    create mode 100644 eclass/zig-toolchain.eclass
    create mode 100644 sys-fs/ncdu/ncdu-2.6-r1.ebuild

    Interdiff:
    diff --git a/eclass/zig-build.eclass b/eclass/zig-build.eclass
    index b1fc89e38d9d..ffa075043cde 100644
    --- a/eclass/zig-build.eclass
    +++ b/eclass/zig-build.eclass
    @@ -1,572 +1,580 @@
    # Copyright 2024 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: zig-build.eclass
    # @MAINTAINER:
    # Eric Joldasov <bratishkaerik@landless-city.net>
    # @AUTHOR:
    # Alfred Wingate <parona@protonmail.com>
    # Violet Purcell <vimproved@inventati.org>
    # Eric Joldasov <bratishkaerik@landless-city.net>
    # @SUPPORTED_EAPIS: 8
    # @PROVIDES: zig-toolchain
    -# @BLURB: Functions for working with ZBS (Zig Build System).
    +# @BLURB: Functions for working with ZBS (Zig Build System)
    # @DESCRIPTION:
    -# Functions for working with Zig build system and package manager.
    -# Supports Zig 0.13+. Exports default functions for convenience.
    +# Functions for working with Zig build system and package manager.
    +# Supports Zig 0.13+. Exports default functions for convenience.
    #
    # Note that zig-build.eclass is mostly tailored for projects that:
    # 1) Install something in build.zig steps
  • From Eric Joldasov@21:1/5 to All on Fri Oct 25 23:40:01 2024
    Hello everyone,

    This patch series adds new eclasses for packages that use Zig
    toolchain with varying level of integration. Since some projects
    or ebuilds use only Zig compiler directly, without touching Zig Build
    System, I have decided to split eclasses into 2:

    * zig-toolchain.eclass: handles dependency on Zig toolchain and
    finds appropriate versions/slots, converts C-style target tuples/triples
    to Zig format and sets environment variables to be used in other
    eclasses and ebuilds. This eclass is more low-level and intended
    to be used by programs and libraries that call "zig" commands directly,
    without having build.zig file and using "zig build" command. For example,
    authors could use "zig build-exe" and "zig test" directly in Makefile,
    or add "zig cc" and compile both C and Zig version of library etc.
    In this patchset it is also used by dev-lang/zig to convert targets
    during bootstrapping, and other logic is suppressed.
    * zig-build.eclass: handles working with "zig build" sub-command and build.zig files.
    This eclass is more high-level and for most ebuilds it's the only
    one which needs to be inherited. It sets default functions for
    ebuild phases, deals with dependencies in package manager, allows
    ebuilds and end users to configure used flags, respects multi-threading
    and verboseness preferences, has some small support for cross-compilation
    and so on.

    Github PR and discussion here: https://github.com/gentoo/gentoo/pull/37283 .
    I have also wrote small generator for Zig ebuild skeletons here: https://github.com/BratishkaErik/zig-ebuild . Example output in that PR.
    It requires dev-lang/zig:9999 to compile, but at runtime it works
    with any version supported by eclass (currently 0.13 and 9999).

    In "v2" revision, including suggestions on mailing list:
    * Move EAPI check after inherit guard
    * Change BDEPEND from "+=" to "=" and remove initial space here,
    * Keep length below 80 characters, and add 2 spaces after full stop,
    * Align lines in switch cases (according to Neovim, on nano I had
    not noticed it before),
    * Add "die -n" to ezig(),
    * Move and rewrite TODO comments in zig-build_start_base_args to be
    shorter and move less relevant information to patch itself.

    ...and GitHub. Also remove old leftovers of Zig 0.12 compatibility.

    Eric Joldasov (5):
    zig-toolchain.eclass: new eclass
    zig-build.eclass: new eclass
    dev-lang/zig: add 0.13.0-r1
    dev-lang/zig: sync 9999 with 0.13.0-r1
    sys-fs/ncdu: add 2.6-r1

    .../zig-0.13.0-skip-test-stack_iterator.patch | 32 +
    dev-lang/zig/zig-0.13.0-r1.ebuild | 245 ++++++++
    dev-lang/zig/zig-9999.ebuild | 244 ++++----
    eclass/zig-build.eclass | 580 ++++++++++++++++++
    eclass/zig-toolchain.eclass | 375 +++++++++++
    sys-fs/ncdu/ncdu-2.6-r1.ebuild | 50 ++
    6 files changed, 1407 insertions(+), 119 deletions(-)
    create mode 100644 dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch
    create mode 100644 dev-lang/zig/zig-0.13.0-r1.ebuild
    create mode 100644 eclass/zig-build.eclass
    create mode 100644 eclass/zig-toolchain.eclass
    create mode 100644 sys-fs/ncdu/ncdu-2.6-r1.ebuild

    Interdiff against v1:
    diff --git a/eclass/zig-build.eclass b/eclass/zig-build.eclass
    index b1fc89e38d9d..ffa075043cde 100644
    --- a/eclass/zig-build.eclass
    +++ b/eclass/zig-build.eclass
    @@ -1,572 +1,580 @@
    # Copyright 2024 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: zig-build.eclass
    # @MAINTAINER:
    # Eric Joldasov <bratishkaerik@landless-city.net>
    # @AUTHOR:
    # Alfred Wingate <parona@protonmail.com>
    # Violet Purcell <vimproved@inventati.org>
    # Eric Joldasov <bratishkaerik@landless-city.net>
    # @SUPPORTED_EAPIS: 8
    # @PROVIDES: zig-toolchain
    -# @BLURB: Functions for working with ZBS (Zig Build System).
    +# @BLURB: Functions for working with ZBS (Zig Build System)
    # @DESCRIPTION:
    -# Functions for working with Zig build system and package manager.
    -# Supports Zig 0.13+. Exports default functions for convenience.
    +# Functions for working with Zig build system and package manager.
    +# Supports Zig 0.13+. Exports default functions for convenience.
    #
    # Note that zig-build.eclass is mostly tailored for projects that:
    # 1) Install something in build.zig steps
  • From Eric Joldasov@21:1/5 to All on Fri Dec 13 21:10:01 2024
    Hello everyone,

    This patch series adds 2 new eclasses for better integration with the
    Zig toolchain and rewrites ebuilds in `::gentoo` repository to use them.

    The `zig-utils.eclass` is designed for other eclasses and ebuilds that
    directly call `zig` command (like `zig.eclass` which runs `zig build`,
    or some packages in wild that have `zig build-exe` in their Makefiles
    or something similar). It is fairly low-level compared to `zig.eclass`,
    so for most Zig projects ebuild authors shoud use latter instead.

    The `zig.eclass` works with `build.zig` system, called ZBS here to
    highlight distinction between it and `zig build-exe` command or other
    build systems with Zig support. It manages dependencies integration for official package manager and options configuration system (some basic
    options with sane defaults that can be combined with additional
    options from ebuild authors and users) and makes packaging more
    convenient by automatically exporting required dependencies and phase functions.

    This is 3-rd version, with changes requested on GitHub PR.
    Big thanks to Michał Górny and Sam James for their review comments there.

    I won't attach interdiff here (it's unreadable IMHO, mostly because of renamings), so instead I wrote small overview:
    * Eclasses renamed: `zig-toolchain` to `zig-utils`, `zig-build` to `zig`.
    Some functions are also renamed, for example `init_base_args` to `setup`.
    * Target and CPU convertion functions now accept 2-nd required
    argument with `CFLAGS`-like value, for more precise convertion and
    needed by new `ZIG_CPU` logic. CPU convertion logic was added for
    more arches. Both functions are now also covered by tests (can
    optionally compile and run Zig code with resulting target and CPU).
    * `ZIG_CPU` now defaults to "value converted from CHOST and CFLAGS
    rather" than `native`, to be more consistent with existing policies
    and other ecosystems.
    * `src_install` does not change CWD when using `einstalldocs` anymore.
    * Other functions were rewritten for simplicity or readability without
    significant changes in behaviour (maybe I forgot some changes).

    Eric Joldasov (5):
    zig-utils.eclass: new eclass
    zig.eclass: new eclass
    dev-lang/zig: add 0.13.0-r2
    dev-lang/zig: sync 9999 with 0.13.0-r2
    sys-fs/ncdu: add 2.7-r1

    ....13.0-skip-test-stack_iterator.patch (new) | 32 +
    dev-lang/zig/zig-0.13.0-r2.ebuild (new) | 248 ++++++++
    dev-lang/zig/zig-9999.ebuild | 243 ++++----
    eclass/tests/zig-utils.sh (new +x) | 320 ++++++++++
    eclass/zig-utils.eclass (new) | 538 +++++++++++++++++
    eclass/zig.eclass (new) | 558 ++++++++++++++++++
    sys-fs/ncdu/ncdu-2.7-r1.ebuild (new) | 52 ++
    7 files changed, 1873 insertions(+), 118 deletions(-)
    create mode 100644 dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch
    create mode 100644 dev-lang/zig/zig-0.13.0-r2.ebuild
    create mode 100755 eclass/tests/zig-utils.sh
    create mode 100644 eclass/zig-utils.eclass
    create mode 100644 eclass/zig.eclass
    create mode 100644 sys-fs/ncdu/ncdu-2.7-r1.ebuild

    --
    2.47.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric Joldasov@21:1/5 to All on Fri Dec 13 21:10:01 2024
    Now uses `zig.eclass`.

    Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
    ---
    sys-fs/ncdu/ncdu-2.7-r1.ebuild (new) | 52 ++++++++++++++++++++++++++++
    1 file changed, 52 insertions(+)

    diff --git a/sys-fs/ncdu/ncdu-2.7-r1.ebuild b/sys-fs/ncdu/ncdu-2.7-r1.ebuild new file mode 100644
    index 000000000000..96b32f45abb3
    --- /dev/null
    +++ b/sys-fs/ncdu/ncdu-2.7-r1.ebuild
    @@ -0,0 +1,52 @@
    +# Copyright 1999-2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +EAPI=8
    +
    +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/yoranheling.asc
    +
    +ZIG_SLOT="0.13"
    +inherit verify-sig zig
    +
    +DESCRIPTION="NCurses Disk Usage"
    +HOMEPAGE="https://dev.yorhel.nl/ncdu https://code.blicky.net/yorhel/ncdu" +SRC_URI="
    + https://dev.yorhel.nl/download/${P}.tar.gz
    + verify-sig? ( https://dev.yorhel.nl/download/${P}.tar.gz.asc )
    +"
    +
    +LICENSE="MIT"
    +SLOT="0"
    +KEYWORDS="~amd64"
    +
    +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-yorhel )"
    +DEPEND="
    + app-arch/zstd:=
    + sys-libs/ncurses:=[unicode(+)]
    +"
    +RDEPEND="${DEPEND}"
    +
    +DOCS=( "README.md"
  • From Eric Joldasov@21:1/5 to All on Fri Dec 13 21:10:02 2024
    This eclass is built on top of `zig-utils.eclass` and works with
    `zig build` sub-commands and `build.zig` system, here called ZBS or
    Zig Build System. By default it adds convenient default dependencies
    and phase functions (which can be opt-out by setting `ZIG_OPTIONAL=1`)
    that:
    * work with dependencies from official package manager,
    * configures basic sane options for `zig build`, which can be further
    complemented by ebuild authors and users,
    * respects user settings for verbosity and jobs number,
    * has some basic support for cross-compilation, which works on my PC
    with `crossdev` and QEMU-ed Docker container, but it was not tested
    on real machine yet.

    This is a major step in unifying behaviour and de-duplicating logic
    spanning multiple ebuilds (target convertion and jobs amount
    in `dev-lang/zig`, different Zig search and build options configuration
    in `sys-fs/ncdu` and other ebuilds in community overlays). Mentioned
    ebuilds are converted in next commits.

    It is recommended to use https://github.com/BratishkaErik/zig-ebuilder
    with this eclass to generate base for new ebuilds.

    Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
    ---
    eclass/zig.eclass (new) | 558 ++++++++++++++++++++++++++++++++++++++++
    1 file changed, 558 insertions(+)

    diff --git a/eclass/zig.eclass b/eclass/zig.eclass
    new file mode 100644
    index 000000000000..e838616ef72a
    --- /dev/null
    +++ b/eclass/zig.eclass
    @@ -0,0 +1,558 @@
    +# Copyright 2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: zig.eclass
    +# @MAINTAINER:
    +# Eric Joldasov <bratishkaerik@landless-city.net>
    +# @AUTHOR:
    +# Alfred Wingate <parona@protonmail.com>
    +# Violet Purcell <vimproved@inventati.org>
    +# Eric Joldasov <bratishkaerik@landless-city.net>
    +# @SUPPORTED_EAPIS: 8
    +# @PROVIDES: zig-utils
    +# @BLURB: Functions for working with ZBS (Zig Build System)
    +# @DESCRIPTION:
    +# Functions for working with Zig build system and package manager.
    +# Supports Zig 0.13+. Exports default functions for convenience.
    +#
    +# Note that zig.eclass is mostly tailored for projects that:
    +# 1) Install something in build.zig steps: "artifacts"
  • From Eric Joldasov@21:1/5 to All on Fri Dec 13 21:10:02 2024
    This eclass handles dependency on Zig toolchain and finds appropriate versions/slots, converts "CHOST-style and CFLAGS" to "Zig target tuple
    and CPU" formats and sets environment variables to be used by other
    eclasses and ebuilds.

    Most of the projects written in Zig use `build.zig` system and should
    use `zig.eclass` from next commit instead. This eclass is more
    low-level and can be used when `zig` commands are called from other
    build systems directly. For example, when authors use `zig build-exe`
    or `zig test` commands in their Makefile/meson.build/Cargo etc.

    Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
    ---
    eclass/tests/zig-utils.sh (new +x) | 320 +++++++++++++++++
    eclass/zig-utils.eclass (new) | 538 +++++++++++++++++++++++++++++
    2 files changed, 858 insertions(+)

    diff --git a/eclass/tests/zig-utils.sh b/eclass/tests/zig-utils.sh
    new file mode 100755
    index 000000000000..14af1d2105e3
    --- /dev/null
    +++ b/eclass/tests/zig-utils.sh
    @@ -0,0 +1,320 @@
    +#!/bin/bash
    +# Copyright 2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +EAPI=8
    +source tests-common.sh || exit
    +
    +inherit zig-utils
    +
    +# Set ZIG_TEST_COMPILATION env-var to "1" if you want to test binary
    +# compilation and running under QEMU. Assumes "zig" is present in PATH
    +# and qemu binfmt is enabled.
    +#
    +# If CPU is marked with ":no-run", it means program compiled for it
    +# successfully but crashed when running under QEMU.
    +if [[ "${ZIG_TEST_COMPILATION:-0}" -eq 1 ]]; then
    + MY_WORKDIR="$(mktemp -d)"
    + my_cleanup() {
    + popd > /dev/null
    + rm -rf "${MY_WORKDIR}"
    + }
    + trap 'my_
  • From Eric Joldasov@21:1/5 to All on Fri Dec 13 21:20:02 2024
    From: Eric Joldasov <bratishkaerik@getgoogleoff.me>

    * Update to use zig-utils and zig eclasses instead of local
    get_zig_mcpu etc. functions.
    * "stage3" compilation is unified by combining build.zig options,
    now both cmake (+llvm) and bootstrap.c (-llvm) build up to "zig2"
    target, after that we use zig.eclass with common options.
    * Before migrating to the zig.eclass, test steps in src_test
    have been ran sequentially in for-loop, which allowed logic inside
    each step to ran parallelly but not several steps at a time. Now we
    use upstream "test" step instead of separately calling all dependant
    steps, so that build system can now ran all of them paralelly.
    This means time spent in `src_test` is now significantly shorter.
    * "zig2" in both scenarios now has explicit target which is set by
    using zig-utils.eclass functions on a CBUILD/CHOST. This allows us
    to skip convertion logic in CMake and bootstrap.c, so that instead
    of patching them we can just update converter in zig-utils.eclass
    and unify target behaviour.
    * Disable autodocs generation for "std" module, since it can now
    be generated on-fly with `zig std` command.

    Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
    ---
    dev-lang/zig/zig-9999.ebuild | 243 ++++++++++++++++++-----------------
    1 file changed, 125 insertions(+), 118 deletions(-)

    diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
    index 858ec3be9405..4f0358a96629 100644
    --- a/dev-lang/zig/zig-9999.ebuild
    +++ b/dev-lang/zig/zig-9999.ebuild
    @@ -1,234 +1,241 @@
    # Copyright 2019-2024 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    EAPI=8

    LLVM_COMPAT=( 19 )
    LLVM_OPTIONAL=1

    -inherit check-reqs cmake edo llvm-r1 toolchain-funcs
    +ZIG_SLOT="$(ver_cut 1-2)"
    +ZIG_OPTIONAL=1
    +
    +inherit check-reqs cmake flag-o-matic edo llvm-r1 toolchain-funcs zig

    DESCRIPTION="A robust, optimal, and maintainable programming language" -HOMEPAGE="https://ziglang.org/"
    +HOMEPAGE="https://ziglang.org/ https://github.com/ziglang/zig/"
    if [[ ${PV} == 9999 ]]; then
    EGIT_REPO_URI="https://github.com/ziglang/zig.git"
    inherit git-r3
    else
    VERIFY_SIG_METHOD=minisig
    VERIFY_SIG_OPENPGP_KEY_PATH=/