Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jul 2008 05:53:30 GMT
From:      "Pedro F. Giffuni" <giffunip@tutopia.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/125705: resurrect graphics/mesagl in a mangled version
Message-ID:  <200807170553.m6H5rUIB019039@www.freebsd.org>
Resent-Message-ID: <200807170600.m6H608uj035664@freefall.freebsd.org>

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

>Number:         125705
>Category:       ports
>Synopsis:       resurrect graphics/mesagl in a mangled version
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 17 06:00:08 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Pedro F. Giffuni
>Release:        6.3-Release
>Organization:
>Environment:
FreeBSD kakumen.cable.net.co 6.3-RELEASE FreeBSD 6.3-RELEASE #10: Sat Jan 19 01:13:55 COT 2008     root@kakumen.cable.net.co:/usr/src/sys/amd64/compile/SMP  amd64

>Description:
In order to do off-screen rendering it is frequently desired to have a Mangled version of Mesa that will not collide with the system GL.
A site that explains how to do this is here:
http://www.vtk.org/Wiki/VTK:How_I_mangled_Mesa

I looked at the older graphics/mesagl ports stuff from the Attic that we carried with XFree86 as it gave a good starting point. Other good ideas/patches were borrowed from the VisIt authors at llnl:
https://wci.llnl.gov/codes/visit/

An upcoming update for math/vtk5 will support this feature.

>How-To-Repeat:

