1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake desktop xdg
8 DESCRIPTION="Game Boy Advance emulator written in C"
9 HOMEPAGE="https://mgba.io"
10 if [[ "${PV}" == 9999 ]] ; then
12 EGIT_REPO_URI="https://github.com/mgba-emu/mgba.git"
14 MY_PV="${PV/_beta/-b}"
15 SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
16 [[ "${PV}" == *_beta* ]] || \
17 KEYWORDS="~amd64 ~x86"
18 S="${WORKDIR}/${PN}-${MY_PV}"
22 IUSE="debug elf ffmpeg imagemagick libav opengl qt5 +sdl sqlite"
23 REQUIRED_USE="|| ( qt5 sdl )
28 sys-libs/zlib[minizip]
29 elf? ( dev-libs/elfutils )
31 libav? ( media-video/libav:= )
32 !libav? ( media-video/ffmpeg:= )
34 imagemagick? ( media-gfx/imagemagick:= )
35 opengl? ( virtual/opengl )
41 opengl? ( dev-qt/qtopengl:5 )
43 sdl? ( media-libs/libsdl2[X,sound,joystick,video,opengl?] )
44 sqlite? ( dev-db/sqlite:3 )
52 # Get rid of any bundled stuff we don't want
53 for pkg in libpng lzma sqlite3 zlib ; do
54 rm -r src/third-party/${pkg} || die
61 -DBUILD_GL="$(usex opengl)"
63 -DBUILD_QT="$(usex qt5)"
64 -DBUILD_SDL="$(usex sdl)"
66 # test suite fails to build (>=0.6.0)
71 -DUSE_DEBUGGERS="$(usex debug)"
72 -DUSE_EDITLINE="$(usex debug)"
73 -DUSE_ELF="$(usex elf)"
75 -DUSE_FFMPEG="$(usex ffmpeg)"
76 -DUSE_GDB_STUB="$(usex debug)"
79 -DUSE_MAGICK="$(usex imagemagick)"
82 -DUSE_SQLITE3="$(usex sqlite)"
94 dobin ../${P}_build/qt/${PN}-qt
96 domenu res/${PN}-qt.desktop
97 for size in 16 24 32 48 64 96 128 256 ; do
98 newicon -s ${size} res/${PN}-${size}.png ${PN}.png
103 newbin ../${P}_build/sdl/${PN} ${PN}-sdl
106 dolib.so ../${P}_build/lib${PN}.so*