Merge branch 'mesa-fixes' into 'master'

Port glvnd and fix mesa-demos, fix webkit and libldns compilation

See merge request redox-os/redox!2350
This commit is contained in:
Jeremy Soller 2026-09-13 20:04:21 -06:00
commit 4bcf49aa83
9 changed files with 64 additions and 55 deletions

View File

@ -7,54 +7,19 @@ patches = ["redox.patch"]
template = "custom"
dependencies = [
"bzip2",
"cairo",
"curl",
"expat",
#TODO: "ffmpeg6",
"fontconfig",
"freetype2",
"fribidi",
"gdk-pixbuf",
"gettext",
"glib",
"harfbuzz",
"libass",
"libffi",
"libgmp",
"libiconv",
"libicu",
"libjpeg",
"libmodplug1",
"libnettle",
"libogg",
"libpng",
"libpsl",
"libpthread-stubs",
"libsndfile",
"libsoup",
"libvorbis",
"libwebp",
"libx11",
"libxau",
"libxcb",
#TODO: "libxdamage",
"libxext",
"libxfixes",
"libxi",
"libxml2",
"libxxf86vm",
"mesa-x11",
"nghttp2",
"mesa",
#TODO: "openal",
"openssl3",
"pango",
"pcre2",
"pixman",
"sqlite3",
"x11proto",
"xextproto",
"xz",
"zlib",
]
script = """
DYNAMIC_INIT

View File

@ -11,6 +11,7 @@ dependencies = [
"liborbital",
"llvm21",
"zlib",
"libglvnd",
]
dev-dependencies = [
"llvm21.dev",
@ -36,6 +37,7 @@ cookbook_meson \
-Dglx=disabled \
-Dllvm=enabled \
-Dosmesa=true \
-Dglvnd=true \
-Dshader-cache=disabled \
-Dgallium-drivers=swrast
@ -44,3 +46,8 @@ LLVMLIBS="-lLLVMBitReader -lLLVMCore -lLLVMExecutionEngine -lLLVMInstCombine -lL
LLVMLIBS+=" -lLLVMMCJIT -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMCoroutines -lLLVMLTO"
sed -i "s/ -lOSMesa / -lOSMesa ${LLVMLIBS} -lstdc++ /" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc"
"""
[package]
dependencies = [
"libglvnd"
]

View File