>Fix:
Here is the complete port:
# 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:
#
#	./mesagl
#	./mesagl/Makefile
#	./mesagl/distinfo
#	./mesagl/files
#	./mesagl/files/patch-configure
#	./mesagl/files/patch-Make-config
#	./mesagl/files/patch-src+config.h
#	./mesagl/files/patch-include+GL+glx_mangle.h
#	./mesagl/pkg-plist
#	./mesagl/pkg-descr
#
echo c - ./mesagl
mkdir -p ./mesagl > /dev/null 2>&1
echo x - ./mesagl/Makefile
sed 's/^X//' >./mesagl/Makefile << 'END-of-./mesagl/Makefile'
X# New ports collection makefile for:    mesagl
X# Date created:         Tue Feb  7 12:02:49  1995
X# Whom:                 pfg
X#
X# $FreeBSD$
X#
X
XPORTNAME=	mesagl
XPORTVERSION=	5.0.2
XCATEGORIES=	graphics
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE} \
X		ftp://ftp.fu-berlin.de/pub/unix/X11/graphics/Mesa/
XMASTER_SITE_SUBDIR=	mesa3d
XPKGNAMESUFFIX=	-mangled
XDISTNAME=	MesaLib-${PORTVERSION}
X
XMAINTAINER=	giffunip@tutopia.org
XCOMMENT=	A graphics library similar to SGI's OpenGL - mangled version
X
XUSE_BZIP2=	yes
XUSE_LDCONFIG=	yes
X
XUSE_XORG=	xxf86vm xext xfixes xdamage
XUSE_GMAKE=	yes
X
XWRKSRC= 	${WRKDIR}/Mesa-${PORTVERSION}
XGLINC=		gl.h gl_mangle.h glu.h glu_mangle.h glx.h glx_mangle.h	\
X		glext.h glxext.h osmesa.h xmesa.h xmesa_x.h xmesa_xf86.h
XGLLIB=		GL GLU GLw OSMesa
XGLVER=		14
X
XMAKEFILE=	Makefile.X11
XALL_TARGET=	realclean freebsd
X
Xdo-install:
X	@${MKDIR} ${PREFIX}/include/Mesa/GL
X.for i in ${GLINC}
X	@${INSTALL_DATA} ${WRKSRC}/include/GL/${i} ${PREFIX}/include/Mesa/GL/
X.endfor
X	@${MKDIR} ${PREFIX}/lib
X.for l in ${GLLIB}
X	@${INSTALL_DATA} ${WRKSRC}/lib/libMesa${l}.a ${PREFIX}/lib/
X	@${INSTALL_DATA} ${WRKSRC}/lib/libMesa${l}.so.?.? ${PREFIX}/lib/libMesa${l}.so.${GLVER}
X	@${LN} -sf ${PREFIX}/lib/libMesa${l}.so.${GLVER} ${PREFIX}/lib/libMesa${l}.so
X.endfor
X
X.include <bsd.port.mk>
END-of-./mesagl/Makefile
echo x - ./mesagl/distinfo
sed 's/^X//' >./mesagl/distinfo << 'END-of-./mesagl/distinfo'
XMD5 (MesaLib-5.0.2.tar.bz2) = 7b4bf9261657c2fca03796d4955e6f50
XSHA256 (MesaLib-5.0.2.tar.bz2) = e63d42092d65dac4d1b2493a5c14ec0bcb1d3b8dfe6769e0ca4914b559aa5eb3
XSIZE (MesaLib-5.0.2.tar.bz2) = 1719544
END-of-./mesagl/distinfo
echo c - ./mesagl/files
mkdir -p ./mesagl/files > /dev/null 2>&1
echo x - ./mesagl/files/patch-configure
sed 's/^X//' >./mesagl/files/patch-configure << 'END-of-./mesagl/files/patch-configure'
X--- configure.orig	Fri Nov  7 12:00:34 2003
X+++ configure	Thu Mar  2 16:13:38 2006
X@@ -1885,10 +1885,10 @@
X 
X # For Mesa-specific libs like libOSMesa.
X LIBMESA_VERSION_INFO=4:${MESA_VERSION}:0    # Mesa 5.0.2
X-LIBGL_VERSION_INFO=5:${MESA_VERSION}:4      # OpenGL 1.4
X-LIBGLU_VERSION_INFO=2:${MESA_VERSION}:1     # GLU 1.1
X-SI_GLU_VERSION_INFO=4:${MESA_VERSION}:3     # GLU 1.3
X-LIBGLUT_VERSION_INFO=10:1:7                 # GLUT 3.7
X+LIBGL_VERSION_INFO=${GLVER}:0
X+LIBGLU_VERSION_INFO=${GLVER}:0
X+SI_GLU_VERSION_INFO=${GLVER}:0
X+LIBGLUT_VERSION_INFO=${GLUTVER}:0
X 
X 
X 
X@@ -7920,6 +7920,7 @@
X 
X # This can be used to rebuild libtool when needed
X LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
X+$ac_aux_dir/ltconfig $LIBTOOL_DEPS
X 
X # Always use our own libtool.
X LIBTOOL='$(SHELL) $(top_builddir)/libtool'
X@@ -8849,7 +8850,7 @@
X 
X     echo "$as_me:$LINENO: result: yes" >&5
X echo "${ECHO_T}yes" >&6
X-    CFLAGS="$CFLAGS -D_REENTRANT -DPTHREADS"
X+    CFLAGS="$CFLAGS -D_THREAD_SAFE -D_REENTRANT -DPTHREADS"
X     THREAD_LIBS="$THREAD_LIBS -lpthread"
X else
X   echo "$as_me: failed program was:" >&5
END-of-./mesagl/files/patch-configure
echo x - ./mesagl/files/patch-Make-config
sed 's/^X//' >./mesagl/files/patch-Make-config << 'END-of-./mesagl/files/patch-Make-config'
X--- Make-config.orig	2003-09-03 09:29:56.000000000 -0500
X+++ Make-config	2008-07-16 18:25:59.000000000 -0500
X@@ -214,18 +214,18 @@
X 
X freebsd:
X 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
X-	"GL_LIB = libGL.a" \
X-	"GLU_LIB = libGLU.a" \
X-	"GLUT_LIB = libglut.a" \
X-	"GLW_LIB = libGLw.a" \
X-	"OSMESA_LIB = libOSMesa.a" \
X-	"CC = gcc" \
X-	"CPLUSPLUS = g++" \
X-	"CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100" \
X-	"CCFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100" \
X+	"GL_LIB = libMesaGL.a" \
X+	"GLU_LIB = libMesaGLU.a" \
X+	"GLUT_LIB = libMesaGlut.a" \
X+	"GLW_LIB = libMesaGLw.a" \
X+	"OSMESA_LIB = libMesaOSMesa.a" \
X+	"CC ?= cc" \
X+	"CPLUSPLUS = ${CXX}" \
X+	"CFLAGS += -O2 -fPIC -I/usr/local/include -DUSE_MGL_NAMESPACE -DUSE_XSHM -DHZ=100" \
X+	"CCFLAGS += -O2 -fPIC -I/usr/local/include -DUSE_MGL_NAMESPACE -DUSE_XSHM -DHZ=100" \
X 	"GLUT_CFLAGS = -fexceptions" \
X 	"MAKELIB = ../bin/mklib.freebsd" \
X-	"APP_LIB_DEPS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
X+	"APP_LIB_DEPS = -L/usr/local/lib -lXext -lXmu -lXi -lX11 -lm"
X 
X freebsd-386:
X 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
END-of-./mesagl/files/patch-Make-config
echo x - ./mesagl/files/patch-src+config.h
sed 's/^X//' >./mesagl/files/patch-src+config.h << 'END-of-./mesagl/files/patch-src+config.h'
X--- src/config.h.orig	2008-07-15 00:16:29.000000000 -0500
X+++ src/config.h	2008-07-15 00:19:17.000000000 -0500
X@@ -118,8 +118,8 @@
X #define MAX_TEXTURE_UNITS 8
X 
X /* Maximum viewport/image size: */
X-#define MAX_WIDTH 2048
X-#define MAX_HEIGHT 2048
X+#define MAX_WIDTH 4096
X+#define MAX_HEIGHT 4096
X 
X /* Maxmimum size for CVA.  May be overridden by the drivers.  */
X #define MAX_ARRAY_LOCK_SIZE 3000
X@@ -162,7 +162,7 @@
X  * rasterizer code.
X  */
X #ifndef DEFAULT_SOFTWARE_DEPTH_BITS
X-#define DEFAULT_SOFTWARE_DEPTH_BITS 16
X+#define DEFAULT_SOFTWARE_DEPTH_BITS 24
X #endif
X #if DEFAULT_SOFTWARE_DEPTH_BITS <= 16
X #define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
END-of-./mesagl/files/patch-src+config.h
echo x - ./mesagl/files/patch-include+GL+glx_mangle.h
sed 's/^X//' >./mesagl/files/patch-include+GL+glx_mangle.h << 'END-of-./mesagl/files/patch-include+GL+glx_mangle.h'
X--- include/GL/glx_mangle.h.orig	2008-07-15 00:24:26.000000000 -0500
X+++ include/GL/glx_mangle.h	2008-07-15 00:26:19.000000000 -0500
X@@ -51,5 +51,59 @@
X /* GLX 1.4 */
X #define glXGetProcAddress mglXGetProcAddress
X 
X+/* ADDED by KSB@llnl for VisIt */
X+
X+#define glXAllocateMemoryNV mglXAllocateMemoryNV
X+#define glXBindChannelToWindowSGIX mglXBindChannelToWindowSGIX
X+#define glXBindSwapBarrierSGIX mglXBindSwapBarrierSGIX
X+#define glXChannelRectSGIX mglXChannelRectSGIX
X+#define glXChannelRectSyncSGIX mglXChannelRectSyncSGIX
X+#define glXChooseFBConfig mglXChooseFBConfig
X+#define glXChooseFBConfigSGIX mglXChooseFBConfigSGIX
X+#define glXCreateContextWithConfigSGIX mglXCreateContextWithConfigSGIX
X+#define glXCreateGLXPbufferSGIX mglXCreateGLXPbufferSGIX
X+#define glXCreateGLXPixmapWithConfigSGIX mglXCreateGLXPixmapWithConfigSGIX
X+#define glXCreateNewContext mglXCreateNewContext
X+#define glXCreatePbuffer mglXCreatePbuffer
X+#define glXCreatePixmap mglXCreatePixmap
X+#define glXCreateWindow mglXCreateWindow
X+#define glXCushionSGI mglXCushionSGI
X+#define glXDestroyGLXPbufferSGIX mglXDestroyGLXPbufferSGIX
X+#define glXDestroyPbuffer mglXDestroyPbuffer
X+#define glXDestroyPixmap mglXDestroyPixmap
X+#define glXDestroyWindow mglXDestroyWindow
X+#define glXFreeContextEXT mglXFreeContextEXT
X+#define glXFreeMemoryNV mglXFreeMemoryNV
X+#define glXGetContextIDEXT mglXGetContextIDEXT
X+#define glXGetCurrentDisplay mglXGetCurrentDisplay
X+#define glXGetCurrentDisplayEXT mglXGetCurrentDisplayEXT
X+#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
X+#define glXGetCurrentReadDrawableSGI mglXGetCurrentReadDrawableSGI
X+#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
X+#define glXGetFBConfigAttribSGIX mglXGetFBConfigAttribSGIX
X+#define glXGetFBConfigFromVisualSGIX mglXGetFBConfigFromVisualSGIX
X+#define glXGetFBConfigs mglXGetFBConfigs
X+#define glXGetProcAddressARB mglXGetProcAddressARB
X+#define glXGetSelectedEvent mglXGetSelectedEvent
X+#define glXGetSelectedEventSGIX mglXGetSelectedEventSGIX
X+#define glXGetTransparentIndexSUN mglXGetTransparentIndexSUN
X+#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
X+#define glXGetVisualFromFBConfigSGIX mglXGetVisualFromFBConfigSGIX
X+#define glXImportContextEXT mglXImportContextEXT
X+#define glXJoinSwapGroupSGIX mglXJoinSwapGroupSGIX
X+#define glXMakeContextCurrent mglXMakeContextCurrent
X+#define glXMakeCurrentReadSGI mglXMakeCurrentReadSGI
X+#define glXQueryChannelDeltasSGIX mglXQueryChannelDeltasSGIX
X+#define glXQueryChannelRectSGIX mglXQueryChannelRectSGIX
X+#define glXQueryContext mglXQueryContext
X+#define glXQueryContextInfoEXT mglXQueryContextInfoEXT
X+#define glXQueryDrawable mglXQueryDrawable
X+#define glXQueryGLXPbufferSGIX mglXQueryGLXPbufferSGIX
X+#define glXQueryMaxSwapBarriersSGIX mglXQueryMaxSwapBarriersSGIX
X+#define glXSelectEvent mglXSelectEvent
X+#define glXSelectEventSGIX mglXSelectEventSGIX
X+#define glXSet3DfxModeMESA mglXSet3DfxModeMESA
X+#define glXSwapIntervalSGI mglXSwapIntervalSGI
X+
X 
X #endif
END-of-./mesagl/files/patch-include+GL+glx_mangle.h
echo x - ./mesagl/pkg-plist
sed 's/^X//' >./mesagl/pkg-plist << 'END-of-./mesagl/pkg-plist'
Xinclude/Mesa/GL/gl.h
Xinclude/Mesa/GL/gl_mangle.h
Xinclude/Mesa/GL/glu.h
Xinclude/Mesa/GL/glu_mangle.h
Xinclude/Mesa/GL/glx.h
Xinclude/Mesa/GL/glx_mangle.h
Xinclude/Mesa/GL/glext.h
Xinclude/Mesa/GL/glxext.h
Xinclude/Mesa/GL/osmesa.h
Xinclude/Mesa/GL/xmesa.h
Xinclude/Mesa/GL/xmesa_x.h
Xinclude/Mesa/GL/xmesa_xf86.h
Xlib/libMesaGL.a
Xlib/libMesaGL.so
Xlib/libMesaGL.so.14
Xlib/libMesaGLU.a
Xlib/libMesaGLU.so
Xlib/libMesaGLU.so.14
Xlib/libMesaGLw.a
Xlib/libMesaGLw.so
Xlib/libMesaGLw.so.14
Xlib/libMesaOSMesa.a
Xlib/libMesaOSMesa.so
Xlib/libMesaOSMesa.so.14
X@dirrm include/Mesa/GL
X@dirrm include/Mesa
END-of-./mesagl/pkg-plist
echo x - ./mesagl/pkg-descr
sed 's/^X//' >./mesagl/pkg-descr << 'END-of-./mesagl/pkg-descr'
XMesa is a 3-D graphics library with an API which is very similar to that
Xof OpenGL*.  To the extent that Mesa utilizes the OpenGL command syntax or 
Xstate machine, it is being used with authorization from Silicon Graphics, 
XInc.  However, the author makes no claim that Mesa is in any way a 
Xcompatible replacement for OpenGL or associated with Silicon Graphics, Inc.
X
XThis is a Mangled version of Mesa in order to do off-screen rendering in 
Xother packages like VTK. Offscreen rendering is useful for a 
Xnumber of things, such as batch processing, parallel processing, and 
Xremote processing.
X
XWWW: http://www.mesa3d.org/
END-of-./mesagl/pkg-descr
exit



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



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