summaryrefslogtreecommitdiff
blob: 6d79359f5be9e13b1ac1fdb5736533335bf15307 (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
94
95
96
97
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit unpacker eutils gnome2-utils

DESCRIPTION="Gnomoria is a sandbox village management game"
HOMEPAGE="http://www.gnomoria.com"
SRC_URI="gnomoria-022316-bin"

LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+system-libs"
RESTRICT="bindist fetch"

MYGAMEDIR=/opt/${PN}
DEPEND="app-arch/unzip"
RDEPEND="${DEPEND}
system-libs? (
	app-arch/p7zip
	dev-lang/mono
	media-libs/libsdl2[sound]
	media-libs/sdl2-image[jpeg,png]
	media-libs/openal
	media-libs/libvorbis
	media-libs/libtheora
)"

S="${WORKDIR}/data"

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

src_unpack() {
	unpack_zip ${A}
}

src_configure() { :; }
src_compile() { :; }

src_install() {
	local arch=x86
	use amd64 && arch=x86_64

	insinto ${MYGAMEDIR}
	exeinto ${MYGAMEDIR}
	dodoc Linux.README

	doexe  "Gnomoria.bin.${arch}"
	doins -r  "Content" FNA.dll   FNA.dll.config  "Mod Files"   gnomorialib.dll Gnomoria.exe
	if use system-libs ; then
		if use amd64 ; then
			mv lib64 lib64.orig
			mkdir lib64
			mv lib64.orig/libmojoshader.so lib64
			ln -s /usr/bin/7za lib64/7za
			doins -r lib64
		else
			mv lib lib.orig
			mkdir lib
			mv lib.orig/libmojoshader.so lib
			ln -s /usr/bin/7za lib/7za
			doins -r lib
		fi
	else
		doins -r  Mono.Posix.dll System.Core.dll System.Drawing.dll System.Xml.dll mscorlib.dll Mono.Security.dll System.Configuration.dll System.Data.dll System.Security.dll System.dll mono
		if use amd64 ; then
			doins -r lib64
		else
			doins -r lib
		fi
	fi

	newicon -s 512 Gnomoria.png ${PN}.png
	make_wrapper ${PN} "${MYGAMEDIR}/Gnomoria.bin.${arch}" "${MYGAMEDIR}"
	make_desktop_entry "${PN}" "Gnomoria" "${PN}" "Game"

	domenu ${PN}

}

pkg_preinst() {
	gnome2_icon_savelist
}

pkg_postinst() {
	gnome2_icon_cache_update
}

pkg_postrm() {
	gnome2_icon_cache_update
}