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

EAPI=7

PYTHON_COMPAT=( python3_{7,8} )

inherit desktop eutils python-single-r1 xdg

COMMIT="ea817f7e163c4fb07a60b2066c694cba92d23818"
DESCRIPTION="Short-term-memory training N-Back game"
HOMEPAGE="https://github.com/samcv/brainworkshop"
SRC_URI="https://github.com/samcv/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

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

BDEPEND="
	${PYTHON_DEPS}
"

S="${WORKDIR}/${PN}-${COMMIT}"

PATCHES=(
	"${FILESDIR}"/${PN}-${PV%_*}-fix-paths.patch
)

src_prepare() {
	edos2unix ${PN}.pyw
	default

	sed -i \
		"s#@GENTOO_DATADIR@#${EPREFIX}/usr/share/${PN}#g" \
		${PN}.pyw || die
}

src_install() {
	python_newscript ${PN}.pyw ${PN}

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

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

	newicon -s 48 res/misc/brain/brain.png ${PN}.png
	make_desktop_entry ${PN} "Brain Workshop"
}