mesa: fix build on Darwin after 25.3 (#462182)

This commit is contained in:
K900
2025-11-16 10:23:11 +00:00
committed by GitHub
2 changed files with 39 additions and 1 deletions

View File

@@ -25,6 +25,11 @@ stdenv.mkDerivation {
meta
;
patches = [
# Backport of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38429
./fix-darwin-build.patch
];
outputs = [
"out"
"dev"
@@ -58,7 +63,6 @@ stdenv.mkDerivation {
"--sysconfdir=/etc"
"--datadir=${placeholder "out"}/share"
(lib.mesonEnable "glvnd" false)
(lib.mesonEnable "shared-glapi" true)
(lib.mesonEnable "llvm" true)
];

View File

@@ -0,0 +1,34 @@
diff --git a/src/glx/apple/apple_cgl.c b/src/glx/apple/apple_cgl.c
index 81b6730f8e29b3920216461858b98bcd3b7a870c..9bdfe555949482ddb6153ee926967ac5c04fe7c8 100644
--- a/src/glx/apple/apple_cgl.c
+++ b/src/glx/apple/apple_cgl.c
@@ -34,6 +34,7 @@
#include "apple_cgl.h"
#include "apple_glx.h"
+#include "util/os_misc.h"
#ifndef OPENGL_FRAMEWORK_PATH
#define OPENGL_FRAMEWORK_PATH "/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL"
diff --git a/src/loader/loader.c b/src/loader/loader.c
index d06a368c1bbff180fcc9432183db66398b75f4a3..0567beb3dee569895fbb36c7e7c3df34be8b32b7 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -139,6 +139,9 @@ iris_predicate(int fd, const char *driver)
bool
nouveau_zink_predicate(int fd, const char *driver)
{
+#ifndef HAVE_LIBDRM
+ return true;
+#else
/* Never load on nv proprietary driver */
if (!drm_fd_is_nouveau(fd))
return false;
@@ -191,6 +194,7 @@ nouveau_zink_predicate(int fd, const char *driver)
if (!use_zink && !strcmp(driver, "nouveau"))
return true;
return false;
+#endif
}