diff --git a/freeglut.spec b/freeglut.spec index 73ad4150a8c2c5f3526a78cc3ccdfc16aebf6b98..29b64d88c8cf54d7d1cd919e6a8db8cbd0457c8d 100644 --- a/freeglut.spec +++ b/freeglut.spec @@ -1,11 +1,12 @@ Name: freeglut Version: 3.0.0 -Release: 10 +Release: 11 Summary: A freely licensed alternative to the GLUT library License: MIT URL: http://freeglut.sourceforge.net Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source1: https://downloads.sourceforge.net/openglut/openglut-0.6.3-doc.tar.gz +Patch0: gcc-10.patch BuildRequires: gcc gcc-c++ cmake libXi-devel libICE-devel BuildRequires: pkgconfig libGLU-devel libXext-devel libXxf86vm-devel @@ -66,5 +67,8 @@ install -p -m 644 doc/man/*.3 $RPM_BUILD_ROOT/%{_mandir}/man3 %doc README doc/*.png doc/*.html %changelog +* Fri Jul 30 2021 linjiaxin5 - 3.0.0-11 +- Fix failure caused by GCC upgrade to 10 + * Fri Nov 22 2019 sunguoshuai - 3.0.0-10 - Package init. diff --git a/gcc-10.patch b/gcc-10.patch new file mode 100644 index 0000000000000000000000000000000000000000..35a50382723688e1ed93a28820595c1c9e97308b --- /dev/null +++ b/gcc-10.patch @@ -0,0 +1,45 @@ +--- a/src/fg_gl2.c ++++ b/src/fg_gl2.c +@@ -26,6 +26,20 @@ + #include + #include "fg_internal.h" + #include "fg_gl2.h" ++ ++#ifndef GL_ES_VERSION_2_0 ++/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed ++ * names are defined in fg_gl2.h header to reference them, for any other case, ++ * define them as function pointers here. ++ */ ++FGH_PFNGLGENBUFFERSPROC fghGenBuffers; ++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; ++FGH_PFNGLBINDBUFFERPROC fghBindBuffer; ++FGH_PFNGLBUFFERDATAPROC fghBufferData; ++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; ++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; ++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; ++#endif + + void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) { + if (fgStructure.CurrentWindow != NULL) +--- a/src/fg_gl2.h ++++ b/src/fg_gl2.h +@@ -67,13 +67,13 @@ + typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); + typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + +-FGH_PFNGLGENBUFFERSPROC fghGenBuffers; +-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; +-FGH_PFNGLBINDBUFFERPROC fghBindBuffer; +-FGH_PFNGLBUFFERDATAPROC fghBufferData; +-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; +-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; +-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; ++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers; ++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; ++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer; ++extern FGH_PFNGLBUFFERDATAPROC fghBufferData; ++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; ++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; ++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; + + # endif