summaryrefslogtreecommitdiff
path: root/games-emulation/bsnes-jg/bsnes-jg-2.0.1.ebuild
blob: c44ece1d716a9a5eda791463c2c87d74b84a72b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DOCS_BUILDER="doxygen"
DOCS_DIR="objs/doc"

inherit docs toolchain-funcs

MY_PN=${PN%-*}
MY_P=${MY_PN}-${PV}
DESCRIPTION="Jolly Good Fork of bsnes"
HOMEPAGE="https://gitlab.com/jgemu/bsnes"
if [[ "${PV}" == *9999 ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://gitlab.com/jgemu/${MY_PN}.git"
else
	SRC_URI="https://gitlab.com/jgemu/${MY_PN}/-/archive/${PV}/${MY_P}.tar.bz2"
	S="${WORKDIR}/${MY_P}"
	KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
fi

LICENSE="
	ISC GPL-3+ LGPL-2.1+ MIT ZLIB
	examples? ( 0BSD )
"
SLOT="1"
IUSE="examples +jgmodule shared"
REQUIRED_USE="
	|| ( examples jgmodule shared )
	doc? ( shared )
"

DEPEND="
	media-libs/libsamplerate
	examples? ( media-libs/libsdl2[sound,video] )
	jgmodule? ( media-libs/jg:1= )
"
RDEPEND="
	${DEPEND}
	jgmodule? ( games-emulation/jgrf )
"
BDEPEND="
	virtual/pkgconfig
"

src_configure() {
	local makeopts=(
		PREFIX="${EPREFIX}"/usr
		DISABLE_MODULE=$(usex jgmodule 0 1)
		ENABLE_EXAMPLE=$(usex examples 1 0)
		ENABLE_SHARED=$(usex shared 1 0)
	)
	export MY_MAKEOPTS="${makeopts[@]}"
}

src_compile() {
	local mymakeargs=(
		CC="$(tc-getCC)"
		CXX="$(tc-getCXX)"
		PKG_CONFIG="$(tc-getPKG_CONFIG)"
		${MY_MAKEOPTS}
	)
	emake "${mymakeargs[@]}"
	use doc && emake doxyfile
	docs_compile
}

src_install() {
	local mymakeargs=(
		DESTDIR="${D}"
		DOCDIR="${EPREFIX}"/usr/share/doc/${PF}
		LIBDIR="${EPREFIX}/usr/$(get_libdir)"
		${MY_MAKEOPTS}
	)
	emake install "${mymakeargs[@]}"
	use doc && einstalldocs
}