summaryrefslogtreecommitdiff
blob: 3b59a9cabce45916f14eb9ea17380cdcd36e9012 (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-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop wrapper

DESCRIPTION="Classic adventure game"
HOMEPAGE="https://wiki.scummvm.org/index.php/Soltys"
SRC_URI="l10n_en? ( mirror://sourceforge/scummvm/${PN}-en-v${PV}.zip )
	l10n_es? ( mirror://sourceforge/scummvm/${PN}-es-v${PV}.zip )
	l10n_pl? ( mirror://sourceforge/scummvm/${PN}-pl-v${PV}.zip )
	!l10n_en? ( !l10n_es? ( !l10n_pl? ( mirror://sourceforge/scummvm/${PN}-en-v${PV}.zip ) ) )
	http://www.scummvm.org/images/cat-${PN}.png"
S="${WORKDIR}"

LICENSE="Soltys"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="l10n_en l10n_es l10n_pl"

RDEPEND="games-engines/scummvm"
BDEPEND="app-arch/unzip"

src_unpack() {
	MY_L10N=( $(usev l10n_en) $(usev l10n_es) $(usev l10n_pl) )
	[[ ${MY_L10N} ]] || MY_L10N=( l10n_en )

	local lang
	for lang in "${MY_L10N[@]//l10n_/}"; do
		mkdir ${lang} || die
		unpack ${PN}-${lang}-v${PV}.zip
		if [[ ${lang} == es ]]; then
			mv ${PN}-${lang}-v$(ver_rs 1 -)/vol.{cat,dat} ${lang}/ || die
		else
			mv vol.{cat,dat} ${lang}/ || die
		fi
	done
}

src_install() {
	insinto /usr/share/${PN}
	local lang
	for lang in "${MY_L10N[@]//l10n_/}"; do
		doins -r ${lang}
		make_wrapper ${PN}-${lang} "scummvm -f -p \"${EPREFIX}/usr/share/${PN}/${lang}\" ${PN}"
		make_desktop_entry ${PN}-${lang} "Soltys (${lang})"
	done

	newicon "${DISTDIR}"/cat-${PN}.png ${PN}.png
}