[gentoo-dev] Last rites: dev-util/cargo-ebuild

2024-10-23 Thread Arthur Zamarin
# Arthur Zamarin  (2024-10-23)
# Doesn't support latest Rust/Cargo ebuild format and standard. Confuses
# developers who tries to use it, and then see pkgcheck warnings on the
# result.
# Superior replacement is app-portage/pycargoebuild, which is
# maintained, and supports more features.
# Removal on 2024-11-22.  Bugs #942026, #934381, #724162, #930011.
dev-util/cargo-ebuild



OpenPGP_signature.asc
Description: OpenPGP digital signature


[gentoo-dev] RFC: virtual/sound-theme: New package providing freedesktop.org spec compliant theme for desktop env. system sounds

2024-10-23 Thread Andreas Sturmlechner
See also:
https://specifications.freedesktop.org/sound-naming-spec/latest/
https://bugs.gentoo.org/941986
https://github.com/gentoo/gentoo/pull/38648 (as part of a libcanberra split)
https://bugs.gentoo.org/323379 (some history)

media-libs/libcanberra is still broadly used as sound event library, even 
media-video/pipewire[X] depends on it, and KDE Plasma packages as well.

media-libs/libcanberra has IUSE=+sounds, which currently pulls in x11-themes/
sound-theme-freedesktop. But it can be replaced by other sound themes as long 
as they adhere to freedesktop.org spec, which essentially seems to come down 
to standardised notification sound names and some index file in

/usr/share/sounds//index.them

In KDE world there are two alternatives:
- kde-plasma/ocean-sound-theme
- kde-plasma/oxygen-sounds

But it is possible there are other themes already in ::gentoo that I am not 
aware of, or maybe other DE maintainers have their own ideas, so CCing 
relevant maintainers.

Current x11-themes/sound-theme-freedesktop RDEPENDs:

gnome-base/gnome
gnome-extra/gnome-tweaks
kde-plasma/kpipewire
kde-plasma/plasma-pa
media-libs/libcanberra-0.30-r7:sound

There are also a few media-libs/libcanberra[sound] revdeps that are addressed 
in the linked PR.


Subject: [PATCH] virtual/sound-theme: new package, add 0

- IUSE sound: derived from media-libs/libcanberra[sound]
- KEYWORDS: derived from x11-themes/sound-theme-freedesktop
  plus ~s390 for media-libs/libcanberra

Bug: https://bugs.gentoo.org/323379
Bug: https://bugs.gentoo.org/941986
Signed-off-by: Andreas Sturmlechner 
---
 create mode 100644 virtual/sound-theme/metadata.xml
 create mode 100644 virtual/sound-theme/sound-theme-0.ebuild

diff --git a/virtual/sound-theme/metadata.xml b/virtual/sound-theme/
metadata.xml
new file mode 100644
index 0..ff357f23fed56
--- /dev/null
+++ b/virtual/sound-theme/metadata.xml
@@ -0,0 +1,11 @@
+
+https://www.gentoo.org/dtd/metadata.dtd";>
+
+   
+   freedesktop-b...@gentoo.org
+   
+   
+   
+   Install freedesktop.org spec compliant 
theme for desktop environment system sounds
+   
+
diff --git a/virtual/sound-theme/sound-theme-0.ebuild b/virtual/sound-theme/
sound-theme-0.ebuild
new file mode 100644
index 0..c57c588d63aa9
--- /dev/null
+++ b/virtual/sound-theme/sound-theme-0.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Virtual for themes following the freedesktop.org sound naming 
spec"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv 
~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="+sound"
+
+RDEPEND="
+   sound? ( || (
+   x11-themes/sound-theme-freedesktop
+   kde-plasma/ocean-sound-theme:*
+   >=kde-plasma/oxygen-sounds-6.0.0:*
+   ) )
+"

signature.asc
Description: This is a digitally signed message part.


[gentoo-dev] [PATCH] python-utils-r1.eclass: Move python3_13t before other python*

2024-10-23 Thread Michał Górny
Move the python3_13t target on the list before other CPython targets.
This means it's technically "less preferred", so e.g. *all phases
would rather be performed with regular CPython, which should generally
be more faster.

