From 8879afdc8c57764561a354cb801c0e982bdef626 Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 25 May 2008 02:54:58 +0000 Subject: [PATCH] Enable building of GLX and SDLGL renderers. ok oga@, claudio@ (maintainer) --- games/quake2/Makefile | 7 ++-- games/quake2/patches/patch-src_gl_rmain_c | 12 +++++++ games/quake2/patches/patch-src_glw_h | 12 +++++++ games/quake2/patches/patch-src_qgl_c | 39 +++++++++++++++++++++++ games/quake2/patches/patch-src_vid_menu_c | 37 +++++++++++++++++++++ games/quake2/pkg/PLIST | 6 +++- 6 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 games/quake2/patches/patch-src_gl_rmain_c create mode 100644 games/quake2/patches/patch-src_glw_h create mode 100644 games/quake2/patches/patch-src_qgl_c create mode 100644 games/quake2/patches/patch-src_vid_menu_c diff --git a/games/quake2/Makefile b/games/quake2/Makefile index 55fb21398e5..9c38895e46a 100644 --- a/games/quake2/Makefile +++ b/games/quake2/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2008/01/11 12:27:54 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.10 2008/05/25 02:54:58 jsg Exp $ ONLY_FOR_ARCHS= i386 SHARED_ONLY= Yes @@ -6,7 +6,7 @@ SHARED_ONLY= Yes COMMENT= first person shooter DISTNAME= quake2-0.3 -PKGNAME= ${DISTNAME}p5 +PKGNAME= ${DISTNAME}p6 CATEGORIES= games HOMEPAGE= http://www.quakeforge.net/ @@ -18,7 +18,7 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -WANTLIB= ICE SM X11 Xext Xau Xdmcp Xrandr Xrender Xxf86dga \ +WANTLIB= ICE GL SM X11 Xext Xau Xdmcp Xrandr Xrender Xxf86dga \ Xxf86vm c m ossaudio pthread usbhid MASTER_SITES= http://humppa.nl/distfiles/ @@ -31,6 +31,7 @@ USE_X11= Yes USE_LIBTOOL= Yes LIBTOOL_FLAGS= --tag=disable-static CONFIGURE_STYLE= gnu +CONFIGURE_ARGS+= --with-opengl=${X11BASE} NO_REGRESS= Yes CFLAGS+= -pthread -g diff --git a/games/quake2/patches/patch-src_gl_rmain_c b/games/quake2/patches/patch-src_gl_rmain_c new file mode 100644 index 00000000000..38f03354bad --- /dev/null +++ b/games/quake2/patches/patch-src_gl_rmain_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-src_gl_rmain_c,v 1.1 2008/05/25 02:54:58 jsg Exp $ +--- src/gl_rmain.c.orig Sat May 24 21:12:32 2008 ++++ src/gl_rmain.c Sat May 24 21:13:27 2008 +@@ -1060,7 +1060,7 @@ void R_Register( void ) + #ifdef _WIN32 + gl_driver = ri.Cvar_Get( "gl_driver", "opengl32", CVAR_ARCHIVE ); + #else +- gl_driver = ri.Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE ); ++ gl_driver = ri.Cvar_Get( "gl_driver", "libGL.so", CVAR_ARCHIVE ); + #endif + gl_texturemode = ri.Cvar_Get( "gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE ); + gl_texturealphamode = ri.Cvar_Get( "gl_texturealphamode", "default", CVAR_ARCHIVE ); diff --git a/games/quake2/patches/patch-src_glw_h b/games/quake2/patches/patch-src_glw_h new file mode 100644 index 00000000000..a655feb9bf0 --- /dev/null +++ b/games/quake2/patches/patch-src_glw_h @@ -0,0 +1,12 @@ +$OpenBSD: patch-src_glw_h,v 1.1 2008/05/25 02:54:58 jsg Exp $ +--- src/glw.h.orig Sat May 24 20:42:41 2008 ++++ src/glw.h Sat May 24 20:42:52 2008 +@@ -30,7 +30,7 @@ + #ifndef __GLW_H__ + #define __GLW_H__ + +-#if defined (__linux__) || defined (__bsd__) || defined (__sgi) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__sun__) ++#if defined (__linux__) || defined (__bsd__) || defined (__sgi) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__sun__) || defined(__OpenBSD__) + + typedef struct + { diff --git a/games/quake2/patches/patch-src_qgl_c b/games/quake2/patches/patch-src_qgl_c new file mode 100644 index 00000000000..85b4ae86612 --- /dev/null +++ b/games/quake2/patches/patch-src_qgl_c @@ -0,0 +1,39 @@ +$OpenBSD: patch-src_qgl_c,v 1.1 2008/05/25 02:54:58 jsg Exp $ +--- src/qgl.c.orig Sat May 24 20:42:30 2008 ++++ src/qgl.c Sat May 24 20:42:47 2008 +@@ -70,7 +70,7 @@ static FILE * log_fp = NULL; + #endif + + /* merged in from qgl_bsd.c -- jaq */ +-#if defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun__) ++#if defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun__) || defined(__OpenBSD__) + /* + //FX Mesa Functions + fxMesaContext (*qfxMesaCreateContext)(GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]); +@@ -3020,7 +3020,7 @@ void QGL_Shutdown( void ) + qglVertexPointer = NULL; + qglViewport = NULL; + /* merged in from qgl_bsd.c -- jaq */ +-#if defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__) ++#if defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + /* + qfxMesaCreateContext = NULL; + qfxMesaCreateBestContext = NULL; +@@ -3041,7 +3041,7 @@ void QGL_Shutdown( void ) + } + + /* merged in from qgl_bsd.c -- jaq */ +-#if defined(__linux__) || defined (__FreeBSD__) || defined(__NetBSD__) || defined (__sun__) ++#if defined(__linux__) || defined (__FreeBSD__) || defined(__NetBSD__) || defined (__sun__) || defined(__OpenBSD__) + #define GPA( a ) dlsym( glw_state.OpenGLLib, a ) + + void *qwglGetProcAddress(char *symbol) +@@ -3444,7 +3444,7 @@ qboolean QGL_Init( const char *dllname ) + qglVertexPointer = dllVertexPointer = GPA( "glVertexPointer" ); + qglViewport = dllViewport = GPA( "glViewport" ); + /* merged in from qgl_bsd.c -- jaq */ +-#if defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun__) ++#if defined(__bsd__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun__) || defined(__OpenBSD__) + /* + qfxMesaCreateContext = GPA("fxMesaCreateContext"); + qfxMesaCreateBestContext = GPA("fxMesaCreateBestContext"); diff --git a/games/quake2/patches/patch-src_vid_menu_c b/games/quake2/patches/patch-src_vid_menu_c new file mode 100644 index 00000000000..1d7a3a45d17 --- /dev/null +++ b/games/quake2/patches/patch-src_vid_menu_c @@ -0,0 +1,37 @@ +$OpenBSD: patch-src_vid_menu_c,v 1.1 2008/05/25 02:54:58 jsg Exp $ +--- src/vid_menu.c.orig Sat May 24 21:12:38 2008 ++++ src/vid_menu.c Sat May 24 21:13:15 2008 +@@ -164,21 +164,21 @@ static void ApplyChanges( void *unused ) + case REF_GLX: + Cvar_Set( "vid_ref", "glx" ); + /* below is wrong if we use different libs for different GL reflibs */ +- Cvar_Set( "gl_driver", "libGL.so.1" ); ++ Cvar_Set( "gl_driver", "libGL.so" ); + if (gl_driver->modified) + vid_ref->modified = true; + break; + case REF_SDLGL: + Cvar_Set( "vid_ref", "sdlgl" ); + /* below is wrong if we use different libs for different GL reflibs */ +- Cvar_Set( "gl_driver", "libGL.so.1" ); ++ Cvar_Set( "gl_driver", "libGL.so" ); + if (gl_driver->modified) + vid_ref->modified = true; + break; + case REF_FXGL: + Cvar_Set("vid_ref", "tdfx"); + /* below is wrong if we use different libs for different GL reflibs */ +- Cvar_Set( "gl_driver", "libGL.so.1" ); ++ Cvar_Set( "gl_driver", "libGL.so" ); + if (gl_driver->modified) + vid_ref->modified = true; + break; +@@ -260,7 +260,7 @@ void VID_MenuInit( void ) + int i; + + if ( !gl_driver ) +- gl_driver = Cvar_Get( "gl_driver", "libGL.so.1", 0 ); ++ gl_driver = Cvar_Get( "gl_driver", "libGL.so", 0 ); + if ( !gl_picmip ) + gl_picmip = Cvar_Get( "gl_picmip", "0", 0 ); + if ( !gl_mode ) diff --git a/games/quake2/pkg/PLIST b/games/quake2/pkg/PLIST index 60dcd012e5c..4d027e0bed4 100644 --- a/games/quake2/pkg/PLIST +++ b/games/quake2/pkg/PLIST @@ -1,4 +1,4 @@ -@comment $OpenBSD: PLIST,v 1.2 2007/04/07 12:13:41 steven Exp $ +@comment $OpenBSD: PLIST,v 1.3 2008/05/25 02:54:58 jsg Exp $ bin/quake2 lib/quake2/ lib/quake2/baseq2/ @@ -7,6 +7,10 @@ lib/quake2/baseq2/game.so lib/quake2/ctf/ lib/quake2/ctf/game.la lib/quake2/ctf/game.so +lib/quake2/ref_glx.la +lib/quake2/ref_glx.so +lib/quake2/ref_sdlgl.la +lib/quake2/ref_sdlgl.so lib/quake2/ref_softsdl.la lib/quake2/ref_softsdl.so lib/quake2/ref_softx.la