summaryrefslogtreecommitdiff
path: root/games-action/vintagestory/vintagestory-1.19.8.ebuild
blob: 5533fb33de35f42a22414bd993213937b584e671 (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Thanks to AUR maintainer copygirl for their PKGBUILD, which this
# is based on.

EAPI=8
DOTNET_PKG_COMPAT="7.0"
inherit desktop font xdg-utils dotnet-pkg-base

DESCRIPTION="Uncompromising wilderness survival sandbox game"
HOMEPAGE="https://www.vintagestory.at/"
AUR_COMMIT="e0ccb81a7f7bf6ef9a966aa54ffd8df5765143c2"
RDEPEND="
	${DOTNET_PKG_RDEPS}
	virtual/opengl
"
SRC_URI="https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux_x64_${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}"
FONT_S="${WORKDIR}/${PN}/assets/game/fonts"
FONT_SUFFIX="otf ttf"

LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="~amd64"

QA_PREBUILT="usr/share/${PN}/*"
RESTRICT="bindist mirror"

src_install() {
	# remove install script provided by developers
	rm install.sh

	# create symbolic links for any assets (excluding fonts) containging non-lowercase letters.
	# some asset files might include uppercase letters, but the game expects them to be lowercase
	find assets/ -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
		local filename="$(basename -- "$file")"
		ln -sf "$filename" "${file%/*}"/"${filename,,}"
	done

	# install fonts
	font_src_install

	# install desktop files and icon
	domenu "${FILESDIR}"/*.desktop
	newicon assets/gameicon.xpm ${PN}.xpm

	# install all application files
	cp -rdp --no-preserve=ownership . "${ED}"/usr/share/"${PN}"

	# create a wrapper to set up the .NET runtime
	dotnet-pkg-base_dolauncher "${EPREFIX}"/usr/share/"${PN}"/Vintagestory "${PN}"
}

pkg_postinst() {
	xdg_desktop_database_update
}

pkg_postrm() {
	xdg_desktop_database_update
}