diff --git a/games/ezquake/Makefile b/games/ezquake/Makefile index 94ab54e06e9e..6052010e5a9f 100644 --- a/games/ezquake/Makefile +++ b/games/ezquake/Makefile @@ -1,45 +1,48 @@ PORTNAME= ezquake DISTVERSION= 3.2.3 -PORTREVISION= 3 +PORTREVISION= 4 PORTEPOCH= 2 CATEGORIES= games MASTER_SITES= https://github.com/ezQuake/ezquake-source/archive/ \ https://github.com/ezQuake/ezquake-source/releases/download/${PORTVERSION}/ DISTFILES= ${PORTVERSION}.tar.gz \ ${PORTNAME}-ubuntu-${PORTVERSION}-full.tar.gz DIST_SUBDIR= ${PORTNAME} MAINTAINER= vvd@FreeBSD.org COMMENT= Modern QuakeWorld client WWW= https://www.ezquake.com/ +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE + LIB_DEPENDS= libcurl.so:ftp/curl \ libexpat.so:textproc/expat2 \ libjansson.so:devel/jansson \ libpcre.so:devel/pcre \ libpng.so:graphics/png \ libspeex.so:audio/speex \ libspeexdsp.so:audio/speexdsp USES= gl gmake jpeg pkgconfig sdl tcl USE_GL= yes USE_SDL= sdl2 MAKE_ENV= TCL_SUFX=${TCL_SHLIB_VER} .for v in TCL_INCLUDEDIR TCL_LIBDIR DATADIR MAKE_ENV+= ${v}="${${v}}" .endfor WRKSRC= ${WRKDIR}/${PORTNAME}-source-${PORTVERSION} .include "${.CURDIR}/../quake-data/Makefile.include" post-patch: @${REINPLACE_CMD} -e 's|libtcl\.so|libtcl${TCL_VER:S/.//}|' \ ${WRKSRC}/embed_tcl.h do-install: @${MKDIR} ${STAGEDIR}${DATADIR} (cd ${WRKDIR} && ${COPYTREE_SHARE} "ezquake qw" ${STAGEDIR}${DATADIR}) ${INSTALL_PROGRAM} ${WRKSRC}/ezquake-freebsd \ ${STAGEDIR}${PREFIX}/bin/ezquake .include diff --git a/games/ezquake/files/patch-Makefile b/games/ezquake/files/patch-Makefile index a2bf147c34bb..36c05c1dc79f 100644 --- a/games/ezquake/files/patch-Makefile +++ b/games/ezquake/files/patch-Makefile @@ -1,19 +1,19 @@ ---- Makefile.orig +--- Makefile.orig 2021-02-09 17:35:52 UTC +++ Makefile -@@ -89,6 +89,7 @@ +@@ -89,6 +89,7 @@ SDL2_CFLAGS ?= $(shell sdl2-config --cflags) SDL2_LIBS ?= $(shell sdl2-config --libs) CFLAGS_c += $(BUILD_DEFS) $(VER_DEFS) $(PATH_DEFS) $(SDL2_CFLAGS) -DNDEBUG -DJSS_CAM -DUSE_PR2 -DWITH_NQPROGS -DUSE_SDL2 -DWITH_ZIP +CFLAGS_c += -DQ1DIR='"$(Q1DIR)"' -DDATADIR='"$(DATADIR)"' LIBS_c += $(SDL2_LIBS) # built-in requirements -@@ -379,7 +380,7 @@ +@@ -379,7 +380,7 @@ endif ifdef CONFIG_WINDOWS TARG_c := ezquake.exe else - TARG_c := ezquake-$(LSYS)-$(CPU) + TARG_c := ezquake-$(LSYS) endif all: $(TARG_c) diff --git a/games/ezquake/files/patch-config_manager.c b/games/ezquake/files/patch-config_manager.c index a8101f526004..f4b99ada77e8 100644 --- a/games/ezquake/files/patch-config_manager.c +++ b/games/ezquake/files/patch-config_manager.c @@ -1,11 +1,11 @@ ---- config_manager.c.orig +--- config_manager.c.orig 2021-02-09 17:35:52 UTC +++ config_manager.c -@@ -68,7 +68,7 @@ +@@ -68,7 +68,7 @@ cvar_t cfg_save_sysinfo = {"cfg_save_sysinfo", "0"}; cvar_t cfg_save_cmdline = {"cfg_save_cmdline", "1"}; cvar_t cfg_backup = {"cfg_backup", "0"}; cvar_t cfg_legacy_exec = {"cfg_legacy_exec", "1"}; -cvar_t cfg_use_home = {"cfg_use_home", "0"}; +cvar_t cfg_use_home = {"cfg_use_home", "1"}; cvar_t cfg_use_gamedir = {"cfg_use_gamedir", "0"}; /************************************ DUMP FUNCTIONS ************************************/ diff --git a/games/ezquake/files/patch-fs.c b/games/ezquake/files/patch-fs.c index d8996840c962..a36395ef144f 100644 --- a/games/ezquake/files/patch-fs.c +++ b/games/ezquake/files/patch-fs.c @@ -1,65 +1,65 @@ ---- fs.c.orig +--- fs.c.orig 2021-02-09 17:35:52 UTC +++ fs.c -@@ -63,6 +63,8 @@ +@@ -63,6 +63,8 @@ char com_basedir[MAX_OSPATH]; // c:/quake char com_homedir[MAX_PATH]; // something really long C:/Documents and Settings/qqshka char userdirfile[MAX_OSPATH] = {0}; char com_userdir[MAX_OSPATH] = {0}; +char com_q1dir[MAX_OSPATH]; // /usr/local/share/quake +char com_datadir[MAX_OSPATH]; // /usr/local/share/ezquake int userdir_type = -1; searchpath_t *fs_searchpaths = NULL; -@@ -616,6 +618,12 @@ +@@ -616,6 +618,12 @@ void FS_SetGamedir (char *dir, qbool force) // Flush all data, so it will be forced to reload. Cache_Flush (); + snprintf(com_q1dir, sizeof(com_q1dir), "%s/%s", Q1DIR, dir); + FS_AddGameDirectory(com_q1dir, FS_LOAD_FILE_ALL); + + snprintf(com_datadir, sizeof(com_datadir), "%s/%s", DATADIR, dir); + FS_AddGameDirectory(com_datadir, FS_LOAD_FILE_ALL); + snprintf(com_gamedir, sizeof(com_gamedir), "%s/%s", com_basedir, dir); FS_AddGameDirectory(com_gamedir, FS_LOAD_FILE_ALL); -@@ -699,6 +707,8 @@ +@@ -699,6 +707,8 @@ void FS_InitFilesystemEx( qbool guess_cwd ) { #elif defined(__linux__) if (!Sys_fullpath(com_basedir, "/proc/self/exe", sizeof(com_basedir))) Sys_Error("FS_InitFilesystemEx: Sys_fullpath failed"); +#elif defined(__FreeBSD__) + snprintf(com_basedir, sizeof(com_basedir), "%s/.ezquake/", getenv("HOME") ? getenv("HOME") : "."); #else com_basedir[0] = 0; // FIXME: MAC / FreeBSD #endif -@@ -717,12 +727,11 @@ +@@ -717,12 +727,11 @@ void FS_InitFilesystemEx( qbool guess_cwd ) { strlcpy (com_basedir, COM_Argv(i + 1), sizeof(com_basedir)); } else { // made com_basedir equa to cwd -//#ifdef __FreeBSD__ -// strlcpy(com_basedir, DATADIR, sizeof(com_basedir) - 1); -//#else - +#ifdef __FreeBSD__ + snprintf(com_basedir, sizeof(com_basedir), "%s/.ezquake/", getenv("HOME") ? getenv("HOME") : "."); +#else Sys_getcwd(com_basedir, sizeof(com_basedir) - 1); // FIXME strlcpy (com_basedir, ".", sizeof(com_basedir)); ? -//#endif +#endif } for (i = 0; i < (int) strlen(com_basedir); i++) -@@ -767,6 +776,14 @@ +@@ -767,6 +776,14 @@ void FS_InitFilesystemEx( qbool guess_cwd ) { } // start up with id1 by default + snprintf(&tmp_path[0], sizeof(tmp_path), "%s/%s", Q1DIR, "id1"); + FS_AddGameDirectory(tmp_path, FS_LOAD_FILE_ALL); + snprintf(&tmp_path[0], sizeof(tmp_path), "%s/%s", Q1DIR, "qw"); + FS_AddGameDirectory(tmp_path, FS_LOAD_FILE_ALL); + snprintf(&tmp_path[0], sizeof(tmp_path), "%s/%s", DATADIR, "ezquake"); + FS_AddGameDirectory(tmp_path, FS_LOAD_FILE_ALL); + snprintf(&tmp_path[0], sizeof(tmp_path), "%s/%s", DATADIR, "qw"); + FS_AddGameDirectory(tmp_path, FS_LOAD_FILE_ALL); snprintf(&tmp_path[0], sizeof(tmp_path), "%s/%s", com_basedir, "id1"); FS_AddGameDirectory(tmp_path, FS_LOAD_FILE_ALL); snprintf(&tmp_path[0], sizeof(tmp_path), "%s/%s", com_basedir, "ezquake"); diff --git a/games/ezquake/files/patch-gl__texture.c b/games/ezquake/files/patch-gl__texture.c new file mode 100644 index 000000000000..c5250684aefd --- /dev/null +++ b/games/ezquake/files/patch-gl__texture.c @@ -0,0 +1,11 @@ +--- gl_texture.c.orig 2021-02-09 17:35:52 UTC ++++ gl_texture.c +@@ -417,7 +417,7 @@ static void GL_Upload32 (unsigned *data, int width, in + + static void GL_Upload8 (byte *data, int width, int height, int mode) + { +- static unsigned trans[640 * 480]; ++ static unsigned trans[8192 * 8192]; + int i, image_size, p; + unsigned *table; + diff --git a/games/ezquake/files/patch-host.c b/games/ezquake/files/patch-host.c index cba197302ad7..ff4f65a13da5 100644 --- a/games/ezquake/files/patch-host.c +++ b/games/ezquake/files/patch-host.c @@ -1,42 +1,42 @@ ---- host.c.orig +--- host.c.orig 2021-02-09 17:35:52 UTC +++ host.c -@@ -333,16 +333,30 @@ +@@ -333,16 +333,30 @@ void SYSINFO_Init(void) SYSINFO_processor_description = cpu_model; gettimeofday(&old_tp, NULL); +#if defined(__powerpc__) || defined(__i386__) || defined(__amd64__) +#ifdef __powerpc__ + __asm__ __volatile__("mfspr %%r3, 268": "=r" (old_tsc)); +#else old_tsc = rdtsc(); +#endif do { gettimeofday(&tp, NULL); } while ((tp.tv_sec - old_tp.tv_sec) * 1000000. + tp.tv_usec - old_tp.tv_usec < 1000000.); +#ifdef __powerpc__ + __asm__ __volatile__("mfspr %%r3, 268": "=r" (tsc_freq)); +#else tsc_freq = rdtsc(); +#endif SYSINFO_MHz = (int)((tsc_freq - old_tsc) / (tp.tv_sec - old_tp.tv_sec + (tp.tv_usec - old_tp.tv_usec) / 1000000.) / 1000000. + .5); // VVD: We can use sysctl hw.clockrate, but it don't work on i486 - always 0. // Must work on Pentium 1/2/3; tested on Pentium 4. And RELENG_4 have no this sysctl. +#else + len = sizeof(val); + sysctlbyname("dev.cpu.0.freq", &val, &len, NULL, 0); + SYSINFO_MHz = val; +#endif if (gl_renderer && gl_renderer[0]) { if (SYSINFO_3D_description != NULL) { -@@ -351,7 +365,7 @@ +@@ -351,7 +365,7 @@ void SYSINFO_Init(void) SYSINFO_3D_description = Q_strdup(gl_renderer); } - snprintf(f_system_string, sizeof(f_system_string), "%lluMB", (int)(SYSINFO_memory / 1024LLU / 1024LLU)); + snprintf(f_system_string, sizeof(f_system_string), "%lluMB", SYSINFO_memory / 1024LLU / 1024LLU); if (SYSINFO_processor_description) { strlcat(f_system_string, ", ", sizeof(f_system_string));