From 96da4e29348459743a07956e535ac2742cfda8fa Mon Sep 17 00:00:00 2001 From: sthen Date: Mon, 13 Apr 2009 23:24:01 +0000 Subject: [PATCH] import graphics/glew: The goal of the OpenGL Extension Wrangler Library (GLEW) is to assist C/C++ OpenGL developers with two tedious tasks: initializing and using extensions and writing portable applications. GLEW provides an efficient run-time mechanism to determine whether a certain extension is supported by the driver or not. OpenGL core and extension functionality is exposed via a single header file. --- graphics/glew/Makefile | 54 +++++++++++++++++++ graphics/glew/distinfo | 5 ++ graphics/glew/files/Makefile.openbsd | 21 ++++++++ graphics/glew/patches/patch-Makefile | 34 ++++++++++++ graphics/glew/patches/patch-include_GL_glew_h | 11 ++++ graphics/glew/pkg/DESCR | 6 +++ graphics/glew/pkg/PFRAG.shared | 2 + graphics/glew/pkg/PLIST | 23 ++++++++ 8 files changed, 156 insertions(+) create mode 100644 graphics/glew/Makefile create mode 100644 graphics/glew/distinfo create mode 100644 graphics/glew/files/Makefile.openbsd create mode 100644 graphics/glew/patches/patch-Makefile create mode 100644 graphics/glew/patches/patch-include_GL_glew_h create mode 100644 graphics/glew/pkg/DESCR create mode 100644 graphics/glew/pkg/PFRAG.shared create mode 100644 graphics/glew/pkg/PLIST diff --git a/graphics/glew/Makefile b/graphics/glew/Makefile new file mode 100644 index 00000000000..00884360d07 --- /dev/null +++ b/graphics/glew/Makefile @@ -0,0 +1,54 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2009/04/13 23:24:01 sthen Exp $ + +COMMENT= GL Extension Wrangler library + +DISTNAME= glew-1.5.1-src +PKGNAME= ${DISTNAME:S/-src//} +CATEGORIES= graphics +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=glew/} +EXTRACT_SUFX= .tgz + +SHARED_LIBS= GLEW 1.0 + +HOMEPAGE= http://glew.sourceforge.net/ + +MAINTAINER= Brad Smith + +# BSD +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes +WANTLIB= GL GLU X11 Xext Xi Xmu c m + +WRKDIST= ${WRKDIR}/glew + +MAKE_ENV= LIBGLEW_VERSION=${LIBGLEW_VERSION} +MAKE_FLAGS= LD=${CC} + +USE_X11= Yes +USE_GMAKE= Yes + +NO_REGRESS= Yes + +post-extract: + @perl -pi -e 's/\r\n/\n/;' \ + ${WRKSRC}/Makefile ${WRKSRC}/config/config.guess \ + ${WRKSRC}/include/GL/*.h ${WRKSRC}/doc/*.{css,html} + @cp ${FILESDIR}/Makefile.openbsd ${WRKSRC}/config + +do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/include/GL + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/glew + ${INSTALL_PROGRAM} ${WRKSRC}/bin/glewinfo ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/bin/visualinfo ${PREFIX}/bin + if [ -f ${WRKSRC}/lib/libGLEW.so.* ]; then \ + ${INSTALL_PROGRAM} ${WRKSRC}/lib/libGLEW.so.* ${PREFIX}/lib; \ + fi + ${INSTALL_DATA} ${WRKSRC}/lib/libGLEW.a ${PREFIX}/lib + ${INSTALL_DATA} ${WRKSRC}/include/GL/*.h ${PREFIX}/include/GL +.for i in css html jpg png + ${INSTALL_DATA} ${WRKSRC}/doc/*.${i} ${PREFIX}/share/doc/glew +.endfor + +.include diff --git a/graphics/glew/distinfo b/graphics/glew/distinfo new file mode 100644 index 00000000000..78b1f9e2c85 --- /dev/null +++ b/graphics/glew/distinfo @@ -0,0 +1,5 @@ +MD5 (glew-1.5.1-src.tgz) = dZpZhT36rk0Ae0FKPBcS8g== +RMD160 (glew-1.5.1-src.tgz) = kg/f9VmXZJKi5qz5PTsC6Chva3s= +SHA1 (glew-1.5.1-src.tgz) = qUETFp1GSHzNobsv3mj6GAO98Ak= +SHA256 (glew-1.5.1-src.tgz) = ieY9CFy1Y8MqGR481JB6GSSE8QQ4pmefE0lFbbS5wQo= +SIZE (glew-1.5.1-src.tgz) = 394566 diff --git a/graphics/glew/files/Makefile.openbsd b/graphics/glew/files/Makefile.openbsd new file mode 100644 index 00000000000..fd2273c94a6 --- /dev/null +++ b/graphics/glew/files/Makefile.openbsd @@ -0,0 +1,21 @@ +NAME = $(GLEW_NAME) +CC ?= cc +LD ?= cc +ifneq (undefined, $(origin GLEW_MX)) +CFLAGS.EXTRA = -DGLEW_MX +endif +LDFLAGS.SO = -shared +LDFLAGS.EXTRA = -L$(X11BASE)/lib +LDFLAGS.GL = -lm -lXmu -lXi -lGLU -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +CFLAGS.EXTRA += -I$(X11BASE)/include +NAME = GLEW +WARN = -Wall -W +POPT = +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(LIBGLEW_VERSION) +LIB.STATIC = lib$(NAME).a +SHARED_OBJ_EXT = so diff --git a/graphics/glew/patches/patch-Makefile b/graphics/glew/patches/patch-Makefile new file mode 100644 index 00000000000..bbec520ac20 --- /dev/null +++ b/graphics/glew/patches/patch-Makefile @@ -0,0 +1,34 @@ +$OpenBSD: patch-Makefile,v 1.1.1.1 2009/04/13 23:24:01 sthen Exp $ +--- Makefile.orig Mon Apr 13 02:13:48 2009 ++++ Makefile Mon Apr 13 02:15:10 2009 +@@ -59,7 +59,7 @@ else + OPT = $(POPT) + endif + INCLUDE = -Iinclude +-CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA) ++CFLAGS += $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA) + + LIB.SRCS = src/glew.c + LIB.OBJS = $(LIB.SRCS:.c=.o) +@@ -85,11 +85,6 @@ lib/$(LIB.STATIC): $(LIB.OBJS) + + lib/$(LIB.SHARED): $(LIB.SOBJS) + $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) +-ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw) +-else +- $(LN) $(LIB.SHARED) lib/$(LIB.SONAME) +- $(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK) +-endif + + bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.SRCS) lib/$(LIB.SHARED) + $(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.SRCS) $(BIN.LIBS) +@@ -99,6 +94,9 @@ bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.SRCS) lib/$(LI + + %.o: %.c + $(CC) -c $(CFLAGS) -o $@ $< ++ ++%.so: %.c ++ $(CC) -c $(CFLAGS) -fPIC -o $@ $< + + src/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + $(CC) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< diff --git a/graphics/glew/patches/patch-include_GL_glew_h b/graphics/glew/patches/patch-include_GL_glew_h new file mode 100644 index 00000000000..d71005f79bd --- /dev/null +++ b/graphics/glew/patches/patch-include_GL_glew_h @@ -0,0 +1,11 @@ +$OpenBSD: patch-include_GL_glew_h,v 1.1.1.1 2009/04/13 23:24:01 sthen Exp $ +--- include/GL/glew.h.orig Sun Apr 12 23:12:58 2009 ++++ include/GL/glew.h Sun Apr 12 23:14:00 2009 +@@ -12244,6 +12244,7 @@ GLEWAPI const GLubyte* glewGetString (GLenum name); + #undef GLEW_APIENTRY_DEFINED + #undef APIENTRY + #undef GLAPIENTRY ++#define GLAPIENTRY + #endif + + #ifdef GLEW_CALLBACK_DEFINED diff --git a/graphics/glew/pkg/DESCR b/graphics/glew/pkg/DESCR new file mode 100644 index 00000000000..c6c5ce2baef --- /dev/null +++ b/graphics/glew/pkg/DESCR @@ -0,0 +1,6 @@ +The goal of the OpenGL Extension Wrangler Library (GLEW) is to assist +C/C++ OpenGL developers with two tedious tasks: initializing and using +extensions and writing portable applications. GLEW provides an efficient +run-time mechanism to determine whether a certain extension is supported +by the driver or not. OpenGL core and extension functionality is exposed +via a single header file. diff --git a/graphics/glew/pkg/PFRAG.shared b/graphics/glew/pkg/PFRAG.shared new file mode 100644 index 00000000000..49b768161f4 --- /dev/null +++ b/graphics/glew/pkg/PFRAG.shared @@ -0,0 +1,2 @@ +@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2009/04/13 23:24:01 sthen Exp $ +@lib lib/libGLEW.so.${LIBGLEW_VERSION} diff --git a/graphics/glew/pkg/PLIST b/graphics/glew/pkg/PLIST new file mode 100644 index 00000000000..d6c37776dd4 --- /dev/null +++ b/graphics/glew/pkg/PLIST @@ -0,0 +1,23 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2009/04/13 23:24:01 sthen Exp $ +%%SHARED%% +@bin bin/glewinfo +@bin bin/visualinfo +include/GL/ +include/GL/glew.h +include/GL/glxew.h +include/GL/wglew.h +lib/libGLEW.a +share/doc/glew/ +share/doc/glew/advanced.html +share/doc/glew/basic.html +share/doc/glew/credits.html +share/doc/glew/glew.css +share/doc/glew/glew.html +share/doc/glew/glew.png +share/doc/glew/glxew.html +share/doc/glew/index.html +share/doc/glew/install.html +share/doc/glew/log.html +share/doc/glew/new.png +share/doc/glew/ogl_sm.jpg +share/doc/glew/wglew.html