1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

- Update to 2.6.0

- Add a patch to build with the USB2 stack
- Unbreak on 8.X
PR:		ports/148215
Submitted by:	Aldis Berjoza [aldis bsdroot.lv]
Approved by:	tabthorpe (mentor)
Feature safe:	yes
This commit is contained in:
Rene Ladan 2010-07-06 17:35:46 +00:00
parent 6ab8c72d01
commit 55dfb60ebe
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=257465
12 changed files with 84 additions and 164 deletions

View File

@ -1,3 +1,4 @@
# vim:ts=8:sw=8
# New ports collection makefile for: freeglut
# Date created: Wed Apr 23 2003
# Whom: thierry@pompo.net
@ -5,36 +6,40 @@
# $FreeBSD$
#
PORTNAME= freeglut
PORTVERSION= 2.4.0
PORTREVISION= 4
CATEGORIES= graphics
MASTER_SITES= SF
PORTNAME= freeglut
PORTVERSION= 2.6.0
CATEGORIES= graphics
MASTER_SITES= SF/${PORTNAME:L}/${PORTNAME:L}/
MAINTAINER= ports@FreeBSD.org
COMMENT= An alternative to the OpenGL Utility Toolkit (GLUT) library
MAINTAINER= aldis@bsdroot.lv
COMMENT= An alternative to the OpenGL Utility Toolkit (GLUT) library
CONFLICTS= libglut-[0-9]*
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"
REINPLACE_ARGS= -i ""
USE_AUTOTOOLS= libtool:22
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
USE_XORG= ice xi
USE_GL= glu
CONFIGURE_ARGS= --disable-warnings
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-lusbhid"
USE_LDCONFIG= yes
DOCS= download.html freeglut.html freeglut_logo.png \
freeglut_user_interface.html index.html ogl_sm.png \
progress.html structure.html
BINS= CallbackMaker Fractals Fractals_random Lorenz One shapes
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 800000
EXTRA_PATCHES= ${FILESDIR}/extra-patch-src__freeglut_joystick.c
.endif
pre-configure:
.for fract in /fractals.c _random/fractals_random.c
.for fract in Fractals/fractals.c Fractals_random/fractals_random.c
@${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" \
${WRKSRC}/progs/demos/Fractals${fract}
${WRKSRC}/progs/demos/${fract}
.endfor
post-build:
@ -48,23 +53,19 @@ post-install:
@${INSTALL_DATA} ${WRKSRC}/doc/${FILE} ${DOCSDIR}
.endfor
@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
.endif
.if !defined(NOPORTEXAMPLES)
@${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>

View File

@ -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

View File

@ -0,0 +1,34 @@
--- ./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;
}

View File

@ -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>

View File

@ -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);

View File

@ -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 );

View File

@ -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>

View File

@ -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;

View File

@ -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>

View File

@ -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

View File

@ -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.

View File

@ -5,14 +5,14 @@ include/GL/glut.h
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
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/callbackmaker
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fractals
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fractals_random
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fractals.dat
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/lorenz
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/one
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shapes
%%PORTDOCS%%%%DOCSDIR%%/download.html
%%PORTDOCS%%%%DOCSDIR%%/freeglut.html
%%PORTDOCS%%%%DOCSDIR%%/freeglut_logo.png
@ -21,6 +21,6 @@ lib/libglut.so.11
%%PORTDOCS%%%%DOCSDIR%%/ogl_sm.png
%%PORTDOCS%%%%DOCSDIR%%/progress.html
%%PORTDOCS%%%%DOCSDIR%%/structure.html
@dirrm include/GL
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%
%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
@dirrmtry include/GL