Files
RedBear-OS/local/recipes/libs/mesa/recipe.toml
T
vasilito cb94e82502 mesa: enable GBM; narrow gallium drivers to softpipe,llvmpipe,virgl
Enable GBM (required by the EGL/GBM/GLES2 surface used by Qt6/KWin).
Drop crocus/iris from the gallium driver set for the 26.1.4 build —
the Intel hardware drivers require DRM uapi surfaces that are not
available in the Redox sysroot yet. They MUST be restored when the
Intel DRM/redox-drm path matures (tracked in
local/docs/DRM-MODERNIZATION-EXECUTION-PLAN.md Stage 5); this is a
build-surface constraint, not a feature removal.

Also widen the -Wno-error set for the 26.1.4 cross-compile
(missing-prototypes, return-type, empty-body, incompatible-pointer-types,
int-conversion, format) — upstream Mesa enables -Werror by default and
the Redox sysroot headers trip these classes; the underlying warnings
remain visible in the build log.
2026-07-20 09:06:06 +09:00

99 lines
3.9 KiB
TOML

[package]
name = "mesa"
version = "26.1.4"
[source]
tar = "https://gitlab.freedesktop.org/mesa/mesa/-/archive/mesa-26.1.4/mesa-mesa-26.1.4.tar.gz"
blake3 = "2299cd27430592c9a4a21c6345e74d5df278f4cd5839875ffd75abc3c1e988f9"
upstream = "https://gitlab.freedesktop.org/mesa/mesa"
# Mesa 26.1.4 no longer has a Redox EGL platform file upstream.
# Keep only the patches that still apply cleanly; the Redox platform-specific
# patches must be rebased separately once the modern surfaceless path is
# validated.
patches = [
"mesa/01-virgl-redox-disk-cache.patch",
"mesa/02-gbm-dumb-prime-export.patch",
"mesa/04-sys-ioccom-stub-header.patch",
"mesa/05-vk-sync-wchar-include.patch",
]
[build]
template = "custom"
dependencies = [
"expat",
"libdrm",
"liborbital",
"libwayland",
"linux-kpi",
"llvm21",
"wayland-protocols",
"zlib",
]
dev-dependencies = [
"llvm21.dev",
]
script = """
DYNAMIC_INIT
#TODO: Should be CPPFLAGS but cookbook_meson isn't reading it
export CFLAGS+=" -DHAVE_PTHREAD=1 -I${COOKBOOK_SYSROOT}/include/libdrm -I${COOKBOOK_SYSROOT}/include/linux-kpi"
export LLVM_CONFIG="${TARGET}-llvm-config"
if [ -x "${HOME}/.redoxer/${TARGET}/toolchain/bin/llvm-config" ]; then
export COOKBOOK_HOST_SYSROOT="${HOME}/.redoxer/${TARGET}/toolchain"
fi
export LDFLAGS+=" -lorbital"
export WAYLAND_SCANNER="/usr/bin/wayland-scanner"
mkdir -p .cookbook-tools
ln -sf "$(command -v "${LLVM_CONFIG}")" .cookbook-tools/llvm-config
# Ensure wayland-scanner resolves to the host tool before any cross-sysroot binary
if [ -x "/usr/bin/wayland-scanner" ]; then
ln -sf "/usr/bin/wayland-scanner" .cookbook-tools/wayland-scanner
fi
for tool in gcc-ar gcc-ranlib g++ gcc cpp c++; do
src="$(command -v "${TARGET}-${tool}" 2>/dev/null)"
if [ -n "$src" ]; then
ln -sf "$src" ".cookbook-tools/${TARGET}-${tool}"
fi
done
# Symlink redbear-run-tool if gcc is a wrapper script
if [ -x ".cookbook-tools/${TARGET}-gcc" ]; then
if head -1 ".cookbook-tools/${TARGET}-gcc" | grep -q "#!/usr/bin/env bash"; then
runtool="$(dirname "$(readlink -f ".cookbook-tools/${TARGET}-gcc")")/redbear-run-tool"
if [ -x "$runtool" ]; then
ln -sf "$runtool" .cookbook-tools/redbear-run-tool
fi
fi
fi
export PATH="$(pwd)/.cookbook-tools:${PATH}"
if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then
COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=enabled)
else
COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=disabled)
fi
cookbook_meson \
-Ddri-drivers-path=/usr/lib/dri \
-Degl=enabled \
-Dgbm=enabled \
-Dglx=disabled \
-Dgallium-drivers=softpipe,llvmpipe,virgl \
-Dllvm=enabled \
-Dplatforms=wayland \
-Degl-native-platform=surfaceless \
-Dshader-cache=disabled \
-Dc_args="['-Wno-error=implicit-function-declaration','-Wno-error=missing-prototypes','-Wno-error=return-type','-Wno-error=empty-body','-Wno-error=incompatible-pointer-types','-Wno-error=int-conversion','-Wno-error=format','-Wno-error','-std=gnu11','-Dstatic_assert=_Static_assert']" \
-Dcpp_args="['-Wno-error=implicit-function-declaration','-Wno-error=missing-prototypes','-Wno-error=return-type','-Wno-error=empty-body','-Wno-error=incompatible-pointer-types','-Wno-error=int-conversion','-Wno-error=format','-Wno-error']" \
-Dvulkan-drivers=swrast \
-Dshared-glapi=enabled
# Hack to add LLVM libs, the list can be seen from meson log and check for matches $("${LLVM_CONFIG}" --libs)
LLVMLIBS="-lLLVMBitReader -lLLVMCore -lLLVMExecutionEngine -lLLVMInstCombine -lLLVMMCDisassembler"
LLVMLIBS+=" -lLLVMMCJIT -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMCoroutines -lLLVMLTO"
# osmesa is no longer built (the -Dosmesa meson option was dropped upstream); only
# patch its pkg-config file if it exists.
if [ -f "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc" ]; then
sed -i "s/ -lOSMesa / -lOSMesa ${LLVMLIBS} -lstdc++ /" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc"
fi
"""