Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-engines/odamex/files/, games-engines/odamex/
Date: Wed, 31 Mar 2021 07:40:43
Message-Id: 1617176419.ab6e3ef325e41f1992546d0da5db8fca7c12b0a4.juippis@gentoo
1 commit: ab6e3ef325e41f1992546d0da5db8fca7c12b0a4
2 Author: William Breathitt Gray <vilhelm.gray <AT> gmail <DOT> com>
3 AuthorDate: Mon Mar 22 09:49:29 2021 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 31 07:40:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab6e3ef3
7
8 games-engines/odamex: Version bump to 0.9.0
9
10 Closes: https://bugs.gentoo.org/777651
11 Signed-off-by: William Breathitt Gray <vilhelm.gray <AT> gmail.com>
12 Closes: https://github.com/gentoo/gentoo/pull/20058
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 games-engines/odamex/Manifest | 1 +
16 ...x-0.9.0-Set-IMPORTED_LOCATION-for-jsoncpp.patch | 24 +++++++
17 .../files/odamex-0.9.0-Unbundle-miniupnpc.patch | 80 ++++++++++++++++++++++
18 games-engines/odamex/odamex-0.9.0.ebuild | 79 +++++++++++++++++++++
19 4 files changed, 184 insertions(+)
20
21 diff --git a/games-engines/odamex/Manifest b/games-engines/odamex/Manifest
22 index 70aeb43694a..44fab4decbb 100644
23 --- a/games-engines/odamex/Manifest
24 +++ b/games-engines/odamex/Manifest
25 @@ -1 +1,2 @@
26 DIST odamex-0.8.3.tar.bz2 8532510 BLAKE2B 751d65dfe07a4c4c0cb5ff360e76a1291cf4ba289c459f15a0c277aca4d15b1e0989e1606cdc4e0f0bec56d6ae437027046302f5c55efb3b835a42df512fb18f SHA512 01a875973d43c87dde7953464e0e3c37fa088b00b6cc0ecbef1a8b3b9a87257ab24ef4e3c224ebcbc0e38cd3139c7adc56b12a03ae2528b66d6498bb8d84d720
27 +DIST odamex-0.9.0.tar.bz2 6644055 BLAKE2B 656a469665783e0a5aa1a39792454a7ec34843b7fa11539f5504463701b5485eed0b5fabcd4f9f39eef3bdad9062f657c0b1d6147bcd41defa4142b51b4096a4 SHA512 f86e61afd5fdd9be6db03554e07fa140fdcc61747ce9312706af2cada8ec88705647abdfff4f221d8cfbd4a53b991e08edf4cbf0025cf6e5a74d2213fc662855
28
29 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
30 new file mode 100644
31 index 00000000000..654085d1d25
32 --- /dev/null
33 +++ b/games-engines/odamex/files/odamex-0.9.0-Set-IMPORTED_LOCATION-for-jsoncpp.patch
34 @@ -0,0 +1,24 @@
35 +From 3707d8ebad7a4a0664ca4d5a5a5bef4a276af6a2 Mon Sep 17 00:00:00 2001
36 +From: William Breathitt Gray <vilhelm.gray@×××××.com>
37 +Date: Mon, 29 Mar 2021 20:30:10 +0900
38 +Subject: [PATCH] Set IMPORTED_LOCATION for jsoncpp
39 +
40 +---
41 + libraries/CMakeLists.txt | 1 +
42 + 1 file changed, 1 insertion(+)
43 +
44 +diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt
45 +index 2ffe95a5..a7dcb83b 100644
46 +--- a/libraries/CMakeLists.txt
47 ++++ b/libraries/CMakeLists.txt
48 +@@ -172,6 +172,7 @@ if(BUILD_SERVER)
49 + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/local/include"
50 + IMPORTED_LOCATION_DEBUG ${JSONCPP_LIBRARY_DEBUG}
51 + IMPORTED_LOCATION_RELEASE ${JSONCPP_LIBRARY_RELEASE}
52 ++ IMPORTED_LOCATION ${JSONCPP_LIBRARY_RELEASE}
53 + MAP_IMPORTED_CONFIG_MINSIZEREL Release
54 + MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release)
55 + endif()
56 +--
57 +2.31.0
58 +
59
60 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
61 new file mode 100644
62 index 00000000000..77b6220041d
63 --- /dev/null
64 +++ b/games-engines/odamex/files/odamex-0.9.0-Unbundle-miniupnpc.patch
65 @@ -0,0 +1,80 @@
66 +From 4b9a8ca565e5cd388a49cd0fbe693b5332577c57 Mon Sep 17 00:00:00 2001
67 +From: William Breathitt Gray <vilhelm.gray@×××××.com>
68 +Date: Mon, 22 Mar 2021 18:20:15 +0900
69 +Subject: [PATCH] Unbundle miniupnpc
70 +
71 +---
72 + libraries/CMakeLists.txt | 42 ----------------------------------------
73 + server/CMakeLists.txt | 3 ++-
74 + 2 files changed, 2 insertions(+), 43 deletions(-)
75 +
76 +diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt
77 +index 177a86a2..2ffe95a5 100644
78 +--- a/libraries/CMakeLists.txt
79 ++++ b/libraries/CMakeLists.txt
80 +@@ -227,48 +227,6 @@ endif()
81 +
82 + ### MiniUPnPc ###
83 +
84 +-if(BUILD_SERVER)
85 +- message(STATUS "Compiling MiniUPnPc...")
86 +-
87 +- # Figure out the correct library path to attach to our imported target
88 +- set(MINIUPNPC_INCLUDE_DIR
89 +- "${CMAKE_CURRENT_BINARY_DIR}/local/include/miniupnpc")
90 +- set(MINIUPNPC_LIBRARY
91 +- "${CMAKE_CURRENT_BINARY_DIR}/local/lib/${libprefix}miniupnpc${libsuffix}")
92 +-
93 +- # This must exist before the target is synthesized.
94 +- file(MAKE_DIRECTORY ${MINIUPNPC_INCLUDE_DIR})
95 +-
96 +- # Generate the build.
97 +- execute_process(COMMAND "${CMAKE_COMMAND}"
98 +- -S "${CMAKE_CURRENT_SOURCE_DIR}/libminiupnpc"
99 +- -B "${CMAKE_CURRENT_BINARY_DIR}/libminiupnpc-build"
100 +- -G "${CMAKE_GENERATOR}"
101 +- -A "${CMAKE_GENERATOR_PLATFORM}"
102 +- -T "${CMAKE_GENERATOR_TOOLSET}"
103 +- "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
104 +- "-DCMAKE_LINKER=${CMAKE_LINKER}"
105 +- "-DCMAKE_RC_COMPILER=${CMAKE_RC_COMPILER}"
106 +- "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
107 +- "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/local"
108 +- "-DCMAKE_INSTALL_LIBDIR=lib" # Without this, CentOS installs into lib64
109 +- "-DUPNPC_BUILD_SHARED=No"
110 +- "-DUPNPC_BUILD_TESTS=No")
111 +-
112 +- # Compile the library.
113 +- execute_process(COMMAND "${CMAKE_COMMAND}"
114 +- --build "${CMAKE_CURRENT_BINARY_DIR}/libminiupnpc-build"
115 +- --config RelWithDebInfo --target install --parallel ${PARALLEL_PROC_COUNT})
116 +-
117 +- # Synthesize an imported target that can be linked against.
118 +- add_library(upnpc-static STATIC IMPORTED GLOBAL)
119 +- set_target_properties(upnpc-static PROPERTIES
120 +- INTERFACE_INCLUDE_DIRECTORIES "${MINIUPNPC_INCLUDE_DIR}"
121 +- IMPORTED_LOCATION ${MINIUPNPC_LIBRARY})
122 +- if(WIN32)
123 +- set_target_properties(upnpc-static PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32;iphlpapi")
124 +- endif()
125 +-endif()
126 +
127 + ### SDL libraries ###
128 +
129 +diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
130 +index 73a70000..e4b085f2 100644
131 +--- a/server/CMakeLists.txt
132 ++++ b/server/CMakeLists.txt
133 +@@ -53,7 +53,8 @@ endif()
134 + target_link_libraries(odasrv jsoncpp odamex-common)
135 +
136 + if(USE_MINIUPNP)
137 +- target_link_libraries(odasrv upnpc-static)
138 ++ target_include_directories(odasrv SYSTEM PRIVATE "/usr/include/miniupnpc")
139 ++ target_link_libraries(odasrv -lminiupnpc)
140 + endif()
141 +
142 + if(WIN32)
143 +--
144 +2.31.0
145 +
146
147 diff --git a/games-engines/odamex/odamex-0.9.0.ebuild b/games-engines/odamex/odamex-0.9.0.ebuild
148 new file mode 100644
149 index 00000000000..dc97bd284d1
150 --- /dev/null
151 +++ b/games-engines/odamex/odamex-0.9.0.ebuild
152 @@ -0,0 +1,79 @@
153 +# Copyright 1999-2021 Gentoo Authors
154 +# Distributed under the terms of the GNU General Public License v2
155 +
156 +EAPI=7
157 +
158 +WX_GTK_VER="3.0-gtk3"
159 +inherit cmake desktop prefix wxwidgets xdg
160 +
161 +DESCRIPTION="Online multiplayer free software engine for DOOM"
162 +HOMEPAGE="https://odamex.net/"
163 +SRC_URI="mirror://sourceforge/${PN}/Odamex/${PV}/${PN}-src-${PV}.tar.bz2 -> ${P}.tar.bz2"
164 +
165 +LICENSE="GPL-2+ MIT"
166 +SLOT="0"
167 +KEYWORDS="~amd64 ~arm ~x86"
168 +IUSE="+client master +odalaunch portmidi server upnp X"
169 +REQUIRED_USE="|| ( client master server )"
170 +
171 +RDEPEND="
172 + client? (
173 + media-libs/libpng:0=
174 + media-libs/libsdl2[joystick,sound,video]
175 + media-libs/sdl2-mixer
176 + odalaunch? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )
177 + portmidi? ( media-libs/portmidi )
178 + X? ( x11-libs/libX11 )
179 + )
180 + server? (
181 + dev-libs/jsoncpp:=
182 + upnp? ( net-libs/miniupnpc:= )
183 + )"
184 +DEPEND="${RDEPEND}"
185 +BDEPEND="games-util/deutex"
186 +
187 +S="${WORKDIR}/${PN}-src-${PV}"
188 +
189 +PATCHES=(
190 + "${FILESDIR}/${P}-Unbundle-miniupnpc.patch"
191 + "${FILESDIR}/${P}-Set-IMPORTED_LOCATION-for-jsoncpp.patch"
192 +)
193 +
194 +src_prepare() {
195 + rm -r libraries/libminiupnpc || die
196 + hprefixify common/d_main.cpp
197 +
198 + use odalaunch && setup-wxwidgets
199 +
200 + cmake_src_prepare
201 +}
202 +
203 +src_configure() {
204 + local mycmakeargs=(
205 + -DCMAKE_DISABLE_FIND_PACKAGE_X11=$(usex !X)
206 + -DUSE_INTERNAL_LIBS=0
207 + -DBUILD_CLIENT=$(usex client)
208 + -DBUILD_LAUNCHER=$(usex odalaunch)
209 + -DBUILD_MASTER=$(usex master)
210 + -DBUILD_SERVER=$(usex server)
211 + -DBUILD_OR_FAIL=1
212 + -DENABLE_PORTMIDI=$(usex portmidi)
213 + -DUSE_MINIUPNP=$(usex upnp)
214 + )
215 +
216 + cmake_src_configure
217 +}
218 +
219 +src_install() {
220 + if use client ; then
221 + newicon -s 128 "${S}/media/icon_${PN}_128.png" "${PN}.png"
222 + make_desktop_entry "${PN}" "Odamex"
223 +
224 + if use odalaunch ; then
225 + newicon -s 128 "${S}/media/icon_odalaunch_128.png" "odalaunch.png"
226 + make_desktop_entry odalaunch "Odamex Launcher" odalaunch
227 + fi
228 + fi
229 +
230 + cmake_src_install
231 +}