commit:     00afd8addb1784b03b0bb637ca6c2fd85676044f
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Sun Jan 28 23:00:25 2024 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Fri Feb 23 09:22:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00afd8ad

games-emulation/gambatte-jg: new USE flags

* examples: Install the example frontend for libgambatte
* jgmodule: Install the module for The Jolly Good API
* shared: Install the shared libgambatte library

The old behavior was to only build the Jollygood module.

Signed-off-by: orbea <orbea <AT> riseup.net>
Closes: https://github.com/gentoo/gentoo/pull/35060
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 .../gambatte-jg/gambatte-jg-9999.ebuild            | 51 +++++++++++++++++-----
 games-emulation/gambatte-jg/metadata.xml           |  4 ++
 2 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/games-emulation/gambatte-jg/gambatte-jg-9999.ebuild 
b/games-emulation/gambatte-jg/gambatte-jg-9999.ebuild
index bc00ccf2fcc5..1c1fd17466dd 100644
--- a/games-emulation/gambatte-jg/gambatte-jg-9999.ebuild
+++ b/games-emulation/gambatte-jg/gambatte-jg-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -15,32 +15,61 @@ if [[ "${PV}" == *9999 ]] ; then
 else
        
SRC_URI="https://gitlab.com/jgemu/${MY_PN}/-/archive/${PV}/${MY_P}.tar.bz2";
        S="${WORKDIR}/${MY_P}"
-       KEYWORDS="~amd64"
+       KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
 fi
 
-LICENSE="BSD GPL-2"
+LICENSE="
+       GPL-2
+       examples? ( 0BSD )
+       jgmodule? ( BSD )
+"
 SLOT="1"
+IUSE="examples +jgmodule shared"
+REQUIRED_USE="|| ( examples jgmodule shared )"
 
 DEPEND="
-       media-libs/jg:1=
-       media-libs/soxr
+       examples? (
+               media-libs/libsdl2[opengl,sound,video]
+               media-libs/speexdsp
+       )
+       jgmodule? (
+               media-libs/jg:1=
+               media-libs/soxr
+       )
 "
 RDEPEND="
        ${DEPEND}
-       games-emulation/jgrf
+       jgmodule? ( games-emulation/jgrf )
 "
 BDEPEND="
        virtual/pkgconfig
 "
 
+pkg_setup() {
+       local makeopts=(
+               DISABLE_MODULE=$(usex jgmodule 0 1)
+               ENABLE_EXAMPLE=$(usex examples 1 0)
+               ENABLE_SHARED=$(usex shared 1 0)
+       )
+       export MY_MAKEOPTS="${makeopts[@]}"
+}
+
 src_compile() {
-       emake CXX="$(tc-getCXX)" PKG_CONFIG="$(tc-getPKG_CONFIG)"
+       local mymakeargs=(
+               CXX="$(tc-getCXX)"
+               PKG_CONFIG="$(tc-getPKG_CONFIG)"
+               ${MY_MAKEOPTS}
+       )
+       emake "${mymakeargs[@]}"
 }
 
 src_install() {
-       emake install \
-               DESTDIR="${D}" \
-               PREFIX="${EPREFIX}"/usr \
-               DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+       local mymakeargs=(
+               DESTDIR="${D}"
+               PREFIX="${EPREFIX}"/usr
+               DOCDIR="${EPREFIX}"/usr/share/doc/${PF}
                LIBDIR="${EPREFIX}/usr/$(get_libdir)"
+               ${MY_MAKEOPTS}
+       )
+       emake install "${mymakeargs[@]}"
 }

diff --git a/games-emulation/gambatte-jg/metadata.xml 
b/games-emulation/gambatte-jg/metadata.xml
index 184d31eac85b..537d0c732c6f 100644
--- a/games-emulation/gambatte-jg/metadata.xml
+++ b/games-emulation/gambatte-jg/metadata.xml
@@ -9,6 +9,10 @@
                <email>[email protected]</email>
                <name>Sam James</name>
        </maintainer>
+       <use>
+               <flag name="jgmodule">Build module for The Jolly Good API</flag>
+               <flag name="shared">Build shared library</flag>
+       </use>
        <longdescription>
                Gambatte JG is an emulator for the Nintendo Game Boy/Game Boy
                Color. This is a fork of the final public revision of Gambatte.

Reply via email to