From 469be215ca8d9c4d8c8a698e80ecf2864abc693f Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 13 Sep 2026 19:57:47 +0200 Subject: [PATCH] Port glvnd and fix mesa-demos --- recipes/libs/mesa/recipe.toml | 7 +++++++ recipes/wip/demos/mesa-demos/recipe.toml | 3 +++ recipes/wip/demos/mesa-demos/redox.patch | 10 +++++----- recipes/wip/libs/other/freeglut/recipe.toml | 14 +++++++++----- recipes/wip/libs/other/freeglut/redox.patch | 13 +++++++++++++ .../wip/{x11 => libs/other}/libglvnd/recipe.toml | 13 +++++-------- 6 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 recipes/wip/libs/other/freeglut/redox.patch rename recipes/wip/{x11 => libs/other}/libglvnd/recipe.toml (52%) diff --git a/recipes/libs/mesa/recipe.toml b/recipes/libs/mesa/recipe.toml index f88db5dec..bfce20151 100644 --- a/recipes/libs/mesa/recipe.toml +++ b/recipes/libs/mesa/recipe.toml @@ -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" +] diff --git a/recipes/wip/demos/mesa-demos/recipe.toml b/recipes/wip/demos/mesa-demos/recipe.toml index ae75b8660..b5c8924a1 100644 --- a/recipes/wip/demos/mesa-demos/recipe.toml +++ b/recipes/wip/demos/mesa-demos/recipe.toml @@ -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 = [ diff --git a/recipes/wip/demos/mesa-demos/redox.patch b/recipes/wip/demos/mesa-demos/redox.patch index f998f6532..f19607216 100644 --- a/recipes/wip/demos/mesa-demos/redox.patch +++ b/recipes/wip/demos/mesa-demos/redox.patch @@ -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 @@ diff --git a/recipes/wip/libs/other/freeglut/recipe.toml b/recipes/wip/libs/other/freeglut/recipe.toml index db6dff56e..b70704bbb 100644 --- a/recipes/wip/libs/other/freeglut/recipe.toml +++ b/recipes/wip/libs/other/freeglut/recipe.toml @@ -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] diff --git a/recipes/wip/libs/other/freeglut/redox.patch b/recipes/wip/libs/other/freeglut/redox.patch new file mode 100644 index 000000000..64a98778c --- /dev/null +++ b/recipes/wip/libs/other/freeglut/redox.patch @@ -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}) diff --git a/recipes/wip/x11/libglvnd/recipe.toml b/recipes/wip/libs/other/libglvnd/recipe.toml similarity index 52% rename from recipes/wip/x11/libglvnd/recipe.toml rename to recipes/wip/libs/other/libglvnd/recipe.toml index 46ca86c6e..23b68dbd9 100644 --- a/recipes/wip/x11/libglvnd/recipe.toml +++ b/recipes/wip/libs/other/libglvnd/recipe.toml @@ -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", +]