From 0224e75766eec0e485f71bcee5b10cbb2fa425da Mon Sep 17 00:00:00 2001 From: sin-ack Date: Sun, 8 Nov 2026 23:08:06 +0000 Subject: [PATCH] zig.eclass: prefer source from WORKDIR if it exists Some dependencies are fetched from Git and can't be in SRC_URI, so we use a vendor "tarball-tarball". However, when the tarball-tarball gets extracted, the resulting deps land in WORKDIR, not DESTDIR, and zig fetch can't find them. Try to see if the dep exists in WORKDIR, and use it if present. Signed-off-by: sin-ack Part-of: https://github.com/gentoo/gentoo/pull/47039 Signed-off-by: Sam James --- eclass/zig.eclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eclass/zig.eclass b/eclass/zig.eclass index 0fe921c1f3624..9a9fd6b0c89f9 100644 --- a/eclass/zig.eclass +++ b/eclass/zig.eclass @@ -513,7 +513,11 @@ zig_src_unpack() { touch build.zig || die for zig_dep in "${zig_deps[@]}"; do # Hide now-spammy hash from stdout - ezig fetch --save-exact="${zig_dep##-*}" "${DISTDIR}/${zig_dep}" > /dev/null + if [[ -f "${WORKDIR}/${zig_dep}" ]]; then + ezig fetch --save-exact="${zig_dep##-*}" "${WORKDIR}/${zig_dep}" > /dev/null + else + ezig fetch --save-exact="${zig_dep##-*}" "${DISTDIR}/${zig_dep}" > /dev/null + fi done # For 0.17 and later: