Skip to content

Commit

Permalink
games-emulation/gambatte-jg: new USE flags
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Closes: gentoo#35060
Signed-off-by: Viorel Munteanu <[email protected]>
  • Loading branch information
orbea authored and ceamac committed Feb 23, 2024
1 parent bd31a1f commit 00afd8a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
51 changes: 40 additions & 11 deletions games-emulation/gambatte-jg/gambatte-jg-9999.ebuild
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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[@]}"
}
4 changes: 4 additions & 0 deletions games-emulation/gambatte-jg/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 00afd8a

Please sign in to comment.