common/build-style/zig-build: adjust sysroot and search path for zig 0.14

This commit is contained in:
tranzystorekk 2025-04-25 11:34:47 +02:00
parent c14203c3b1
commit 60fed86b5f

View file

@ -1,5 +1,5 @@
do_build() { do_build() {
local zig_target zig_cpu local zig_target zig_cpu zig_search_prefix
# TODO: This duplication between build-profiles and cross-profiles # TODO: This duplication between build-profiles and cross-profiles
# is totally unnecessary. It would be nice if there was some way to # is totally unnecessary. It would be nice if there was some way to
@ -7,9 +7,11 @@ do_build() {
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then
zig_target="${XBPS_CROSS_ZIG_TARGET}" zig_target="${XBPS_CROSS_ZIG_TARGET}"
zig_cpu="${XBPS_CROSS_ZIG_CPU}" zig_cpu="${XBPS_CROSS_ZIG_CPU}"
zig_search_prefix=/
else else
zig_target="${XBPS_ZIG_TARGET}" zig_target="${XBPS_ZIG_TARGET}"
zig_cpu="${XBPS_ZIG_CPU}" zig_cpu="${XBPS_ZIG_CPU}"
zig_search_prefix=/usr
fi fi
# Inform zig of the required libc include paths. # Inform zig of the required libc include paths.
@ -30,8 +32,8 @@ do_build() {
# prefix used by the zig build system. # prefix used by the zig build system.
DESTDIR="zig-out" zig build \ DESTDIR="zig-out" zig build \
-j"${XBPS_MAKEJOBS}" \ -j"${XBPS_MAKEJOBS}" \
--sysroot "${XBPS_CROSS_BASE}" \ --sysroot "${XBPS_CROSS_BASE:-/}" \
--search-prefix "${XBPS_CROSS_BASE}/usr" \ --search-prefix "${zig_search_prefix}" \
--prefix /usr \ --prefix /usr \
--global-cache-dir /host/zig \ --global-cache-dir /host/zig \
--libc xbps_zig_libc.txt \ --libc xbps_zig_libc.txt \