Re: Update from Maintainer: games/mvdsv 0.34 -> 0.35

2022-08-23 Thread Nam Nguyen
Tom Murphy writes:

> 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. I've committed this with a tweak of changing the
CMAKE_SYSTEM_NAME line (commented inline). The !OpenBSD did not work in
my testing; when I tested with !FreeBSD it would omit dl anyways. Using
NOT seems to detect platform.

> + # Check build target, and included sources and libs
> + if(UNIX)
> + target_link_libraries(${PROJECT_NAME} m)
> ++if(CMAKE_SYSTEM_NAME MATCHES !OpenBSD)

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)
> +@@ -147,6 +164,9 @@ if(CURL_FOUND)
> + target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES})
> + endif()



Re: Update from Maintainer: games/mvdsv 0.34 -> 0.35

2022-08-23 Thread Tom Murphy
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
--- Makefile11 Mar 2022 19:04:41 -  1.5
+++ Makefile23 Aug 2022 13:43:29 -
@@ -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
--- distinfo16 Oct 2021 14:43:12 -  1.3
+++ distinfo23 Aug 2022 13:43:29 -
@@ -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 -
+++ patches/patch-CMakeLists_txt23 Aug 2022 13:43:29 -
@@ -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 -  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -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 += [
--  

Re: Update from Maintainer: games/mvdsv 0.34 -> 0.35

2022-08-22 Thread Tom Murphy
Hi Nam,

On Tue, Aug 16, 2022 at 06:52:03PM -0700, Nam Nguyen wrote:
> Tom Murphy writes:
> 
> > Hi,
> >
> >   Here is a diff to update games/mvdsv from 0.34 to 0.35.
> >   A few notable changes:
> >
> >   * meson build dropped -- only uses cmake
> >   * devel/pcre no longer used -- dropped in favor of wraps
> 
> wraps was part of meson and not cmake. Since it has moved to cmake, it
> now uses the ancient bundled pcre. I am concerned about security with
> the bundled pcre, so I would prefer holding off on this update until
> cmake is updated to allow linking against system pcre. It seems like
> debian had a similar concern.
> 
> see: https://github.com/QW-Group/mvdsv/issues/40

I've reworked the diff and got Cmake to use devel/pcre instead of the
bundled, outdated pcre. Can you have a look and tell me if this looks
OK? My experience of CMake is rather limited.

Thanks,
Tom

Index: Makefile
===
RCS file: /cvs/ports/games/mvdsv/Makefile,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 Makefile
--- Makefile11 Mar 2022 19:04:41 -  1.5
+++ Makefile22 Aug 2022 16:46:36 -
@@ -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
--- distinfo16 Oct 2021 14:43:12 -  1.3
+++ distinfo22 Aug 2022 16:46:36 -
@@ -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 -
+++ patches/patch-CMakeLists_txt22 Aug 2022 16:46:36 -
@@ -0,0 +1,44 @@
+Remove link to dl as it is in OpenBSD's libc
+Have Cmake find and link to devel/pcre instead of the outdated bundled pcre
+Index: CMakeLists.txt
+--- CMakeLists.txt.orig
 CMakeLists.txt
+@@ -89,7 +89,20 @@ else()
+   )
+ endif()
+ 
++##
+ 
++# Check for pcre, and include sources and libs, if found
++find_library(PCRE_LIBRARIES pcre)
++if(PCRE_LIBRARIES)
++  set(HAVE_LIBPCRE 1)
++  find_path(PCRE_INCLUDE_DIR pcre.h)
++  if(PCRE_INCLUDE_DIR)
++  include_directories(${PCRE_INCLUDE_DIR})
++  set(CMAKE_REQUIRED_INCLUDES ${PCRE_INCLUDE_DIR})
++  endif(PCRE_INCLUDE_DIR)
++  mark_as_advanced(FORCE PCRE_LIBRARIES PCRE_INCLUDE_DIR)
++endif(PCRE_LIBRARIES)
++
+ 
##
+ 
+ # Set base compiler flags
+@@ -118,7 +131,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${C
+ # Check build target, and included sources and libs
+ if(UNIX)
+   target_link_libraries(${PROJECT_NAME} m)
+-  target_link_libraries(${PROJECT_NAME} dl)
+ else()
+   target_link_libraries(${PROJECT_NAME} ws2_32)
+   target_link_libraries(${PROJECT_NAME} winmm)
+@@ -147,6 +159,9 @@ if(CURL_FOUND)
+   target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES})
+ endif()
+ 
++if(PCRE_LIBRARIES)
++  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 -  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -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),
-+  

Re: Update from Maintainer: games/mvdsv 0.34 -> 0.35

2022-08-16 Thread Nam Nguyen
Tom Murphy writes:

> Hi,
>
>   Here is a diff to update games/mvdsv from 0.34 to 0.35.
>   A few notable changes:
>
>   * meson build dropped -- only uses cmake
>   * devel/pcre no longer used -- dropped in favor of wraps

wraps was part of meson and not cmake. Since it has moved to cmake, it
now uses the ancient bundled pcre. I am concerned about security with
the bundled pcre, so I would prefer holding off on this update until
cmake is updated to allow linking against system pcre. It seems like
debian had a similar concern.

see: https://github.com/QW-Group/mvdsv/issues/40



Update from Maintainer: games/mvdsv 0.34 -> 0.35

2022-08-03 Thread Tom Murphy
Hi,

  Here is a diff to update games/mvdsv from 0.34 to 0.35.
  A few notable changes:

  * Github project changed from 'deurk' to 'QW-Group'
  * meson build dropped -- only uses cmake
  * devel/pcre no longer used -- dropped in favor of wraps
  * New patch for CMakeLists.txt to stop trying to link
'dl' which is already in OpenBSD's libc

Thanks,
Tom


Index: Makefile
===
RCS file: /cvs/ports/games/mvdsv/Makefile,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 Makefile
--- Makefile11 Mar 2022 19:04:41 -  1.5
+++ Makefile3 Aug 2022 16:57:23 -
@@ -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
 
@@ -17,19 +17,15 @@ MASTER_SITES0 = https://raw.githubuserco
 # GPLv2+
 PERMIT_PACKAGE =   Yes
 
-WANTLIB += c curl m pcre pthread
+WANTLIB += c curl m pthread
 
 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
+LIB_DEPENDS =  net/curl
 
 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
--- distinfo16 Oct 2021 14:43:12 -  1.3
+++ distinfo3 Aug 2022 16:57:23 -
@@ -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 -
+++ patches/patch-CMakeLists_txt3 Aug 2022 16:57:23 -
@@ -0,0 +1,12 @@
+Remove link to dl as it is in OpenBSD's libc
+Index: CMakeLists.txt
+--- CMakeLists.txt.orig
 CMakeLists.txt
+@@ -118,7 +118,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${C
+ # Check build target, and included sources and libs
+ if(UNIX)
+   target_link_libraries(${PROJECT_NAME} m)
+-  target_link_libraries(${PROJECT_NAME} dl)
+ else()
+   target_link_libraries(${PROJECT_NAME} ws2_32)
+   target_link_libraries(${PROJECT_NAME} winmm)
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 -  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -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_c11 Mar 2022 19:04:41 -  1.2
+++ patches/patch-src_sv_ccmds_c3 Aug 2022 16:57:23 -
@@ -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
//<-