Wednesday, November 01, 2023

(DIST_TUPLE) - Re: Update from Maintainer: games/mvdsv -> 0.36

On 2023/10/31 21:34, Tom Murphy wrote:
> This diff updates games/mvdsv to 0.36. There was some reordering I
> had to do to get this working since the github repo now requires a
> submodule for the "qwprotocol". I took advantage of the new DIST_TUPLE
> mechanism for both this submodule and for the distribution of the
> qwprogs.dat file (which is found free in the id-Software/Quake repo)
> so the old SITES.a line is gone, replaced by DIST_TUPLE.

Better to use DIST_TUPLE for everything and skip the indirection
via extra variables, I think. This should be functionally equivalent
to your diff.

(I wonder if DIST_TUPLE/bsd.port.mk can be wrangled into allowing
truncated commit hashes somehow... would need explicit signalling for
tags vs hash rather than implying based on whether the 4th argument
looks like a hash but that might be possible... anyway that's a
possible future direction and not for this diff)

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/mvdsv/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile 25 Sep 2023 17:07:29 -0000 1.9
+++ Makefile 1 Nov 2023 07:10:15 -0000
@@ -1,27 +1,19 @@
COMMENT = QuakeWorld server

-GH_ACCOUNT = QW-Group
-GH_PROJECT = mvdsv
-GH_TAGNAME = 0.35
-
CATEGORIES = games

-HOMEPAGE = https://sourceforge.net/projects/mvdsv/
-
-MAINTAINER = Tom Murphy <openbsd@pertho.net>
-
-QWP_COMMIT = 0023db327bc1db00068284b70e1db45857aeee35
-QWP_VERSION = 20120131
-SITES.a = https://raw.githubusercontent.com/id-Software/Quake/${QWP_COMMIT}/QW/progs/
+DIST_TUPLE += github QW-Group mvdsv 0.36 .
+DIST_TUPLE += github QW-Group qwprot 53af547d0608a1507895fc1629cdc3f4820fc0af src/qwprot
+DIST_TUPLE += github id-software Quake bf4ac424ce754894ac8f1dae6a3981954bc9852d .

# GPLv2+
PERMIT_PACKAGE = Yes

-WANTLIB += c curl m pcre pthread
+MAINTAINER = Tom Murphy <openbsd@pertho.net>

-DISTFILES = mvdsv-{}${GH_TAGNAME}.tar.gz
-DISTFILES.a = qwprogs-${QWP_VERSION}{qwprogs}.dat
-EXTRACT_ONLY = mvdsv-${GH_TAGNAME}.tar.gz
+HOMEPAGE = https://mvdsv.quake.se/
+
+WANTLIB += c curl m pcre pthread

MODULES = devel/cmake

@@ -36,7 +28,7 @@ do-install:
${INSTALL_PROGRAM} ${WRKBUILD}/mvdsv ${PREFIX}/bin
${INSTALL_DATA_DIR} ${SAMPLES_DIR}
${INSTALL_DATA} ${FILESDIR}/server.cfg ${SAMPLES_DIR}
- ${INSTALL_DATA} ${DISTDIR}/qwprogs-${QWP_VERSION}.dat \
- ${SAMPLES_DIR}/qwprogs.dat
+ ${INSTALL_DATA} ${WRKDIR}/${QWDAT_REPO}-${QWDAT_COMMIT}/QW/progs/qwprogs.dat \
+ ${SAMPLES_DIR}/qwprogs.dat

