Index: games/Makefile =================================================================== --- games/Makefile +++ games/Makefile @@ -1157,6 +1157,7 @@ SUBDIR += xzip SUBDIR += yadex SUBDIR += yahtzee + SUBDIR += yquake2 SUBDIR += zangband SUBDIR += zatacka SUBDIR += zaz Index: games/yquake2/Makefile =================================================================== --- /dev/null +++ games/yquake2/Makefile @@ -0,0 +1,30 @@ +PORTNAME= yquake2 +DISTVERSIONPREFIX= QUAKE2_ +DISTVERSION= 8_00 +CATEGORIES= games + +MAINTAINER= shamaz.mazum@gmail.com +COMMENT= Yamagi QuakeII is an improved version of Icculus Quake II + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libcurl.so:ftp/curl + +USES= cmake gl openal sdl +USE_GITHUB= yes +USE_GL= gl +USE_SDL= sdl2 +CMAKE_ON= SYSTEMWIDE_SUPPORT + +CONFLICTS_INSTALL= quake2lnx quake2max quake2sdl + +OPTIONS_SUB= yes + +.include "${.CURDIR}/../quake2-data/Makefile.include" + +post-patch: .SILENT + ${REINPLACE_CMD} -e 's|%%DATADIR%%|${Q2DIR}| ; \ + s|%%LIBDIR%%|${PREFIX}/lib|' ${WRKSRC}/src/common/filesystem.c + +.include Index: games/yquake2/distinfo =================================================================== --- /dev/null +++ games/yquake2/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1648197658 +SHA256 (yquake2-yquake2-QUAKE2_8_00_GH0.tar.gz) = 44114a766d0b05f6a5da2cb77e7a6a1c4795118f8d60d521097d2e9728f63348 +SIZE (yquake2-yquake2-QUAKE2_8_00_GH0.tar.gz) = 2495259 Index: games/yquake2/files/patch-CMakeLists.txt =================================================================== --- /dev/null +++ games/yquake2/files/patch-CMakeLists.txt @@ -0,0 +1,10 @@ +--- CMakeLists.txt.orig 2021-06-20 06:28:58 UTC ++++ CMakeLists.txt +@@ -660,3 +660,7 @@ set_target_properties(ref_soft PROPERTIES + SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX} + ) + target_link_libraries(ref_soft ${yquake2LinkerFlags} ${yquake2SDLLinkerFlags}) ++ ++install (TARGETS quake2 q2ded RUNTIME DESTINATION bin) ++install (TARGETS ref_soft ref_gl1 ref_gl3 LIBRARY DESTINATION lib/yquake2) ++install (TARGETS game LIBRARY DESTINATION lib/yquake2/baseq2) Index: games/yquake2/files/patch-src_client_vid_vid.c =================================================================== --- /dev/null +++ games/yquake2/files/patch-src_client_vid_vid.c @@ -0,0 +1,18 @@ +--- src/client/vid/vid.c.orig 2021-06-20 06:42:10 UTC ++++ src/client/vid/vid.c +@@ -318,7 +318,14 @@ const char* lib_ext = "so"; + static void + VID_GetRendererLibPath(const char *renderer, char *path, size_t len) + { +- snprintf(path, len, "%sref_%s.%s", Sys_GetBinaryDir(), renderer, lib_ext); ++ char *next_path = NULL; ++ ++ while ((next_path = FS_GetNextRawPath (next_path)) != NULL) { ++ snprintf(path, len, "%s/ref_%s.%s", next_path, renderer, lib_ext); ++ if (Sys_IsFile(path)) { ++ break; ++ } ++ } + } + + /* Index: games/yquake2/files/patch-src_common_filesystem.c =================================================================== --- /dev/null +++ games/yquake2/files/patch-src_common_filesystem.c @@ -0,0 +1,24 @@ +--- src/common/filesystem.c.orig 2021-06-20 06:39:17 UTC ++++ src/common/filesystem.c +@@ -37,8 +37,9 @@ + #define MAX_PAKS 100 + + #ifdef SYSTEMWIDE +- #ifndef SYSTEMDIR +- #define SYSTEMDIR "/usr/share/games/quake2" ++ #if !defined(SYSTEMDATADIR) || !defined( SYSTEMLIBDIR) ++ #define SYSTEMDATADIR "%%DATADIR%%/" ++ #define SYSTEMLIBDIR "%%LIBDIR%%/yquake2/" + #endif + #endif + +@@ -1881,7 +1882,8 @@ void FS_BuildRawPath(void) { + + // Add SYSTEMDIR + #ifdef SYSTEMWIDE +- FS_AddDirToRawPath(SYSTEMDIR, false); ++ FS_AddDirToRawPath(SYSTEMDATADIR, false); ++ FS_AddDirToRawPath(SYSTEMLIBDIR, false); + #endif + + // The CD must be the last directory of the path, Index: games/yquake2/pkg-descr =================================================================== --- /dev/null +++ games/yquake2/pkg-descr @@ -0,0 +1,11 @@ +Yamagi Quake II is an enhanced client for id Software's Quake II with +focus on offline and coop gameplay. Both the gameplay and the graphics +are unchanged, but many bugs in the last official release were fixed +and some nice to have features like widescreen support and a modern +OpenGL 3.2 renderer were added. Unlike most other Quake II source +ports Yamagi Quake II is fully 64-bit clean. It works perfectly on +modern processors and operating systems. Yamagi Quake II runs on +nearly all common platforms; including FreeBSD, Linux, NetBSD, +OpenBSD, Windows and macOS (experimental). + +WWW: https://github.com/yquake2/yquake2 \ No newline at end of file Index: games/yquake2/pkg-plist =================================================================== --- /dev/null +++ games/yquake2/pkg-plist @@ -0,0 +1,6 @@ +bin/q2ded +bin/quake2 +lib/yquake2/baseq2/game.so +lib/yquake2/ref_gl1.so +lib/yquake2/ref_gl3.so +lib/yquake2/ref_soft.so