3bcf4cc196
Comprehensive fix — not a fallback. Each recipe now has explicit [package] section with name and version. Version inference: - Git-source recipes without rev/branch: '0.1.0' (Red Bear convention) - Tar/git recipes with version in URL or dir name: extracted version - Sysroot-copy recipes: matched to toolchain version Affected: 250+ recipes across all categories (core, libs, dev, system, kde, qt, drivers, gpu, drm, kernel, userspace, etc.) Every recipe in the redbear-mini build chain that was missing [package] now has explicit version metadata. Cookbook can now always determine a version at packaging time, eliminating 'cannot guess version' failures. No cookbook fallback hack — the source of truth is recipe metadata.
67 lines
2.7 KiB
TOML
67 lines
2.7 KiB
TOML
[package]
|
|
name = "relibc"
|
|
version = "0.1.0"
|
|
|
|
[source]
|
|
path = "../../../local/sources/relibc"
|
|
|
|
[build]
|
|
template = "custom"
|
|
script = """
|
|
# rustup workaround https://github.com/rust-lang/rustup/issues/988
|
|
if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ] && command -v rustup >/dev/null 2>&1; then
|
|
pushd ${COOKBOOK_SOURCE}
|
|
${RUSTUP:-rustup} install
|
|
popd
|
|
fi
|
|
|
|
# relibc HEAD uses VaList::next_arg() and VaList<'a> (1 lifetime) from
|
|
# Rust 1.98-dev. The PREFIX toolchain (nightly-2025-11-15) is older and
|
|
# has VaList<'a, 'f: 'a> (2 lifetimes) with no next_arg() method.
|
|
# When building via make live, REDOXER_TOOLCHAIN=PREFIX forces the older
|
|
# Rust. Override to the redoxer default toolchain (Rust 1.98-dev) which
|
|
# has the required API. Skip during PREFIX bootstrap (*.partial dirs).
|
|
REDOXER_TC="${REDOXER_TOOLCHAIN:-}"
|
|
if [ -n "${REDOXER_TC}" ] && [[ "${REDOXER_TC}" != *".partial"* ]]; then
|
|
REDOXER_DEFAULT="${HOME}/.redoxer/${TARGET}/toolchain"
|
|
if [ -d "${REDOXER_DEFAULT}/lib/rustlib/src/rust/library/core" ]; then
|
|
export RUSTUP_TOOLCHAIN="${REDOXER_DEFAULT}"
|
|
export PATH="${REDOXER_DEFAULT}/bin:${PATH}"
|
|
fi
|
|
fi
|
|
|
|
export CARGO=${CARGO:-env -u CARGO cargo}
|
|
"${COOKBOOK_MAKE}" \
|
|
-C "${COOKBOOK_SOURCE}" \
|
|
-j"${COOKBOOK_MAKE_JOBS}" \
|
|
DESTDIR="${COOKBOOK_STAGE}/usr" \
|
|
install
|
|
|
|
# Fix cbindgen generating ... instead of va_list for v*printf functions
|
|
sed -i '/^int vfprintf(/s/\\.\\.\\./va_list ap/' "${COOKBOOK_STAGE}/usr/include/stdio.h"
|
|
sed -i '/^int vsnprintf(/s/\\.\\.\\./va_list ap/' "${COOKBOOK_STAGE}/usr/include/stdio.h"
|
|
sed -i '/^int vsprintf(/s/\\.\\.\\./va_list ap/' "${COOKBOOK_STAGE}/usr/include/stdio.h"
|
|
|
|
# Mirror the freshly built libc into the prefix toolchain. `make prefix`
|
|
# does this via mk/prefix.mk, but `make r.relibc` alone does not, and
|
|
# recipes that link against the dynamic libc.so would otherwise see a
|
|
# stale libc.so (no eventfd, no __fseterr, ...) and fail with
|
|
# "undefined reference" at link time. The redoxer toolchain is what
|
|
# `make live` actually consumes for cross-recipe builds, so it must
|
|
# stay in sync too.
|
|
PREFIX_LIB_DIR="${COOKBOOK_HOST_SYSROOT%/}/${TARGET}/lib"
|
|
if [ -d "${PREFIX_LIB_DIR}" ]; then
|
|
cp -f "${COOKBOOK_STAGE}/usr/lib/libc.a" "${PREFIX_LIB_DIR}/" 2>/dev/null || true
|
|
if [ -f "${COOKBOOK_STAGE}/usr/lib/libc.so" ]; then
|
|
cp -f "${COOKBOOK_STAGE}/usr/lib/libc.so" "${PREFIX_LIB_DIR}/" 2>/dev/null || true
|
|
fi
|
|
fi
|
|
REDOXER_TC_LIB="${HOME}/.redoxer/${TARGET}/toolchain/${TARGET}/lib"
|
|
if [ -d "${REDOXER_TC_LIB}" ]; then
|
|
cp -f "${COOKBOOK_STAGE}/usr/lib/libc.a" "${REDOXER_TC_LIB}/" 2>/dev/null || true
|
|
if [ -f "${COOKBOOK_STAGE}/usr/lib/libc.so" ]; then
|
|
cp -f "${COOKBOOK_STAGE}/usr/lib/libc.so" "${REDOXER_TC_LIB}/" 2>/dev/null || true
|
|
fi
|
|
fi
|
|
"""
|