mesa: Add experimental 25.3.3; #8152

* We'll probably split this apart better
* Don't remove the ?all yet
This commit is contained in:
Alexander von Gluck
2026-01-02 13:16:59 -06:00
parent 6a9dfb1288
commit 0c11b74884
2 changed files with 237 additions and 0 deletions

View File

@@ -0,0 +1,186 @@
SUMMARY="Multi-platform GL implementation"
DESCRIPTION="Mesa is an open-source implementation of the OpenGL \
specification, which documents a system for rendering interactive \
3D graphics. Mesa fills the role of the Haiku OpenGL kit, \
providing 3D rendering to Haiku applications."
HOMEPAGE="https://www.mesa3d.org/"
COPYRIGHT="1999-2023 Brian Paul"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz"
CHECKSUM_SHA256="05328b3891c000e6a110a3e7321d8bfbb21631d132bf86bd3d4a8f45c535ef6b"
PATCHES="mesa-$portVersion.patchset"
ADDITIONAL_FILES="50_mesa.json"
ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"
libVersion=1.0.0
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
# Mesa is tightly coupled to llvm versions
llvmMajor=21
PROVIDES="
mesa$secondaryArchSuffix = $portVersion
lib:libglapi$secondaryArchSuffix = 0.0.0
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libLLVM$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
"
PROVIDES_devel="
mesa${secondaryArchSuffix}_devel = $portVersion
devel:libglapi$secondaryArchSuffix = 0.0.0
"
REQUIRES_devel="
mesa$secondaryArchSuffix == $portVersion base
devel:libGL$secondaryArchSuffix
"
SUMMARY_eglvnd="The Mesa glvnd rendering drivers for Haiku"
DESCRIPTION_eglvnd="This glvnd rendering driver package provides \
software pipe rendering (with LLVM-bosted performance)."
PROVIDES_eglvnd="
mesa${secondaryArchSuffix}_eglvnd = $portVersion
"
REQUIRES_eglvnd="
mesa$secondaryArchSuffix == $portVersion base
lib:libLLVM$secondaryArchSuffix
"
SUMMARY_lavapipe="Vulkan software rasteriser driver"
DESCRIPTION_lavapipe="Lavapipe is Mesa's software-based Vulkan 1.2 \
implementation akin to LLVMpipe for OpenGL."
PROVIDES_lavapipe="
mesa${secondaryArchSuffix}_lavapipe = $portVersion
"
REQUIRES_lavapipe="
lib:libLLVM$secondaryArchSuffix >= $llvmMajor
"
# We require libglvnd_devel for now for clairity since there is no
# libglvnd.so and mesa 22.x provides our devel:libGL
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
libglvnd${secondaryArchSuffix}_devel
devel:libz$secondaryArchSuffix
devel:libLLVM$secondaryArchSuffix >= $llvmMajor
devel:libexpat$secondaryArchSuffix
devel:libvulkan$secondaryArchSuffix
"
BUILD_PREREQUIRES="
python3.10$secondaryArchSuffix
mako_python310
pyyaml_python310
cmd:ninja
cmd:bison
cmd:find
cmd:flex
cmd:glslangValidator
cmd:meson
cmd:git
cmd:llvm_config >= $llvmMajor
cmd:egrep
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
cmd:which
"
defineDebugInfoPackage mesa$secondaryArchSuffix \
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_eglvnd}/opengl/egl_vendor.d/libEGL_mesa.so.0" \
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_lavapipe}/vulkan/icd.d/libvulkan_lvp.so" \
BUILD()
{
if [ -n "$secondaryArchSuffix" ]; then
export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture"
fi
mkdir -p build
# In the future, all we need to do is enable other gallium
# drivers so libEGL_mesa contains other drivers in addition
# to llvm swpipe.
meson build \
-Degl=enabled -Dglvnd=enabled -Dglx=disabled -Dplatforms=haiku \
-Dgallium-rusticl=false \
-Dgallium-drivers=llvmpipe \
-Dvulkan-drivers=swrast \
-Dvulkan-icd-dir=$addOnsDir/vulkan/icd.d \
--buildtype=debugoptimized \
--prefix=$prefix \
--libdir=$libDir \
--includedir=$includeDir/os/opengl
ninja -C build $jobArgs
}
INSTALL()
{
ninja -C build install
# Do a little cleanup
rm -rf $prefix/share
# Mesa's EGL render driver
mkdir -p $addOnsDir/opengl/egl_vendor.d
mv $libDir/libEGL_mesa.so* "$addOnsDir/opengl/egl_vendor.d/"
# Vulkan lavapipe driver
mv $libDir/libvulkan_lvp.so \
"$addOnsDir/vulkan/icd.d"
# remove stock glvnd json
rm -rf $dataDir/glvnd
# remove dri stuff
rm -rf $dataDir/drirc.d
rm -rf $libDir/haiku
# Configure Mesa EGL Vendor Renderer
cp "$portDir/additional-files/50_mesa.json" "$addOnsDir/opengl/egl_vendor.d/"
# Configure vulkan lavapipe render (Fix path)
sed -i "s/\/packages\/mesa-.*\/.self\/lib\/libvulkan_lvp.so/.\/libvulkan_lvp.so/" $addOnsDir/vulkan/icd.d/lvp_icd.x86_64.json
# Set some nice version info
appVersion=${portVersion//\./ }
setversion "$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0" -app $appVersion -long \
"Mesa EGL rendering drivers"
setversion "$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" -app $appVersion -long \
"Vulkan software rasteriser driver"
fixPkgconfig
# devel package
packageEntries devel \
$developDir
# swpipe renderer package
packageEntries eglvnd \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0" \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0" \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so" \
"$addOnsDir/opengl/egl_vendor.d/50_mesa.json"
# lavapipe renderer package
packageEntries lavapipe \
"$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" \
"$addOnsDir/vulkan/icd.d/lvp_icd.x86_64.json"
# Remove empty directories from mesa package
rmdir "$addOnsDir/vulkan/icd.d"
rmdir "$addOnsDir/vulkan"
rmdir "$addOnsDir/opengl/egl_vendor.d"
rmdir "$addOnsDir/opengl"
}
TEST()
{
make check
}

View File

@@ -0,0 +1,51 @@
From 290fa2558e94d29f8345f66873f05e5692a76ff1 Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Fri, 2 Jan 2026 09:42:13 -0600
Subject: [PATCH 1/2] renderdoc: Add Haiku platform support
---
include/renderdoc_app.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/renderdoc_app.h b/include/renderdoc_app.h
index b2d10c5e2d2..debd0c72fdd 100644
--- a/include/renderdoc_app.h
+++ b/include/renderdoc_app.h
@@ -35,7 +35,7 @@
#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
#define RENDERDOC_CC __cdecl
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__HAIKU__)
#define RENDERDOC_CC
#elif defined(__APPLE__)
#define RENDERDOC_CC
--
2.52.0
From 69eacf9476d51b31d6933e04bb5e27ef3d261164 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck <alex@terarocket.io>
Date: Fri, 2 Jan 2026 10:35:17 -0600
Subject: [PATCH 2/2] egl/haiku/meson: Include shared libglapi code for
dispatch functions
---
src/egl/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/egl/meson.build b/src/egl/meson.build
index b9baa09122c..f9b0e348ad4 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -147,7 +147,7 @@ elif with_platform_haiku
incs_for_egl += [inc_mesa]
incs_for_egl += [include_directories('../gallium/frontends/hgl')]
- link_for_egl += [libmesa, libgallium, libswhgl, libsthgl]
+ link_for_egl += [libmesa, libgallium, libswhgl, libsthgl, libglapi]
deps_for_egl += [cpp.find_library('be'), driver_swrast]
elif with_platform_windows
c_args_for_egl += [
--
2.52.0