On Wed, Aug 18, 2021 at 11:13:22AM +0100, Edd Barrett wrote:
> On Mon, Aug 16, 2021 at 03:06:09PM +0100, Edd Barrett wrote:
> > On Fri, Aug 06, 2021 at 10:52:51AM +0100, Edd Barrett wrote:
> > > Comments? OK?
> >
> > Any comments before I commit this?
>
> 0.9.4 was just released. Here's a diff for that...
Hey Edd,
Gave this a go on my amd64 laptop, snapshot as of 24hrs ago,
ports updated just before I applied the patch.
This didn't patch properly during "make patch" until I changed the
FIX_CRLF_FILES line to include:
FIX_CRLF_FILES = CMakeLists.txt odalaunch/CMakeLists.txt
Then it built right, but on the fake stage it failed to find odamex.wad.
On a hunch, I pkg_add deutex and restarted the build process. That
worked, so I think you also need a BUILD_DEPENDS on archivers/deutex.
This produced a working package for me and I was able to go pew pew
in a single player game, and also fire up odalaunch and join a server
and shoot the empty space where I wish more players were ;)
-ryan
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/games/odamex/Makefile,v
> retrieving revision 1.5
> diff -u -p -r1.5 Makefile
> --- Makefile 9 Jun 2021 19:50:07 -0000 1.5
> +++ Makefile 17 Aug 2021 08:50:32 -0000
> @@ -2,10 +2,9 @@
>
> COMMENT = online multiplayer doom
>
> -V = 0.8.3
> +V = 0.9.4
> DISTNAME = odamex-src-${V}
> PKGNAME = odamex-${V}
> -REVISION = 0
>
> CATEGORIES = games
> HOMEPAGE = https://odamex.net/
> @@ -15,10 +14,9 @@ MAINTAINER = Edd Barrett <[email protected]
> PERMIT_PACKAGE = Yes
>
> WANTLIB += ${COMPILER_LIBCXX} ICE SDL2 SDL2_mixer SM X11 Xext
> -WANTLIB += c execinfo m miniupnpc png portmidi wx_baseu-3.0 wx_baseu_net-3.0
> -WANTLIB += wx_baseu_xml-3.0 wx_gtk3u_adv-3.0 wx_gtk3u_core-3.0
> -WANTLIB += wx_gtk3u_html-3.0 wx_gtk3u_qa-3.0 wx_gtk3u_xrc-3.0
> -WANTLIB += z
> +WANTLIB += c curl execinfo m miniupnpc png portmidi wx_baseu-3.0
> +WANTLIB += wx_baseu_net-3.0 wx_gtk3u_adv-3.0 wx_gtk3u_core-3.0
> +WANTLIB += wx_gtk3u_xrc-3.0 z
>
> MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=odamex/}
> EXTRACT_SUFX = .tar.bz2
> @@ -29,21 +27,20 @@ COMPILER = base-clang ports-gcc base-gc
>
> MODULES = devel/cmake
>
> -CONFIGURE_ENV += CXXFLAGS="-I${LOCALBASE}/include
> -I${LOCALBASE}/include/miniupnpc" \
> - LDFLAGS="-L${LOCALBASE}/lib"
> +# Note that odamex won't build against the system libjsoncpp (doesn't build
> +# with std=gnu++98), so we use the bundled one. Upstream notified.
> +CONFIGURE_ENV += CXXFLAGS=-I${LOCALBASE}/include/miniupnpc \
> + LDFLAGS=-L${LOCALBASE}/lib
> CONFIGURE_ARGS += -DNO_AG-ODALAUNCH_TARGET=YES
>
> LIB_DEPENDS = x11/wxWidgets \
> audio/portmidi \
> graphics/png \
> devel/sdl2-mixer \
> - net/miniupnp/miniupnpc
> + net/miniupnp/miniupnpc \
> + net/curl
>
> NO_TEST = Yes
> -
> -pre-build:
> - ${SUBST_CMD} ${WRKSRC}/CMakeLists.txt
> - ${SUBST_CMD} ${WRKSRC}/server/CMakeLists.txt
>
> EXAMPLES_DIR = ${PREFIX}/share/examples/odamex
> post-install:
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/games/odamex/distinfo,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 distinfo
> --- distinfo 5 Oct 2020 21:07:37 -0000 1.1.1.1
> +++ distinfo 17 Aug 2021 08:50:47 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (odamex-src-0.8.3.tar.bz2) =
> 3M/SMwPXQlCLvs8SQIpVVTkGc5GSzfPy1tXi8HWP+eY=
> -SIZE (odamex-src-0.8.3.tar.bz2) = 8532510
> +SHA256 (odamex-src-0.9.4.tar.bz2) =
> tKYsnEcmQOYQOPZ6EvbgwVkj4yNvHHGEnzfow1A2bVQ=
> +SIZE (odamex-src-0.9.4.tar.bz2) = 6659835
> Index: patches/patch-CMakeLists_txt
> ===================================================================
> RCS file: patches/patch-CMakeLists_txt
> diff -N patches/patch-CMakeLists_txt
> --- patches/patch-CMakeLists_txt 5 Oct 2020 21:07:37 -0000 1.1.1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,34 +0,0 @@
> -$OpenBSD: patch-CMakeLists_txt,v 1.1.1.1 2020/10/05 21:07:37 edd Exp $
> -
> -INSTALL_PREFIX needs to be set to find executables and wads.
> -
> -Don't use the bundled miniupnpc.
> -
> -Index: CMakeLists.txt
> ---- CMakeLists.txt.orig
> -+++ CMakeLists.txt
> -@@ -10,6 +10,7 @@ set(CMAKE_INSTALL_BINDIR "bin")
> - set(CMAKE_INSTALL_DATADIR "share")
> - include(GNUInstallDirs OPTIONAL)
> -
> -+add_definitions(-DINSTALL_PREFIX="${PREFIX}")
> - add_definitions(-DINSTALL_BINDIR="${CMAKE_INSTALL_BINDIR}")
> - add_definitions(-DINSTALL_DATADIR="${CMAKE_INSTALL_DATADIR}")
> -
> -@@ -149,16 +150,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/module
> - # git describe
> - include(GetGitRevisionDescription)
> - git_describe(GIT_DESCRIBE --tags --always)
> --
> --# MiniUPnPc
> --if (USE_MINIUPNP)
> -- set(UPNPC_BUILD_STATIC ON CACHE INTERNAL "" FORCE)
> -- set(UPNPC_BUILD_SHARED OFF CACHE INTERNAL "" FORCE)
> -- set(UPNPC_BUILD_TESTS OFF CACHE INTERNAL "" FORCE)
> -- set(UPNPC_INSTALL OFF CACHE INTERNAL "" FORCE)
> -- mark_as_advanced(FORCE UPNPC_INSTALL)
> -- add_subdirectory(libraries/libminiupnpc)
> --endif()
> -
> - # Subdirectories for Odamex projects
> - if(BUILD_CLIENT)
> Index: patches/patch-client_CMakeLists_txt
> ===================================================================
> RCS file: /cvs/ports/games/odamex/patches/patch-client_CMakeLists_txt,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-client_CMakeLists_txt
> --- patches/patch-client_CMakeLists_txt 5 Oct 2020 21:07:37 -0000
> 1.1.1.1
> +++ patches/patch-client_CMakeLists_txt 22 Jul 2021 19:55:12 -0000
> @@ -3,7 +3,7 @@ $OpenBSD: patch-client_CMakeLists_txt,v
> Index: client/CMakeLists.txt
> --- client/CMakeLists.txt.orig
> +++ client/CMakeLists.txt
> -@@ -234,7 +234,7 @@ if(SDL_VERSION)
> +@@ -220,7 +220,7 @@ if(TARGET SDL2::SDL2 OR TARGET SDL::SDL)
> endif()
>
> if(UNIX AND NOT APPLE)
> Index: patches/patch-libraries_CMakeLists_txt
> ===================================================================
> RCS file: patches/patch-libraries_CMakeLists_txt
> diff -N patches/patch-libraries_CMakeLists_txt
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-libraries_CMakeLists_txt 5 Aug 2021 20:33:05 -0000
> @@ -0,0 +1,59 @@
> +$OpenBSD$
> +
> +Don't use bundled miniupnpc.
> +
> +Index: libraries/CMakeLists.txt
> +--- libraries/CMakeLists.txt.orig
> ++++ libraries/CMakeLists.txt
> +@@ -225,51 +225,6 @@ if(BUILD_CLIENT)
> + endif()
> + endif()
> +
> +-### MiniUPnPc ###
> +-
> +-if(BUILD_SERVER)
> +- message(STATUS "Compiling MiniUPnPc...")
> +-
> +- # Figure out the correct library path to attach to our imported target
> +- set(MINIUPNPC_INCLUDE_DIR
> +- "${CMAKE_CURRENT_BINARY_DIR}/local/include/miniupnpc")
> +- set(MINIUPNPC_LIBRARY
> +-
> "${CMAKE_CURRENT_BINARY_DIR}/local/lib/${libprefix}miniupnpc${libsuffix}")
> +-
> +- # This must exist before the target is synthesized.
> +- file(MAKE_DIRECTORY ${MINIUPNPC_INCLUDE_DIR})
> +-
> +- # Generate the build.
> +- execute_process(COMMAND "${CMAKE_COMMAND}"
> +- -S "${CMAKE_CURRENT_SOURCE_DIR}/libminiupnpc"
> +- -B "${CMAKE_CURRENT_BINARY_DIR}/libminiupnpc-build"
> +- -G "${CMAKE_GENERATOR}"
> +- -A "${CMAKE_GENERATOR_PLATFORM}"
> +- -T "${CMAKE_GENERATOR_TOOLSET}"
> +- "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
> +- "-DCMAKE_LINKER=${CMAKE_LINKER}"
> +- "-DCMAKE_RC_COMPILER=${CMAKE_RC_COMPILER}"
> +- "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
> +- "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/local"
> +- "-DCMAKE_INSTALL_LIBDIR=lib" # Without this, CentOS installs into lib64
> +- "-DUPNPC_BUILD_SHARED=No"
> +- "-DUPNPC_BUILD_TESTS=No")
> +-
> +- # Compile the library.
> +- execute_process(COMMAND "${CMAKE_COMMAND}"
> +- --build "${CMAKE_CURRENT_BINARY_DIR}/libminiupnpc-build"
> +- --config RelWithDebInfo --target install --parallel
> ${PARALLEL_PROC_COUNT})
> +-
> +- # Synthesize an imported target that can be linked against.
> +- add_library(upnpc-static STATIC IMPORTED GLOBAL)
> +- set_target_properties(upnpc-static PROPERTIES
> +- INTERFACE_INCLUDE_DIRECTORIES "${MINIUPNPC_INCLUDE_DIR}"
> +- IMPORTED_LOCATION ${MINIUPNPC_LIBRARY})
> +- if(WIN32)
> +- set_target_properties(upnpc-static PROPERTIES INTERFACE_LINK_LIBRARIES
> "ws2_32;iphlpapi")
> +- endif()
> +-endif()
> +-
> + ### SDL libraries ###
> +
> + if(BUILD_CLIENT)
> Index: patches/patch-odalaunch_CMakeLists_txt
> ===================================================================
> RCS file: patches/patch-odalaunch_CMakeLists_txt
> diff -N patches/patch-odalaunch_CMakeLists_txt
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-odalaunch_CMakeLists_txt 6 Aug 2021 08:49:14 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +Make odalaunch find the odamex executable.
> +
> +Index: odalaunch/CMakeLists.txt
> +--- odalaunch/CMakeLists.txt.orig
> ++++ odalaunch/CMakeLists.txt
> +@@ -1,5 +1,8 @@
> + include(OdalaunchCopyLibs)
> + include(OdamexTargetSettings)
> ++
> ++add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
> ++
> +
> + # API
> + set(API_DIR ../odalpapi)
> Index: patches/patch-odalpapi_net_io_cpp
> ===================================================================
> RCS file: /cvs/ports/games/odamex/patches/patch-odalpapi_net_io_cpp,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-odalpapi_net_io_cpp
> --- patches/patch-odalpapi_net_io_cpp 5 Oct 2020 21:07:37 -0000 1.1.1.1
> +++ patches/patch-odalpapi_net_io_cpp 6 Aug 2021 08:49:17 -0000
> @@ -5,7 +5,7 @@ AI_ALL isn't defined on OpenBSD.
> Index: odalpapi/net_io.cpp
> --- odalpapi/net_io.cpp.orig
> +++ odalpapi/net_io.cpp
> -@@ -182,7 +182,6 @@ void BufferedSocket::SetRemoteAddress(const string& Ad
> +@@ -183,7 +183,6 @@ void BufferedSocket::SetRemoteAddress(const string& Ad
> addrinfo* result = NULL;
>
> memset(&hints, 0, sizeof(struct addrinfo));
> Index: patches/patch-server_CMakeLists_txt
> ===================================================================
> RCS file: /cvs/ports/games/odamex/patches/patch-server_CMakeLists_txt,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-server_CMakeLists_txt
> --- patches/patch-server_CMakeLists_txt 5 Oct 2020 21:07:37 -0000
> 1.1.1.1
> +++ patches/patch-server_CMakeLists_txt 17 Aug 2021 09:53:11 -0000
> @@ -1,51 +1,18 @@
> -$OpenBSD: patch-server_CMakeLists_txt,v 1.1.1.1 2020/10/05 21:07:37 edd Exp $
> -
> -Don't use the bundled miniupnpc.
> +$OpenBSD$
>
> Index: server/CMakeLists.txt
> --- server/CMakeLists.txt.orig
> +++ server/CMakeLists.txt
> -@@ -33,12 +33,6 @@ set(JSONCPP_DIR ../libraries/jsoncpp)
> - file(GLOB JSONCPP_HEADERS ${JSONCPP_DIR}/json/*.h)
> - set(JSONCPP_SOURCE ${JSONCPP_DIR}/jsoncpp.cpp)
> -
> --# MiniUPnPc
> --if (USE_MINIUPNP)
> -- set(MINIUPNPC_DIR ../libraries/libminiupnpc)
> -- set(MINIUPNPC_STATIC_LIBRARIES upnpc-static)
> --endif()
> --
> - # git describe
> - set_source_files_properties(${COMMON_DIR}/version.cpp PROPERTIES
> COMPILE_FLAGS -DGIT_DESCRIBE=\\"${GIT_DESCRIBE}\\")
> -
> -@@ -59,7 +53,7 @@ include_directories(${JSONCPP_DIR} ${COMMON_DIR} ${SER
> -
> - # Include miniupnpc if we want it
> - if (USE_MINIUPNP)
> -- include_directories(${MINIUPNPC_DIR})
> -+ include_directories(${LOCALBASE}/include/miniupnpc)
> - endif()
> -
> - # Set up FHS installation path
> -@@ -67,6 +61,8 @@ if(NOT APPLE AND NOT WIN32)
> - add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
> - endif()
> -
> -+link_directories(${LOCALBASE}/lib)
> -+
> - add_executable(odasrv
> - ${JSONCPP_SOURCE} ${JSONCPP_HEADERS}
> - ${COMMON_SOURCES} ${COMMON_HEADERS}
> -@@ -74,7 +70,7 @@ add_executable(odasrv
> - ${SERVER_WIN32_HEADERS} ${SERVER_WIN32_RESOURCES})
> +@@ -53,7 +53,7 @@ endif()
> + target_link_libraries(odasrv jsoncpp odamex-common)
>
> - if (USE_MINIUPNP)
> -- target_link_libraries(odasrv ${MINIUPNPC_STATIC_LIBRARIES})
> + if(USE_MINIUPNP)
> +- target_link_libraries(odasrv upnpc-static)
> + target_link_libraries(odasrv miniupnpc)
> endif()
>
> if(WIN32)
> -@@ -87,7 +83,7 @@ elseif(UNIX)
> +@@ -66,7 +66,7 @@ elseif(UNIX)
> endif()
>
> if(UNIX AND NOT APPLE)
> @@ -53,4 +20,4 @@ Index: server/CMakeLists.txt
> + target_link_libraries(odasrv execinfo)
> endif()
>
> - if(APPLE)
> + odamex_copy_wad(odasrv)
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/games/odamex/pkg/PLIST,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 PLIST
> --- pkg/PLIST 5 Oct 2020 21:07:37 -0000 1.1.1.1
> +++ pkg/PLIST 5 Aug 2021 11:26:44 -0000
> @@ -1,6 +1,5 @@
> @comment $OpenBSD: PLIST,v 1.1.1.1 2020/10/05 21:07:37 edd Exp $
> @bin bin/odalaunch
> -@bin bin/odamast
> @bin bin/odamex
> @bin bin/odasrv
> share/doc/pkg-readmes/${PKGSTEM}
> @@ -9,6 +8,7 @@ share/examples/odamex/coop-doom.cfg
> share/examples/odamex/coop-masterlevels.cfg
> share/examples/odamex/coop-modern.cfg
> share/examples/odamex/coop-zdoom.cfg
> +share/examples/odamex/ctf-attackdefend.cfg
> share/examples/odamex/ctf-doom.cfg
> share/examples/odamex/ctf-pub.cfg
> share/examples/odamex/ctf-wdl.cfg
> @@ -20,6 +20,10 @@ share/examples/odamex/duel-ddl.cfg
> share/examples/odamex/duel-doom.cfg
> share/examples/odamex/duel-zddl.cfg
> share/examples/odamex/duel-zdoom.cfg
> +share/examples/odamex/lms-2team.cfg
> +share/examples/odamex/lms-3team.cfg
> +share/examples/odamex/lms-ffa.cfg
> +share/examples/odamex/survival-modern.cfg
> share/examples/odamex/tdm-doom.cfg
> share/examples/odamex/tdm-modern.cfg
> share/examples/odamex/tdm-zdoom.cfg
>
> --
> Best Regards
> Edd Barrett
>
> https://www.theunixzoo.co.uk
>