summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-01-08 04:12:57 +0000
committerSam James <sam@gentoo.org>2023-01-08 04:55:07 +0000
commit01ab9353cd4fe260fb5bbf096494ccdcde6ed800 (patch)
treee21de3b21002ed0157ec7d4077e7fecf031ab551 /games-strategy
parentgames-strategy/ja2-stracciatella: EAPI 8, fix indentation, tests (diff)
downloadgentoo-01ab9353cd4fe260fb5bbf096494ccdcde6ed800.tar.gz
gentoo-01ab9353cd4fe260fb5bbf096494ccdcde6ed800.tar.bz2
gentoo-01ab9353cd4fe260fb5bbf096494ccdcde6ed800.zip
dev-libs/miniaudio: EAPI 8, fix LICENSE
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'games-strategy')
-rw-r--r--games-strategy/ja2-stracciatella/files/ja2-stracciatella-0.20.0-lua-cmake.patch14
-rw-r--r--games-strategy/ja2-stracciatella/ja2-stracciatella-0.20.0.ebuild41
2 files changed, 47 insertions, 8 deletions
diff --git a/games-strategy/ja2-stracciatella/files/ja2-stracciatella-0.20.0-lua-cmake.patch b/games-strategy/ja2-stracciatella/files/ja2-stracciatella-0.20.0-lua-cmake.patch
new file mode 100644
index 000000000000..d09ac895119b
--- /dev/null
+++ b/games-strategy/ja2-stracciatella/files/ja2-stracciatella-0.20.0-lua-cmake.patch
@@ -0,0 +1,14 @@
+--- a/dependencies/lib-lua/CMakeLists.txt
++++ b/dependencies/lib-lua/CMakeLists.txt
+@@ -3,9 +3,9 @@
+ option(LOCAL_LUA_LIB "Download and build Lua instead of searching the system" ON)
+ if (NOT LOCAL_LUA_LIB)
+ message(STATUS "Using system Lua")
+- find_package(Lua "5.3" REQUIRED)
++ find_package(Lua "${LUA_VERSION}" REQUIRED EXACT)
+ if (NOT LUA_FOUND)
+- message(FATAL_ERROR "Lua 5.3 not found")
++ message(FATAL_ERROR "Lua ${LUA_VERSION} not found")
+ endif()
+
+ set(LUA_INCLUDE_DIRS "${LUA_INCLUDE_DIR}" PARENT_SCOPE)
diff --git a/games-strategy/ja2-stracciatella/ja2-stracciatella-0.20.0.ebuild b/games-strategy/ja2-stracciatella/ja2-stracciatella-0.20.0.ebuild
index 20fb18ba3fae..e24a7554b147 100644
--- a/games-strategy/ja2-stracciatella/ja2-stracciatella-0.20.0.ebuild
+++ b/games-strategy/ja2-stracciatella/ja2-stracciatella-0.20.0.ebuild
@@ -126,11 +126,15 @@ winapi-x86_64-pc-windows-gnu-0.4.0
yaml-rust-0.4.5
"
-inherit cargo cmake xdg
+# See dependencies/lib-lua/CMakeLists.txt
+LUA_COMPAT=( lua5-3 )
+
+inherit cargo cmake lua-single xdg
DESCRIPTION="An improved, cross-platform, stable Jagged Alliance 2 runtime"
HOMEPAGE="https://github.com/ja2-stracciatella/"
-SRC_URI="https://github.com/ja2-stracciatella/ja2-stracciatella/archive/v${PV}.tar.gz -> ${P}.tar.gz
+SRC_URI="
+ https://github.com/ja2-stracciatella/ja2-stracciatella/archive/v${PV}.tar.gz -> ${P}.tar.gz
editor? ( https://github.com/ja2-stracciatella/free-ja2-resources/releases/download/v1/editor.slf -> ${P}-editor.slf )
"
SRC_URI+=" $(cargo_crate_uris ${CRATES})"
@@ -138,41 +142,58 @@ SRC_URI+=" $(cargo_crate_uris ${CRATES})"
LICENSE="public-domain SFI-SCLA"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="cdinstall editor ru-gold"
+IUSE="cdinstall editor ru-gold test"
+# ./ja2 -unittest can't find save files
+RESTRICT="!test? ( test ) test"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
DEPEND="
- media-libs/libsdl2[X,sound,video]
- !~media-libs/libsdl2-2.0.6
- >=virtual/rust-1.40.0
- >=x11-libs/fltk-1.3.5[opengl]
+ ${LUA_DEPS}
>=dev-cpp/sol2-3.3.0
>=dev-cpp/string-theory-3.1
>=dev-games/libsmacker-1.1.1
- >=dev-lang/lua-5.3:*
>=dev-libs/miniaudio-0.11.11
>=dev-libs/rapidjson-1.1.0
+ media-libs/libsdl2[X,sound,video]
+ >=x11-libs/fltk-1.3.5[opengl]
+ >=virtual/rust-1.40.0
"
RDEPEND="
${DEPEND}
cdinstall? ( games-strategy/ja2-stracciatella-data )
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.20.0-lua-cmake.patch
+)
+
src_prepare() {
cmake_src_prepare
}
src_configure() {
local mycmakeargs=(
+ -DUSE_SCCACHE=OFF
+
-DLOCAL_GTEST_LIB=OFF
+ -DLOCAL_FLTK_LIB=OFF
+
-DLOCAL_LUA_LIB=OFF
+ -DLUA_VERSION="${ELUA#lua}"
+
-DLOCAL_MAGICENUM_LIB=OFF
-DLOCAL_MINIAUDIO_LIB=OFF
-DLOCAL_RAPIDJSON_LIB=OFF
+ -DLOCAL_SDL_LIB=OFF
-DLOCAL_SOL_LIB=OFF
-DLOCAL_STRING_THEORY_LIB=OFF
+
-DWITH_MAGICENUM=OFF
-DWITH_RUST_BINARIES=OFF
+ -DWITH_UNITTESTS=$(usex test)
+
-DBUILD_LAUNCHER=OFF
+
-DINSTALL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
-DEXTRA_DATA_DIR="${EPREFIX}/usr/share/ja2"
-DMINIAUDIO_INCLUDE_DIR="${EPREFIX}/usr/include/miniaudio"
@@ -193,6 +214,10 @@ src_install() {
cmake_src_install
}
+src_test() {
+ "${BUILD_DIR}"/ja2 -unittests || die
+}
+
pkg_postinst() {
if ! use cdinstall ; then
elog "You need to copy all files from the Data directory of"