Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2010 20:53:37 GMT
From:      Aldis Berjoza <aldis@bsdroot.lv>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/147259: PORTS new port graphics/freeglut26
Message-ID:  <201005312053.o4VKrbwZ048147@www.freebsd.org>
Resent-Message-ID: <201005312100.o4VL09Q1059008@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         147259
>Category:       ports
>Synopsis:       PORTS new port graphics/freeglut26
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 31 21:00:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Aldis Berjoza
>Release:        FreeBSD-8
>Organization:
>Environment:
FreeBSD killasmurf86.pc 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #2: Sat Feb 20 10:00:40 EET 2010     killasmurf86@killasmurf86.pc:/usr/obj/usr/src/sys/ANTIGENERIC  i386
>Description:
Created port for latest FreeGLUT.
Problem with FreeGLUT and FreeBSD 8 is that it won't build because of FreeBSD new USB stack.

To work around this problem I created 1 small, and ugly patch. Which adds 1 header and comments out content of 1 file.

I'm not sure if what i did is good/bad, but at least it compiled on my PC and I was able to run freeglut samples.


I wanted to try running Nexuiz with FreeGlut to test it, but it's not so easy.

anyway, I think it should work, the only problem that I predict is joystick not working. [but who know what else could happen]


P.S.
I also added pkg-message for FreeBSD-8 users, to warn them about this.
This should work just fine on FreeBSD<8
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	distinfo
#	files
#	freeglut26.txt
#	pkg-descr
#	pkg-message
#	pkg-plist
#	files/patch-src__freeglut_joystick.c
#
echo x - Makefile
sed 's/^X//' >Makefile << 'b67911656ef5d18c4ae36cb6741b7965'
X# New ports collection makefile for:	freeglut
X# Date created:		Wed Apr 23 2003
X# Whom:			thierry@pompo.net
X#
X# $FreeBSD: ports/graphics/freeglut/Makefile,v 1.22 2009/08/02 19:34:01 mezz Exp $
X#
X
XPORTNAME=		freeglut
XPORTVERSION=		2.6.0
XCATEGORIES=		graphics
XMASTER_SITES=		http://sourceforge.net/projects/${PORTNAME:L}/files/${PORTNAME:L}/
X
XMAINTAINER=		aldis@bsdroot.lv
XCOMMENT=		An alternative to the OpenGL Utility Toolkit (GLUT) library
X
XCONFLICTS=		libglut-[0-9]*
XCONFLICTS+=		freeglut-2.[45].*
X
XUSE_AUTOTOOLS=		libtool:22
XGNU_CONFIGURE=		yes
XUSE_LDCONFIG=		yes
XUSE_XORG=		ice
XUSE_GL=			glu
XCONFIGURE_ARGS=		--disable-warnings
XCONFIGURE_ENV=		CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-lusbhid"
X
XREINPLACE_ARGS=		-i ""
X
XDOCS=	download.html freeglut.html freeglut_logo.png		\
X	freeglut_user_interface.html index.html ogl_sm.png	\
X	progress.html structure.html
XBINS=	CallbackMaker Fractals Fractals_random Lorenz One shapes
X
X.include <bsd.port.pre.mk>
X.if ${OSVERSION} < 800000
Xdo-patch:
X	${nada}
X.endif
X
Xpre-configure:
X.for fract in /fractals.c _random/fractals_random.c
X	@${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g"		\
X		${WRKSRC}/progs/demos/Fractals${fract}
X.endfor
X
Xpost-build:
X	@${MV} ${WRKSRC}/progs/demos/CallbackMaker/.libs/CallbackMaker	\
X		${WRKSRC}/progs/demos/CallbackMaker/.libs/callbackmaker
X
Xpost-install:
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}
X.for FILE in ${DOCS}
X	@${INSTALL_DATA} ${WRKSRC}/doc/${FILE} ${DOCSDIR}
X.endfor
X	@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
X	@${MKDIR} ${EXAMPLESDIR}
X	@${INSTALL_DATA} ${WRKSRC}/progs/demos/Fractals/fractals.dat ${EXAMPLESDIR}
X.for prog in ${BINS}
X	@${INSTALL_PROGRAM} ${WRKSRC}/progs/demos/${prog}/.libs/${prog:L} ${EXAMPLESDIR}
X.endfor
X	@${ECHO_MSG} "===> Examples installed in ${EXAMPLESDIR}."
X.endif
X.if ${OSVERSION} >= 800000
X	@${ECHO_MSG}
X	@${CAT} ${PKGMESSAGE}
X	@${ECHO_MSG}
X.endif
X
X.include <bsd.port.post.mk>
b67911656ef5d18c4ae36cb6741b7965
echo x - distinfo
sed 's/^X//' >distinfo << '57677d168a5ec21bdf22c9501f075a8f'
XMD5 (freeglut-2.6.0.tar.gz) = 39f0f2de89f399529d2b981188082218
XSHA256 (freeglut-2.6.0.tar.gz) = 615b41edc96c405ee6bb7e9a2942642140c3e57c1dd8c68e968a17ddfb59e98f
XSIZE (freeglut-2.6.0.tar.gz) = 1124186
57677d168a5ec21bdf22c9501f075a8f
echo c - files
mkdir -p files > /dev/null 2>&1
echo x - freeglut26.txt
sed 's/^X//' >freeglut26.txt << '4122f7b9873061032ebfccd485f39e07'
X# This is a shell archive.  Save it in a file, remove anything before
X# this line, and then unpack it by entering "sh file".  Note, it may
X# create directories; files and directories will be owned by you and
X# have default permissions.
X#
X# This archive contains:
X#
X#	Makefile
X#	distinfo
X#	files
X#	freeglut26.txt
X#	pkg-descr
X#	pkg-message
X#	pkg-plist
X#	files/patch-src__freeglut_joystick.c
X#
Xecho x - Makefile
Xsed 's/^X//' >Makefile << 'b67911656ef5d18c4ae36cb6741b7965'
XX# New ports collection makefile for:	freeglut
XX# Date created:		Wed Apr 23 2003
XX# Whom:			thierry@pompo.net
XX#
XX# $FreeBSD: ports/graphics/freeglut/Makefile,v 1.22 2009/08/02 19:34:01 mezz Exp $
XX#
XX
XXPORTNAME=		freeglut
XXPORTVERSION=		2.6.0
XXCATEGORIES=		graphics
XXMASTER_SITES=		http://sourceforge.net/projects/${PORTNAME:L}/files/${PORTNAME:L}/
XX
XXMAINTAINER=		aldis@bsdroot.lv
XXCOMMENT=		An alternative to the OpenGL Utility Toolkit (GLUT) library
XX
XXCONFLICTS=		libglut-[0-9]*
XXCONFLICTS+=		freeglut-2.[45].*
XX
XXUSE_AUTOTOOLS=		libtool:22
XXGNU_CONFIGURE=		yes
XXUSE_LDCONFIG=		yes
XXUSE_XORG=		ice
XXUSE_GL=			glu
XXCONFIGURE_ARGS=		--disable-warnings
XXCONFIGURE_ENV=		CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-lusbhid"
XX
XXREINPLACE_ARGS=		-i ""
XX
XXDOCS=	download.html freeglut.html freeglut_logo.png		\
XX	freeglut_user_interface.html index.html ogl_sm.png	\
XX	progress.html structure.html
XXBINS=	CallbackMaker Fractals Fractals_random Lorenz One shapes
XX
XX.include <bsd.port.pre.mk>
XX.if ${OSVERSION} < 800000
XXdo-patch:
XX	${nada}
XX.endif
XX
XXpre-configure:
XX.for fract in /fractals.c _random/fractals_random.c
XX	@${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g"		\
XX		${WRKSRC}/progs/demos/Fractals${fract}
XX.endfor
XX
XXpost-build:
XX	@${MV} ${WRKSRC}/progs/demos/CallbackMaker/.libs/CallbackMaker	\
XX		${WRKSRC}/progs/demos/CallbackMaker/.libs/callbackmaker
XX
XXpost-install:
XX.if !defined(NOPORTDOCS)
XX	@${MKDIR} ${DOCSDIR}
XX.for FILE in ${DOCS}
XX	@${INSTALL_DATA} ${WRKSRC}/doc/${FILE} ${DOCSDIR}
XX.endfor
XX	@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
XX	@${MKDIR} ${EXAMPLESDIR}
XX	@${INSTALL_DATA} ${WRKSRC}/progs/demos/Fractals/fractals.dat ${EXAMPLESDIR}
XX.for prog in ${BINS}
XX	@${INSTALL_PROGRAM} ${WRKSRC}/progs/demos/${prog}/.libs/${prog:L} ${EXAMPLESDIR}
XX.endfor
XX	@${ECHO_MSG} "===> Examples installed in ${EXAMPLESDIR}."
XX.endif
XX.if ${OSVERSION} >= 800000
XX	@${ECHO_MSG}
XX	@${CAT} ${PKGMESSAGE}
XX	@${ECHO_MSG}
XX.endif
XX
XX.include <bsd.port.post.mk>
Xb67911656ef5d18c4ae36cb6741b7965
Xecho x - distinfo
Xsed 's/^X//' >distinfo << '57677d168a5ec21bdf22c9501f075a8f'
XXMD5 (freeglut-2.6.0.tar.gz) = 39f0f2de89f399529d2b981188082218
XXSHA256 (freeglut-2.6.0.tar.gz) = 615b41edc96c405ee6bb7e9a2942642140c3e57c1dd8c68e968a17ddfb59e98f
XXSIZE (freeglut-2.6.0.tar.gz) = 1124186
X57677d168a5ec21bdf22c9501f075a8f
Xecho c - files
Xmkdir -p files > /dev/null 2>&1
Xecho x - freeglut26.txt
Xsed 's/^X//' >freeglut26.txt << '4122f7b9873061032ebfccd485f39e07'
4122f7b9873061032ebfccd485f39e07
echo x - pkg-descr
sed 's/^X//' >pkg-descr << '7f9555c3c1089940396b503dd37f3979'
Xfreeglut is a completely OpenSourced alternative to the OpenGL Utility
XToolkit (GLUT) library. GLUT was originally written by Mark Kilgard to
Xsupport the sample programs in the second edition OpenGL 'RedBook'.
XSince then, GLUT has been used in a wide variety of practical applications
Xbecause it is simple, universally available and highly portable.
X
XGLUT (and hence freeglut) allows the user to create and manage windows
Xcontaining OpenGL contexts on a wide range of platforms and also read the
Xmouse, keyboard and joystick functions.
X
Xfreeglut is released under the X-Consortium license.
X
XWWW: http://freeglut.sourceforge.net/
7f9555c3c1089940396b503dd37f3979
echo x - pkg-message
sed 's/^X//' >pkg-message << '90c81c06929c43140502a9f17b449376'
XSince FreeBSD has new USB stack, freeglut normally doesn't build on FreeBSD 8
X(yet). To workaround this I created small, ugly patch. this patch adds one
Xinclude file and comments out content of one function (only leaves return NULL).
X
XI have no idea what kind of side effects this can cause. Joystick wont work.
XThere might be ports that won't compile, or apps that may crash because of
Xthis. I don't know.
X
XIf you face any problems delete this port and install graphics/libglut.
90c81c06929c43140502a9f17b449376
echo x - pkg-plist
sed 's/^X//' >pkg-plist << '842cde48cf18b70a11b15515ca566742'
Xinclude/GL/freeglut.h
Xinclude/GL/freeglut_ext.h
Xinclude/GL/freeglut_std.h
Xinclude/GL/glut.h
Xlib/libglut.a
Xlib/libglut.la
Xlib/libglut.so
Xlib/libglut.so.12
X%%PORTDOCS%%%%EXAMPLESDIR%%/callbackmaker
X%%PORTDOCS%%%%EXAMPLESDIR%%/fractals
X%%PORTDOCS%%%%EXAMPLESDIR%%/fractals_random
X%%PORTDOCS%%%%EXAMPLESDIR%%/fractals.dat
X%%PORTDOCS%%%%EXAMPLESDIR%%/lorenz
X%%PORTDOCS%%%%EXAMPLESDIR%%/one
X%%PORTDOCS%%%%EXAMPLESDIR%%/shapes
X%%PORTDOCS%%%%DOCSDIR%%/download.html
X%%PORTDOCS%%%%DOCSDIR%%/freeglut.html
X%%PORTDOCS%%%%DOCSDIR%%/freeglut_logo.png
X%%PORTDOCS%%%%DOCSDIR%%/freeglut_user_interface.html
X%%PORTDOCS%%%%DOCSDIR%%/index.html
X%%PORTDOCS%%%%DOCSDIR%%/ogl_sm.png
X%%PORTDOCS%%%%DOCSDIR%%/progress.html
X%%PORTDOCS%%%%DOCSDIR%%/structure.html
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
X%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%
X@dirrmtry include/GL
842cde48cf18b70a11b15515ca566742
echo x - files/patch-src__freeglut_joystick.c
sed 's/^X//' >files/patch-src__freeglut_joystick.c << '74d171833d0f86cfcc567b1fcffcb85c'
X--- ./src/freeglut_joystick.c.orig	2009-11-14 06:31:39.000000000 +0200
X+++ ./src/freeglut_joystick.c	2010-05-31 21:27:13.362358514 +0300
X@@ -79,11 +79,13 @@
X #        include <errno.h>
X #    endif
X #    if defined(__FreeBSD__) || defined(__NetBSD__)
X+#        include <osreldate.h>
X /* XXX The below hack is done until freeglut's autoconf is updated. */
X #        define HAVE_USB_JS    1
X 
X #        if defined(__FreeBSD__)
X #            include <sys/joystick.h>
X+#            include <dev/usb/usb_ioctl.h>
X #        else
X /*
X  * XXX NetBSD/amd64 systems may find that they have to steal the
X@@ -200,7 +202,7 @@
X  */
X static char *fghJoystickWalkUSBdev(int f, char *dev, char *out, int outlen)
X {
X-  struct usb_device_info di;
X+/*  struct usb_device_info di;
X   int i, a;
X   char *cp;
X 
X@@ -221,6 +223,7 @@
X         return out;
X       }
X   }
X+  */
X   return NULL;
X }
X 
74d171833d0f86cfcc567b1fcffcb85c
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005312053.o4VKrbwZ048147>