summaryrefslogtreecommitdiffstats
path: root/graphics/freeglut
diff options
context:
space:
mode:
authorzeising <zeising@058c260c-8361-11dd-a0ac-aa2bafec7d09>2012-02-06 03:57:54 +0800
committerzeising <zeising@058c260c-8361-11dd-a0ac-aa2bafec7d09>2012-02-06 03:57:54 +0800
commit3aa52e79219f1d0b65dbe44637aaeb37de3b33e2 (patch)
tree76c467153a2cc19318266f8ba0c19f569e003782 /graphics/freeglut
parent288d9b681e56a68a35f69d124222a3c6cf820e7b (diff)
downloadxorg-devel-ports-3aa52e79219f1d0b65dbe44637aaeb37de3b33e2.tar
xorg-devel-ports-3aa52e79219f1d0b65dbe44637aaeb37de3b33e2.tar.gz
xorg-devel-ports-3aa52e79219f1d0b65dbe44637aaeb37de3b33e2.tar.bz2
xorg-devel-ports-3aa52e79219f1d0b65dbe44637aaeb37de3b33e2.tar.lz
xorg-devel-ports-3aa52e79219f1d0b65dbe44637aaeb37de3b33e2.tar.xz
xorg-devel-ports-3aa52e79219f1d0b65dbe44637aaeb37de3b33e2.tar.zst
xorg-devel-ports-3aa52e79219f1d0b65dbe44637aaeb37de3b33e2.zip
Replace libGLUT with FreeGLUT
Update FreeGLUT to 2.8.0 which is not in the FreeBSD ports tree (yet). FreeGLUT is a truly open source implementation of GLUT. libGLUT allowed for free distribution but not modification, and has been abandoned long ago. As such no new features or bug fixes were really possible. The FreeGLUT port has some minor issues, mostly in the autotools scripts that perhaps should be looked into. It works fine though. git-svn-id: https://trillian.chruetertee.ch/svn/ports/trunk@398 058c260c-8361-11dd-a0ac-aa2bafec7d09
Diffstat (limited to 'graphics/freeglut')
-rw-r--r--graphics/freeglut/Makefile72
-rw-r--r--graphics/freeglut/distinfo2
-rw-r--r--graphics/freeglut/files/extra-patch-src__freeglut_joystick.c42
-rw-r--r--graphics/freeglut/files/patch-prog-demos-smooth_opengl3.c18
-rw-r--r--graphics/freeglut/pkg-descr13
-rw-r--r--graphics/freeglut/pkg-message9
-rw-r--r--graphics/freeglut/pkg-plist26
7 files changed, 182 insertions, 0 deletions
diff --git a/graphics/freeglut/Makefile b/graphics/freeglut/Makefile
new file mode 100644
index 0000000..713bed7
--- /dev/null
+++ b/graphics/freeglut/Makefile
@@ -0,0 +1,72 @@
+# vim:ts=8:sw=8
+# New ports collection makefile for: freeglut
+# Date created: Wed Apr 23 2003
+# Whom: thierry@pompo.net
+#
+# $FreeBSD: ports/graphics/freeglut/Makefile,v 1.26 2011/09/23 22:23:09 amdmi3 Exp $
+#
+
+PORTNAME= freeglut
+PORTVERSION= 2.8.0
+CATEGORIES= graphics
+MASTER_SITES= SF/${PORTNAME:L}/${PORTNAME:L}/${PORTVERSION}
+
+MAINTAINER= x11@FreeBSD.org
+COMMENT= An alternative to the OpenGL Utility Toolkit (GLUT) library
+
+CONFLICTS= libglut-[0-9].*
+
+USE_GMAKE= yes
+USE_AUTOTOOLS= libtool
+GNU_CONFIGURE= yes
+USE_LDCONFIG= yes
+USE_XORG= ice xi xrandr
+USE_GL= glu
+CONFIGURE_ARGS= --disable-warnings
+LDFLAGS+= -lusbhid -L${LOCALBASE}/lib
+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/fractals.c Fractals_random/fractals_random.c
+ @${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" \
+ ${WRKSRC}/progs/demos/${fract}
+.endfor
+
+post-build:
+ @${MV} ${WRKSRC}/progs/demos/CallbackMaker/.libs/CallbackMaker \
+ ${WRKSRC}/progs/demos/CallbackMaker/.libs/callbackmaker
+
+post-install:
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for FILE in ${DOCS}
+ @${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}
+.for prog in ${BINS}
+ @${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}
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/graphics/freeglut/distinfo b/graphics/freeglut/distinfo
new file mode 100644
index 0000000..81ae29d
--- /dev/null
+++ b/graphics/freeglut/distinfo
@@ -0,0 +1,2 @@
+SHA256 (freeglut-2.8.0.tar.gz) = 197293ff886abe613bc9eb4a762d9161b0c9e64b3e8e613ed7c5e353974fba05
+SIZE (freeglut-2.8.0.tar.gz) = 979459
diff --git a/graphics/freeglut/files/extra-patch-src__freeglut_joystick.c b/graphics/freeglut/files/extra-patch-src__freeglut_joystick.c
new file mode 100644
index 0000000..e6021d8
--- /dev/null
+++ b/graphics/freeglut/files/extra-patch-src__freeglut_joystick.c
@@ -0,0 +1,42 @@
+--- src/freeglut_joystick.c.orig 2011-09-28 03:37:26.000000000 +0200
++++ src/freeglut_joystick.c 2012-01-30 20:25:02.000000000 +0100
+@@ -80,11 +80,13 @@
+ # include <string.h>
+ # endif
+ # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || 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__) || defined(__FreeBSD_kernel__)
+ # include <sys/joystick.h>
++# include <dev/usb/usb_ioctl.h>
+ # else
+ /*
+ * XXX NetBSD/amd64 systems may find that they have to steal the
+@@ -152,7 +154,7 @@
+ # include <libusbhid.h>
+ # endif
+ # endif
+-# include <legacy/dev/usb/usb.h>
++# include <dev/usb/usb.h>
+ # include <dev/usb/usbhid.h>
+
+ /* Compatibility with older usb.h revisions */
+@@ -199,7 +201,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;
+
+@@ -220,6 +222,7 @@
+ return out;
+ }
+ }
++ */
+ return NULL;
+ }
+
diff --git a/graphics/freeglut/files/patch-prog-demos-smooth_opengl3.c b/graphics/freeglut/files/patch-prog-demos-smooth_opengl3.c
new file mode 100644
index 0000000..53866ea
--- /dev/null
+++ b/graphics/freeglut/files/patch-prog-demos-smooth_opengl3.c
@@ -0,0 +1,18 @@
+--- progs/demos/smooth_opengl3/smooth_opengl3.c.orig 2011-12-14 04:35:07.000000000 +0100
++++ progs/demos/smooth_opengl3/smooth_opengl3.c 2012-01-31 19:11:53.000000000 +0100
+@@ -94,6 +94,7 @@
+ typedef ptrdiff_t ourGLsizeiptr;
+ typedef char ourGLchar;
+
++#if defined(WIN32)
+ #ifndef APIENTRY
+ #define APIENTRY
+ #endif
+@@ -117,6 +118,7 @@
+ typedef void (APIENTRY *PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+ typedef GLint (APIENTRY *PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const ourGLchar *name);
+ typedef void (APIENTRY *PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
++#endif /* WIN32 */
+
+ PFNGLGENBUFFERSPROC gl_GenBuffers;
+ PFNGLBINDBUFFERPROC gl_BindBuffer;
diff --git a/graphics/freeglut/pkg-descr b/graphics/freeglut/pkg-descr
new file mode 100644
index 0000000..12d1586
--- /dev/null
+++ b/graphics/freeglut/pkg-descr
@@ -0,0 +1,13 @@
+freeglut is a completely OpenSourced alternative to the OpenGL Utility
+Toolkit (GLUT) library. GLUT was originally written by Mark Kilgard to
+support the sample programs in the second edition OpenGL 'RedBook'.
+Since then, GLUT has been used in a wide variety of practical applications
+because it is simple, universally available and highly portable.
+
+GLUT (and hence freeglut) allows the user to create and manage windows
+containing OpenGL contexts on a wide range of platforms and also read the
+mouse, keyboard and joystick functions.
+
+freeglut is released under the X-Consortium license.
+
+WWW: http://freeglut.sourceforge.net/
diff --git a/graphics/freeglut/pkg-message b/graphics/freeglut/pkg-message
new file mode 100644
index 0000000..8bf6ef5
--- /dev/null
+++ b/graphics/freeglut/pkg-message
@@ -0,0 +1,9 @@
+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).
+
+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 --git a/graphics/freeglut/pkg-plist b/graphics/freeglut/pkg-plist
new file mode 100644
index 0000000..8ddb105
--- /dev/null
+++ b/graphics/freeglut/pkg-plist
@@ -0,0 +1,26 @@
+include/GL/freeglut.h
+include/GL/freeglut_ext.h
+include/GL/freeglut_std.h
+include/GL/glut.h
+lib/libglut.a
+lib/libglut.la
+lib/libglut.so
+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
+%%PORTDOCS%%%%DOCSDIR%%/freeglut_user_interface.html
+%%PORTDOCS%%%%DOCSDIR%%/index.html
+%%PORTDOCS%%%%DOCSDIR%%/ogl_sm.png
+%%PORTDOCS%%%%DOCSDIR%%/progress.html
+%%PORTDOCS%%%%DOCSDIR%%/structure.html
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
+@dirrmtry include/GL