[crux-commits] ports/opt (3.5): freeglut: gcc10 fix

crux at crux.nu crux at crux.nu
Wed Aug 5 12:51:19 UTC 2020


commit 909516aa53609b7126cfc625c928f8c382268542
Author: Danny Rawlins <monster.romster at gmail.com>
Date:   Wed Aug 5 22:31:01 2020 +1000

    freeglut: gcc10 fix

diff --git a/freeglut/.signature b/freeglut/.signature
index e0105c141..1c8fa8a02 100644
--- a/freeglut/.signature
+++ b/freeglut/.signature
@@ -1,5 +1,6 @@
 untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/UoSYjG5jXhLvKjLAuBUuxgJ/Utr7VBVGAP8Ywh8IVLzB6BmjMQNPUQKoNhIXcBhKIHjsk+Bv5F6Pi/wvRri1QA=
-SHA256 (Pkgfile) = 8d10e8a0d213c089df9b31a0037f967809c68e7e4211fc02d9193eb2cc5f1169
+RWSE3ohX2g5d/Z7tNl58Vtx8gTGYcj0/BNPS6O5DoZEDdeQuBQauujrMqKEcv8pw7K+liM0ekVHC/6vGhltH00VBprzTMjqZiQU=
+SHA256 (Pkgfile) = 9acfdef672f13ec4b1d64f62145a766be2d78d617ba8751b1bc18fef8c55d147
 SHA256 (.footprint) = e1456ea754b868b14d770c08b877d10d842f5ea84e5170911f187ecdf7d7eedc
 SHA256 (freeglut-3.2.1.tar.gz) = d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68
+SHA256 (gcc10.patch) = ce2d11ffbffda1872dde5d50198fa5de961c22716e29fb1715648b7b818222c5
diff --git a/freeglut/Pkgfile b/freeglut/Pkgfile
index cdca64fc4..e1fe875ad 100644
--- a/freeglut/Pkgfile
+++ b/freeglut/Pkgfile
@@ -5,22 +5,20 @@
 
 name=freeglut
 version=3.2.1
-release=1
-source=(https://downloads.sourceforge.net/$name/$name-$version.tar.gz)
+release=2
+source=(https://downloads.sourceforge.net/$name/$name-$version.tar.gz
+	gcc10.patch)
 
 build() {
-	cd $name-$version
+	patch -d $name-$version -p1 -i $SRC/gcc10.patch
 
-	install -d build
-	cd build
-
-	cmake .. \
+	cmake -S$name-$version -Bbuild -GNinja \
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DCMAKE_INSTALL_LIBDIR=lib \
 		-DCMAKE_BUILD_TYPE=Release
 
-	make
-	make DESTDIR=$PKG install
+	cmake --build build
+	DESTDIR=$PKG cmake --install build
 
 	ln -s glut.pc $PKG/usr/lib/pkgconfig/freeglut.pc
 }
diff --git a/freeglut/gcc10.patch b/freeglut/gcc10.patch
new file mode 100644
index 000000000..cb85ee115
--- /dev/null
+++ b/freeglut/gcc10.patch
@@ -0,0 +1,48 @@
+diff -urN freeglut-3.2.1.orig/src/fg_gl2.c freeglut-3.2.1/src/fg_gl2.c
+--- freeglut-3.2.1.orig/src/fg_gl2.c	2014-06-01 04:24:47.000000000 -0500
++++ freeglut-3.2.1/src/fg_gl2.c	2020-08-04 19:54:14.348875031 -0500
+@@ -27,6 +27,20 @@
+ #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)
+     fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
+diff -urN freeglut-3.2.1.orig/src/fg_gl2.h freeglut-3.2.1/src/fg_gl2.h
+--- freeglut-3.2.1.orig/src/fg_gl2.h	2012-04-21 13:22:24.000000000 -0500
++++ freeglut-3.2.1/src/fg_gl2.h	2020-08-04 19:54:17.075914225 -0500
+@@ -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
+ 


More information about the crux-commits mailing list