@ -1,6 +1,9 @@
#TODO wayland only
[source]
tar = "https://archive.mesa3d.org/demos/mesa-demos-9.0.0.tar.xz"
patches = [
"redox.patch"
]
[build]
template = "meson"
dependencies = [

View File

@ -1,4 +1,4 @@
diff --color -ruwN source/meson.build source-new/meson.build
diff -ruwN source/meson.build source-new/meson.build
--- source/meson.build 2023-03-22 19:13:43.000000000 +0700
+++ source-new/meson.build 2026-06-12 05:37:17.049652059 +0700
@@ -39,7 +39,7 @@
@ -6,7 +6,7 @@ diff --color -ruwN source/meson.build source-new/meson.build
dep_winmm = cc.find_library('winmm', required : false)
-dep_gl = dependency('gl')
+dep_gl = dependency('gl', required: false)
+dep_gl = dependency('opengl')
dep_epoll = dependency('epoll-shim', required : false)
dep_gles1 = dependency('glesv1_cm', required : get_option('gles1'))
@ -19,7 +19,7 @@ diff --color -ruwN source/meson.build source-new/meson.build
# xquartz doesn't have a glx.pc, but it does have the header. And all the
# symbols reside in libGL, so let's just use that.
if cc.check_header('GL/glx.h', dependencies: dep_x11)
diff --color -ruwN source/src/egl/eglut/eglut_wayland.c source-new/src/egl/eglut/eglut_wayland.c
diff -ruwN source/src/egl/eglut/eglut_wayland.c source-new/src/egl/eglut/eglut_wayland.c
--- source/src/egl/eglut/eglut_wayland.c 2023-03-22 19:13:43.000000000 +0700
+++ source-new/src/egl/eglut/eglut_wayland.c 2026-06-12 06:13:45.751910615 +0700
@@ -7,7 +7,7 @@
@ -72,7 +72,7 @@ diff --color -ruwN source/src/egl/eglut/eglut_wayland.c source-new/src/egl/eglut
} else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD)) {
wl_keyboard_destroy(d->seat.keyboard);
d->seat.keyboard = NULL;
diff --color -ruwN source/src/egl/opengles2/es2gears.c source-new/src/egl/opengles2/es2gears.c
diff -ruwN source/src/egl/opengles2/es2gears.c source-new/src/egl/opengles2/es2gears.c
--- source/src/egl/opengles2/es2gears.c 2023-03-22 19:13:43.000000000 +0700
+++ source-new/src/egl/opengles2/es2gears.c 2026-06-12 06:16:40.759435351 +0700
@@ -155,6 +155,13 @@
@ -89,7 +89,7 @@ diff --color -ruwN source/src/egl/opengles2/es2gears.c source-new/src/egl/opengl
for (i = 0; i < teeth; i++) {
/* Calculate needed sin/cos for varius angles */
sincos(i * 2.0 * M_PI / teeth, &s[0], &c[0]);
diff --color -ruwN source/src/vulkan/wsi/wayland.c source-new/src/vulkan/wsi/wayland.c
diff -ruwN source/src/vulkan/wsi/wayland.c source-new/src/vulkan/wsi/wayland.c
--- source/src/vulkan/wsi/wayland.c 2023-03-22 19:13:43.000000000 +0700
+++ source-new/src/vulkan/wsi/wayland.c 2026-06-12 06:14:03.701669367 +0700
@@ -35,7 +35,7 @@

View File

@ -8,7 +8,14 @@ cp drill/install-sh .
"""
[build]
template = "configure"
template = "custom"
dependencies = [
"openssl3"
]
script = """
DYNAMIC_INIT
COOKBOOK_CONFIGURE_FLAGS+=(
--with-ssl="$COOKBOOK_SYSROOT"
)
cookbook_configure
"""

View File

@ -1,7 +1,10 @@
#TODO wayland only
[source]
tar = "https://github.com/freeglut/freeglut/releases/download/v3.4.0/freeglut-3.4.0.tar.gz"
blake3 = "e11ef6f8710c995ca200c0213a5fee2c8710d5cfd1284ec442c9c734dd3f98fb"
tar = "https://github.com/freeglut/freeglut/releases/download/v3.8.0/freeglut-3.8.0.tar.gz"
blake3 = "f0f61839c91b633c958afb2bf015f8067cd9fe650fce92cc68ed1a93aad74352"
patches = [
"redox.patch"
]
[build]
dependencies = [
"mesa",
@ -11,9 +14,10 @@ dependencies = [
]
template = "cmake"
cmakeflags = [
"-DFREEGLUT_WAYLAND=1",
"-DFREEGLUT_GLES=1",
"-DFREEGLUT_BUILD_DEMOS=1"
"-DFREEGLUT_WAYLAND=ON",
"-DFREEGLUT_X11=OFF",
"-DFREEGLUT_GLES=OFF",
"-DFREEGLUT_BUILD_DEMOS=OFF",
]
[package]

View File

@ -0,0 +1,13 @@
diff -ruwN source/CMakeLists.txt source-new/CMakeLists.txt
--- source/CMakeLists.txt 2025-11-16 18:58:36.000000000 +0000
+++ source-new/CMakeLists.txt 2026-09-13 16:56:44.965356983 +0000
@@ -408,7 +408,8 @@
if(NOT CMAKE_VERSION VERSION_LESS "3.10")
FIND_PACKAGE(OpenGL REQUIRED COMPONENTS OpenGL)
- LIST(APPEND LIBS OpenGL::GL)
+ # Renamed to OpenGL::OpenGL to match with GLVND
+ LIST(APPEND LIBS OpenGL::OpenGL)
else()
FIND_PACKAGE(OpenGL REQUIRED)
LIST(APPEND LIBS ${OPENGL_gl_LIBRARY})

View File

@ -3,12 +3,9 @@
git = "https://github.com/NVIDIA/libglvnd.git"
[build]
dependencies = [
"libpthread-stubs",
"libx11",
"libxau",
"libxcb",
"libxext",
"x11proto",
]
template = "meson"
mesonflags = [
"-Dglx=disabled",
"-Dx11=disabled",
"-Dhgl=false",
]

View File

@ -142,6 +142,19 @@ diff -ruwN source/Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_mallo
free_wasted_mem += value->mem_to_waste;
free_virtual_mem += value->size_of_allocated_pages;
diff -ruwN source/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c source-new/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c
--- source/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c 2025-01-27 12:56:15.198834200 +0000
+++ source-new/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.c 2026-09-13 15:08:33.505794000 +0000
@@ -214,6 +214,9 @@
#endif
#if PAS_PLATFORM(PLAYSTATION)
getname_result = pthread_get_name_np(thread, thread_name);
+#elif PAS_OS(REDOX)
+ // no op
+ getname_result = -1;
#else
getname_result = pthread_getname_np(thread, thread_name, sizeof(thread_name));
#endif
diff -ruwN source/Source/JavaScriptCore/heap/BlockDirectory.cpp source-new/Source/JavaScriptCore/heap/BlockDirectory.cpp
--- source/Source/JavaScriptCore/heap/BlockDirectory.cpp 2025-03-21 00:07:59.015023500 +0700
+++ source-new/Source/JavaScriptCore/heap/BlockDirectory.cpp 2025-09-09 09:08:03.419985553 +0700