.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/games/mvdsv/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo 24 Aug 2022 03:24:32 -0000 1.4
+++ distinfo 1 Nov 2023 07:10:15 -0000
@@ -1,4 +1,6 @@
-SHA256 (mvdsv-0.35.tar.gz) = bk7yLKpr85yxLjGLd9gFmVXb+fxBmttPbnR2aOYAC5o=
-SHA256 (qwprogs-20120131.dat) = /1HLXnc2DXK5NIfYkZjc+UYpuS+LrhAPxupIpsEqeDA=
-SIZE (mvdsv-0.35.tar.gz) = 555708
-SIZE (qwprogs-20120131.dat) = 197684
+SHA256 (QW-Group-mvdsv-0.36.tar.gz) = jyoHILfjcMyqejVQTA59165akFGzbpS3jWUlbzTpuOk=
+SHA256 (QW-Group-qwprot-53af547d0608a1507895fc1629cdc3f4820fc0af.tar.gz) = +nkEALY4D495qX9h2LdciMAwR3CWcT6ewRLjBUsuxFA=
+SHA256 (id-software-Quake-bf4ac424ce754894ac8f1dae6a3981954bc9852d.tar.gz) = +5joyZdAEj8/rIMME4dYTsH2hNuJCMv0K3GH0G05kBM=
+SIZE (QW-Group-mvdsv-0.36.tar.gz) = 551595
+SIZE (QW-Group-qwprot-53af547d0608a1507895fc1629cdc3f4820fc0af.tar.gz) = 8815
+SIZE (id-software-Quake-bf4ac424ce754894ac8f1dae6a3981954bc9852d.tar.gz) = 2958901
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 25 Sep 2022 16:34:20 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,85 +0,0 @@
-Remove link to dl as it is in OpenBSD's libc
-Have Cmake find and link to devel/pcre if installed, otherwise fall back to bundled pcre.
-Prevent error in target_compile_definitions when big-endian
-Index: CMakeLists.txt
---- CMakeLists.txt.orig
-+++ CMakeLists.txt
-@@ -59,8 +59,6 @@ set(SRC_COMMON
- "${DIR_SRC}/vfs_pak.c"
- "${DIR_SRC}/world.c"
- "${DIR_SRC}/zone.c"
-- "${DIR_SRC}/pcre/get.c"
-- "${DIR_SRC}/pcre/pcre.c"
- )
-
- # Check build target, and included sources
-@@ -89,14 +87,31 @@ else()
- )
- endif()
-
-+######################################################################################################
-
-+# Check for pcre, and include sources and libs, if found
-+find_library(PCRE_LIBRARIES pcre)
-+if(PCRE_LIBRARIES)
-+ set(PCRE_FOUND 1)
-+ find_path(PCRE_INCLUDE_DIR pcre.h)
-+endif(PCRE_LIBRARIES)
-+
-+if(NOT PCRE_FOUND)
-+ message(STATUS "PCRE library not found. Using bundled PCRE intead.")
-+ list(APPEND SRC_COMMON
-+ "${DIR_SRC}/pcre/get.c"
-+ "${DIR_SRC}/pcre/pcre.c"
-+ )
-+else()
-+ message(STATUS "Found PCRE: ${PCRE_LIBRARIES}")
-+endif()
-+
- ######################################################################################################
-
- # Set base compiler flags
- set(CFLAGS -Wall)
- set(LFLAGS)
-
--
- ######################################################################################################
-
- # Set target
-@@ -111,14 +126,16 @@ set_target_properties(${PROJECT_NAME}
-
- # Set include directories
- target_include_directories(${PROJECT_NAME} PRIVATE ${CURL_INCLUDE_DIRS})
-+target_include_directories(${PROJECT_NAME} PRIVATE ${PCRE_INCLUDE_DIR})
-
--
- ######################################################################################################
-
- # Check build target, and included sources and libs
- if(UNIX)
- target_link_libraries(${PROJECT_NAME} m)
-+if(NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
- target_link_libraries(${PROJECT_NAME} dl)
-+endif()
- else()
- target_link_libraries(${PROJECT_NAME} ws2_32)
- target_link_libraries(${PROJECT_NAME} winmm)
-@@ -135,7 +152,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE USE
- include (TestBigEndian)
- TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
- if(IS_BIG_ENDIAN)
-- target_compile_definitions(${PROJECT_NAME} __BIG_ENDIAN__Q__)
-+ target_compile_definitions(${PROJECT_NAME} PRIVATE __BIG_ENDIAN__Q__)
- message(STATUS "BIG_ENDIAN")
- else()
- target_compile_definitions(${PROJECT_NAME} PRIVATE __LITTLE_ENDIAN__Q__)
-@@ -147,6 +164,9 @@ if(CURL_FOUND)
- target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES})
- endif()
-
-+if(PCRE_FOUND)
-+ target_link_libraries(${PROJECT_NAME} ${PCRE_LIBRARIES})
-+endif()
-
- ######################################################################################################
-
Index: patches/patch-src_server_h
===================================================================
RCS file: /cvs/ports/games/mvdsv/patches/patch-src_server_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_server_h
--- patches/patch-src_server_h 11 Mar 2022 19:04:41 -0000 1.2
+++ patches/patch-src_server_h 1 Nov 2023 07:10:15 -0000
@@ -6,7 +6,7 @@ at: https://github.com/deurk/mvdsv/pull/
Index: src/server.h
--- src/server.h.orig
+++ src/server.h
-@@ -1087,7 +1087,6 @@ void SV_SetClientConnectionTime(client_t* client);
+@@ -1088,7 +1088,6 @@ void SV_SetClientConnectionTime(client_t* client);
#ifdef SERVERONLY
// mvdsv not changed over to enums yet, which was more about documentation
#define SV_CommandLineEnableCheats() (COM_CheckParm("-cheats"))
@@ -14,7 +14,7 @@ Index: src/server.h
#define SV_CommandLineDemoCacheArgument() (COM_CheckParm("-democache"))
#define SV_CommandLineProgTypeArgument() (COM_CheckParm("-progtype"))
#define SV_CommandLineUseMinimumMemory() (COM_CheckParm("-minmemory"))
-@@ -1095,7 +1094,6 @@ void SV_SetClientConnectionTime(client_t* client);
+@@ -1096,7 +1095,6 @@ void SV_SetClientConnectionTime(client_t* client);
#define SV_CommandLineHeapSizeMemoryMB() (COM_CheckParm("-mem"))
#else
#define SV_CommandLineEnableCheats() (COM_CheckParm(cmdline_param_server_enablecheats))

No comments:

Post a Comment