Signed-off-by: Michał Górny 
---
 eclass/python-utils-r1.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 1c0e63a2621f..0cb132b72e3a 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -40,8 +40,8 @@ inherit multiprocessing toolchain-funcs
 # All supported Python implementations, most preferred last.
 _PYTHON_ALL_IMPLS=(
pypy3
-   python3_{10..13}
python3_13t
+   python3_{10..13}
 )
 readonly _PYTHON_ALL_IMPLS
 
-- 
2.47.0




[gentoo-dev] [PATCH 1/2] eclass/dotnet-pkg-base: turn off DOTNET_NUGET_SIGNATURE_VERIFICATION

2024-10-23 Thread xgqt
From: Maciej Barć 

Speeds up "dotnet restore". Especially can be noticed when running
without network sandbox.
Suggested by vimproved on IRC - thanks!

See also: https://github.com/NuGet/Home/issues/13062

Signed-off-by: Maciej Barć 
---
 eclass/dotnet-pkg-base.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/dotnet-pkg-base.eclass b/eclass/dotnet-pkg-base.eclass
index 15e9ba703b..8cedde073b 100644
--- a/eclass/dotnet-pkg-base.eclass
+++ b/eclass/dotnet-pkg-base.eclass
@@ -101,6 +101,9 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
 export MSBUILDDISABLENODEREUSE=1
 export POWERSHELL_TELEMETRY_OPTOUT=1
 export POWERSHELL_UPDATECHECK=0
+# Speeds up restore. Using this is redundant with Portage manifests.
+# See also: https://github.com/NuGet/Home/issues/13062
+export DOTNET_NUGET_SIGNATURE_VERIFICATION=false
 # Overwrite selected MSBuild properties ("-p:XYZ").
 export UseSharedCompilation=false
 
-- 
2.45.2




[gentoo-dev] [PATCH 2/2] eclass/dotnet-pkg-base: add efsi function for running FSI

2024-10-23 Thread xgqt
From: Maciej Barć 

This will replace "edotnet fsi" as used in "app-shells/pwsh" package.

Signed-off-by: Maciej Barć 
---
 eclass/dotnet-pkg-base.eclass | 12 
 1 file changed, 12 insertions(+)

diff --git a/eclass/dotnet-pkg-base.eclass b/eclass/dotnet-pkg-base.eclass
index 8cedde073b..26db694f59 100644
--- a/eclass/dotnet-pkg-base.eclass
+++ b/eclass/dotnet-pkg-base.eclass
@@ -294,6 +294,18 @@ edotnet() {
edo "${DOTNET_PKG_EXECUTABLE}" "${@}"
 }
 
+# @FUNCTION: efsi
+# @USAGE:  [args...]
+# @DESCRIPTION:
+# Call dotnet fsi, passing the supplied arguments.
+# FSI is the F# interpreter shipped with .NET SDK, it is useful for running F#
+# maintenance scripts.
+efsi() {
+   debug-print-function ${FUNCNAME} "$@"
+
+   edotnet fsi --nologo "${@}"
+}
+
 # @FUNCTION: dotnet-pkg-base_info
 # @DESCRIPTION:
 # Show information about current .NET SDK that is being used.
-- 
2.45.2




[gentoo-dev] [PATCH 3/5] dev-lang/zig: add 0.13.0-r1

2024-10-23 Thread Eric Joldasov
From: Eric Joldasov 

* Update to use llvm-r1 eclass instead of llvm, zig-build and
  zig-toolchain functions instead of local get_zig_mcpu etc. functions.
* Port "llvm USE-flag" and "removing memory limit flags" from 
  ebuild.
* 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-build.eclass with common options.
* Before migrating to the zig-build.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-toolchain 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-toolchain.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 
---
 .../zig-0.13.0-skip-test-stack_iterator.patch |  32 +++
 dev-lang/zig/zig-0.13.0-r1.ebuild | 242 ++
 2 files changed, 274 insertions(+)
 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

