debian/0000755000000000000000000000000012264737170007177 5ustar debian/yamagi-quake2.prerm0000644000000000000000000000026112264737170012702 0ustar #! /bin/sh set -e if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] then update-alternatives --remove quake2-engine /usr/lib/yamagi-quake2/quake2 fi #DEBHELPER# exit 0 debian/yamagi-quake2.postinst0000644000000000000000000000022312264737170013436 0ustar #! /bin/sh set -e update-alternatives --install /usr/lib/quake2/quake2-engine quake2-engine /usr/lib/yamagi-quake2/quake2 0 #DEBHELPER# exit 0 debian/yamagi-quake2.lintian-overrides0000644000000000000000000000016712264737170015220 0ustar # intentional, to put the quake2-engine alternative in yamagi-quake2: package-contains-empty-directory usr/lib/quake2/ debian/yamagi-quake2.install0000644000000000000000000000012012264737170013215 0ustar release/quake2 usr/lib/yamagi-quake2 stuff/yq2.cfg usr/lib/yamagi-quake2/baseq2 debian/yamagi-quake2.examples0000644000000000000000000000001312264737170013366 0ustar stuff/*.sh debian/yamagi-quake2.dirs0000644000000000000000000000001712264737170012515 0ustar usr/lib/quake2 debian/yamagi-quake2-core.prerm0000644000000000000000000000026712264737170013636 0ustar #! /bin/sh set -e if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] then update-alternatives --remove quake2-engine-server /usr/lib/yamagi-quake2/q2ded fi #DEBHELPER# exit 0 debian/yamagi-quake2-core.postinst0000644000000000000000000000024012264737170014363 0ustar #! /bin/sh set -e update-alternatives --install /usr/lib/quake2/quake2-engine-server quake2-engine-server /usr/lib/yamagi-quake2/q2ded 0 #DEBHELPER# exit 0 debian/yamagi-quake2-core.lintian-overrides0000644000000000000000000000017412264737170016144 0ustar # intentional, to put the quake2-engine alternative in yamagi-quake2-core: package-contains-empty-directory usr/lib/quake2/ debian/yamagi-quake2-core.install0000644000000000000000000000013012264737170014144 0ustar release/q2ded usr/lib/yamagi-quake2 release/baseq2/game.so usr/lib/yamagi-quake2/baseq2 debian/yamagi-quake2-core.dirs0000644000000000000000000000001712264737170013443 0ustar usr/lib/quake2 debian/watch0000644000000000000000000000024212264737170010226 0ustar version=3 opts="uversionmangle=s/.*QUAKE2_//g;s/WIN32_TEST//g;s/_/./g,dversionmangle=s/.dfsg.//g" \ https://github.com/yquake2/yquake2/releases .*/(.*)\.tar\.gz debian/source/0000755000000000000000000000000012264737170010477 5ustar debian/source/format0000644000000000000000000000001412264737170011705 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000101512264737170010254 0ustar #!/usr/bin/make -f DEB_CPPFLAGS_MAINT_APPEND += -DLIBDIR=\"/usr/lib/yamagi-quake2/\" DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed -Wl,-z,defs export DEB_CPPFLAGS_MAINT_APPEND DEB_LDFLAGS_MAINT_APPEND %: dh $@ override_dh_auto_build: dh_auto_build -- \ DLOPEN_LIBGL=no \ DLOPEN_OPENAL=no \ VERBOSE=1 \ WITH_SYSTEMWIDE=yes \ WITH_SYSTEMDIR="/usr/lib/yamagi-quake2/" \ WITH_X11GAMMA=yes override_dh_installchangelogs: dh_installchangelogs CHANGELOG override_dh_installdocs: dh_installdocs CONTRIBUTE README debian/patches/0000755000000000000000000000000012264737170010626 5ustar debian/patches/series0000644000000000000000000000035012264737170012041 0ustar 0001-Append-to-C-LD-FLAGS-instead-of-overriding-them-to-o.patch 0002-Fix-spelling-errors-detected-by-lintian.patch 0003-Look-for-architecture-dependent-files-in-a-separate-.patch 0004-Optionally-link-libopenal-at-compile-time.patch debian/patches/0004-Optionally-link-libopenal-at-compile-time.patch0000644000000000000000000003740612264737170022256 0ustar From: Simon McVittie Date: Fri, 27 Sep 2013 01:35:43 +0100 Subject: Optionally link libopenal at compile time In Linux distributions, having the executable depend on the right libraries and arrange for them to be installed is straightforward, and there's a lot of infrastructure for tracking which library version a particular executable needs. Loading libopenal at runtime defeats that. The Debian packaging previously did the same for libGL, but an equivalent change was made upstream in version 5.20. --- Makefile | 19 +++- src/backends/generic/qal.c | 217 ++++++++++++++++++++++++--------------------- src/backends/unix/system.c | 16 +++- 3 files changed, 146 insertions(+), 106 deletions(-) diff --git a/Makefile b/Makefile index 3e1aada..2adec6c 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,12 @@ WITH_OGG:=yes # installed WITH_OPENAL:=yes +# Enables optional runtime loading of OpenAL (dlopen +# or similar). +# If set to "no", the library is linked in at compile +# time in the normal way. +DLOPEN_OPENAL:=yes + # Enables retexturing support. Adds # a dependency to libjpeg WITH_RETEXTURING:=yes @@ -395,15 +401,20 @@ endif endif ifeq ($(WITH_OPENAL),yes) +ifeq ($(DLOPEN_OPENAL),yes) ifeq ($(OSTYPE), OpenBSD) -release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"' +release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"' -DDLOPEN_OPENAL else ifeq ($(OSTYPE), Darwin) -release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"/System/Library/Frameworks/OpenAL.framework/OpenAL"' +release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"/System/Library/Frameworks/OpenAL.framework/OpenAL"' -DDLOPEN_OPENAL release/quake2 : LDFLAGS += -framework OpenAL else -release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' -endif +release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' -DDLOPEN_OPENAL endif +else # !DLOPEN_OPENAL +release/quake2 : CFLAGS += -DUSE_OPENAL +release/quake2 : LDFLAGS += -lopenal +endif # !DLOPEN_OPENAL +endif # WITH_OPENAL ifeq ($(WITH_ZIP),yes) release/quake2 : CFLAGS += -DZIP -DNOUNCRYPT diff --git a/src/backends/generic/qal.c b/src/backends/generic/qal.c index b3eef6d..fba2e4c 100644 --- a/src/backends/generic/qal.c +++ b/src/backends/generic/qal.c @@ -32,6 +32,8 @@ #ifdef USE_OPENAL +#define AL_ALEXT_PROTOTYPES + #if defined (__APPLE__) #include #include @@ -39,6 +41,7 @@ #include #include #include +#include #endif #include "../../common/header/common.h" @@ -48,7 +51,9 @@ static ALCcontext *context; static ALCdevice *device; static cvar_t *al_device; +#ifdef DLOPEN_OPENAL static cvar_t *al_driver; +#endif static void *handle; /* Function pointers for OpenAL management */ @@ -331,9 +336,12 @@ QAL_Shutdown() qalDeleteFilters = NULL; #endif - /* Unload the shared lib */ - Sys_FreeLibrary(handle); - handle = NULL; + if (handle) + { + /* Unload the shared lib */ + Sys_FreeLibrary(handle); + handle = NULL; + } } /* @@ -343,9 +351,11 @@ QAL_Shutdown() qboolean QAL_Init() { + al_device = Cvar_Get("al_device", "", CVAR_ARCHIVE); + +#ifdef DLOPEN_OPENAL /* DEFAULT_OPENAL_DRIVER is defined at compile time via the compiler */ al_driver = Cvar_Get("al_driver", DEFAULT_OPENAL_DRIVER, CVAR_ARCHIVE); - al_device = Cvar_Get("al_device", "", CVAR_ARCHIVE); Com_Printf("LoadLibrary(%s)\n", al_driver->string); @@ -357,109 +367,114 @@ QAL_Init() Com_Printf("Loading %s failed! Disabling OpenAL.\n", al_driver->string); return false; } +# define ALSYMBOL(handle, sym) Sys_GetProcAddress(handle, #sym) +#else + handle = NULL; +# define ALSYMBOL(handle, sym) sym +#endif /* Connect function pointers to management functions */ - qalcCreateContext = Sys_GetProcAddress(handle, "alcCreateContext"); - qalcMakeContextCurrent = Sys_GetProcAddress(handle, "alcMakeContextCurrent"); - qalcProcessContext = Sys_GetProcAddress(handle, "alcProcessContext"); - qalcSuspendContext = Sys_GetProcAddress(handle, "alcSuspendContext"); - qalcDestroyContext = Sys_GetProcAddress(handle, "alcDestroyContext"); - qalcGetCurrentContext = Sys_GetProcAddress(handle, "alcGetCurrentContext"); - qalcGetContextsDevice = Sys_GetProcAddress(handle, "alcGetContextsDevice"); - qalcOpenDevice = Sys_GetProcAddress(handle, "alcOpenDevice"); - qalcCloseDevice = Sys_GetProcAddress(handle, "alcCloseDevice"); - qalcGetError = Sys_GetProcAddress(handle, "alcGetError"); - qalcIsExtensionPresent = Sys_GetProcAddress(handle, "alcIsExtensionPresent"); - qalcGetProcAddress = Sys_GetProcAddress(handle, "alcGetProcAddress"); - qalcGetEnumValue = Sys_GetProcAddress(handle, "alcGetEnumValue"); - qalcGetString = Sys_GetProcAddress(handle, "alcGetString"); - qalcGetIntegerv = Sys_GetProcAddress(handle, "alcGetIntegerv"); - qalcCaptureOpenDevice = Sys_GetProcAddress(handle, "alcCaptureOpenDevice"); - qalcCaptureCloseDevice = Sys_GetProcAddress(handle, "alcCaptureCloseDevice"); - qalcCaptureStart = Sys_GetProcAddress(handle, "alcCaptureStart"); - qalcCaptureStop = Sys_GetProcAddress(handle, "alcCaptureStop"); - qalcCaptureSamples = Sys_GetProcAddress(handle, "alcCaptureSamples"); + qalcCreateContext = ALSYMBOL(handle, alcCreateContext); + qalcMakeContextCurrent = ALSYMBOL(handle, alcMakeContextCurrent); + qalcProcessContext = ALSYMBOL(handle, alcProcessContext); + qalcSuspendContext = ALSYMBOL(handle, alcSuspendContext); + qalcDestroyContext = ALSYMBOL(handle, alcDestroyContext); + qalcGetCurrentContext = ALSYMBOL(handle, alcGetCurrentContext); + qalcGetContextsDevice = ALSYMBOL(handle, alcGetContextsDevice); + qalcOpenDevice = ALSYMBOL(handle, alcOpenDevice); + qalcCloseDevice = ALSYMBOL(handle, alcCloseDevice); + qalcGetError = ALSYMBOL(handle, alcGetError); + qalcIsExtensionPresent = ALSYMBOL(handle, alcIsExtensionPresent); + qalcGetProcAddress = ALSYMBOL(handle, alcGetProcAddress); + qalcGetEnumValue = ALSYMBOL(handle, alcGetEnumValue); + qalcGetString = ALSYMBOL(handle, alcGetString); + qalcGetIntegerv = ALSYMBOL(handle, alcGetIntegerv); + qalcCaptureOpenDevice = ALSYMBOL(handle, alcCaptureOpenDevice); + qalcCaptureCloseDevice = ALSYMBOL(handle, alcCaptureCloseDevice); + qalcCaptureStart = ALSYMBOL(handle, alcCaptureStart); + qalcCaptureStop = ALSYMBOL(handle, alcCaptureStop); + qalcCaptureSamples = ALSYMBOL(handle, alcCaptureSamples); /* Connect function pointers to to OpenAL API functions */ - qalEnable = Sys_GetProcAddress(handle, "alEnable"); - qalDisable = Sys_GetProcAddress(handle, "alDisable"); - qalIsEnabled = Sys_GetProcAddress(handle, "alIsEnabled"); - qalGetString = Sys_GetProcAddress(handle, "alGetString"); - qalGetBooleanv = Sys_GetProcAddress(handle, "alGetBooleanv"); - qalGetIntegerv = Sys_GetProcAddress(handle, "alGetIntegerv"); - qalGetFloatv = Sys_GetProcAddress(handle, "alGetFloatv"); - qalGetDoublev = Sys_GetProcAddress(handle, "alGetDoublev"); - qalGetBoolean = Sys_GetProcAddress(handle, "alGetBoolean"); - qalGetInteger = Sys_GetProcAddress(handle, "alGetInteger"); - qalGetFloat = Sys_GetProcAddress(handle, "alGetFloat"); - qalGetDouble = Sys_GetProcAddress(handle, "alGetDouble"); - qalGetError = Sys_GetProcAddress(handle, "alGetError"); - qalIsExtensionPresent = Sys_GetProcAddress(handle, "alIsExtensionPresent"); - qalGetProcAddress = Sys_GetProcAddress(handle, "alGetProcAddress"); - qalGetEnumValue = Sys_GetProcAddress(handle, "alGetEnumValue"); - qalListenerf = Sys_GetProcAddress(handle, "alListenerf"); - qalListener3f = Sys_GetProcAddress(handle, "alListener3f"); - qalListenerfv = Sys_GetProcAddress(handle, "alListenerfv"); - qalListeneri = Sys_GetProcAddress(handle, "alListeneri"); - qalListener3i = Sys_GetProcAddress(handle, "alListener3i"); - qalListeneriv = Sys_GetProcAddress(handle, "alListeneriv"); - qalGetListenerf = Sys_GetProcAddress(handle, "alGetListenerf"); - qalGetListener3f = Sys_GetProcAddress(handle, "alGetListener3f"); - qalGetListenerfv = Sys_GetProcAddress(handle, "alGetListenerfv"); - qalGetListeneri = Sys_GetProcAddress(handle, "alGetListeneri"); - qalGetListener3i = Sys_GetProcAddress(handle, "alGetListener3i"); - qalGetListeneriv = Sys_GetProcAddress(handle, "alGetListeneriv"); - qalGenSources = Sys_GetProcAddress(handle, "alGenSources"); - qalDeleteSources = Sys_GetProcAddress(handle, "alDeleteSources"); - qalIsSource = Sys_GetProcAddress(handle, "alIsSource"); - qalSourcef = Sys_GetProcAddress(handle, "alSourcef"); - qalSource3f = Sys_GetProcAddress(handle, "alSource3f"); - qalSourcefv = Sys_GetProcAddress(handle, "alSourcefv"); - qalSourcei = Sys_GetProcAddress(handle, "alSourcei"); - qalSource3i = Sys_GetProcAddress(handle, "alSource3i"); - qalSourceiv = Sys_GetProcAddress(handle, "alSourceiv"); - qalGetSourcef = Sys_GetProcAddress(handle, "alGetSourcef"); - qalGetSource3f = Sys_GetProcAddress(handle, "alGetSource3f"); - qalGetSourcefv = Sys_GetProcAddress(handle, "alGetSourcefv"); - qalGetSourcei = Sys_GetProcAddress(handle, "alGetSourcei"); - qalGetSource3i = Sys_GetProcAddress(handle, "alGetSource3i"); - qalGetSourceiv = Sys_GetProcAddress(handle, "alGetSourceiv"); - qalSourcePlayv = Sys_GetProcAddress(handle, "alSourcePlayv"); - qalSourceStopv = Sys_GetProcAddress(handle, "alSourceStopv"); - qalSourceRewindv = Sys_GetProcAddress(handle, "alSourceRewindv"); - qalSourcePausev = Sys_GetProcAddress(handle, "alSourcePausev"); - qalSourcePlay = Sys_GetProcAddress(handle, "alSourcePlay"); - qalSourceStop = Sys_GetProcAddress(handle, "alSourceStop"); - qalSourceRewind = Sys_GetProcAddress(handle, "alSourceRewind"); - qalSourcePause = Sys_GetProcAddress(handle, "alSourcePause"); - qalSourceQueueBuffers = Sys_GetProcAddress(handle, "alSourceQueueBuffers"); - qalSourceUnqueueBuffers = Sys_GetProcAddress(handle, "alSourceUnqueueBuffers"); - qalGenBuffers = Sys_GetProcAddress(handle, "alGenBuffers"); - qalDeleteBuffers = Sys_GetProcAddress(handle, "alDeleteBuffers"); - qalIsBuffer = Sys_GetProcAddress(handle, "alIsBuffer"); - qalBufferData = Sys_GetProcAddress(handle, "alBufferData"); - qalBufferf = Sys_GetProcAddress(handle, "alBufferf"); - qalBuffer3f = Sys_GetProcAddress(handle, "alBuffer3f"); - qalBufferfv = Sys_GetProcAddress(handle, "alBufferfv"); - qalBufferi = Sys_GetProcAddress(handle, "alBufferi"); - qalBuffer3i = Sys_GetProcAddress(handle, "alBuffer3i"); - qalBufferiv = Sys_GetProcAddress(handle, "alBufferiv"); - qalGetBufferf = Sys_GetProcAddress(handle, "alGetBufferf"); - qalGetBuffer3f = Sys_GetProcAddress(handle, "alGetBuffer3f"); - qalGetBufferfv = Sys_GetProcAddress(handle, "alGetBufferfv"); - qalGetBufferi = Sys_GetProcAddress(handle, "alGetBufferi"); - qalGetBuffer3i = Sys_GetProcAddress(handle, "alGetBuffer3i"); - qalGetBufferiv = Sys_GetProcAddress(handle, "alGetBufferiv"); - qalDopplerFactor = Sys_GetProcAddress(handle, "alDopplerFactor"); - qalDopplerVelocity = Sys_GetProcAddress(handle, "alDopplerVelocity"); - qalSpeedOfSound = Sys_GetProcAddress(handle, "alSpeedOfSound"); - qalDistanceModel = Sys_GetProcAddress(handle, "alDistanceModel"); + qalEnable = ALSYMBOL(handle, alEnable); + qalDisable = ALSYMBOL(handle, alDisable); + qalIsEnabled = ALSYMBOL(handle, alIsEnabled); + qalGetString = ALSYMBOL(handle, alGetString); + qalGetBooleanv = ALSYMBOL(handle, alGetBooleanv); + qalGetIntegerv = ALSYMBOL(handle, alGetIntegerv); + qalGetFloatv = ALSYMBOL(handle, alGetFloatv); + qalGetDoublev = ALSYMBOL(handle, alGetDoublev); + qalGetBoolean = ALSYMBOL(handle, alGetBoolean); + qalGetInteger = ALSYMBOL(handle, alGetInteger); + qalGetFloat = ALSYMBOL(handle, alGetFloat); + qalGetDouble = ALSYMBOL(handle, alGetDouble); + qalGetError = ALSYMBOL(handle, alGetError); + qalIsExtensionPresent = ALSYMBOL(handle, alIsExtensionPresent); + qalGetProcAddress = ALSYMBOL(handle, alGetProcAddress); + qalGetEnumValue = ALSYMBOL(handle, alGetEnumValue); + qalListenerf = ALSYMBOL(handle, alListenerf); + qalListener3f = ALSYMBOL(handle, alListener3f); + qalListenerfv = ALSYMBOL(handle, alListenerfv); + qalListeneri = ALSYMBOL(handle, alListeneri); + qalListener3i = ALSYMBOL(handle, alListener3i); + qalListeneriv = ALSYMBOL(handle, alListeneriv); + qalGetListenerf = ALSYMBOL(handle, alGetListenerf); + qalGetListener3f = ALSYMBOL(handle, alGetListener3f); + qalGetListenerfv = ALSYMBOL(handle, alGetListenerfv); + qalGetListeneri = ALSYMBOL(handle, alGetListeneri); + qalGetListener3i = ALSYMBOL(handle, alGetListener3i); + qalGetListeneriv = ALSYMBOL(handle, alGetListeneriv); + qalGenSources = ALSYMBOL(handle, alGenSources); + qalDeleteSources = ALSYMBOL(handle, alDeleteSources); + qalIsSource = ALSYMBOL(handle, alIsSource); + qalSourcef = ALSYMBOL(handle, alSourcef); + qalSource3f = ALSYMBOL(handle, alSource3f); + qalSourcefv = ALSYMBOL(handle, alSourcefv); + qalSourcei = ALSYMBOL(handle, alSourcei); + qalSource3i = ALSYMBOL(handle, alSource3i); + qalSourceiv = ALSYMBOL(handle, alSourceiv); + qalGetSourcef = ALSYMBOL(handle, alGetSourcef); + qalGetSource3f = ALSYMBOL(handle, alGetSource3f); + qalGetSourcefv = ALSYMBOL(handle, alGetSourcefv); + qalGetSourcei = ALSYMBOL(handle, alGetSourcei); + qalGetSource3i = ALSYMBOL(handle, alGetSource3i); + qalGetSourceiv = ALSYMBOL(handle, alGetSourceiv); + qalSourcePlayv = ALSYMBOL(handle, alSourcePlayv); + qalSourceStopv = ALSYMBOL(handle, alSourceStopv); + qalSourceRewindv = ALSYMBOL(handle, alSourceRewindv); + qalSourcePausev = ALSYMBOL(handle, alSourcePausev); + qalSourcePlay = ALSYMBOL(handle, alSourcePlay); + qalSourceStop = ALSYMBOL(handle, alSourceStop); + qalSourceRewind = ALSYMBOL(handle, alSourceRewind); + qalSourcePause = ALSYMBOL(handle, alSourcePause); + qalSourceQueueBuffers = ALSYMBOL(handle, alSourceQueueBuffers); + qalSourceUnqueueBuffers = ALSYMBOL(handle, alSourceUnqueueBuffers); + qalGenBuffers = ALSYMBOL(handle, alGenBuffers); + qalDeleteBuffers = ALSYMBOL(handle, alDeleteBuffers); + qalIsBuffer = ALSYMBOL(handle, alIsBuffer); + qalBufferData = ALSYMBOL(handle, alBufferData); + qalBufferf = ALSYMBOL(handle, alBufferf); + qalBuffer3f = ALSYMBOL(handle, alBuffer3f); + qalBufferfv = ALSYMBOL(handle, alBufferfv); + qalBufferi = ALSYMBOL(handle, alBufferi); + qalBuffer3i = ALSYMBOL(handle, alBuffer3i); + qalBufferiv = ALSYMBOL(handle, alBufferiv); + qalGetBufferf = ALSYMBOL(handle, alGetBufferf); + qalGetBuffer3f = ALSYMBOL(handle, alGetBuffer3f); + qalGetBufferfv = ALSYMBOL(handle, alGetBufferfv); + qalGetBufferi = ALSYMBOL(handle, alGetBufferi); + qalGetBuffer3i = ALSYMBOL(handle, alGetBuffer3i); + qalGetBufferiv = ALSYMBOL(handle, alGetBufferiv); + qalDopplerFactor = ALSYMBOL(handle, alDopplerFactor); + qalDopplerVelocity = ALSYMBOL(handle, alDopplerVelocity); + qalSpeedOfSound = ALSYMBOL(handle, alSpeedOfSound); + qalDistanceModel = ALSYMBOL(handle, alDistanceModel); #if !defined (__APPLE__) - qalGenFilters = Sys_GetProcAddress(handle, "alGenFilters"); - qalFilteri = Sys_GetProcAddress(handle, "alFilteri"); - qalFilterf = Sys_GetProcAddress(handle, "alFilterf"); - qalDeleteFilters = Sys_GetProcAddress(handle, "alDeleteFilters"); + qalGenFilters = ALSYMBOL(handle, alGenFilters); + qalFilteri = ALSYMBOL(handle, alFilteri); + qalFilterf = ALSYMBOL(handle, alFilterf); + qalDeleteFilters = ALSYMBOL(handle, alDeleteFilters); #endif /* Open the OpenAL device */ diff --git a/src/backends/unix/system.c b/src/backends/unix/system.c index 79cb942..9617b28 100644 --- a/src/backends/unix/system.c +++ b/src/backends/unix/system.c @@ -496,7 +496,21 @@ Sys_GetHomeDir(void) void * Sys_GetProcAddress(void *handle, const char *sym) { - return dlsym(handle, sym); + if (handle == NULL) + { +#ifdef RTLD_DEFAULT + return dlsym(RTLD_DEFAULT, sym); +#else + /* POSIX suggests that this is a portable equivalent */ + static void *global_namespace = NULL; + + if (global_namespace == NULL) + global_namespace = dlopen(NULL, RTLD_GLOBAL|RTLD_LAZY); + + return dlsym(global_namespace, sym); +#endif + } + return dlsym(handle, sym); } void * debian/patches/0003-Look-for-architecture-dependent-files-in-a-separate-.patch0000644000000000000000000000251012264737170024142 0ustar From: Fabian Greffrath Date: Mon, 13 Jan 2014 10:02:11 +0000 Subject: Look for architecture-dependent files in a separate LIBDIR directory [Updated for yquake2/5.21, added commit message -Simon McVittie] --- src/common/filesystem.c | 2 ++ src/common/header/common.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/common/filesystem.c b/src/common/filesystem.c index 35064b2..72cc055 100644 --- a/src/common/filesystem.c +++ b/src/common/filesystem.c @@ -1675,6 +1675,7 @@ FS_SetGamedir(char *dir) #endif FS_AddGameDirectory(va("%s/%s", fs_basedir->string, dir)); + FS_AddGameDirectory(va("%s/%s", LIBDIR, dir)); FS_AddHomeAsGameDirectory(dir); } } @@ -2088,6 +2089,7 @@ FS_InitFilesystem(void) /* Add baseq2 to search path. */ FS_AddGameDirectory(va("%s/" BASEDIRNAME, fs_basedir->string)); + FS_AddGameDirectory(va("%s/" BASEDIRNAME, LIBDIR)); FS_AddHomeAsGameDirectory(BASEDIRNAME); /* Any set gamedirs will be freed up to here. */ diff --git a/src/common/header/common.h b/src/common/header/common.h index 2f1d570..fbdc233 100644 --- a/src/common/header/common.h +++ b/src/common/header/common.h @@ -79,6 +79,9 @@ #define LIBGL "libGL.so.1" #endif +#ifndef LIBDIR + #define LIBDIR "." +#endif /* ================================================================== */ debian/patches/0002-Fix-spelling-errors-detected-by-lintian.patch0000644000000000000000000000471512264737170021733 0ustar From: Fabian Greffrath Date: Mon, 13 Jan 2014 09:14:44 +0000 Subject: Fix spelling-errors detected by lintian --- src/backends/unix/signalhandler.c | 6 +++--- src/game/savegame/savegame.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backends/unix/signalhandler.c b/src/backends/unix/signalhandler.c index 1ae2435..2cada6d 100644 --- a/src/backends/unix/signalhandler.c +++ b/src/backends/unix/signalhandler.c @@ -49,7 +49,7 @@ printBacktrace(int sig) printf("Product: Yamagi Quake II\n"); printf("Version: %s\n", VERSION); - printf("Plattform: %s\n", BUILDSTRING); + printf("Platform: %s\n", BUILDSTRING); printf("Architecture: %s\n", CPUSTRING); printf("Compiler: %s\n", __VERSION__); printf("Signal: %i\n", sig); @@ -70,7 +70,7 @@ printBacktrace(int sig) { printf("Product: Yamagi Quake II\n"); printf("Version: %s\n", VERSION); - printf("Plattform: %s\n", BUILDSTRING); + printf("Platform: %s\n", BUILDSTRING); printf("Architecture: %s\n", CPUSTRING); printf("Compiler: %s\n", __VERSION__); printf("Signal: %i\n", sig); @@ -98,7 +98,7 @@ signalhandler(int sig) printf(" - game.so (the game.so of the mod you were playing\n"); printf(" when the game crashed. baseq2/game.so for the\n"); printf(" main game)\n\n"); - printf(" - Any other data which you think might be usefull\n"); + printf(" - Any other data which you think might be useful\n"); printf("\nThank you very much for your help, making Yamagi Quake\n"); printf("II an even better source port. It's much appreciated.\n"); printf("\n=======================================================\n\n"); diff --git a/src/game/savegame/savegame.c b/src/game/savegame/savegame.c index a72981e..4351808 100644 --- a/src/game/savegame/savegame.c +++ b/src/game/savegame/savegame.c @@ -835,18 +835,18 @@ ReadGame(const char *filename) else if (strcmp(str_game, GAMEVERSION)) { fclose(f); - gi.error("Savegame from an other game.so.\n"); + gi.error("Savegame from another game.so.\n"); } else if (strcmp(str_os, OS)) { fclose(f); - gi.error("Savegame from an other os.\n"); + gi.error("Savegame from another os.\n"); } else if (strcmp(str_arch, ARCH)) { fclose(f); - gi.error("Savegame from an other architecure.\n"); + gi.error("Savegame from another architecure.\n"); } g_edicts = gi.TagMalloc(game.maxentities * sizeof(g_edicts[0]), TAG_GAME); debian/patches/0001-Append-to-C-LD-FLAGS-instead-of-overriding-them-to-o.patch0000644000000000000000000000251712264737170023374 0ustar From: Fabian Greffrath Date: Mon, 13 Jan 2014 09:57:16 +0000 Subject: Append to {C, LD}FLAGS instead of overriding them, to obey dpkg-buildflags Also include CPPFLAGS in CFLAGS, since dpkg-buildflags separates them but yquake2 doesn't. [Updated for yquake2/5.21, added commit message -Simon McVittie] --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9689645..3e1aada 100644 --- a/Makefile +++ b/Makefile @@ -140,12 +140,13 @@ endif # # -MMD to generate header dependencies. (They cannot be # generated if building universal binaries on OSX) +CFLAGS += $(CPPFLAGS) ifeq ($(OSTYPE), Darwin) -CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \ +CFLAGS += -O2 -fno-strict-aliasing -fomit-frame-pointer \ -Wall -pipe -g CFLAGS += $(OSX_ARCH) else -CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \ +CFLAGS += -O2 -fno-strict-aliasing -fomit-frame-pointer \ -Wall -pipe -g -MMD endif @@ -204,9 +205,9 @@ endif # Base LDFLAGS. ifeq ($(OSTYPE),Linux) -LDFLAGS := -L/usr/lib -lm -ldl -rdynamic +LDFLAGS += -L/usr/lib -lm -ldl -rdynamic else ifeq ($(OSTYPE),FreeBSD) -LDFLAGS := -L/usr/local/lib -lm +LDFLAGS += -L/usr/local/lib -lm else ifeq ($(OSTYPE),OpenBSD) LDFLAGS := -L/usr/local/lib -lm else ifeq ($(OSTYPE),Windows) debian/gbp.conf0000644000000000000000000000035112264737170010615 0ustar [DEFAULT] debian-branch = master upstream-branch = upstream pristine-tar = True [git-import-orig] filter = [ 'stuff/osx/*', 'stuff/misc/*', 'stuff/win32-libs/*', 'stuff/icon/*', 'src/backends/sdl_osx/*' ] filter-pristine-tar = True debian/copyright0000644000000000000000000001643412264737170011142 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Yamagi Quake II Source: https://github.com/yquake2 Disclaimer: This package is in the contrib archive area, which is not part of Debian. This package itself is free software, but it is only useful when combined with game data. In principle, freely licensed data analogous to OpenQuartz and OpenArena could be created for it, but the maintainers are not aware of any freely-licensed data that is compatible with Quake II. Comment: The "orig" tarball was repackaged via git-import-orig to exclude support files for Windows and Mac OS, which included third-party software with source code not provided, and Objective C source whose copyright/licensing was unclear. Files: * Copyright: 1997-2005, Id Software, Inc 2001, Robert Bäuml 2002, W. P. va Paassen 2005, Ryan C. Gordon 2005, Stuart Dalton (badcdev@gmail.com) 2010-2013, Yamagi Burmeister 2010, skuller.net 2011, Knightmare 2013, Alejandro Ricoveri License: GPL-2+ Files: src/backends/sdl/refresh.c Copyright: 2010 Yamagi Burmeister 1997-2001 Id Software, Inc. 1997-2013 Sam Lantinga License: GPL-2+ and Zlib Files: src/common/md4.c Copyright: - License: public-domain /* * Public Domain C source implementation of RFC 1320 * - The MD4 Message-Digest Algorithm - * * http://www.faqs.org/rfcs/rfc1320.html * by Steven Fuller */ Files: src/common/shared/rand.c Copyright: 2011, Shinobu License: public-domain /* * KISS PRNG (c) 2011 Shinobu * * This file was optained from zuttobenkyou.wordpress.com * and modified by the Yamagi Quake II developers. * * LICENSE: Public domain * * ======================================================================= * * KISS PRNG, as devised by Dr. George Marsaglia * * ======================================================================= */ Files: src/common/unzip/* Copyright: 1990-2000, Info-ZIP 1998-2009, Gilles Vollant License: Zlib and Info-ZIP Files: debian/* Copyright: 2013 Fabian Greffrath License: GPL-2+ License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". License: Zlib This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. . Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: . 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. License: Info-ZIP This is version 2009-Jan-02 of the Info-ZIP license. The definitive version of this document should be available at ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and a copy at http://www.info-zip.org/pub/infozip/license.html. . . Copyright (c) 1990-2010 Info-ZIP. All rights reserved. . For the purposes of this copyright and license, "Info-ZIP" is defined as the following set of individuals: . Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth, Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda, Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren, Rich Wales, Mike White. . This software is provided "as is," without warranty of any kind, express or implied. In no event shall Info-ZIP or its contributors be held liable for any direct, indirect, incidental, special or consequential damages arising out of the use of or inability to use this software. . Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the above disclaimer and the following restrictions: . 1. Redistributions of source code (in whole or in part) must retain the above copyright notice, definition, disclaimer, and this list of conditions. . 2. Redistributions in binary form (compiled executables and libraries) must reproduce the above copyright notice, definition, disclaimer, and this list of conditions in documentation and/or other materials provided with the distribution. Additional documentation is not needed for executables where a command line license option provides these and a note regarding this option is in the executable's startup banner. The sole exception to this condition is redistribution of a standard UnZipSFX binary (including SFXWiz) as part of a self-extracting archive; that is permitted without inclusion of this license, as long as the normal SFX banner has not been removed from the binary or disabled. . 3. Altered versions--including, but not limited to, ports to new operating systems, existing ports with new graphical interfaces, versions with modified or added functionality, and dynamic, shared, or static library versions not from Info-ZIP--must be plainly marked as such and must not be misrepresented as being the original source or, if binaries, compiled from the original source. Such altered versions also must not be misrepresented as being Info-ZIP releases--including, but not limited to, labeling of the altered versions with the names "Info-ZIP" (or any variation thereof, including, but not limited to, different capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the explicit permission of Info-ZIP. Such altered versions are further prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP will provide support for the altered versions. . 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own source and binary releases. debian/control0000644000000000000000000000372612264737170010612 0ustar Source: yquake2 Section: contrib/games Priority: extra Maintainer: Debian Games Team Uploaders: Fabian Greffrath , Simon McVittie Build-Depends: debhelper (>= 9), libgl1-mesa-dev | libgl-dev, libjpeg8-dev, libopenal-dev, libsdl2-dev, libvorbis-dev, libxrandr-dev, libxxf86vm-dev, zlib1g-dev Standards-Version: 3.9.5 Homepage: http://www.yamagi.org/quake2/ Vcs-Git: git://anonscm.debian.org/pkg-games/yquake2.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-games/yquake2.git;a=summary Package: yamagi-quake2 Architecture: any-amd64 any-i386 Depends: yamagi-quake2-core (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Provides: quake2-engine Description: enhanced version of id Software's Quake II - client This is the Yamagi Quake II Client, an enhanced Version of id Software's Quake II. The main focus is single player, the gameplay and the graphics are unchanged, but many bugs were fixed. This code is based upon Icculus Quake II, which itself is built upon id Software's original code drop. Additional code and patches by many contributers were used. . This engine is intended to be used via the wrapper script and menu entries in the quake2 package. Package: yamagi-quake2-core Architecture: any-amd64 any-i386 Depends: ${misc:Depends}, ${shlibs:Depends} Provides: quake2-engine-server Breaks: yamagi-quake2 (<< 5.11) Replaces: yamagi-quake2 (<< 5.11) Description: enhanced version of id Software's Quake II - non-GUI part This is the Yamagi Quake II Server, an enhanced Version of id Software's Quake II. This code is based upon Icculus Quake II, which itself is built upon id Software's original code drop. Additional code and patches by many contributers were used. . This package contains files common to the client and the server, and a dedicated server engine is intended to be used via the wrapper script and init scripts in the quake2-server package. debian/compat0000644000000000000000000000000212264737170010375 0ustar 9 debian/changelog0000644000000000000000000000412512264737170011053 0ustar yquake2 (5.21~dfsg1-1) unstable; urgency=low * New upstream release - the refresher (renderer) is now directly linked into the executable - refresh patches * Standards-Version: 3.9.5 (no changes needed) * Release to unstable -- Simon McVittie Mon, 13 Jan 2014 10:22:42 +0000 yquake2 (5.11.v2~dfsg1-1) experimental; urgency=low [ Fabian Greffrath ] * Initial release (Closes: #689824). * Filter potentially non-free stuff out of the upstream release tarball. * Append to {C,LD}FLAGS instead of overriding them, obey dpkg-buildflags thereby. * Install port-specific architecture-dependent files into a separate LIBDIR directory. * Fix spelling-errors detected by lintian. * Add Recommends: libgl1-mesa-glx | libgl1, libopenal1. They get dlopen()ed and should be installed in all but unusual installations. This way they also show up in reportbug templates. [ Simon McVittie ] * Add myself to Uploaders * Enable pristine-tar support * Fix git-import-orig filter syntax * Also filter out src/backends/sdl_osx since those files' origin and license are unclear * debian/copyright: document why this is in contrib, and how the orig tarball was filtered * Provide a virtual package for the quake2-engine * Take the engine and server off the $PATH, recommending the quake2 package (from src:quake >= 4) as the "user-facing" Quake II package * Provide virtual packages for the quake2-engine and quake2-engine-server * Split out a yamagi-quake2-core package with the server and shared files * Link against libgl, libopenal1 libraries at compile time in the usual way, instead of dlopen() + Recommends * Set SYSTEMWIDE directory to the LIBDIR, so the wrapper scripts in the quake2, quake2-server packages can select either demo data (/usr/share/games/quake2-demo) or full data (/usr/share/games/quake2) if both are installed * yamagi-quake2-core: add Breaks/Replaces for the yamagi-quake2 packages provided by upstream * Upload to experimental -- Simon McVittie Sun, 29 Sep 2013 14:38:45 +0100 debian/README.source0000644000000000000000000000015012264737170011352 0ustar Note to ftp-masters reviewing this package: the same person should probably review src:quake version 4.