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

EAPI=8

inherit desktop wrapper xdg

DESCRIPTION="3D point and click adventure, sequel to The Whispered World"
HOMEPAGE="https://www.daedalic.com/silence"
SRC_URI="Silence_${PV}_Linux_Full_EN_DE_IT_ES_FR_ZH_JA_PT_KO_RU_PL_EL_Daedalic_noDRM.zip"
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE="l10n_de +l10n_en l10n_pl l10n_zh"
REQUIRED_USE="|| ( ${IUSE//+} )"
RESTRICT="bindist fetch splitdebug strip"

BDEPEND="app-arch/unzip"

RDEPEND="
	virtual/opengl
	x11-libs/libX11
	x11-libs/libXcursor
	x11-libs/libXrandr
"

S="${WORKDIR}"
DIR="/opt/${PN}"
QA_PREBUILT="${DIR#/}/*"

pkg_nofetch() {
	einfo "Please buy and download ${SRC_URI} from:"
	einfo "  https://www.humblebundle.com/store/${PN}"
	einfo "and move it to your distfiles directory."
}

src_prepare() {
	default

	MY_ARCH=$(usex amd64 x86_64 x86)
	OTHER_ARCH=$(usex amd64 x86 x86_64)

	# Delete files for the other architecture.
	# Delete Steam library because we're not running under Steam.
	# Delete Screen Selector library, because it requires GTK2 but is unused.
	rm -rv \
		Silence_Data/{Mono,Plugins}/${OTHER_ARCH}/ \
		Silence_Data/Plugins/${MY_ARCH}/{libDaedalic.Ecosystems.Steam.External,ScreenSelector}.so \
		|| die

	# Remove unneeded language files.
	local locale localedir
	for locale in ${IUSE//+}; do
		if [[ ${locale} = l10n_* ]] && ! use ${locale}; then
			case ${locale#l10n_} in
				de) localedir=german ;;
				en) localedir=english ;;
				pl) localedir=polish ;;
				zh) localedir=chinese ;;
				 *) die "unrecognised locale ${locale}" ;;
			esac
			rm -rv Silence_Data/GameData/Sounds/{LipSync,Voice}/${localedir}/ || die
		fi
	done
}

src_install() {
	exeinto "${DIR}"
	newexe Silence.${MY_ARCH} Silence
	make_wrapper ${PN} ./Silence "${DIR}"

	insinto "${DIR}"
	doins -r Silence_Data version.txt

	local libdir
	for libdir in Mono Plugins; do
		exeinto "${DIR}"/Silence_Data/${libdir}/${MY_ARCH}
		doexe Silence_Data/${libdir}/${MY_ARCH}/*.so
	done

	newicon -s 128 Silence_Data/Resources/UnityPlayer.png silence.png
	make_desktop_entry ${PN} Silence
}

pkg_postinst() {
	xdg_pkg_postinst

	if ! use l10n_en; then
		ewarn "You have disabled the English voice audio and lip sync data. The game"
		ewarn "still defaults to English though, so you will need to manually change"
		ewarn "the voice language in the options menu."
	fi
}