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.
This commit is contained in:
sthen 2009-04-13 23:24:01 +00:00
parent 652d654b3f
commit 96da4e2934
8 changed files with 156 additions and 0 deletions

54
graphics/glew/Makefile Normal file
View File

@ -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 <brad@comstyle.com>
# 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 <bsd.port.mk>

5
graphics/glew/distinfo Normal file
View File

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

View File

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

View File

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

View File

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

6
graphics/glew/pkg/DESCR Normal file
View File

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

View File

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

23
graphics/glew/pkg/PLIST Normal file
View File

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