mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-05 04:06:38 +08:00
Port glvnd and fix mesa-demos
This commit is contained in:
parent
e3d31c7d84
commit
469be215ca
@ -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"
|
||||
]
|
||||
|
||||
@ -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 = [
|
||||
|
||||
@ -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 @@
|
||||
|
||||
@ -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]
|
||||
|
||||
13
recipes/wip/libs/other/freeglut/redox.patch
Normal file
13
recipes/wip/libs/other/freeglut/redox.patch
Normal 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})
|
||||
@ -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",
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user