diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h
index 630345ea7..8a2d96d7a 100644
--- a/include/libcamera/internal/egl.h
+++ b/include/libcamera/internal/egl.h
@@ -16,6 +16,12 @@
 #include <libcamera/base/span.h>
 #include <libcamera/base/utils.h>
 
+/*
+ * Workaround for build issues on Mesa <= 22.2, see
+ * https://github.com/KhronosGroup/EGL-Registry/pull/130
+ */
+#define EGL_NO_X11
+
 #define EGL_EGLEXT_PROTOTYPES
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
