summaryrefslogtreecommitdiff
blob: e20ccdc8096e96242244dea9bc525f078b0fc6d6 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

REAL_PN="melonDS"
REAL_P="${REAL_PN}-${PV}"

inherit cmake flag-o-matic readme.gentoo-r1 toolchain-funcs xdg

DESCRIPTION="Nintendo DS emulator, sorta"
HOMEPAGE="http://melonds.kuribo64.net
	https://github.com/Arisotura/melonDS"

if [[ "${PV}" == *9999* ]] ; then
	inherit git-r3

	EGIT_REPO_URI="https://github.com/Arisotura/${REAL_PN}.git"
else
	SRC_URI="https://github.com/Arisotura/${REAL_PN}/archive/${PV}.tar.gz
		-> ${REAL_P}.tar.gz"
	S="${WORKDIR}/${REAL_P}"

	KEYWORDS="~amd64"
fi

LICENSE="BSD-2 GPL-2 GPL-3 Unlicense"
SLOT="0"
IUSE="+jit +opengl wayland"

RDEPEND="
	app-arch/libarchive
	dev-qt/qtcore:5
	dev-qt/qtgui:5
	dev-qt/qtmultimedia:5
	dev-qt/qtnetwork:5
	dev-qt/qtwidgets:5
	media-libs/libsdl2[sound,video]
	net-libs/enet:=
	net-libs/libpcap
	net-libs/libslirp
	wayland? (
		dev-libs/wayland
	)
"
DEPEND="
	${RDEPEND}
"
BDEPEND="
	wayland? (
		kde-frameworks/extra-cmake-modules:0
	)
"

# used for JIT recompiler
QA_EXECSTACK="usr/bin/melonDS"

DISABLE_AUTOFORMATTING="yes"
DOC_CONTENTS="You need the following files in order to run melonDS:
- bios7.bin
- bios9.bin
- firmware.bin
- romlist.bin
Place them in ~/.config/melonDS
Those files can be extracted from devices or found somewhere on the Internet ;-)"

src_prepare() {
	filter-lto
	append-flags -fno-strict-aliasing

	cmake_src_prepare
}

src_configure() {
	local -a mycmakeargs=(
		-DBUILD_SHARED_LIBS="OFF"
		-DENABLE_JIT="$(usex jit)"
		-DENABLE_OGLRENDERER="$(usex opengl)"
		-DENABLE_WAYLAND="$(usex wayland)"
	)
	cmake_src_configure
}

src_compile() {
	tc-export AR
	cmake_src_compile
}

src_install() {
	readme.gentoo_create_doc
	cmake_src_install
}

pkg_postinst() {
	xdg_pkg_postinst
	readme.gentoo_print_elog
}