Subject: Package needed for icculus.org quake 3
To: None <pkgsrc-users@netbsd.org>
From: Yorick Hardy <yhardy@uj.ac.za>
List: pkgsrc-users
Date: 03/29/2007 16:29:34
This is a multi-part message in MIME format.
--------------000900070005000302030205
Content-Type: text/plain; charset=US-ASCII; format=flowed
Content-Transfer-Encoding: 7bit

Since drm is working for some users in current,
quake 3 is now viable.

Is someone willing to make a package of icculus.org quake3?

The website is
http://www.ioquake3.org/

The source code is available at
http://ioquake3.org/files/ioquake3_1.34-rc3.tar.bz2

The demo pk3 files are included in
ftp://ftp.idsoftware.com/idstuff/quake3/linux/linuxq3ademo-1.11-6.x86.gz.sh
which is just a shell script with a tarball appended.

Updated pk3 files are needed from (license must be agreed to)
http://www.ioquake3.org/?page=getdata

Dependencies:
libSDL
OpenAL (I think it can work without this, I did not try)

I used the attached q3.patch.

I used the following procedure to build

#where to install
TARGET=/usr/pkg

#needs gnu make
MAKE=gmake

${MAKE} COPYDIR=${TARGET}/share/quake3arena &&
${MAKE} COPYDIR=${TARGET}/share/quake3arena copyfiles &&
printf "#!/bin/sh\ncd ${TARGET}/share/quake3arena\nexec ./ioquake3.* 
\"\$@\"\n"\
 > ${TARGET}/bin/quake3 && \
chmod a+x ${TARGET}/bin/quake3

The pk3 files should be copied to the directory
${TARGET}/share/quake3arena/baseq3

I hope that is enough information to make a package.

-- 
Kind regards,

Yorick Hardy


--------------000900070005000302030205
Content-Type: text/plain;
 name="q3.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="q3.patch"

--- ./code/unix/unix_shared.c.orig	2006-11-29 00:05:25.000000000 +0200
+++ ./code/unix/unix_shared.c	2007-03-26 18:34:19.000000000 +0200
@@ -76,7 +76,7 @@
 	return curtime;
 }
 
-#if (defined(__linux__) || defined(__FreeBSD__) || defined(__sun)) && !defined(DEDICATED)
+#if (defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__NetBSD__)) && !defined(DEDICATED)
 /*
 ================
 Sys_XTimeToSysTime
--- ./code/unix/unix_glw.h.orig	2006-11-29 00:05:25.000000000 +0200
+++ ./code/unix/unix_glw.h	2007-03-26 18:34:19.000000000 +0200
@@ -19,7 +19,7 @@
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 ===========================================================================
 */
-#if !( defined __linux__ || defined __FreeBSD__ || defined __sun || defined MACOS_X )
+#if !( defined __linux__ || defined __FreeBSD__ || defined __sun || defined MACOS_X || defined __NetBSD__)
 #error You should include this file only on Linux/FreeBSD/Solaris platforms
 #endif
 
--- ./code/tools/asm/Makefile.orig	2006-11-29 00:05:32.000000000 +0200
+++ ./code/tools/asm/Makefile	2007-03-26 18:34:15.000000000 +0200
@@ -13,7 +13,7 @@
 endif
 
 CC=gcc
-Q3ASM_CFLAGS=-O2 -Wall -Werror -fno-strict-aliasing
+Q3ASM_CFLAGS=-O2 -Wall -fno-strict-aliasing
 
 ifeq ($(PLATFORM),darwin)
   LCC_CFLAGS += -DMACOS_X=1
--- ./code/renderer/qgl.h.orig	2006-11-29 00:05:34.000000000 +0200
+++ ./code/renderer/qgl.h	2007-03-26 18:34:15.000000000 +0200
@@ -63,7 +63,7 @@
 #include <OpenGL/CGLMacro.h>
 #endif
 
-#elif defined( __linux__ ) || defined(__FreeBSD__)
+#elif defined( __linux__ ) || defined(__FreeBSD__) || defined(__NetBSD__)
 
 #include <GL/gl.h>
 #include <GL/glx.h>
