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

EAPI="7"

inherit desktop

DESCRIPTION="Side-scrolling platformer written by StudioPixel, aka Cave Story"
HOMEPAGE="https://www.cavestory.org"
SRC_URI="https://www.archive.org/download/CavestorydoukutsuForLinuxV1.01/linuxdoukutsu-1.01.tar.bz2"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

QA_PREBUILT="*"

RDEPEND="media-libs/libsdl[X]"

S=${WORKDIR}/linuxDoukutsu-${PV}

src_install() {
	insinto /usr/share/${PN}
	doins -r data DoConfig.exe
	dodoc doc/*

	exeinto /usr/share/${PN}
	doexe doukutsu.bin
	echo "cd /usr/share/${PN} && ./doukutsu.bin" > doukutsu || die "couldn't create wrapper?!"
	dobin doukutsu

	dosym /var/lib/doukutsu_Config.dat /usr/share/${PN}/Config.dat
	dosym /var/lib/doukutsu_Profile.dat /usr/share/${PN}/Profile.dat

	make_desktop_entry doukutsu "Cave Story"
}

pkg_postinst() {
	# do this here so un/reinstalling won't destroy your config/save
	[[ -f /var/lib/doukutsu_Config.dat ]] || {
		cp "${S}"/Config.dat /var/lib/doukutsu_Config.dat
		chmod 666 /var/lib/doukutsu_Config.dat
	}
	[[ -f /var/lib/doukutsu_Profile.dat ]] || {
		touch /var/lib/doukutsu_Profile.dat
		chmod 666 /var/lib/doukutsu_Profile.dat
	}

	elog "This port does not provide a configuration tool for Config.dat."
	elog "For Wine users, /usr/share/${PN}/DoConfig.exe should do the job."
	elog "otherwise, /usr/share/doc/${P}/configfileformat.txt may help."
	elog ""
	elog "If you need to back up your config/save file for any reason,"
	elog "it is located at /var/lib/doukutsu_{Config,Profile}.dat"
	elog "Please be aware that every user can read/write these files."
}