Hi,

  I've redone the diff to match what you recommend upstream. I've also
added logic so that if system is UNIX but not OpenBSD, then link in dl
(which allows it to build for other platforms upstream). Once this is
committed upstream I can remove the CMakeLists.txt patch.

  Thanks,
  Tom


Index: Makefile
===================================================================
RCS file: /cvs/ports/games/mvdsv/Makefile,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 Makefile
--- Makefile    11 Mar 2022 19:04:41 -0000      1.5
+++ Makefile    23 Aug 2022 13:43:29 -0000
@@ -1,8 +1,8 @@
 COMMENT =      QuakeWorld server
 
-GH_ACCOUNT =   deurk
+GH_ACCOUNT =   QW-Group
 GH_PROJECT =   mvdsv
-GH_TAGNAME =   0.34
+GH_TAGNAME =   0.35
 
 CATEGORIES =   games
 
@@ -23,13 +23,10 @@ DISTFILES = mvdsv-{}${GH_TAGNAME}.tar.gz
                qwprogs-${QWP_VERSION}{qwprogs}.dat:0
 EXTRACT_ONLY = mvdsv-${GH_TAGNAME}.tar.gz
 
-MODULES =      devel/meson
+MODULES =      devel/cmake
 
 LIB_DEPENDS =  devel/pcre \
                net/curl
-
-# help ld.bfd find libnghttp2
-LDFLAGS =      -L${LOCALBASE}/lib
 
 NO_TEST =      Yes
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/games/mvdsv/distinfo,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 distinfo
--- distinfo    16 Oct 2021 14:43:12 -0000      1.3
+++ distinfo    23 Aug 2022 13:43:29 -0000
@@ -1,4 +1,4 @@
-SHA256 (mvdsv-0.34.tar.gz) = gZBxjf4QiPTxKmYXfusBwaUn9fRl5w3sT7uP7tSZTGo=
+SHA256 (mvdsv-0.35.tar.gz) = bk7yLKpr85yxLjGLd9gFmVXb+fxBmttPbnR2aOYAC5o=
 SHA256 (qwprogs-20120131.dat) = /1HLXnc2DXK5NIfYkZjc+UYpuS+LrhAPxupIpsEqeDA=
-SIZE (mvdsv-0.34.tar.gz) = 597476
+SIZE (mvdsv-0.35.tar.gz) = 555708
 SIZE (qwprogs-20120131.dat) = 197684
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-CMakeLists_txt        23 Aug 2022 13:43:29 -0000
@@ -0,0 +1,75 @@
+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.
+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(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)
+@@ -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-meson_build
===================================================================
RCS file: patches/patch-meson_build
diff -N patches/patch-meson_build
--- patches/patch-meson_build   11 Mar 2022 19:04:41 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-Index: meson.build
---- meson.build.orig
-+++ meson.build
-@@ -86,8 +86,8 @@ if target_machine.system() == 'windows'
- else
-       mvdsv_sources += 'src/sv_sys_unix.c'
-       deps += [
--              meson.get_compiler('c').find_library('m'),
--              meson.get_compiler('c').find_library('dl'),
-+              meson.get_compiler('c').find_library('m', required: false),
-+              meson.get_compiler('c').find_library('dl', required: false),
-       ]
- endif
- 
Index: patches/patch-src_sv_ccmds_c
===================================================================
RCS file: /cvs/ports/games/mvdsv/patches/patch-src_sv_ccmds_c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-src_sv_ccmds_c
--- patches/patch-src_sv_ccmds_c        11 Mar 2022 19:04:41 -0000      1.2
+++ patches/patch-src_sv_ccmds_c        23 Aug 2022 13:43:29 -0000
@@ -5,7 +5,7 @@ at: https://github.com/deurk/mvdsv/pull/
 Index: src/sv_ccmds.c
 --- src/sv_ccmds.c.orig
 +++ src/sv_ccmds.c
-@@ -738,54 +738,6 @@ void SV_ChmodFile_f (void)
+@@ -741,54 +741,6 @@ void SV_ChmodFile_f (void)
  }
  #endif //_WIN32
  
@@ -60,7 +60,7 @@ Index: src/sv_ccmds.c
  /*
  ==================
  SV_Kick_f
-@@ -1844,8 +1796,6 @@ void SV_InitOperatorCommands (void)
+@@ -1847,8 +1799,6 @@ void SV_InitOperatorCommands (void)
        Cmd_AddCommand ("chmod", SV_ChmodFile_f);
  #endif //_WIN32
        //<-

Reply via email to