commit:     01ab9353cd4fe260fb5bbf096494ccdcde6ed800
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  8 04:12:57 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 04:55:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01ab9353

dev-libs/miniaudio: EAPI 8, fix LICENSE

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/miniaudio/miniaudio-0.11.11.ebuild        | 10 +++---
 .../files/ja2-stracciatella-0.20.0-lua-cmake.patch | 14 ++++++++
 .../ja2-stracciatella-0.20.0.ebuild                | 41 +++++++++++++++++-----
 3 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/dev-libs/miniaudio/miniaudio-0.11.11.ebuild 
b/dev-libs/miniaudio/miniaudio-0.11.11.ebuild
index 924d6a449338..3cb98015c5b2 100644
--- a/dev-libs/miniaudio/miniaudio-0.11.11.ebuild
+++ b/dev-libs/miniaudio/miniaudio-0.11.11.ebuild
@@ -1,15 +1,15 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-DESCRIPTION="A single file library for audio playback and capture."
-HOMEPAGE="https://miniaudio.io";
 COMMIT="a0dc1037f99a643ff5fad7272cd3d6461f2d63fa"
+DESCRIPTION="A single file library for audio playback and capture"
+HOMEPAGE="https://miniaudio.io";
 SRC_URI="https://github.com/mackron/miniaudio/archive/${COMMIT}.tar.gz -> 
${P}.tar.gz"
 S="${WORKDIR}/${PN}-${COMMIT}"
 
-LICENSE="MIT"
+LICENSE="|| ( public-domain MIT-0 )"
 SLOT="0"
 KEYWORDS="~amd64"
 

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"

Reply via email to