summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-01-09 06:41:15 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-01-09 06:41:15 +0000
commitd94fef9a5708b8e64f363f4a71f0b56caef5efe4 (patch)
treeb8041134209c7d8f47560e719b584508ea78180f /eclass
parent9991465b0b90d77b2a8a2ae833b6ecd99e6b5101 (diff)
gentoo auto-resync : 09:01:2025 - 06:41:15
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin40179 -> 40181 bytes
-rw-r--r--eclass/zig-utils.eclass25
2 files changed, 23 insertions, 2 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index d29e6eaf5c48..832ba6f50bfb 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/zig-utils.eclass b/eclass/zig-utils.eclass
index ca72e89ed6ea..5502d997935e 100644
--- a/eclass/zig-utils.eclass
+++ b/eclass/zig-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 2024 Gentoo Authors
+# Copyright 2024-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: zig-utils.eclass
@@ -54,6 +54,14 @@ inherit edo flag-o-matic linux-info
# and most likely changed to more common in other eclasses ZIG_MIN/
# ZIG_MAX form.
+# @ECLASS_VARIABLE: ZIG_NEEDS_LLVM
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set to a non-empty value, the package will BDEPEND on a Zig package
+# with LLVM enabled. This is currently required for packages that require
+# C/C++ source files to be compiled with Zig.
+
# @ECLASS_VARIABLE: ZIG_OPTIONAL
# @PRE_INHERIT
# @DEFAULT_UNSET
@@ -69,9 +77,15 @@ inherit edo flag-o-matic linux-info
# For zig.eclass users: see documentation in zig.eclass
# instead.
if [[ ! ${ZIG_OPTIONAL} ]]; then
+ _ZIG_USEDEP=""
+ if [[ ${ZIG_NEEDS_LLVM} ]]; then
+ _ZIG_USEDEP="[llvm(+)]"
+ fi
+
+ # NOTE: zig-bin is always built with LLVM support, so no USE needed.
BDEPEND="
|| (
- dev-lang/zig:${ZIG_SLOT}
+ dev-lang/zig:${ZIG_SLOT}${_ZIG_USEDEP}
dev-lang/zig-bin:${ZIG_SLOT}
)
"
@@ -440,6 +454,10 @@ zig-utils_find_installation() {
local base_path="${BROOT}/usr/bin"
+ local -x ZIG_GLOBAL_CACHE_DIR="${T}/zig-detect"
+ mkdir -p "${ZIG_GLOBAL_CACHE_DIR}" || die
+ touch "${ZIG_GLOBAL_CACHE_DIR}/empty.zig" || die
+
local selected_path selected_ver
for selected_ver in "${zig_supported_versions[@]}"; do
# Check if candidate satisfies ZIG_SLOT condition.
@@ -451,6 +469,9 @@ zig-utils_find_installation() {
local candidate_path
for candidate_path in "${base_path}"/zig{,-bin}-"${selected_ver}"; do
if [[ -x "${candidate_path}" ]]; then
+ if [[ ${ZIG_NEEDS_LLVM} ]]; then
+ "${candidate_path}" test -fllvm -OReleaseSmall "${ZIG_GLOBAL_CACHE_DIR}/empty.zig" &> /dev/null || continue
+ fi
selected_path="${candidate_path}"
break 2
fi