summaryrefslogtreecommitdiff
path: root/games-strategy/unciv-bin/unciv-bin-4.15.6_p1.ebuild
blob: b5b5e303873bd1e80419d325a017bec26b27b849 (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
# Copyright 2021-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop java-pkg-2 xdg

MY_PV=${PV/_p/-patch}
DESCRIPTION="Turn-based historical strategy game, a remake of Civ V"
HOMEPAGE="https://github.com/yairm210/Unciv"
SRC_URI="https://github.com/yairm210/Unciv/releases/download/${MY_PV}/Unciv.jar -> ${P}.jar"
S="${WORKDIR}"

LICENSE="MPL-2.0"
SLOT="0"
KEYWORDS="-* ~amd64" # the jar also should work on arm{,64} but I am unable to test that

RDEPEND=">=virtual/jre-11:*" # could be more
BDEPEND="app-arch/unzip"

declare -r IMG_PATH="ExtraImages/Icon.png"

src_unpack() {
	cp "${DISTDIR}/${P}.jar" "${WORKDIR}"
	unzip ${P}.jar ${IMG_PATH} || die "Extracting icon failed"
}

src_install() {
	java-pkg_newjar "${P}.jar"
	java-pkg_dolauncher "${PN}" --jar "${PN}.jar"
	newicon --size 32 ${IMG_PATH} unciv.png || die "Installing icon failed"
	# this desktop file is better than upstream's
	make_desktop_entry "${PN}" Unciv-bin unciv "Game;StrategyGame" "Terminal=false"
}

pkg_preinst() {
	java-pkg-2_pkg_preinst
	xdg_pkg_preinst
}