repo/gentoo:master commit in: games-simulation/corsix-th/

"Sam James" <[email protected]>
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1786147747.ee4c45382f351dfdf2caac92741f47d59841590e.sam@gentoo>
commit:     ee4c45382f351dfdf2caac92741f47d59841590e
Author:     Sebastian Engel <sighunter <AT> gmx <DOT> de>
AuthorDate: Fri Aug  7 12:28:50 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug  8 00:09:07 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee4c4538

games-simulation/corsix-th: add 0.70.0-r3

* FETCH_CATCH2 is only defined when running tests
* disabled lua5-3 (and lua5-2) because of a failing test
* added a missing dependency for midi playback and disabled arm KEYWORD for now

Closes: https://bugs.gentoo.org/980175
Closes: https://bugs.gentoo.org/980176
Signed-off-by: Sebastian Engel <sighunter <AT> gmx.de>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1618
Merges: https://codeberg.org/gentoo/gentoo/pulls/1618
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../corsix-th/corsix-th-0.70.0-r3.ebuild           | 135 +++++++++++++++++++++
 1 file changed, 135 insertions(+)

diff --git a/games-simulation/corsix-th/corsix-th-0.70.0-r3.ebuild b/games-simulation/corsix-th/corsix-th-0.70.0-r3.ebuild
new file mode 100644
index 000000000000..c2b9735b1400
--- /dev/null
+++ b/games-simulation/corsix-th/corsix-th-0.70.0-r3.ebuild
@@ -0,0 +1,135 @@
+# Copyright 2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-1 lua5-4 luajit )
+
+inherit cmake edo lua-single xdg
+
+MY_PN="CorsixTH"
+MY_PV="${PV/_/-}"
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="Open source clone of Theme Hospital"
+HOMEPAGE="https://corsixth.com"
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+	S="${WORKDIR}/${MY_P}"
+
+	if [[ ${PV} != *_beta* && ${PV} != *_rc* ]] ; then
+		KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+	fi
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc +midi test tools +videos"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RDEPEND="
+	${LUA_DEPS}
+	$(lua_gen_cond_dep '
+		>=dev-lua/luafilesystem-1.5[${LUA_USEDEP}]
+		>=dev-lua/lpeg-0.9[${LUA_USEDEP}]
+		>=dev-lua/luasocket-3.0_rc1-r4[${LUA_USEDEP}]
+	')
+	media-libs/libsdl2[opengl,video]
+	media-libs/libpng:=
+	>=media-libs/freetype-2.5.3:2
+	media-libs/sdl2-mixer[midi?]
+	virtual/zlib:=
+	midi? (
+		media-libs/rtmidi
+		media-sound/fluid-soundfont
+	)
+	videos? ( >=media-video/ffmpeg-2.2.3:0= )
+"
+DEPEND="${RDEPEND}"
+# Although the docs could potentially be built with nearly any Lua version,
+# we need to ensure the necessary Lua modules are installed, so pin to the
+# same single version as runtime.
+BDEPEND="
+	virtual/pkgconfig
+	doc? (
+		app-text/doxygen[dot]
+		${LUA_DEPS}
+		$(lua_gen_cond_dep '
+			>=dev-lua/luafilesystem-1.5[${LUA_USEDEP}]
+			>=dev-lua/lpeg-0.9[${LUA_USEDEP}]
+		')
+	)
+	test? (
+		>=dev-cpp/catch-3:0
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.67-cmake_lua_detection.patch
+)
+
+lua_enable_tests busted
+
+src_configure() {
+	local mycmakeargs=(
+		-DBUILD_TOOLS=$(usex tools)
+		-DENABLE_UNIT_TESTS=$(usex test)
+		-DFETCH_SOUNDFONT=OFF
+		-DFETCH_UNICODE_FONT=OFF
+		-DWITH_MIDI_DEVICE=$(usex midi)
+		-DWITH_MOVIES=$(usex videos)
+		-DWITH_UPDATE_CHECK=OFF
+	)
+
+	if use lua_single_target_luajit ; then
+		mycmakeargs+=(
+			-DLUA_VERSION=5.1
+			-DLUA_LIBRARY=$(lua_get_shared_lib)
+			-DWITH_LUAJIT=ON
+		)
+	else
+		mycmakeargs+=(
+			-DLUA_VERSION=$(lua_get_version)
+		)
+	fi
+
+	if use test ; then
+		mycmakeargs+=(
+			-DFETCH_CATCH2=OFF
+		)
+	fi
+
+	cmake_src_configure
+}
+
+src_compile() {
+	cmake_src_compile
+	use doc && cmake_src_compile doc
+}
+
+src_test() {
+	# https://github.com/CorsixTH/CorsixTH/blob/master/.github/workflows/Linux.yml#L88
+	# C++ tests
+	BUILD_DIR="${BUILD_DIR}"/CorsixTH cmake_src_test
+
+	# Lua tests
+	# vip_spec.lua fails with luajit
+	edo busted \
+		--lua="${ELUA}" \
+		--output="TAP" \
+		--verbose \
+		--directory=CorsixTH/Luatest \
+		--filter-out='VIP.*rating'
+}
+
+src_install() {
+	cmake_src_install
+	dodoc changelog.txt CONTRIBUTING.md
+
+	docinto html
+	use doc && dodoc -r "${BUILD_DIR}"/doc/*
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.