diff --git a/dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch 
b/dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch
new file mode 100644
index ..e088af2102ed
--- /dev/null
+++ b/dev-lang/zig/files/zig-0.13.0-skip-test-stack_iterator.patch
@@ -0,0 +1,32 @@
+From: Eric Joldasov 
+
+Skip standalone test "stack_iterator" that fail on Gentoo Linux x86_64.
+Fails in ReleaseSafe, ReleaseFast and ReleaseSmall, but not in Debug.
+Reported to upstream here https://github.com/ziglang/zig/issues/19944 .
+
+Signed-off-by: Eric Joldasov 
+
+diff --git a/test/standalone/stack_iterator/shared_lib_unwind.zig 
b/test/standalone/stack_iterator/shared_lib_unwind.zig
+index 57513a49c6..75fddb04c9 100644
+--- a/test/standalone/stack_iterator/shared_lib_unwind.zig
 b/test/standalone/stack_iterator/shared_lib_unwind.zig
+@@ -35,6 +35,7 @@ extern fn frame0(
+ ) void;
+
+ pub fn main() !void {
++if (true) return;
+ // Disabled until the DWARF unwinder bugs on .aarch64 are solved
+ if (builtin.omit_frame_pointer and comptime builtin.target.isDarwin() and 
builtin.cpu.arch == .aarch64) return;
+
+diff --git a/test/standalone/stack_iterator/unwind.zig 
b/test/standalone/stack_iterator/unwind.zig
+index 69c463a0c1..40963af63d 100644
+--- a/test/standalone/stack_iterator/unwind.zig
 b/test/standalone/stack_iterator/unwind.zig
+@@ -87,6 +87,7 @@ noinline fn frame0(expected: *[4]usize, unwound: *[4]usize) 
void {
+ }
+
+ pub fn main() !void {
++if (true) return;
+ // Disabled until the DWARF unwinder bugs on .aarch64 are solved
+ if (builtin.omit_frame_pointer and comptime builtin.target.isDarwin() and 
builtin.cpu.arch == .aarch64) return;
+
diff --git a/dev-lang/zig/zig-0.13.0-r1.ebuild 
b/dev-lang/zig/zig-0.13.0-r1.ebuild
new file mode 100644
index ..dee2be065321
--- /dev/null
+++ b/dev-lang/zig/zig-0.13.0-r1.ebuild
@@ -0,0 +1,242 @@
+# Copyright 2019-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=(18)
+LLVM_OPTIONAL=1
+
+ZIG_SLOT="$(ver_cut 1-2)"
+ZIG_OPTIONAL=1
+
+inherit check-reqs cmake flag-o-matic edo llvm-r1 toolchain-funcs zig-build
+
+DESCRIPTION="A robust, optimal, and maintainable programming language"
+HOMEPAGE="https://ziglang.org/ https://github.com/ziglang/zig/";
+if [[ ${PV} ==  ]]; then
+   EGIT_REPO_URI="https://github.com/ziglang/zig.git";
+   inherit git-r3
+else
+   VERIFY_SIG_METHOD=minisig
+   
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/minisig-keys/zig-software-foundation.pub
+   inherit verify-sig
+
+   SRC_URI="
+   https://ziglang.org/download/${PV}/${P}.tar.xz
+   verify-sig? ( 
https://ziglang.org/download/${PV}/${P}.tar.xz.minisig )
+   "
+   KEYWORDS="~amd64 ~arm ~arm64"
+
+   BDEPEND="verify-sig? ( sec-keys/minisig-keys-zig-software-foundation )"
+fi
+
+# project itself: MIT
+# There are bunch of projects under "lib/" folder that are needed for 
cross-compilation.
+# Files that are unnecessary for cross-compilation are removed by upstream
+# and therefore their licenses (if any special) are not included.
+# lib/libunwind: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
+# lib/libcxxabi: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
+# lib/libcxx: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
+# lib/libc/wasi: || ( Apache-2.0-with

[gentoo-dev] [PATCH 4/5] dev-lang/zig: sync 9999 with 0.13.0-r1

2024-10-23 Thread Eric Joldasov
From: Eric Joldasov 

* Update to use zig-build and zig-toolchain functions instead of
  local get_zig_mcpu etc. functions.
* Port "sys-apps/sandbox-2.39" test dependency requirement from
  0.13.0 ebuild.
* 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-build.eclass with common options.
* Before migrating to the zig-build.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-toolchain 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-toolchain.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 
---
 dev-lang/zig/zig-.ebuild | 239 ++-
 1 file changed, 121 insertions(+), 118 deletions(-)

diff --git a/dev-lang/zig/zig-.ebuild b/dev-lang/zig/zig-.ebuild
index 335ac0eab28c..380bb83a3dac 100644
--- a/dev-lang/zig/zig-.ebuild
+++ b/dev-lang/zig/zig-.ebuild
@@ -1,234 +1,237 @@
 # Copyright 2019-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-LLVM_COMPAT=( 19 )
+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-build
 
 DESCRIPTION="A robust, optimal, and maintainable programming language"
-HOMEPAGE="https://ziglang.org/";
+HOMEPAGE="https://ziglang.org/ https://github.com/ziglang/zig/";
 if [[ ${PV} ==  ]]; then
EGIT_REPO_URI="https://github.com/ziglang/zig.git";
inherit git-r3
 else
VERIFY_SIG_METHOD=minisig

VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/minisig-keys/zig-software-foundation.pub
inherit verify-sig
 
SRC_URI="
https://ziglang.org/download/${PV}/${P}.tar.xz
verify-sig? ( 
https://ziglang.org/download/${PV}/${P}.tar.xz.minisig )
"
KEYWORDS="~amd64 ~arm ~arm64"
 
BDEPEND="verify-sig? ( sec-keys/minisig-keys-zig-software-foundation )"
 fi
 
 # project itself: MIT
 # There are bunch of projects under "lib/" folder that are needed for 
cross-compilation.
 # Files that are unnecessary for cross-compilation are removed by upstream
 # and therefore their licenses (if any special) are not included.
 # lib/libunwind: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
 # lib/libcxxabi: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
 # lib/libcxx: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
 # lib/libc/wasi: || ( Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) 
public-domain
 # lib/libc/musl: MIT BSD-2
 # lib/libc/mingw: ZPL public-domain BSD-2 ISC HPND
 # lib/libc/glibc: BSD HPND ISC inner-net LGPL-2.1+
 LICENSE="MIT Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT ) || ( 
Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) public-domain BSD-2 ZPL 
ISC HPND BSD inner-net LGPL-2.1+"
-SLOT="$(ver_cut 1-2)"
-IUSE="doc +llvm"
+SLOT="${ZIG_SLOT}"
+IUSE="doc +llvm test"
+RESTRICT="!test? ( test )"
 REQUIRED_USE="
!llvm? ( !doc )
llvm? ( ${LLVM_REQUIRED_USE} )
 "
 
-BUILD_DIR="${S}/build"
+# Used by both cmake and zig-build eclass.
+BUILD_DIR="${WORKDIR}/${P}_build"
 
 # Zig requires zstd and zlib compression support in LLVM, if using LLVM 
backend.
 # (non-LLVM backends don't require these)
 # They are not required "on their own", so please don't add them here.
 # You can check https://github.com/ziglang/zig-bootstrap in future, to see
 # options that are passed to LLVM CMake building (excluding "static" ofc).
 DEPEND="
llvm? (
$(llvm_gen_dep '
sys-devel/clang:${LLVM_SLOT}
sys-devel/lld:${LLVM_SLOT}
sys-devel/llvm:${LLVM_SLOT}[zstd]
')
)
 "
-
-RDEPEND="
+BDEPEND+="
+   test? ( !!https://github.com/ziglang/zig/issues/3382
-# For now, Zig Build System doesn't support enviromental CFLAGS/LDFLAGS/etc.
-QA_FLAGS_IGNORED="usr/.*/zig/${PV}/bin/zig"
+DOCS=("README.md" "doc/build.zig.zon.md")
 
-RESTRICT="!llvm? ( test )"
+# zig-build does not set this for us since we use ZIG_OPTIONAL=1
+QA_FLAGS_IGNORED="usr/.*/zig/${PV}/bin/zig"
 
 # Since commit 
https://github.com/ziglang/zig/commit/e7d28344fa3ee81d6ad7ca5ce1f83d50d8502118
 # Zig uses self-hosted compiler only

[gentoo-dev] [PATCH 2/5] zig-build.eclass: new eclass

2024-10-23 Thread Eric Joldasov
Signed-off-by: Eric Joldasov 
---
 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 ..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 
+# @AUTHOR:
+# Alfred Wingate 
+# Violet Purcell 
+# Eric Joldasov 
+# @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 tailored for projects that:
+# 1) Install something in build.zig steps: "artifacts" (executable,
+# libraries, objects), source codes, assets, tests, scripts etc. But many 
authors
+# also use it to write Zig "modules", build logic and/or bindings/wrappers
+# for C/C++ libraries. They install nothing and are only used at build-time,
+# so it's unneccessary and mostly useless to make ebuilds for them.
+# 2) Have required `target`, `cpu` and optional `optimize` options
+# in build.zig that accept standard Zig-style target and optimize mode.
+# They are usually created by `standardTargetOptions` and 
`standardOptimizeOption`.
+#
+# For end-user executables, usually it's recommended to fix calling these 
options by patch
+# and upstream it, but in some cases they have good reasons
+# to not have this option, f.e. if it is built only for WASM
+# platform with ReleaseSmall, and is not intended to run in your /usr/bin/.
+# In this case, declare dummy options using `standardTargetOptions` and
+# ignore their values, or else eclass wouldn't work.
+#
+# Another case is when upstream has `target` option but it is customized
+# and does not accept usual targets, but something specific to the project
+# like "linux-baseline-lts" or combine CPU and target in one option.
+# In this case, it's best to rename that option to something like 
`target-custom`,
+# then declare `target` option and make converter from one value to other.
+#
+# For non-executable binaries like C shared/static libraries, objects etc.
+# our policy is stricter, all 3 options are required and should not
+# be ignored, with no exceptions.
+
+case ${EAPI} in
+   8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ ! ${_ZIG_BUILD_ECLASS} ]]; then
+_ZIG_BUILD_ECLASS=1
+
+inherit multiprocessing zig-toolchain
+
+# @ECLASS_VARIABLE: ZIG_OPTIONAL
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set to a non-empty value, all logic in zig-toolchain and zig-build
+# eclasses will be considered optional. No dependencies will be added and
+# no phase functions will be exported.
+#
+# For zig-build.eclass users:
+# You need to add Zig and pkgconfig dependency in your BDEPEND, set 
QA_FLAGS_IGNORED
+# and call all phase functions manually, or, if you want to call "ezig" 
directly,
+# at least call "zig-build_pkg_setup" before it.
+#
+# For zig-toolchain.eclass users: see documentation in zig-toolchain.eclass 
instead.
+if [[ ! ${ZIG_OPTIONAL} ]]; then
+   BDEPEND+="virtual/pkgconfig"
+
+   # See https://github.com/ziglang/zig/issues/3382
+   # Zig Build System does not support CFLAGS/LDFLAGS/etc.
+   QA_FLAGS_IGNORED=".*"
+fi
+
+# @ECLASS_VARIABLE: ZBS_DEPENDENCIES
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Bash associative array with all tarballs that will be fetched by
+# "ezig fetch" in zig-build_src_unpack phase. Value is URL where
+# tarball is located, key is name under which it would be downloaded
+# and renamed. So generally it has effect of "value -> key".
+#
+# Note: if Zig Build System dependency can't be represented in SRC_URI
+# (like direct Git commit URIs), you should do the following (zig-ebuilder
+# does archiving automatically for you):
+#   1. Archive each folder with dependency content in some tarball,
+#  so f.e. if you have 2 Git dependencies, create 2 tarballs.
+#   2. Archive all previous tarballs into one combined tarball (also
+#  called tarball-tarball from now on), no subdirs, so that eclass
+#  can firstly unpack this tarball with "unpack",
+#  and secondly unpack its content with "zig fetch".
+#   3. (zig-ebuilder can't do this) Host this tarball somewhere
+#  and put URL of this tarball in SRC_URI, and archives in 
ZBS_DEPENDENCIES,
+#  keys must be names of archives, leave values empty.
+#
+# Example:
+# @CODE
+# declare -r -A ZBS_DEPENDENCIES=(
+#  [tarball_a-.tar.gz]='URL_A'
+#  [tarball_b-.tar.gz]='URL_B'
+#
+#  # If there are Git dependencies:
+#  [git_c-.tar.gz]=''
+#  # Tarball-tarball should contain inside above tarball flatly.

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

2024-10-23 Thread Eric Joldasov
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: to compile, but at runtime it works
with any version supported by eclass (currently 0.13 and ).

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  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-.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




[gentoo-dev] [PATCH 1/5] zig-toolchain.eclass: new eclass

2024-10-23 Thread Eric Joldasov
Signed-off-by: Eric Joldasov 
---
 eclass/zig-toolchain.eclass | 325 
 1 file changed, 325 insertions(+)
 create mode 100644 eclass/zig-toolchain.eclass

diff --git a/eclass/zig-toolchain.eclass b/eclass/zig-toolchain.eclass
new file mode 100644
index ..8504dc0553e1
--- /dev/null
+++ b/eclass/zig-toolchain.eclass
@@ -0,0 +1,325 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: zig-toolchain.eclass
+# @MAINTAINER:
+# Eric Joldasov 
+# @AUTHOR:
+# Eric Joldasov 
+# @SUPPORTED_EAPIS: 8
+# @BLURB: Prepare Zig toolchain and set environment variables.
+# @DESCRIPTION:
+# Prepare Zig toolchain and set environment variables. Supports Zig 0.13+.
+# Does not set any default function, ebuilds must call them manually.
+# Generally, only "zig-toolchain_populate_env_vars" is needed.
+#
+# Intended to be used by ebuilds that call "zig build-exe/lib/obj"
+# or "zig test" directly and by "dev-lang/zig".
+# For ebuilds with ZBS (Zig Build System), it's usually better
+# to inherit zig-build instead, as it has default phases-functions.
+
+case ${EAPI} in
+   8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ ! ${_ZIG_TOOLCHAIN_ECLASS} ]]; then
+_ZIG_TOOLCHAIN_ECLASS=1
+
+inherit edo flag-o-matic
+
+# @ECLASS_VARIABLE: ZIG_SLOT
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# Zig slot that will be used in "ezig" function. Also, if ZIG_OPTIONAL is
+# empty, adds dev-lang/zig and dev-lang/zig-bin dependency to BDEPEND.
+# Must be >= "0.13".
+#
+# Example:
+# @CODE
+# 0.13
+# @CODE
+
+# @ECLASS_VARIABLE: ZIG_OPTIONAL
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set to a non-empty value, all logic in zig-toolchain and zig-build
+# eclasses will be considered optional. No dependencies will be added and
+# no phase functions will be exported.
+#
+# For zig-toolchain.eclass users:
+# You have to add Zig dependency in your BDEPEND manually and call
+# at least "zig-toolchain_populate_env_vars" before using "ezig".
+#
+# For zig-build.eclass users: see documentation in zig-build.eclass instead.
+if [[ ! ${ZIG_OPTIONAL} ]]; then
+   BDEPEND+=" || (
+   dev-lang/zig:${ZIG_SLOT}
+   dev-lang/zig-bin:${ZIG_SLOT}
+   )"
+fi
+
+# @ECLASS_VARIABLE: ZIG_TARGET
+# @DESCRIPTION:
+# Zig target triple to use. Has the following format:
+# arch-os[.os_version_range]-abi[.abi_version]
+# Can be passed as:
+# * "-target " option in "zig test" or "zig build-exe/lib/obj",
+# * "-Dtarget=" option in "zig build" (if project uses 
"std.Build.standardTargetOptions").
+#
+# Can be overriden by user. If not overriden, then set by 
"zig-toolchain_populate_env_vars".
+#
+# Example:
+# @CODE
+# native # autodetected by Zig
+# x86_64-linux-gnu # Machine running Linux x86_64 system, with glibc
+# x86_64-linux.6.1.12...6.6.16-gnu.2.38 # Similar to above, but versions are 
passed explicitly
+# powerpc64le-linux-musl # Machine running Linux 64-bit little-endian PowerPC 
system, with musl
+# @CODE
+#
+
+# @ECLASS_VARIABLE: ZIG_CPU
+# @DESCRIPTION:
+# Zig target CPU and features to use. Has the following format:
+# family_name(\+enable_feature|\-disable_feature)*
+# Can be passed as:
+# * "-mcpu " option in "zig test" or "zig build-exe/lib/obj",
+# * "-Dcpu=" option in "zig build" (if project uses 
"std.Build.standardTargetOptions").
+#
+# Can be overriden by user. If not overriden, then set by 
"zig-toolchain_populate_env_vars".
+#
+# Example:
+# @CODE
+# native # autodetected by Zig
+# znver2 # AMD Zen 2 processor
+# x86_64+x87-sse2" # x86_64 processor, X87 support enabled, SSE2 support 
disabled
+# @CODE
+
+# @ECLASS_VARIABLE: ZIG_EXE
+# @DESCRIPTION:
+# Absolute path to the used Zig executable.
+#
+# Please note that when passing one flag several times with different values:
+# * to "zig build" in "-Dbar=false -Dbar" form: errors due to conflict of 
flags,
+# * to "zig build" in "-Dbar=false -Dbar=true" form: "bar" becomes a list, 
which is likely not what you (or upstream) want,
+# * to "zig test" or "zig build-exe/lib/obj" in "-fbar -fno-bar" form: latest 
value overwrites values before.
+# Similar situation with other types of options (enums, "std.SemanticVersion", 
integers, strings, etc.)
+#
+# Can be overriden by user. If not overriden, then set by 
"zig-toolchain_populate_env_vars".
+
+# @ECLASS_VARIABLE: ZIG_VER
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# Zig version found during "zig-toolchain_find_installation", as reported by 
"zig version".
+#
+# Example:
+# @CODE
+# 0.13.0
+# @CODE
+
+# @FUNCTION: zig-toolchain_get_target
+# @USAGE: 
+# @DESCRIPTION:
+# Translates C-style target triple (like CHOST or CBUILD)
+# to Zig-style target triple. Some information (like ARM features)
+# is handled by "zig-toolchain_get_cpu". Mostly used during cross-compiling
+# if user does not set ZIG_TARGET variable.
+#
+# See ZIG_TARGET description for more information.
+zig-toolchain_

