commit:     ab6e3ef325e41f1992546d0da5db8fca7c12b0a4
Author:     William Breathitt Gray <vilhelm.gray <AT> gmail <DOT> com>
AuthorDate: Mon Mar 22 09:49:29 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Mar 31 07:40:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab6e3ef3

games-engines/odamex: Version bump to 0.9.0

Closes: https://bugs.gentoo.org/777651
Signed-off-by: William Breathitt Gray <vilhelm.gray <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/20058
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 games-engines/odamex/Manifest                      |  1 +
 ...x-0.9.0-Set-IMPORTED_LOCATION-for-jsoncpp.patch | 24 +++++++
 .../files/odamex-0.9.0-Unbundle-miniupnpc.patch    | 80 ++++++++++++++++++++++
 games-engines/odamex/odamex-0.9.0.ebuild           | 79 +++++++++++++++++++++
 4 files changed, 184 insertions(+)

diff --git a/games-engines/odamex/Manifest b/games-engines/odamex/Manifest
index 70aeb43694a..44fab4decbb 100644
--- a/games-engines/odamex/Manifest
+++ b/games-engines/odamex/Manifest
@@ -1 +1,2 @@
 DIST odamex-0.8.3.tar.bz2 8532510 BLAKE2B 
751d65dfe07a4c4c0cb5ff360e76a1291cf4ba289c459f15a0c277aca4d15b1e0989e1606cdc4e0f0bec56d6ae437027046302f5c55efb3b835a42df512fb18f
 SHA512 
01a875973d43c87dde7953464e0e3c37fa088b00b6cc0ecbef1a8b3b9a87257ab24ef4e3c224ebcbc0e38cd3139c7adc56b12a03ae2528b66d6498bb8d84d720
+DIST odamex-0.9.0.tar.bz2 6644055 BLAKE2B 
656a469665783e0a5aa1a39792454a7ec34843b7fa11539f5504463701b5485eed0b5fabcd4f9f39eef3bdad9062f657c0b1d6147bcd41defa4142b51b4096a4
 SHA512 
f86e61afd5fdd9be6db03554e07fa140fdcc61747ce9312706af2cada8ec88705647abdfff4f221d8cfbd4a53b991e08edf4cbf0025cf6e5a74d2213fc662855

diff --git 
a/games-engines/odamex/files/odamex-0.9.0-Set-IMPORTED_LOCATION-for-jsoncpp.patch
 
b/games-engines/odamex/files/odamex-0.9.0-Set-IMPORTED_LOCATION-for-jsoncpp.patch
new file mode 100644
index 00000000000..654085d1d25
--- /dev/null
+++ 
b/games-engines/odamex/files/odamex-0.9.0-Set-IMPORTED_LOCATION-for-jsoncpp.patch
@@ -0,0 +1,24 @@
+From 3707d8ebad7a4a0664ca4d5a5a5bef4a276af6a2 Mon Sep 17 00:00:00 2001
+From: William Breathitt Gray <[email protected]>
+Date: Mon, 29 Mar 2021 20:30:10 +0900
+Subject: [PATCH] Set IMPORTED_LOCATION for jsoncpp
+
+---
+ libraries/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt
+index 2ffe95a5..a7dcb83b 100644
+--- a/libraries/CMakeLists.txt
++++ b/libraries/CMakeLists.txt
+@@ -172,6 +172,7 @@ if(BUILD_SERVER)
+     INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/local/include"
+     IMPORTED_LOCATION_DEBUG ${JSONCPP_LIBRARY_DEBUG}
+     IMPORTED_LOCATION_RELEASE ${JSONCPP_LIBRARY_RELEASE}
++    IMPORTED_LOCATION ${JSONCPP_LIBRARY_RELEASE}
+     MAP_IMPORTED_CONFIG_MINSIZEREL Release
+     MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)
+ endif()
+-- 
+2.31.0
+

