summaryrefslogtreecommitdiff
blob: f7d1e72840640f681e8fe345c933a1ec0376dedd (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..12} )
inherit desktop python-single-r1

DESCRIPTION="Short-term-memory training N-Back game"
HOMEPAGE="https://github.com/brain-workshop/brainworkshop/"
SRC_URI="
	https://github.com/brain-workshop/brainworkshop/archive/refs/tags/v${PV}.tar.gz
		-> ${P}.tar.gz
"

LICENSE="CC-Sampling-Plus-1.0 GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="
	${PYTHON_DEPS}
	$(python_gen_cond_dep 'dev-python/pyglet[${PYTHON_USEDEP},sound]')
"
BDEPEND="
	${PYTHON_DEPS}
"

PATCHES=(
	"${FILESDIR}"/${PN}-5.0.2-datadir.patch
)

src_prepare() {
	default

	sed -i "s|@GENTOO_DATADIR@|${EPREFIX}/usr/share/${PN}|" ${PN}.py || die

	python_fix_shebang ${PN}.py
}

src_install() {
	newbin ${PN}.py ${PN}

	insinto /usr/share/${PN}
	doins -r res/.

	dodoc Readme.md Readme-{instructions,resources}.txt data/Readme-stats.txt

	domenu ${PN}.desktop
	newicon res/misc/brain/brain.png ${PN}.png
}