[gentoo-dev] [PATCH 5/5] sys-fs/ncdu: add 2.6-r1

2024-10-23 Thread Eric Joldasov
Now uses "zig-build" eclass.

Signed-off-by: Eric Joldasov 
---
 sys-fs/ncdu/ncdu-2.6-r1.ebuild | 50 ++
 1 file changed, 50 insertions(+)
 create mode 100644 sys-fs/ncdu/ncdu-2.6-r1.ebuild

diff --git a/sys-fs/ncdu/ncdu-2.6-r1.ebuild b/sys-fs/ncdu/ncdu-2.6-r1.ebuild
new file mode 100644
index ..6fb3c76328cc
--- /dev/null
+++ b/sys-fs/ncdu/ncdu-2.6-r1.ebuild
@@ -0,0 +1,50 @@
+# 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
+# Upstream states 0.12.x and 0.13.x support,
+# but eclass supports only one slot.
+ZIG_SLOT="0.13"
+inherit verify-sig zig-build
+
+DESCRIPTION="NCurses Disk Usage"
+HOMEPAGE="https://dev.yorhel.nl/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" "ChangeLog")
+
+src_unpack() {
+   verify-sig_src_unpack
+}
+
+src_configure() {
+   local my_zbs_args=(
+   -Dpie=true
+   # Upstream recommends this default:
+   --release=fast
+   )
+
+   zig-build_src_configure
+}
+
+src_install() {
+   zig-build_src_install
+
+   doman ncdu.1
+}
-- 
2.47.0