diff --git a/games/ezquake/Makefile b/games/ezquake/Makefile index 2abd0da8d2d6..e035deaab274 100644 --- a/games/ezquake/Makefile +++ b/games/ezquake/Makefile @@ -1,46 +1,46 @@ # Created by: alepulver PORTNAME= ezquake DISTVERSION= 3.2.3 -PORTREVISION= 1 +PORTREVISION= 2 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@unislabs.com COMMENT= Modern QuakeWorld client 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-host.c b/games/ezquake/files/patch-host.c index 0506eb4589d0..cba197302ad7 100644 --- a/games/ezquake/files/patch-host.c +++ b/games/ezquake/files/patch-host.c @@ -1,31 +1,42 @@ ---- host.c.orig 2020-09-16 22:08:02 UTC +--- host.c.orig +++ host.c -@@ -333,11 +333,19 @@ void SYSINFO_Init(void) +@@ -333,16 +333,30 @@ 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); -@@ -351,7 +359,7 @@ void SYSINFO_Init(void) + // 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 @@ 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));