aboutsummaryrefslogtreecommitdiff
path: root/games/alienarena
diff options
context:
space:
mode:
authorAlejandro Pulver <alepulver@FreeBSD.org>2007-12-12 17:16:33 +0000
committerAlejandro Pulver <alepulver@FreeBSD.org>2007-12-12 17:16:33 +0000
commit077abd146d079a74e7fc9c834fcacc40549e16c7 (patch)
treeaad988c8438fae9b4d30c9fd1d61522787f3d04f /games/alienarena
parentb0e2c57cdd99b6d97c7be2bb56680178ff14127a (diff)
downloadports-077abd146d079a74e7fc9c834fcacc40549e16c7.tar.gz
ports-077abd146d079a74e7fc9c834fcacc40549e16c7.zip
Notes
Diffstat (limited to 'games/alienarena')
-rw-r--r--games/alienarena/Makefile20
-rw-r--r--games/alienarena/distinfo6
-rw-r--r--games/alienarena/files/patch-Makefile4
-rw-r--r--games/alienarena/files/patch-client__menu.c148
-rw-r--r--games/alienarena/files/patch-game__acesrc__acebot_nodes.c2
-rw-r--r--games/alienarena/files/patch-qcommon__files.c178
-rw-r--r--games/alienarena/files/patch-ref_gl__r_script.c83
7 files changed, 419 insertions, 22 deletions
diff --git a/games/alienarena/Makefile b/games/alienarena/Makefile
index 34bc2e720fbd..92f29f029bef 100644
--- a/games/alienarena/Makefile
+++ b/games/alienarena/Makefile
@@ -6,11 +6,10 @@
#
PORTNAME= alienarena
-PORTVERSION= 2007.605
+PORTVERSION= 2007.610
CATEGORIES= games
-MASTER_SITES= http://offload1.icculus.org/alienarena/files/ \
- http://distfiles.gentoo.org/distfiles/
-DISTNAME= ${PORTNAME}2007-20070613-linux
+MASTER_SITES= ftp://ftp.simtel.com/pub/gamezone/31/5/17/
+DISTNAME= ${PORTNAME}2007-20071011-linux
MAINTAINER= alepulver@FreeBSD.org
COMMENT= Alien Arena 2006 (native version)
@@ -24,7 +23,6 @@ USE_GMAKE= yes
MAKE_ENV= WITH_DATADIR=yes WITH_LIBDIR=yes \
DATADIR="${DATADIR}" LIBDIR="${LIBDIR}"
WRKSRC= ${WRKDIR}/${PORTNAME}2007/source
-BUILD_WRKSRC= ${WRKSRC}/..
ALL_TARGET= build-release
OPTIONS= CLIENT "Build client" on \
@@ -44,7 +42,9 @@ IGNORE= needs at least one executable (CLIENT, DEDICATED or SDL)
.endif
.if !defined(WITHOUT_CLIENT) || !defined(WITHOUT_SDL)
-LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg
+LIB_DEPENDS+= curl.4:${PORTSDIR}/ftp/curl \
+ jpeg.9:${PORTSDIR}/graphics/jpeg \
+ png.5:${PORTSDIR}/graphics/png
USE_GL= yes
.endif
@@ -80,22 +80,22 @@ PLIST_SUB+= SDL="@comment "
do-install:
${MKDIR} ${LIBDIR}/arena ${LIBDIR}/data1
- cd ${BUILD_WRKSRC}/release && \
+ cd ${WRKSRC}/release && \
${INSTALL_PROGRAM} arena/game.so ${LIBDIR}/arena && \
${INSTALL_PROGRAM} game.so ${LIBDIR}/data1
${LN} -s ${DATADIR}/arena/* ${LIBDIR}/arena
${LN} -s ${DATADIR}/botinfo ${LIBDIR}
${LN} -s ${DATADIR}/data1/* ${LIBDIR}/data1
.if !defined(WITHOUT_CLIENT)
- ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/release/crx \
+ ${INSTALL_PROGRAM} ${WRKSRC}/release/crx \
${PREFIX}/bin/${PORTNAME}
.endif
.if !defined(WITHOUT_DEDICATED)
- ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/release/crded \
+ ${INSTALL_PROGRAM} ${WRKSRC}/release/crded \
${PREFIX}/bin/${PORTNAME}-ded
.endif
.if !defined(WITHOUT_SDL)
- ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/release/crx.sdl \
+ ${INSTALL_PROGRAM} ${WRKSRC}/release/crx.sdl \
${PREFIX}/bin/${PORTNAME}-sdl
.endif
diff --git a/games/alienarena/distinfo b/games/alienarena/distinfo
index 1877022f3f02..f2ad41d5aa9f 100644
--- a/games/alienarena/distinfo
+++ b/games/alienarena/distinfo
@@ -1,3 +1,3 @@
-MD5 (alienarena2007-20070613-linux.zip) = 65d2948fa636cbc28c82da2264df2fea
-SHA256 (alienarena2007-20070613-linux.zip) = 593a7b106768abaff4c55f0b06dc20b5914601516c98ca5dfe93526de0559933
-SIZE (alienarena2007-20070613-linux.zip) = 223204178
+MD5 (alienarena2007-20071011-linux.zip) = 7ebb0dfeec4be80311921a075379c8dc
+SHA256 (alienarena2007-20071011-linux.zip) = 33036bd0dec77ae06c113d8e06718bd6f9e42efb634ee304c3fd9d48184c2e20
+SIZE (alienarena2007-20071011-linux.zip) = 245067302
diff --git a/games/alienarena/files/patch-Makefile b/games/alienarena/files/patch-Makefile
index 8eb73d19d1ac..3316dd54ec77 100644
--- a/games/alienarena/files/patch-Makefile
+++ b/games/alienarena/files/patch-Makefile
@@ -1,5 +1,5 @@
---- ../Makefile.orig Fri May 25 01:00:34 2007
-+++ ../Makefile Sat Jul 21 13:39:48 2007
+--- ./Makefile.orig Fri May 25 01:00:34 2007
++++ ./Makefile Sat Jul 21 13:39:48 2007
@@ -22,6 +22,10 @@
# Build binary that uses SDL for sound when "1".
SDLSOUND?=1
diff --git a/games/alienarena/files/patch-client__menu.c b/games/alienarena/files/patch-client__menu.c
new file mode 100644
index 000000000000..51abd7e0bf14
--- /dev/null
+++ b/games/alienarena/files/patch-client__menu.c
@@ -0,0 +1,148 @@
+--- ./client/menu.c.orig Tue Dec 11 18:57:14 2007
++++ ./client/menu.c Wed Dec 12 00:31:03 2007
+@@ -5104,143 +5104,16 @@
+
+ static void PlayerConfig_ScanDirectories( void )
+ {
+- char findname[1024];
+ char scratch[1024];
+ int ndirs = 0, npms = 0;
+ char **dirnames;
+ int i;
+
+- extern char **FS_ListFiles( char *, int *, unsigned, unsigned );
++ extern char **FS_ListFiles2( char *, int *, unsigned, unsigned );
+
+ s_numplayermodels = 0;
+
+- //get dirs from gamedir first.
+-
+- Com_sprintf( findname, sizeof(findname), "%s/players/*.*", FS_Gamedir() );
+-
+- dirnames = FS_ListFiles( findname, &ndirs, SFF_SUBDIR, 0 );
+-
+- if ( dirnames ) {
+-
+- /*
+- ** go through the subdirectories
+- */
+- npms = ndirs;
+- if ( npms > MAX_PLAYERMODELS )
+- npms = MAX_PLAYERMODELS;
+-
+- for ( i = 0; i < npms; i++ )
+- {
+- int k, s;
+- char *a, *b, *c;
+- char **pcxnames;
+- char **skinnames;
+- int npcxfiles;
+- int nskins = 0;
+-
+- if ( dirnames[i] == 0 )
+- continue;
+-
+- // verify the existence of tris.md2
+- strcpy( scratch, dirnames[i] );
+- strcat( scratch, "/tris.md2" );
+- if ( !Sys_FindFirst( scratch, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM ) )
+- {
+- free( dirnames[i] );
+- dirnames[i] = 0;
+- Sys_FindClose();
+- continue;
+- }
+- Sys_FindClose();
+-
+- // verify the existence of at least one skin
+- strcpy( scratch, dirnames[i] );
+- strcat( scratch, "/*.tga" );
+- pcxnames = FS_ListFiles( scratch, &npcxfiles, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM );
+-
+- if ( !pcxnames )
+- {
+- free( dirnames[i] );
+- dirnames[i] = 0;
+- continue;
+- }
+-
+- // count valid skins, which consist of a skin with a matching "_i" icon
+- for ( k = 0; k < npcxfiles-1; k++ )
+- {
+- if ( !strstr( pcxnames[k], "_i.tga" ) )
+- {
+- if ( IconOfSkinExists( pcxnames[k], pcxnames, npcxfiles - 1 ) )
+- {
+- nskins++;
+- }
+- }
+- }
+- if ( !nskins )
+- continue;
+-
+- skinnames = malloc( sizeof( char * ) * ( nskins + 1 ) );
+- memset( skinnames, 0, sizeof( char * ) * ( nskins + 1 ) );
+-
+- // copy the valid skins
+- for ( s = 0, k = 0; k < npcxfiles-1; k++ )
+- {
+- char *a, *b, *c;
+-
+- if ( !strstr( pcxnames[k], "_i.tga" ) )
+- {
+- if ( IconOfSkinExists( pcxnames[k], pcxnames, npcxfiles - 1 ) )
+- {
+- a = strrchr( pcxnames[k], '/' );
+- b = strrchr( pcxnames[k], '\\' );
+-
+- if ( a > b )
+- c = a;
+- else
+- c = b;
+-
+- strcpy( scratch, c + 1 );
+-
+- if ( strrchr( scratch, '.' ) )
+- *strrchr( scratch, '.' ) = 0;
+-
+- skinnames[s] = strdup( scratch );
+- s++;
+- }
+- }
+- }
+-
+- // at this point we have a valid player model
+- s_pmi[s_numplayermodels].nskins = nskins;
+- s_pmi[s_numplayermodels].skindisplaynames = skinnames;
+-
+- // make short name for the model
+- a = strrchr( dirnames[i], '/' );
+- b = strrchr( dirnames[i], '\\' );
+-
+- if ( a > b )
+- c = a;
+- else
+- c = b;
+-
+- strncpy( s_pmi[s_numplayermodels].displayname, c + 1, MAX_DISPLAYNAME-1 );
+- strcpy( s_pmi[s_numplayermodels].directory, c + 1 );
+-
+- FreeFileList( pcxnames, npcxfiles );
+-
+- s_numplayermodels++;
+- }
+- if ( dirnames )
+- FreeFileList( dirnames, ndirs );
+- }
+-
+- /*
+- ** get a list of directories from basedir
+- */
+-
+- Com_sprintf( findname, sizeof(findname), "%s/players/*.*", BASEDIRNAME);
+-
+- dirnames = FS_ListFiles( findname, &ndirs, SFF_SUBDIR, 0 );
++ dirnames = FS_ListFiles2( "players/*.*", &ndirs, SFF_SUBDIR, 0 );
+
+ if ( !dirnames )
+ return;
diff --git a/games/alienarena/files/patch-game__acesrc__acebot_nodes.c b/games/alienarena/files/patch-game__acesrc__acebot_nodes.c
index 7b1d1e531d65..86f0fc03d700 100644
--- a/games/alienarena/files/patch-game__acesrc__acebot_nodes.c
+++ b/games/alienarena/files/patch-game__acesrc__acebot_nodes.c
@@ -4,7 +4,7 @@
safe_bprintf(PRINT_MEDIUM,"Saving node table...");
--#ifdef __linux__
+-#ifdef __unix__
- strcpy(filename,"botinfo/nav/");
-#else
- strcpy(filename,"botinfo\\nav\\");
diff --git a/games/alienarena/files/patch-qcommon__files.c b/games/alienarena/files/patch-qcommon__files.c
index 15c4e13ac71b..06f0f58e91b2 100644
--- a/games/alienarena/files/patch-qcommon__files.c
+++ b/games/alienarena/files/patch-qcommon__files.c
@@ -1,6 +1,6 @@
---- ./qcommon/files.c.orig Wed Apr 18 14:28:43 2007
-+++ ./qcommon/files.c Sat Jul 21 09:36:05 2007
-@@ -776,6 +776,12 @@
+--- ./qcommon/files.c.orig Tue Dec 11 18:57:14 2007
++++ ./qcommon/files.c Tue Dec 11 21:51:48 2007
+@@ -734,6 +734,12 @@
else
{
Cvar_FullSet ("gamedir", dir, CVAR_SERVERINFO|CVAR_NOSET);
@@ -10,10 +10,176 @@
+#ifdef LIBDIR
+ FS_AddGameDirectory (va("%s/%s", LIBDIR, dir) );
+#endif
- if (fs_cddir->string[0])
- FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
-@@ -1020,6 +1026,19 @@
+ #ifdef __unix__
+ FS_AddHomeAsGameDirectory(dir);
+@@ -834,7 +840,156 @@
+ return list;
+ }
+
+-//#ifdef __unix__
++/*
++ * CompareAttributesPack
++ *
++ * Compare file attributes (musthave and canthave) in packed files. If
++ * "output" is not NULL, "size" is greater than zero and the file matches the
++ * attributes then a copy of the matching string will be placed there (with
++ * SFF_SUBDIR it changes).
++ *
++ * Returns a boolean value, true if the attributes match the file.
++ */
++qboolean
++ComparePackFiles(const char *findname, const char *name,
++ unsigned musthave, unsigned canthave, char *output, int size)
++{
++ qboolean retval;
++ char *ptr;
++ char buffer[MAX_OSPATH];
++
++ strncpy(buffer, name, sizeof(buffer)-1);
++ buffer[sizeof(buffer)-1] = '\0';
++
++ if ((canthave & SFF_SUBDIR) && name[strlen(name)-1] == '/')
++ return (false);
++
++ if (musthave & SFF_SUBDIR) {
++ if ((ptr = strrchr(buffer, '/')) != NULL)
++ *ptr = '\0';
++ else
++ return (false);
++ }
++
++ if ((musthave & SFF_HIDDEN) || (canthave & SFF_HIDDEN)) {
++ if ((ptr = strrchr(buffer, '/')) == NULL)
++ ptr = buffer;
++ if (((musthave & SFF_HIDDEN) && ptr[1] != '.') ||
++ ((canthave & SFF_HIDDEN) && ptr[1] == '.'))
++ return (false);
++ }
++
++ if (canthave & SFF_RDONLY)
++ return (false);
++
++ retval = glob_match((char *)findname, buffer);
++
++ if (retval && output != NULL) {
++ strncpy(output, buffer, size-1);
++ buffer[size-1] = '\0';
++ }
++
++ return (retval);
++}
++
++/*
++ * FS_ListFiles2
++ *
++ * Create a list of files that match a criteria.
++ *
++ * Searchs are relative to the game directory and use all the search paths
++ * including .pak and .pk3 files.
++ */
++char **
++FS_ListFiles2(char *findname, int *numfiles, unsigned musthave, unsigned canthave)
++{
++ searchpath_t *search; /* Search path. */
++ int i, j; /* Loop counters. */
++ int nfiles; /* Number of files found. */
++ int tmpnfiles; /* Temp number of files. */
++ char **tmplist; /* Temporary list of files. */
++ char **list; /* List of files found. */
++ char path[MAX_OSPATH]; /* Temporary path. */
++
++ nfiles = 0;
++ list = malloc(sizeof(char *));
++
++ for (search = fs_searchpaths; search != NULL; search = search->next) {
++ if (search->pack != NULL) {
++ for (i = 0, j = 0; i < search->pack->numfiles; i++)
++ if (ComparePackFiles(findname,
++ search->pack->files[i].name,
++ musthave, canthave, NULL, 0))
++ j++;
++ if (j == 0)
++ continue;
++ nfiles += j;
++ list = realloc(list, nfiles * sizeof(char *));
++ for (i = 0, j = nfiles - j;
++ i < search->pack->numfiles;
++ i++)
++ if (ComparePackFiles(findname,
++ search->pack->files[i].name,
++ musthave, canthave, path, sizeof(path)))
++ list[j++] = strdup(path);
++ } else if (search->filename != NULL) {
++ Com_sprintf(path, sizeof(path), "%s/%s",
++ search->filename, findname);
++ tmplist = FS_ListFiles(path, &tmpnfiles, musthave,
++ canthave);
++ if (tmplist != NULL) {
++ tmpnfiles--;
++ nfiles += tmpnfiles;
++ list = realloc(list, nfiles * sizeof(char *));
++ for (i = 0, j = nfiles - tmpnfiles;
++ i < tmpnfiles;
++ i++, j++)
++ list[j] = strdup(tmplist[i] +
++ strlen(search->filename) + 1);
++ FS_FreeFileList(tmplist, tmpnfiles);
++ }
++ }
++ }
++
++ /* Delete duplicates. */
++ tmpnfiles = 0;
++ for (i = 0; i < nfiles; i++) {
++ if (list[i] == NULL)
++ continue;
++ for (j = i + 1; j < nfiles; j++)
++ if (list[j] != NULL &&
++ strcmp(list[i], list[j]) == 0) {
++ free(list[j]);
++ list[j] = NULL;
++ tmpnfiles++;
++ }
++ }
++
++ if (tmpnfiles > 0) {
++ nfiles -= tmpnfiles;
++ tmplist = malloc(nfiles * sizeof(char *));
++ for (i = 0, j = 0; i < nfiles + tmpnfiles; i++)
++ if (list[i] != NULL)
++ tmplist[j++] = list[i];
++ free(list);
++ list = tmplist;
++ }
++
++ /* Add a guard. */
++ if (nfiles > 0) {
++ nfiles++;
++ list = realloc(list, nfiles * sizeof(char *));
++ list[nfiles - 1] = NULL;
++ } else {
++ free(list);
++ list = NULL;
++ }
++
++ *numfiles = nfiles;
++
++ return (list);
++}
++
+ void FS_FreeFileList (char **list, int n) // jit
+ {
+ int i;
+@@ -850,7 +1005,6 @@
+
+ free(list);
+ }
+-//#endif
+
+ /*
+ ** FS_Dir_f
+@@ -976,6 +1130,19 @@
Cmd_AddCommand ("path", FS_Path_f);
Cmd_AddCommand ("link", FS_Link_f);
Cmd_AddCommand ("dir", FS_Dir_f );
diff --git a/games/alienarena/files/patch-ref_gl__r_script.c b/games/alienarena/files/patch-ref_gl__r_script.c
new file mode 100644
index 000000000000..67c682a277b4
--- /dev/null
+++ b/games/alienarena/files/patch-ref_gl__r_script.c
@@ -0,0 +1,83 @@
+--- ref_gl/r_script.c.orig Wed Dec 12 01:22:30 2007
++++ ref_gl/r_script.c Wed Dec 12 01:21:49 2007
+@@ -1020,35 +1020,16 @@
+ free(buf);
+ }
+
+-extern char **FS_ListFiles( char *, int *, unsigned, unsigned );
++extern char **FS_ListFiles2( char *, int *, unsigned, unsigned );
+ extern void FS_FreeFileList (char **list, int n);
+ void RS_ScanPathForScripts (void)
+ {
+ char script[MAX_OSPATH];
+- char dirstring[1024], *c;
++ char *c;
+ char **script_list;
+ int script_count, i;
+- char *path = NULL;
+-
+-
+- Com_sprintf(dirstring, sizeof(dirstring), "%s/scripts/*.rscript", FS_Gamedir());
+- script_list = FS_ListFiles(dirstring, &script_count, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM);
+-
+- if(script_list) {
+- for (i = 0; i < script_count-1; i++)
+- {
+- c = COM_SkipPath(script_list[i]);
+- Com_sprintf(script, MAX_OSPATH, "scripts/%s", c);
+- RS_LoadScript(script);
+- }
+-
+- FS_FreeFileList(script_list, script_count);
+- }
+-
+- script_count = 0;
+
+- Com_sprintf(dirstring, sizeof(dirstring), "%s/scripts/*.rscript", BASEDIRNAME);
+- script_list = FS_ListFiles(dirstring, &script_count, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM);
++ script_list = FS_ListFiles2("scripts/*.rscript", &script_count, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM);
+
+ if(script_list) {
+ for (i = 0; i < script_count-1; i++)
+@@ -1057,32 +1038,12 @@
+ Com_sprintf(script, MAX_OSPATH, "scripts/%s", c);
+ RS_LoadScript(script);
+ }
+-
+ FS_FreeFileList(script_list, script_count);
+ }
+
+ script_count = 0;
+ if(gl_normalmaps->value) { //search for normal map scripts ONLY if we are using normal mapping
+-
+- Com_sprintf(dirstring, sizeof(dirstring), "%s/scripts/normals/*.rscript", FS_Gamedir());
+- script_list = FS_ListFiles(dirstring, &script_count, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM);
+-
+- if(script_list) {
+- for (i = 0; i < script_count-1; i++)
+- {
+- c = COM_SkipPath(script_list[i]);
+- Com_sprintf(script, MAX_OSPATH, "scripts/normals/%s", c);
+- RS_LoadScript(script);
+- }
+-
+- FS_FreeFileList(script_list, script_count);
+- }
+-
+- script_count = 0;
+-
+- Com_sprintf(dirstring, sizeof(dirstring), "%s/scripts/normals/*.rscript", BASEDIRNAME);
+- script_list = FS_ListFiles(dirstring, &script_count, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM);
+-
++ script_list = FS_ListFiles("scripts/normals/*.rscript", &script_count, 0, SFF_SUBDIR | SFF_HIDDEN | SFF_SYSTEM);
+ if(script_list) {
+ for (i = 0; i < script_count-1; i++)
+ {
+@@ -1090,7 +1051,6 @@
+ Com_sprintf(script, MAX_OSPATH, "scripts/normals/%s", c);
+ RS_LoadScript(script);
+ }
+-
+ FS_FreeFileList(script_list, script_count);
+ }
+ }