Index: games/q2pro/Makefile =================================================================== --- games/q2pro/Makefile +++ games/q2pro/Makefile @@ -2,134 +2,77 @@ # $FreeBSD$ PORTNAME= q2pro -PORTVERSION= ${SVN_REV} -PORTREVISION= 12 +PORTVERSION= 20180828 CATEGORIES= games -MASTER_SITES= LOCAL/alepulver MAINTAINER= danfe@FreeBSD.org -COMMENT= Quake II engine modification compatible with R1Q2 +COMMENT= Enhanced, multiplayer-oriented Quake 2 client and server LICENSE= GPLv2+ -LICENSE_FILE= ${WRKSRC}/gnu.txt +LICENSE_FILE= ${WRKSRC}/LICENSE -USES= dos2unix gmake tar:bzip2 -WRKSRC= ${WRKDIR}/${PORTNAME} -ALL_TARGET= # +USES= gmake pkgconfig -SVN_REV= 142 +USE_GITHUB= yes +GH_ACCOUNT= skullernet +GH_TAGNAME= 0914b63 -MAKE_ENV= LIBDIR="${LIBDIR}" -PLIST_SUB= LIBDIR="${LIBDIR:S|${PREFIX}/||}" -LIBDIR= ${PREFIX}/lib/${PORTNAME} +ALL_TARGET= +MAKE_ARGS= SYS=${OPSYS} \ + CPU=${ARCH} \ + CONFIG_NO_ICMP=y \ + CONFIG_HTTP=y \ + CONFIG_VARIABLE_SERVER_FPS=y \ + CONFIG_CLIENT_GTV=y \ + CONFIG_ANTICHEAT_SERVER=y \ + CONFIG_MVD_CLIENT=y \ + CONFIG_MVD_SERVER=y \ + CONFIG_OPENAL=y \ + CONFIG_PNG=y \ + CONFIG_JPEG=y \ + CONFIG_PATH_DATA="${Q2DIR}" \ + CONFIG_PATH_LIB="${Q2DIR}" \ + CONFIG_PATH_HOME="~/.quake2" -OPTIONS_DEFINE= CLIENT DEDICATED GAME GL SOFT UI -OPTIONS_DEFINE_i386= ASM -OPTIONS_DEFAULT= CLIENT DEDICATED GL SOFT UI -OPTIONS_DEFAULT_i386= ASM +OPTIONS_DEFINE= CLIENT DEDICATED GAME DEBUG +OPTIONS_DEFAULT= CLIENT DEDICATED +OPTIONS_SUB= yes CLIENT_DESC= Build client +CLIENT_USES= gl jpeg openal +CLIENT_USE= gl sdl=sdl2 +CLIENT_ALL_TARGET= q2pro +CLIENT_LIB_DEPENDS= libpng.so:graphics/png \ + libcurl.so:ftp/curl + DEDICATED_DESC= Build dedicated server -GAME_DESC= Build main game (default mod) -GL_DESC= Build OpenGL renderer -SOFT_DESC= Build software renderer -UI_DESC= Build user interface (for client menus) +DEDICATED_ALL_TARGET= q2proded -.include +GAME_DESC= Build baseq2 game library +GAME_ALL_TARGET= game.so -.if ${PORT_OPTIONS:MCLIENT} -USE_SDL+= sdl -ALL_TARGET+= client -PLIST_SUB+= CLIENT="" -.else -PLIST_SUB+= CLIENT="@comment " -.endif +DEBUG_DESC= Build with extra debugging support +DEBUG_MAKE_ARGS= CONFIG_DEBUG=y -.if ${PORT_OPTIONS:MDEDICATED} -ALL_TARGET+= server -PLIST_SUB+= DEDICATED="" -.else -PLIST_SUB+= DEDICATED="@comment " -.endif - -.if ${PORT_OPTIONS:MGAME} -ALL_TARGET+= game -PLIST_SUB+= GAME="" -.else -PLIST_SUB+= GAME="@comment " -.endif - -.if ${PORT_OPTIONS:MGL} -LIB_DEPENDS+= libpng.so:graphics/png -USES+= jpeg -USE_GL= gl -ALL_TARGET+= ref_newgl -PLIST_SUB+= GL="" -.else -PLIST_SUB+= GL="@comment " -.endif - -.if ${PORT_OPTIONS:MSOFT} -ALL_TARGET+= ref_soft -PLIST_SUB+= SOFT="" -.else -PLIST_SUB+= SOFT="@comment " -.endif - -.if ${PORT_OPTIONS:MUI} -ALL_TARGET+= ui -PLIST_SUB+= UI="" -.else -PLIST_SUB+= UI="@comment " -.endif - -.if ${PORT_OPTIONS:MASM} -MAKE_ENV+= USE_X86_ASM=yes -.endif - post-patch: - @${REINPLACE_CMD} -e 's|jpeg_mem_src|local_jpeg_mem_src|' \ - -e '/png_set_gray_1_2_4_to_8/s|png_set|&_expand|' \ - ${WRKSRC}/ref_shared/r_images.c - @${REINPLACE_CMD} -E 's|[[:digit:]]+|${SVN_REV}|' \ - ${WRKSRC}/include/version.h + @${ECHO_CMD} ${PORTVERSION} > ${WRKSRC}/VERSION do-install: - @${MKDIR} ${STAGEDIR}${LIBDIR}/baseq2 -.if ${PORT_OPTIONS:MCLIENT} - ${INSTALL_PROGRAM} ${WRKSRC}/build/release/q2pro \ + ${MKDIR} ${STAGEDIR}${Q2DIR}/baseq2 + +do-install-CLIENT-on: + ${INSTALL_PROGRAM} ${WRKSRC}/q2pro \ ${STAGEDIR}${PREFIX}/bin -.endif -.if ${PORT_OPTIONS:MDEDICATED} - ${INSTALL_PROGRAM} ${WRKSRC}/build/release/q2proded \ + ${INSTALL_DATA} ${WRKSRC}/src/client/ui/q2pro.menu \ + ${STAGEDIR}${Q2DIR}/baseq2 + +do-install-DEDICATED-on: + ${INSTALL_PROGRAM} ${WRKSRC}/q2proded \ ${STAGEDIR}${PREFIX}/bin -.endif -.if ${PORT_OPTIONS:MGAME} - ${INSTALL_PROGRAM} ${WRKSRC}/build/release/game.so \ - ${STAGEDIR}${LIBDIR}/baseq2 -.endif -.if ${PORT_OPTIONS:MGL} - ${INSTALL_PROGRAM} ${WRKSRC}/build/release/ref_newgl.so \ - ${STAGEDIR}${LIBDIR} -.endif -.if ${PORT_OPTIONS:MSOFT} - ${INSTALL_PROGRAM} ${WRKSRC}/build/release/ref_soft.so \ - ${STAGEDIR}${LIBDIR} -.endif -.if ${PORT_OPTIONS:MUI} - ${INSTALL_PROGRAM} ${WRKSRC}/build/release/ui.so \ - ${STAGEDIR}${LIBDIR} -.endif -generate-distfile: - @if [ -f ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ]; then \ - ${ECHO_CMD} "ERROR: the distfile already exists."; \ - ${FALSE}; \ - fi - svn export -r${SVN_REV} \ - https://svn.sourceforge.net/svnroot/q2pro/q2pro q2pro - ${TAR} jcf ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} q2pro - ${RM} -r q2pro +do-install-GAME-on: + ${INSTALL_PROGRAM} ${WRKSRC}/game.so \ + ${STAGEDIR}${Q2DIR}/baseq2 .include "${.CURDIR}/../quake2-data/Makefile.include" .include Index: games/q2pro/distinfo =================================================================== --- games/q2pro/distinfo +++ games/q2pro/distinfo @@ -1,2 +1,3 @@ -SHA256 (q2pro-142.tar.bz2) = 8549752b1926a8da840049aa0aac218392821c6819b78eec893155281c1513b3 -SIZE (q2pro-142.tar.bz2) = 1391352 +TIMESTAMP = 1536117953 +SHA256 (skullernet-q2pro-20180828-0914b63_GH0.tar.gz) = 4d5e1d9efdc211de97d88b8f97ca12034d616d2515e067cd50f603a45508d531 +SIZE (skullernet-q2pro-20180828-0914b63_GH0.tar.gz) = 864669 Index: games/q2pro/files/patch-Makefile =================================================================== --- /dev/null +++ games/q2pro/files/patch-Makefile @@ -0,0 +1,23 @@ +--- Makefile.orig 2018-08-28 13:38:51 UTC ++++ Makefile +@@ -488,6 +488,11 @@ else + LIBS_s += -ldl -lrt + LIBS_c += -ldl -lrt -lpthread + endif ++ ++ ifeq ($(SYS),FreeBSD) ++ LIBS_s += -lrt ++ LIBS_c += -lrt -lpthread ++ endif + endif + + ifdef CONFIG_TESTS +@@ -511,7 +516,7 @@ ifdef CONFIG_WINDOWS + else + TARG_s := q2proded + TARG_c := q2pro +- TARG_g := game$(CPU).so ++ TARG_g := game.so + endif + + all: $(TARG_s) $(TARG_c) $(TARG_g) Index: games/q2pro/files/patch-build__client.mk =================================================================== --- games/q2pro/files/patch-build__client.mk +++ /dev/null @@ -1,18 +0,0 @@ ---- ./build/client.mk.orig Sun Feb 4 15:31:20 2007 -+++ ./build/client.mk Sun Feb 4 16:13:09 2007 -@@ -27,9 +27,14 @@ - RESFILES_WIN32 += q2.rc - - SRCFILES_LINUX = sys_unix.c snd_linux.c cd_linux.c vid_sdl.c in_linux.c -+ifdef USE_X86_ASM - ASMFILES_LINUX = snd_mixa.s -+else -+SRCFILES_LINUX += snd_mix.c -+CFLAGS_LINUX += -DC_ONLY -+endif - CFLAGS_LINUX += $(CFLAGS_SDL) --LDFLAGS_LINUX += -ldl -lX11 $(LDFLAGS_SDL) -+LDFLAGS_LINUX += -lX11 $(LDFLAGS_SDL) - - include ../../post.mk - Index: games/q2pro/files/patch-build__detect.mk =================================================================== --- games/q2pro/files/patch-build__detect.mk +++ /dev/null @@ -1,11 +0,0 @@ ---- ./build/detect.mk.orig Mon Dec 25 17:07:02 2006 -+++ ./build/detect.mk Mon Dec 25 17:07:02 2006 -@@ -21,7 +21,7 @@ - ifeq (linux,$(TARGETOS)) - EXEEXT = #blank - SHLIBEXT = .so --OUTDIRSUFFIX = i386 -+OUTDIRSUFFIX = #blank - else - $(error Unknown target OS) - endif Index: games/q2pro/files/patch-build__post.mk =================================================================== --- games/q2pro/files/patch-build__post.mk +++ /dev/null @@ -1,14 +0,0 @@ ---- build/post.mk.orig Sun Feb 4 19:51:48 2007 -+++ build/post.mk Sun Feb 4 19:52:55 2007 -@@ -33,7 +33,10 @@ - - %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< -- -+ -+q_shared.o: q_shared.c -+ $(CC) $(CFLAGS) -fPIC -c -o $@ $< -+ - %.o: %.s - $(CC) $(CFLAGS) -x assembler-with-cpp -c -o $@ $< - Index: games/q2pro/files/patch-build__pre.mk =================================================================== --- games/q2pro/files/patch-build__pre.mk +++ /dev/null @@ -1,26 +0,0 @@ ---- build/pre.mk.orig Sun Feb 4 16:13:21 2007 -+++ build/pre.mk Sun Feb 4 16:27:54 2007 -@@ -25,7 +25,7 @@ CFLAGS+=-g - LDFLAGS+=-g - else - #CFLAGS += -march=i686 -msse2 -mfpmath=sse -O2 -fno-strict-aliasing -DNDEBUG --CFLAGS+=-ffloat-store -O2 -fno-strict-aliasing -DNDEBUG -+CFLAGS+= -DNDEBUG - LDFLAGS+=-s - endif - -@@ -48,10 +48,10 @@ SRCFILES_WIN32=#blank - ASMFILES_WIN32=#blank - VPATH_WIN32=$(RCDIR) - --DATADIR?=/usr/share/games/quake2 --LIBDIR?=/usr/lib/games/quake2 --CFLAGS_LINUX=-DDATADIR='"$(DATADIR)"' -DLIBDIR='"$(LIBDIR)"' --LDFLAGS_LINUX=#blank -+DATADIR?=$(Q2DIR) -+LIBDIR?=$(PREFIX)/lib/q2pro -+CFLAGS_LINUX=-I$(LOCALBASE)/include -DDATADIR='"$(DATADIR)"' -DLIBDIR='"$(LIBDIR)"' -+LDFLAGS_LINUX=-L$(LOCALBASE)/lib - SRCFILES_LINUX=#blank - ASMFILES_LINUX=#blank - Index: games/q2pro/files/patch-build__ref_soft.mk =================================================================== --- games/q2pro/files/patch-build__ref_soft.mk +++ /dev/null @@ -1,22 +0,0 @@ ---- build/ref_soft.mk.orig Wed Feb 14 18:10:04 2007 -+++ build/ref_soft.mk Wed Feb 14 18:15:42 2007 -@@ -43,6 +43,7 @@ SRCFILES = q_shared.c \ - sw_sird.c \ - r_images.c - -+ifdef USE_X86_ASM - ASMFILES = r_aclipa.s \ - r_draw16.s \ - r_drawa.s \ -@@ -53,7 +54,10 @@ ASMFILES = r_aclipa.s \ - r_varsa.s \ - d_polysa.s \ - sys_dosa.s -- -+else -+CFLAGS += -DC_ONLY -+endif -+ - RESFILES += ref_soft.rc - - SRCFILES_WIN32 = q_shwin.c Index: games/q2pro/files/patch-build__server.mk =================================================================== --- games/q2pro/files/patch-build__server.mk +++ /dev/null @@ -1,10 +0,0 @@ ---- build/server.mk.orig Sun Feb 4 16:29:23 2007 -+++ build/server.mk Sun Feb 4 16:30:00 2007 -@@ -22,7 +22,6 @@ - RESFLAGS_WIN32+=-DDEDICATED_ONLY - - SRCFILES_LINUX+=sys_unix.c --LDFLAGS_LINUX+=-ldl - - include ../../post.mk - Index: games/q2pro/files/patch-source__cd_linux.c =================================================================== --- games/q2pro/files/patch-source__cd_linux.c +++ /dev/null @@ -1,253 +0,0 @@ ---- ./source/cd_linux.c.orig Mon Dec 25 17:07:02 2006 -+++ ./source/cd_linux.c Mon Dec 25 17:07:03 2006 -@@ -31,7 +31,11 @@ - #include - #include - -+#ifdef __FreeBSD__ -+#include -+#else - #include -+#endif - - #include "client.h" - -@@ -61,8 +65,13 @@ - if (cdfile == -1 || !enabled) - return; // no cd init'd - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOCEJECT) == -1) -+ Com_DPrintf ("ioctl cdioceject failed\n"); -+#else - if ( ioctl(cdfile, CDROMEJECT) == -1 ) - Com_DPrintf("ioctl cdromeject failed\n"); -+#endif - } - - -@@ -71,30 +80,53 @@ - if (cdfile == -1 || !enabled) - return; // no cd init'd - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOCCLOSE) == -1) -+ Com_DPrintf ("ioctl cdiocclose failed\n"); -+#else - if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 ) - Com_DPrintf("ioctl cdromclosetray failed\n"); -+#endif - } - - static int CDAudio_GetAudioDiskInfo(void) - { -+#ifdef __FreeBSD__ -+ struct ioc_toc_header tochdr; -+#else - struct cdrom_tochdr tochdr; -+#endif - - cdValid = qfalse; - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOREADTOCHEADER, &tochdr) == -1) -+ { -+ Com_DPrintf ("ioctl cdioreadtocheader failed\n"); -+#else - if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 ) - { - Com_DPrintf("ioctl cdromreadtochdr failed\n"); -+#endif - return -1; - } - -+#ifdef __FreeBSD__ -+ if (tochdr.starting_track < 1) -+#else - if (tochdr.cdth_trk0 < 1) -+#endif - { - Com_DPrintf("CDAudio: no music tracks\n"); - return -1; - } - - cdValid = qtrue; -+#ifdef __FreeBSD__ -+ maxTrack = tochdr.ending_track; -+#else - maxTrack = tochdr.cdth_trk1; -+#endif - - return 0; - } -@@ -102,8 +134,14 @@ - - void CDAudio_Play(int track, qboolean looping) - { -+#ifdef __FreeBSD__ -+ struct ioc_read_toc_entry entry; -+ struct cd_toc_entry toc_buffer; -+ struct ioc_play_track ti; -+#else - struct cdrom_tocentry entry; - struct cdrom_ti ti; -+#endif - - if (cdfile == -1 || !enabled) - return; -@@ -123,6 +161,21 @@ - return; - } - -+#ifdef __FreeBSD__ -+ #define CDROM_DATA_TRACK 4 -+ bzero((char *)&toc_buffer, sizeof(toc_buffer)); -+ entry.data_len = sizeof(toc_buffer); -+ entry.data = &toc_buffer; -+ // don't try to play a non-audio track -+ entry.starting_track = track; -+ entry.address_format = CD_MSF_FORMAT; -+ if ( ioctl(cdfile, CDIOREADTOCENTRYS, &entry) == -1 ) -+ { -+ Com_DPrintf("ioctl cdromreadtocentry failed\n"); -+ return; -+ } -+ if (toc_buffer.control == CDROM_DATA_TRACK) -+#else - // don't try to play a non-audio track - entry.cdte_track = track; - entry.cdte_format = CDROM_MSF; -@@ -132,6 +185,7 @@ - return; - } - if (entry.cdte_ctrl == CDROM_DATA_TRACK) -+#endif - { - Com_Printf("CDAudio: track %i is not audio\n", track); - return; -@@ -144,19 +198,37 @@ - CDAudio_Stop(); - } - -+#ifdef __FreeBSD__ -+ ti.start_track = track; -+ ti.end_track = track; -+ ti.start_index = 1; -+ ti.end_index = 99; -+#else - ti.cdti_trk0 = track; - ti.cdti_trk1 = track; - ti.cdti_ind0 = 1; - ti.cdti_ind1 = 99; -+#endif - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOCPLAYTRACKS, &ti) == -1) -+ { -+ Com_DPrintf ("ioctl cdiocplaytracks failed\n"); -+#else - if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 ) - { - Com_DPrintf("ioctl cdromplaytrkind failed\n"); -+#endif - return; - } - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOCRESUME) == -1) -+ Com_DPrintf ("ioctl cdiocresume failed\n"); -+#else - if ( ioctl(cdfile, CDROMRESUME) == -1 ) - Com_DPrintf("ioctl cdromresume failed\n"); -+#endif - - playLooping = looping; - playTrack = track; -@@ -175,8 +247,13 @@ - if (!playing) - return; - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOCSTOP) == -1) -+ Com_DPrintf ("ioctl cdiocstop failed (%d)\n", errno); -+#else - if ( ioctl(cdfile, CDROMSTOP) == -1 ) - Com_DPrintf("ioctl cdromstop failed (%d)\n", errno); -+#endif - - wasPlaying = qfalse; - playing = qfalse; -@@ -190,8 +267,13 @@ - if (!playing) - return; - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOCPAUSE) == -1) -+ Com_DPrintf ("ioctl cdiocpause failed\n"); -+#else - if ( ioctl(cdfile, CDROMPAUSE) == -1 ) - Com_DPrintf("ioctl cdrompause failed\n"); -+#endif - - wasPlaying = playing; - playing = qfalse; -@@ -209,8 +291,13 @@ - if (!wasPlaying) - return; - -+#ifdef __FreeBSD__ -+ if (ioctl(cdfile, CDIOCRESUME) == -1) -+ Com_DPrintf ("ioctl cdiocresume failed\n"); -+#else - if ( ioctl(cdfile, CDROMRESUME) == -1 ) - Com_DPrintf("ioctl cdromresume failed\n"); -+#endif - playing = qtrue; - } - -@@ -334,7 +421,12 @@ - - void CDAudio_Update(void) - { -+#ifdef __FreeBSD__ -+ struct ioc_read_subchannel subchnl; -+ struct cd_sub_channel_info data; -+#else - struct cdrom_subchnl subchnl; -+#endif - static time_t lastchk; - - if (cdfile == -1 || !enabled) -@@ -357,6 +449,24 @@ - } - - if (playing && lastchk < time(NULL)) { -+#if defined(__FreeBSD__) -+ subchnl.address_format = CD_MSF_FORMAT; -+ subchnl.data_format = CD_CURRENT_POSITION; -+ subchnl.data_len = sizeof(data); -+ subchnl.track = playTrack; -+ subchnl.data = &data; -+ if (ioctl(cdfile, CDIOCREADSUBCHANNEL, &subchnl) == -1 ) { -+ Com_DPrintf("ioctl cdiocreadsubchannel failed\n"); -+ playing = qfalse; -+ return; -+ } -+ if (subchnl.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS && -+ subchnl.data->header.audio_status != CD_AS_PLAY_PAUSED) { -+ playing = qfalse; -+ if (playLooping) -+ CDAudio_Play(playTrack, qtrue); -+ } -+#else - lastchk = time(NULL) + 2; //two seconds between chks - subchnl.cdsc_format = CDROM_MSF; - if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) { -@@ -370,6 +480,7 @@ - if (playLooping) - CDAudio_Play(playTrack, qtrue); - } -+#endif - } - } - Index: games/q2pro/files/patch-source__files.c =================================================================== --- games/q2pro/files/patch-source__files.c +++ /dev/null @@ -1,119 +0,0 @@ ---- source/files.c.orig Tue Jan 30 18:07:53 2007 -+++ source/files.c Sun Feb 4 19:31:21 2007 -@@ -1542,6 +1542,22 @@ - - } - -+#ifdef __unix__ -+/* -+================ -+FS_AddHomeAsGameDirectory -+ -+Adds ~/.q2pro/ as a game directory. -+================ -+*/ -+void FS_AddHomeAsGameDirectory(char *dir) -+{ -+ char *homedir; /* Home directory. */ -+ -+ if ((homedir = getenv("HOME")) != NULL) -+ FS_AddGameDirectory("%s/"HOMEDIRNAME"/%s", homedir, dir); -+} -+#endif - - /* - ================= -@@ -1569,7 +1585,7 @@ - #ifdef _WIN32 - Com_sprintf( path, sizeof( path ), "%s/%s/gamex86.dll", fs_basedir->string, dirlist[i] ); - #else -- Com_sprintf( path, sizeof( path ), "%s/%s/gamei386.so", fs_basedir->string, dirlist[i] ); -+ Com_sprintf( path, sizeof( path ), "%s/%s/game.so", fs_basedir->string, dirlist[i] ); - #endif - - if( !( fp = fopen( path, "rb" ) ) ) { -@@ -2358,21 +2374,15 @@ - */ - static void FS_DefaultGamedir( void ) { - #ifdef __unix__ -- char *homedir = getenv( "HOME" ); -- -- if( homedir ) { -- FS_AddGameDirectory( "%s/"HOMEDIRNAME"/"BASEDIRNAME, homedir ); -- } else -+ FS_AddHomeAsGameDirectory(BASEDIRNAME); - #else -- { - /* write to baseq2pro on Windows */ - Com_sprintf( fs_gamedir, sizeof( fs_gamedir ), "%s/"INITDIRNAME, - fs_basedir->string ); -- } --#endif - - Cvar_Set( "game", "" ); - Cvar_Set( "gamedir", "" ); -+#endif - } - - -@@ -2410,18 +2420,11 @@ - if( fs_cddir->string[0] ) - FS_AddGameDirectory( "%s/%s", fs_cddir->string, fs_game->string ); - -+ FS_AddGameDirectory("%s/%s", DATADIR, fs_game->string); -+ FS_AddGameDirectory("%s/%s", LIBDIR, fs_game->string); - FS_AddGameDirectory( "%s/%s", fs_basedir->string, fs_game->string ); -+ FS_AddHomeAsGameDirectory(fs_game->string); - --#ifdef __unix__ -- { -- char *homedir = getenv( "HOME" ); -- -- if( homedir ) { -- FS_AddGameDirectory( "%s/"HOMEDIRNAME"/%s", -- homedir, fs_game->string ); -- } -- } --#endif - } - - qboolean FS_SafeToRestart( void ) { -@@ -2518,7 +2521,6 @@ - */ - void FS_Init( void ) { - int startTime, i; -- char *base; - - startTime = Sys_Milliseconds(); - -@@ -2554,13 +2556,7 @@ - // allows the game to run from outside the data tree - // - --#ifdef __unix__ -- base = DATADIR; --#else -- base = Sys_GetCurrentDirectory(); --#endif -- -- fs_basedir = Cvar_Get( "basedir", base, CVAR_NOSET ); -+ fs_basedir = Cvar_Get( "basedir", Sys_GetCurrentDirectory(), CVAR_NOSET ); - - /* strip trailing slash */ - if( fs_basedir->string[0] ) { -@@ -2591,8 +2587,15 @@ - // - // start up with baseq2 by default - // -+ FS_AddGameDirectory("%s/"BASEDIRNAME, DATADIR); -+ FS_AddGameDirectory("%s/"BASEDIRNAME, LIBDIR); - FS_AddGameDirectory( "%s/"BASEDIRNAME, fs_basedir->string ); -+ FS_AddHomeAsGameDirectory(BASEDIRNAME); -+ -+ FS_AddGameDirectory("%s/"INITDIRNAME, DATADIR); -+ FS_AddGameDirectory("%s/"INITDIRNAME, LIBDIR); - FS_AddGameDirectory( "%s/"INITDIRNAME, fs_basedir->string ); -+ FS_AddHomeAsGameDirectory(INITDIRNAME); - - fs_base_searchpaths = fs_searchpaths; - Index: games/q2pro/files/patch-source__in_linux.c =================================================================== --- games/q2pro/files/patch-source__in_linux.c +++ /dev/null @@ -1,31 +0,0 @@ ---- source/in_linux.c.orig Sun Jan 28 20:57:44 2007 -+++ source/in_linux.c Sun Feb 4 19:35:14 2007 -@@ -27,10 +27,14 @@ - #include - #include - #include -+#ifdef __linux__ - #include -+#endif - #include - -+#ifdef __linux__ - #include -+#endif - - static cvar_t *in_device; - -@@ -38,6 +42,7 @@ - static qboolean mouseactive; - static int evdev_fd; - -+#ifdef __linux__ - #define MAX_EVENTS 64 - #define EVENT_SIZE sizeof( struct input_event ) - -@@ -224,4 +229,4 @@ - api->ClearStates = Evdev_ClearMouseStates; - } - -- -+#endif Index: games/q2pro/files/patch-source__sys_unix.c =================================================================== --- games/q2pro/files/patch-source__sys_unix.c +++ /dev/null @@ -1,23 +0,0 @@ ---- source/sys_unix.c.orig Sun Jan 28 20:57:44 2007 -+++ source/sys_unix.c Sun Feb 4 19:49:07 2007 -@@ -908,7 +908,7 @@ - - static void *gameLibrary; - --#define GAMELIB "gamei386.so" -+#define GAMELIB "game.so" - - /* - ================= -@@ -935,9 +935,9 @@ - char name[MAX_OSPATH]; - char *path; - #ifdef NDEBUG -- const char *debugdir = "releasei386"; -+ const char *debugdir = "release"; - #else -- const char *debugdir = "debugi386"; -+ const char *debugdir = "debug"; - #endif - - if( gameLibrary ) { Index: games/q2pro/files/patch-src_server_game.c =================================================================== --- /dev/null +++ games/q2pro/files/patch-src_server_game.c @@ -0,0 +1,11 @@ +--- src/server/game.c.orig 2018-09-12 07:20:45 UTC ++++ src/server/game.c +@@ -813,7 +813,7 @@ static void *SV_LoadGameLibrary(const char *game, cons + + len = Q_concat(path, sizeof(path), sys_libdir->string, + PATH_SEP_STRING, game, PATH_SEP_STRING, +- prefix, "game" CPUSTRING LIBSUFFIX, NULL); ++ prefix, "game" LIBSUFFIX, NULL); + if (len >= sizeof(path)) { + Com_EPrintf("Game library path length exceeded\n"); + return NULL; Index: games/q2pro/pkg-descr =================================================================== --- games/q2pro/pkg-descr +++ games/q2pro/pkg-descr @@ -1,16 +1,12 @@ -Q2PRO is a Quake II engine modification. Client and server sides are both -compatible with original Quake2 v3.20 network architecture, as well as with -modern R1Q2 network architecture. Q2PRO is designed to be secure, fast, and -doesn't provide any graphical enhancements that are contrary to the classic -Quake2 look and feel. It yet provides some features unique to Quake2, most -notably server side MVDs (multi view demos). Q2PRO has its own software and -OpenGL refresh libraries and runs under Windows and Unix-like systems. +Q2PRO is an enhanced, multiplayer-oriented Quake 2 client and server. Features +include: -Q2PRO supports the following network protocols: + * rewritten OpenGL renderer optimized for stable FPS + * enhanced client console with persistent history + * ZIP packfiles (.pkz), JPEG and PNG textures, MD3 models + * fast HTTP downloads + * multichannel sound using OpenAL + * recording from demos, forward and backward seeking + * server side multiview demos and GTV capabilities - - 34, original Quake2 protocol - - 35, enhanced R1Q2 protocol - - 36, enhanced Q2PRO protocol, extension of R1Q2 protocol - - 37, special broadband MVD protocol - -WWW: http://q2pro.sourceforge.net/ +WWW: http://skuller.net/q2pro/ Index: games/q2pro/pkg-plist =================================================================== --- games/q2pro/pkg-plist +++ games/q2pro/pkg-plist @@ -1,7 +1,5 @@ %%CLIENT%%bin/q2pro +%%CLIENT%%%%Q2DIR%%/baseq2/q2pro.menu %%DEDICATED%%bin/q2proded -%%GAME%%%%LIBDIR%%/baseq2/game.so -%%GL%%%%LIBDIR%%/ref_newgl.so -%%SOFT%%%%LIBDIR%%/ref_soft.so -%%UI%%%%LIBDIR%%/ui.so -@dir %%LIBDIR%%/baseq2 +%%GAME%%%%Q2DIR%%/baseq2/game.so +@dir %%Q2DIR%%/baseq2