@@ -191,7 +191,7 @@
 //===========================================================================
 
 // non-dlopening systems will just redefine qgl* to gl*
-#if !defined( _WIN32 ) && !defined(MACOS_X) && !defined( __linux__ ) && !defined( __FreeBSD__ ) && !defined(__sun) // rb010123
+#if !defined( _WIN32 ) && !defined(MACOS_X) && !defined( __linux__ ) && !defined( __FreeBSD__ ) && !defined(__NetBSD__) && !defined(__sun) // rb010123
 
 #include "qgl_linked.h"
 
--- ./code/renderer/tr_types.h.orig	2007-03-26 18:37:51.000000000 +0200
+++ ./code/renderer/tr_types.h	2007-03-26 18:38:14.000000000 +0200
@@ -227,7 +227,7 @@
 
 #define _3DFX_DRIVER_NAME	"libMesaVoodooGL.so"
 // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=524
-#define OPENGL_DRIVER_NAME	"libGL.so.1"
+#define OPENGL_DRIVER_NAME	"libGL.so"
 
 #endif	// !defined _WIN32
 
--- ./code/client/qal.c.orig	2006-11-29 00:05:38.000000000 +0200
+++ ./code/client/qal.c	2007-03-26 18:34:19.000000000 +0200
@@ -44,7 +44,7 @@
 #define SYMLOAD(x,y) GetProcAddress(x,y)
 #define OBJFREE(x) FreeLibrary(x)
 
-#elif defined __linux__ || defined __FreeBSD__ || defined MACOS_X || defined __sun
+#elif defined __linux__ || defined __FreeBSD__ || defined MACOS_X || defined __sun || defined __NetBSD__
 #include <dlfcn.h>
 #define OBJTYPE void *
 #define OBJLOAD(x) dlopen(x, RTLD_LAZY | RTLD_GLOBAL)
@@ -55,7 +55,7 @@
 #error "Your platform has no lib loading code or it is disabled"
 #endif
 
-#if defined __linux__ || defined __FreeBSD__ || defined MACOS_X
+#if defined __linux__ || defined __FreeBSD__ || defined MACOS_X || defined __NetBSD__
 #include <unistd.h>
 #include <sys/types.h>
 #endif
--- ./Makefile.orig	2006-11-29 00:05:39.000000000 +0200
+++ ./Makefile	2007-03-26 18:34:19.000000000 +0200
@@ -541,10 +541,42 @@
 
   ifneq ($(ARCH),i386)
     BASE_CFLAGS += -DNO_VM_COMPILED
+  else
+    HAVE_VM_COMPILED=true
+  endif
+
+  ifeq ($(USE_OPENAL),1)
+    BASE_CFLAGS += -DUSE_OPENAL=1
+    ifeq ($(USE_OPENAL_DLOPEN),1)
+      BASE_CFLAGS += -DUSE_OPENAL_DLOPEN=1
+    endif
+  endif
+
+  ifeq ($(USE_CODEC_VORBIS),1)
+    BASE_CFLAGS += -DUSE_CODEC_VORBIS=1
+  endif
+
+  ifeq ($(USE_SDL),1)
+    BASE_CFLAGS += $(shell sdl-config --cflags) -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1
+  endif
+
+  ifeq ($(USE_SDL),1)
+    CLIENT_LDFLAGS += $(shell sdl-config --libs)
+  else
+    CLIENT_LDFLAGS += -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
+  endif
+
+  ifeq ($(USE_OPENAL),1)
+    ifneq ($(USE_OPENAL_DLOPEN),1)
+      CLIENT_LDFLAGS += $(THREAD_LDFLAGS) -lopenal -lossaudio
+    endif
+  endif
+
+  ifeq ($(USE_CODEC_VORBIS),1)
+    CLIENT_LDFLAGS += -lvorbisfile -lvorbis -logg
   endif
 
-  BUILD_CLIENT = 0
-  BUILD_GAME_QVM = 0
+  CFLAGS=$(BASE_CFLAGS)
 
 else # ifeq netbsd
 

--------------000900070005000302030205--