File 0565-Fix-wx-build-issue-when-GL-glu.h-is-not-present.patch of Package erlang

From 327426b71c61ec8182ab657bd9f595a401804800 Mon Sep 17 00:00:00 2001
From: Tom Crossland <tomc@fortu.net>
Date: Wed, 28 Sep 2022 18:55:04 +0200
Subject: [PATCH] Fix wx build issue when GL/glu.h is not present

Currently the build of wx fails if GL/gl.h is present but GL/glu.h is
not. This may happen, for example, in macOS if the homebrew mesa package
is installed.

This change ensures that both GL/gl.h and GL/glu.h are present before
including them.
---
 lib/wx/c_src/egl_impl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/wx/c_src/egl_impl.h b/lib/wx/c_src/egl_impl.h
index 21bcf69644..8acb17de02 100644
--- a/lib/wx/c_src/egl_impl.h
+++ b/lib/wx/c_src/egl_impl.h
@@ -29,10 +29,10 @@
 #include <windows.h>  
 #include <gl/gl.h>
 #include <gl/glu.h>
-#elif defined(HAVE_GL_GL_H)
+#elif defined(HAVE_GL_GL_H) && defined(HAVE_GL_GLU_H)
 #include <GL/gl.h>
 # include <GL/glu.h>	
-#elif defined(HAVE_OPENGL_GL_H)
+#elif defined(HAVE_OPENGL_GL_H) && defined(HAVE_OPENGL_GLU_H)
 #include <OpenGL/gl.h> 
 #include <OpenGL/glu.h> 
 #endif
-- 
2.35.3

openSUSE Build Service is sponsored by