ports/148215: [PATCH] update port graphics/freeglut to v2.6
Aldis Berjoza
aldis at bsdroot.lv
Mon Jun 28 16:50:02 UTC 2010
>Number: 148215
>Category: ports
>Synopsis: [PATCH] update port graphics/freeglut to v2.6
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Mon Jun 28 16:50:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Aldis Berjoza
>Release:
>Organization:
>Environment:
>Description:
After some mailing with rene at FreeBSD.org, we agreed, that inseatad of making new port (freeglut26) we could simply update freeglut to 2.6, since freeglut 2.4 on FreeBSD-8 is broken anyway
http://www.freebsd.org/cgi/query-pr.cgi?pr=147259
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -urN /usr/ports/graphics/freeglut/Makefile freeglut/Makefile
--- /usr/ports/graphics/freeglut/Makefile 2009-08-02 22:34:01.000000000 +0300
+++ freeglut/Makefile 2010-06-28 19:36:10.931977924 +0300
@@ -5,24 +5,25 @@
# $FreeBSD: ports/graphics/freeglut/Makefile,v 1.22 2009/08/02 19:34:01 mezz Exp $
#
-PORTNAME= freeglut
-PORTVERSION= 2.4.0
-PORTREVISION= 4
-CATEGORIES= graphics
-MASTER_SITES= SF
-
-MAINTAINER= ports at FreeBSD.org
-COMMENT= An alternative to the OpenGL Utility Toolkit (GLUT) library
-
-CONFLICTS= libglut-[0-9]*
-
-USE_AUTOTOOLS= libtool:22
-GNU_CONFIGURE= yes
-USE_LDCONFIG= yes
-USE_XORG= ice
-USE_GL= glu
-CONFIGURE_ARGS= --disable-warnings
-CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-lusbhid"
+PORTNAME= freeglut
+PORTVERSION= 2.6.0
+CATEGORIES= graphics
+MASTER_SITES= http://sourceforge.net/projects/${PORTNAME:L}/files/${PORTNAME:L}/
+
+MAINTAINER= aldis at bsdroot.lv
+COMMENT= An alternative to the OpenGL Utility Toolkit (GLUT) library
+
+CONFLICTS= libglut-[0-9]*
+CONFLICTS+= freeglut-2.[45].*
+
+USE_AUTOTOOLS= libtool:22
+GNU_CONFIGURE= yes
+USE_LDCONFIG= yes
+USE_XORG= ice
+USE_GL= glu
+CONFIGURE_ARGS= --disable-warnings
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-lusbhid"
+USE_LDCONFIG= yes
REINPLACE_ARGS= -i ""
@@ -31,6 +32,12 @@
progress.html structure.html
BINS= CallbackMaker Fractals Fractals_random Lorenz One shapes
+.include <bsd.port.pre.mk>
+.if ${OSVERSION} < 800000
+do-patch:
+ ${nada}
+.endif
+
pre-configure:
.for fract in /fractals.c _random/fractals_random.c
@${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" \
@@ -49,22 +56,16 @@
.endfor
@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
@${MKDIR} ${EXAMPLESDIR}
- @${INSTALL_DATA} ${WRKSRC}/progs/demos/Fractals/fractals.dat \
- ${EXAMPLESDIR}
+ @${INSTALL_DATA} ${WRKSRC}/progs/demos/Fractals/fractals.dat ${EXAMPLESDIR}
.for prog in ${BINS}
- @${INSTALL_PROGRAM} ${WRKSRC}/progs/demos/${prog}/.libs/${prog:L} \
- ${EXAMPLESDIR}
+ @${INSTALL_PROGRAM} ${WRKSRC}/progs/demos/${prog}/.libs/${prog:L} ${EXAMPLESDIR}
.endfor
@${ECHO_MSG} "===> Examples installed in ${EXAMPLESDIR}."
.endif
+.if ${OSVERSION} >= 800000
@${ECHO_MSG}
@${CAT} ${PKGMESSAGE}
@${ECHO_MSG}
-
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 800064
-BROKEN= does not build
.endif
.include <bsd.port.post.mk>
diff -urN /usr/ports/graphics/freeglut/distinfo freeglut/distinfo
--- /usr/ports/graphics/freeglut/distinfo 2005-11-25 21:33:44.000000000 +0200
+++ freeglut/distinfo 2010-05-31 20:53:42.649328785 +0300
@@ -1,3 +1,3 @@
-MD5 (freeglut-2.4.0.tar.gz) = 6d16873bd876fbf4980a927cfbc496a1
-SHA256 (freeglut-2.4.0.tar.gz) = 269f2d50ba30b381622eb36f20b552ad43a1b43d544b9075e484e7146e81b052
-SIZE (freeglut-2.4.0.tar.gz) = 469557
+MD5 (freeglut-2.6.0.tar.gz) = 39f0f2de89f399529d2b981188082218
+SHA256 (freeglut-2.6.0.tar.gz) = 615b41edc96c405ee6bb7e9a2942642140c3e57c1dd8c68e968a17ddfb59e98f
+SIZE (freeglut-2.6.0.tar.gz) = 1124186
diff -urN /usr/ports/graphics/freeglut/files/patch-progs::demos::CallbackMaker::CallbackMaker.c freeglut/files/patch-progs::demos::CallbackMaker::CallbackMaker.c
--- /usr/ports/graphics/freeglut/files/patch-progs::demos::CallbackMaker::CallbackMaker.c 2003-12-14 15:03:37.000000000 +0200
+++ freeglut/files/patch-progs::demos::CallbackMaker::CallbackMaker.c 1970-01-01 03:00:00.000000000 +0300
@@ -1,11 +0,0 @@
---- progs/demos/CallbackMaker/CallbackMaker.c.orig Mon Nov 10 17:01:05 2003
-+++ progs/demos/CallbackMaker/CallbackMaker.c Sat Dec 13 14:43:35 2003
-@@ -4,7 +4,7 @@
- */
-
-
--#include <GL/freeglut.h>
-+#include "../../../include/GL/freeglut.h"
- #include <stdio.h>
- #include <stdlib.h>
-
diff -urN /usr/ports/graphics/freeglut/files/patch-progs::demos::Fractals::fractals.c freeglut/files/patch-progs::demos::Fractals::fractals.c
--- /usr/ports/graphics/freeglut/files/patch-progs::demos::Fractals::fractals.c 2003-10-04 12:46:21.000000000 +0300
+++ freeglut/files/patch-progs::demos::Fractals::fractals.c 1970-01-01 03:00:00.000000000 +0300
@@ -1,20 +0,0 @@
---- progs/demos/Fractals/fractals.c.orig Sun Sep 21 15:47:36 2003
-+++ progs/demos/Fractals/fractals.c Mon Sep 29 23:35:43 2003
-@@ -18,7 +18,7 @@
- * Escape - quit
- */
-
--#include <GL/freeglut.h>
-+#include "../../../include/GL/freeglut.h"
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
-@@ -262,7 +262,7 @@
- if ( argc > 1 )
- readConfigFile ( argv[1] ) ;
- else
-- readConfigFile ( "fractals.dat" ) ;
-+ readConfigFile ( "/usr/local/share/examples/freeglut/fractals.dat" ) ;
-
- glutInit(&argc, argv);
- glutInitWindowSize(500, 250);
diff -urN /usr/ports/graphics/freeglut/files/patch-progs::demos::Fractals_random::fractals_random.c freeglut/files/patch-progs::demos::Fractals_random::fractals_random.c
--- /usr/ports/graphics/freeglut/files/patch-progs::demos::Fractals_random::fractals_random.c 2003-12-14 15:03:37.000000000 +0200
+++ freeglut/files/patch-progs::demos::Fractals_random::fractals_random.c 1970-01-01 03:00:00.000000000 +0300
@@ -1,20 +0,0 @@
---- progs/demos/Fractals_random/fractals_random.c.orig Thu Dec 11 02:32:08 2003
-+++ progs/demos/Fractals_random/fractals_random.c Sat Dec 13 10:17:10 2003
-@@ -20,7 +20,7 @@
- * Escape - quit
- */
-
--#include <GL/freeglut.h>
-+#include "../../../include/GL/freeglut.h"
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
-@@ -346,7 +346,7 @@
- if ( argc > 1 )
- readConfigFile ( argv[1] ) ;
- else
-- readConfigFile ( "fractals.dat" ) ;
-+ readConfigFile ( "/usr/local/share/examples/freeglut/fractals.dat" ) ;
-
- fractal_window = glutCreateWindow( window_title );
-
diff -urN /usr/ports/graphics/freeglut/files/patch-progs::demos::Lorenz::lorenz.c freeglut/files/patch-progs::demos::Lorenz::lorenz.c
--- /usr/ports/graphics/freeglut/files/patch-progs::demos::Lorenz::lorenz.c 2005-06-11 22:57:46.000000000 +0300
+++ freeglut/files/patch-progs::demos::Lorenz::lorenz.c 1970-01-01 03:00:00.000000000 +0300
@@ -1,11 +0,0 @@
---- progs/demos/Lorenz/lorenz.c.orig Mon Jan 3 11:24:15 2005
-+++ progs/demos/Lorenz/lorenz.c Sat Jun 11 14:06:07 2005
-@@ -31,7 +31,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <math.h>
--#include <GL/freeglut.h>
-+#include "../../../include/GL/freeglut.h"
- #ifdef WIN32
- /* DUMP MEMORY LEAKS */
- #include <crtdbg.h>
diff -urN /usr/ports/graphics/freeglut/files/patch-progs::demos::One::one.c freeglut/files/patch-progs::demos::One::one.c
--- /usr/ports/graphics/freeglut/files/patch-progs::demos::One::one.c 2003-10-04 12:46:21.000000000 +0300
+++ freeglut/files/patch-progs::demos::One::one.c 1970-01-01 03:00:00.000000000 +0300
@@ -1,11 +0,0 @@
---- progs/demos/One/one.c.orig Sat Sep 13 15:35:53 2003
-+++ progs/demos/One/one.c Mon Sep 22 21:56:03 2003
-@@ -19,7 +19,7 @@
- #include <stdio.h>
- #include <stdlib.h>
-
--#include <GL/freeglut.h>
-+#include "../../../include/GL/freeglut.h"
-
- int g_LeaveGameMode = 0;
- int g_InGameMode = 1;
diff -urN /usr/ports/graphics/freeglut/files/patch-progs::demos::shapes::shapes.c freeglut/files/patch-progs::demos::shapes::shapes.c
--- /usr/ports/graphics/freeglut/files/patch-progs::demos::shapes::shapes.c 2003-12-14 15:03:37.000000000 +0200
+++ freeglut/files/patch-progs::demos::shapes::shapes.c 1970-01-01 03:00:00.000000000 +0300
@@ -1,11 +0,0 @@
---- progs/demos/shapes/shapes.c.orig Sun Dec 7 11:12:22 2003
-+++ progs/demos/shapes/shapes.c Sat Dec 13 14:51:38 2003
-@@ -12,7 +12,7 @@
- * using the + and - keys.
- */
-
--#include <GL/freeglut.h>
-+#include "../../../include/GL/freeglut.h"
-
- #include <stdlib.h>
-
diff -urN /usr/ports/graphics/freeglut/files/patch-src::freeglut_joystick.c freeglut/files/patch-src::freeglut_joystick.c
--- /usr/ports/graphics/freeglut/files/patch-src::freeglut_joystick.c 2005-06-11 22:57:46.000000000 +0300
+++ freeglut/files/patch-src::freeglut_joystick.c 1970-01-01 03:00:00.000000000 +0300
@@ -1,34 +0,0 @@
---- src/freeglut_joystick.c.orig Wed May 4 14:53:48 2005
-+++ src/freeglut_joystick.c Sat Jun 11 14:40:48 2005
-@@ -80,7 +80,7 @@
- /* XXX The below hack is done until freeglut's autoconf is updated. */
- # define HAVE_USB_JS 1
-
--# if defined(__FreeBSD__) && __FreeBSD_version >= 500000
-+# if defined(__FreeBSD__)
- # include <sys/joystick.h>
- # else
- /*
-@@ -656,9 +656,9 @@
- if (usage > 0 && usage < _JS_MAX_BUTTONS + 1)
- {
- if (d)
-- joy->os->cache_buttons |= (1 << usage - 1);
-+ joy->os->cache_buttons |= (1 << (usage - 1));
- else
-- joy->os->cache_buttons &= ~(1 << usage - 1);
-+ joy->os->cache_buttons &= ~(1 <<( usage - 1));
- }
- }
- }
-@@ -1060,7 +1060,9 @@
- # ifdef JS_NEW
- unsigned char u;
- # else
-- int counter;
-+# if defined( __linux__ )
-+ int counter;
-+# endif
- # endif
- #endif
-
diff -urN /usr/ports/graphics/freeglut/files/patch-src__freeglut_joystick.c freeglut/files/patch-src__freeglut_joystick.c
--- /usr/ports/graphics/freeglut/files/patch-src__freeglut_joystick.c 1970-01-01 03:00:00.000000000 +0300
+++ freeglut/files/patch-src__freeglut_joystick.c 2010-05-31 21:27:46.909280818 +0300
@@ -0,0 +1,33 @@
+--- ./src/freeglut_joystick.c.orig 2009-11-14 06:31:39.000000000 +0200
++++ ./src/freeglut_joystick.c 2010-05-31 21:27:13.362358514 +0300
+@@ -79,11 +79,13 @@
+ # include <errno.h>
+ # endif
+ # if defined(__FreeBSD__) || defined(__NetBSD__)
++# include <osreldate.h>
+ /* XXX The below hack is done until freeglut's autoconf is updated. */
+ # define HAVE_USB_JS 1
+
+ # if defined(__FreeBSD__)
+ # include <sys/joystick.h>
++# include <dev/usb/usb_ioctl.h>
+ # else
+ /*
+ * XXX NetBSD/amd64 systems may find that they have to steal the
+@@ -200,7 +202,7 @@
+ */
+ static char *fghJoystickWalkUSBdev(int f, char *dev, char *out, int outlen)
+ {
+- struct usb_device_info di;
++/* struct usb_device_info di;
+ int i, a;
+ char *cp;
+
+@@ -221,6 +223,7 @@
+ return out;
+ }
+ }
++ */
+ return NULL;
+ }
+
diff -urN /usr/ports/graphics/freeglut/pkg-message freeglut/pkg-message
--- /usr/ports/graphics/freeglut/pkg-message 2008-03-24 01:00:25.000000000 +0200
+++ freeglut/pkg-message 2010-05-31 22:37:58.775785919 +0300
@@ -1,6 +1,9 @@
-******************************************************************
-freeglut requires a DRI / OpenGL enabled-graphic card;
-You may try to run the sample programs to check your installation.
+Since FreeBSD has new USB stack, freeglut normally doesn't build on FreeBSD 8
+(yet). To workaround this I created small, ugly patch. this patch adds one
+include file and comments out content of one function (only leaves return NULL).
-Notice: freeglut is now a GLUT replacement.
-******************************************************************
+I have no idea what kind of side effects this can cause. Joystick wont work.
+There might be ports that won't compile, or apps that may crash because of
+this. I don't know.
+
+If you face any problems delete this port and install graphics/libglut.
diff -urN /usr/ports/graphics/freeglut/pkg-plist freeglut/pkg-plist
--- /usr/ports/graphics/freeglut/pkg-plist 2006-02-23 12:36:59.000000000 +0200
+++ freeglut/pkg-plist 2010-06-28 19:34:11.496202707 +0300
@@ -5,14 +5,14 @@
lib/libglut.a
lib/libglut.la
lib/libglut.so
-lib/libglut.so.11
-%%PORTDOCS%%%%EXAMPLESDIR%%/callbackmaker
-%%PORTDOCS%%%%EXAMPLESDIR%%/fractals
-%%PORTDOCS%%%%EXAMPLESDIR%%/fractals_random
-%%PORTDOCS%%%%EXAMPLESDIR%%/fractals.dat
-%%PORTDOCS%%%%EXAMPLESDIR%%/lorenz
-%%PORTDOCS%%%%EXAMPLESDIR%%/one
-%%PORTDOCS%%%%EXAMPLESDIR%%/shapes
+lib/libglut.so.12
+%%!NOEXAMPLES%%%%EXAMPLESDIR%%/callbackmaker
+%%!NOEXAMPLES%%%%EXAMPLESDIR%%/fractals
+%%!NOEXAMPLES%%%%EXAMPLESDIR%%/fractals_random
+%%!NOEXAMPLES%%%%EXAMPLESDIR%%/fractals.dat
+%%!NOEXAMPLES%%%%EXAMPLESDIR%%/lorenz
+%%!NOEXAMPLES%%%%EXAMPLESDIR%%/one
+%%!NOEXAMPLES%%%%EXAMPLESDIR%%/shapes
%%PORTDOCS%%%%DOCSDIR%%/download.html
%%PORTDOCS%%%%DOCSDIR%%/freeglut.html
%%PORTDOCS%%%%DOCSDIR%%/freeglut_logo.png
@@ -21,6 +21,6 @@
%%PORTDOCS%%%%DOCSDIR%%/ogl_sm.png
%%PORTDOCS%%%%DOCSDIR%%/progress.html
%%PORTDOCS%%%%DOCSDIR%%/structure.html
- at dirrm include/GL
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%
+ at dirrmtry include/GL
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list