diff --git a/games-engines/odamex/files/odamex-0.9.0-Unbundle-miniupnpc.patch 
b/games-engines/odamex/files/odamex-0.9.0-Unbundle-miniupnpc.patch
new file mode 100644
index 00000000000..77b6220041d
--- /dev/null
+++ b/games-engines/odamex/files/odamex-0.9.0-Unbundle-miniupnpc.patch
@@ -0,0 +1,80 @@
+From 4b9a8ca565e5cd388a49cd0fbe693b5332577c57 Mon Sep 17 00:00:00 2001
+From: William Breathitt Gray <[email protected]>
+Date: Mon, 22 Mar 2021 18:20:15 +0900
+Subject: [PATCH] Unbundle miniupnpc
+
+---
+ libraries/CMakeLists.txt | 42 ----------------------------------------
+ server/CMakeLists.txt    |  3 ++-
+ 2 files changed, 2 insertions(+), 43 deletions(-)
+
+diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt
+index 177a86a2..2ffe95a5 100644
+--- a/libraries/CMakeLists.txt
++++ b/libraries/CMakeLists.txt
+@@ -227,48 +227,6 @@ 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 ###
+ 
+diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
+index 73a70000..e4b085f2 100644
+--- a/server/CMakeLists.txt
++++ b/server/CMakeLists.txt
+@@ -53,7 +53,8 @@ endif()
+ target_link_libraries(odasrv jsoncpp odamex-common)
+ 
+ if(USE_MINIUPNP)
+-  target_link_libraries(odasrv upnpc-static)
++      target_include_directories(odasrv SYSTEM PRIVATE 
"/usr/include/miniupnpc")
++      target_link_libraries(odasrv -lminiupnpc)
+ endif()
+ 
+ if(WIN32)
+-- 
+2.31.0
+

diff --git a/games-engines/odamex/odamex-0.9.0.ebuild 
b/games-engines/odamex/odamex-0.9.0.ebuild
new file mode 100644
index 00000000000..dc97bd284d1
--- /dev/null
+++ b/games-engines/odamex/odamex-0.9.0.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+WX_GTK_VER="3.0-gtk3"
+inherit cmake desktop prefix wxwidgets xdg
+
+DESCRIPTION="Online multiplayer free software engine for DOOM"
+HOMEPAGE="https://odamex.net/";
+SRC_URI="mirror://sourceforge/${PN}/Odamex/${PV}/${PN}-src-${PV}.tar.bz2 -> 
${P}.tar.bz2"
+
+LICENSE="GPL-2+ MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+client master +odalaunch portmidi server upnp X"
+REQUIRED_USE="|| ( client master server )"
+
+RDEPEND="
+       client? (
+               media-libs/libpng:0=
+               media-libs/libsdl2[joystick,sound,video]
+               media-libs/sdl2-mixer
+               odalaunch? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )
+               portmidi? ( media-libs/portmidi )
+               X? ( x11-libs/libX11 )
+       )
+       server? (
+               dev-libs/jsoncpp:=
+               upnp? ( net-libs/miniupnpc:= )
+       )"
+DEPEND="${RDEPEND}"
+BDEPEND="games-util/deutex"
+
+S="${WORKDIR}/${PN}-src-${PV}"
+
+PATCHES=(
+       "${FILESDIR}/${P}-Unbundle-miniupnpc.patch"
+       "${FILESDIR}/${P}-Set-IMPORTED_LOCATION-for-jsoncpp.patch"
+)
+
+src_prepare() {
+       rm -r libraries/libminiupnpc || die
+       hprefixify common/d_main.cpp
+
+       use odalaunch && setup-wxwidgets
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DCMAKE_DISABLE_FIND_PACKAGE_X11=$(usex !X)
+               -DUSE_INTERNAL_LIBS=0
+               -DBUILD_CLIENT=$(usex client)
+               -DBUILD_LAUNCHER=$(usex odalaunch)
+               -DBUILD_MASTER=$(usex master)
+               -DBUILD_SERVER=$(usex server)
+               -DBUILD_OR_FAIL=1
+               -DENABLE_PORTMIDI=$(usex portmidi)
+               -DUSE_MINIUPNP=$(usex upnp)
+       )
+
+       cmake_src_configure
+}
+
+src_install() {
+       if use client ; then
+               newicon -s 128 "${S}/media/icon_${PN}_128.png" "${PN}.png"
+               make_desktop_entry "${PN}" "Odamex"
+
+               if use odalaunch ; then
+                       newicon -s 128 "${S}/media/icon_odalaunch_128.png" 
"odalaunch.png"
+                       make_desktop_entry odalaunch "Odamex Launcher" odalaunch
+               fi
+       fi
+
+       cmake_src_install
+}

Reply via email to