summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-01-26 08:54:40 +0000
committerSam James <sam@gentoo.org>2025-01-26 08:55:37 +0000
commite535aaaaefe1e99e7235dc1ba2dc2fa8277f04a8 (patch)
tree72e48023a4917be175efb554624388c8ea8ed3cd /games-simulation
parentgames-simulation/corsix-th: wire up tests (diff)
downloadgentoo-e535aaaaefe1e99e7235dc1ba2dc2fa8277f04a8.tar.gz
gentoo-e535aaaaefe1e99e7235dc1ba2dc2fa8277f04a8.tar.bz2
gentoo-e535aaaaefe1e99e7235dc1ba2dc2fa8277f04a8.zip
games-simulation/corsix-th: add live ebuild
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'games-simulation')
-rw-r--r--games-simulation/corsix-th/corsix-th-0.68.0.ebuild16
-rw-r--r--games-simulation/corsix-th/corsix-th-9999.ebuild106
2 files changed, 117 insertions, 5 deletions
diff --git a/games-simulation/corsix-th/corsix-th-0.68.0.ebuild b/games-simulation/corsix-th/corsix-th-0.68.0.ebuild
index 257dadab1230..75849743f032 100644
--- a/games-simulation/corsix-th/corsix-th-0.68.0.ebuild
+++ b/games-simulation/corsix-th/corsix-th-0.68.0.ebuild
@@ -13,14 +13,20 @@ MY_P="${MY_PN}-${MY_PV}"
DESCRIPTION="Open source clone of Theme Hospital"
HOMEPAGE="https://corsixth.com"
-SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
-S="${WORKDIR}/${MY_P}"
+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 ~arm ~arm64 ~ppc64 ~x86"
+ fi
+fi
LICENSE="MIT"
SLOT="0"
-if [[ ${PV} != *_beta* && ${PV} != *_rc* ]] ; then
- KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
-fi
IUSE="doc +midi +sound test tools +truetype +videos"
RESTRICT="!test? ( test )"
REQUIRED_USE="${LUA_REQUIRED_USE}"
diff --git a/games-simulation/corsix-th/corsix-th-9999.ebuild b/games-simulation/corsix-th/corsix-th-9999.ebuild
new file mode 100644
index 000000000000..75849743f032
--- /dev/null
+++ b/games-simulation/corsix-th/corsix-th-9999.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1..4} )
+
+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 ~arm ~arm64 ~ppc64 ~x86"
+ fi
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc +midi +sound test tools +truetype +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]
+ sound? ( media-libs/sdl2-mixer[midi?] )
+ truetype? ( >=media-libs/freetype-2.5.3:2 )
+ 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=(
+ -DLUA_VERSION=$(lua_get_version)
+ -DBUILD_TOOLS=$(usex tools)
+ -DENABLE_UNIT_TESTS=$(usex test)
+ -DWITH_AUDIO=$(usex sound)
+ -DWITH_FREETYPE2=$(usex truetype)
+ -DWITH_MOVIES=$(usex videos)
+ -DWITH_UPDATE_CHECK=OFF
+ )
+
+ 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
+ edo busted --lua="${ELUA}" --output="TAP" --verbose --directory=CorsixTH/Luatest
+}
+
+src_install() {
+ cmake_src_install
+ dodoc changelog.txt CONTRIBUTING.md
+
+ docinto html
+ use doc && dodoc -r "${BUILD_DIR}"/doc/*
+}