summaryrefslogtreecommitdiff
blob: 9793c576930c75b65de01758ccd9bd6dc01d1009 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3

inherit games versionator

MY_PV=$(replace_all_version_separators _ "$(get_version_component_range 2-)")
MY_PN=df
MY_P=${MY_PN}_${MY_PV}

DESCRIPTION="A single-player fantasy game"
HOMEPAGE="http://www.bay12games.com/dwarves"
SRC_URI="http://www.bay12games.com/dwarves/${MY_P}_linux.tar.bz2"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~amd64 ~x86 -*"
IUSE=""
# this is all precompiled
RESTRICT="strip"

RDEPEND="
	virtual/glu
	amd64? (
		app-emulation/emul-linux-x86-baselibs
		app-emulation/emul-linux-x86-gtklibs
		app-emulation/emul-linux-x86-opengl
		app-emulation/emul-linux-x86-sdl
		app-emulation/emul-linux-x86-soundlibs
		app-emulation/emul-linux-x86-xlibs
	)
	x86? (
		media-libs/fmod:1
		media-libs/freetype
		media-libs/libsdl[opengl,video,X]
		media-libs/libsndfile[alsa]
		media-libs/openal
		media-libs/sdl-image[png,tiff,jpeg]
		media-libs/sdl-ttf
		sys-libs/zlib
		x11-libs/cairo[xcb,X]
		x11-libs/gtk+:2[xinerama]
		x11-libs/libXcomposite
		x11-libs/libXcursor
		x11-libs/pango[X]
	)"

S=${WORKDIR}/${MY_PN}_linux

src_install() {
	# install config stuff
	insinto "${GAMES_SYSCONFDIR}"/${PN}
	doins -r data/init/* || die

	# keep saves, movies and objects directories
	keepdir "${GAMES_STATEDIR}"/${PN}/save \
		"${GAMES_STATEDIR}"/${PN}/movies \
		"${GAMES_STATEDIR}"/${PN}/objects || die

	# install data-files and libs
	local gamesdir="${GAMES_PREFIX_OPT}/${PN}"
	insinto "${gamesdir}"
	rm -r data/{movies,init} || die
	doins -r raw data libs || die

	# install our wrapper
	newgamesbin "${FILESDIR}"/${PN}-wrapper ${PN} || die

	# install docs
	dodoc README.linux *.txt || die

	# create symlinks for several directories we want to have 
	# in a different place
	dosym "${GAMES_SYSCONFDIR}"/${PN} "${gamesdir}"/data/init || die
	dosym "${GAMES_STATEDIR}"/${PN}/save "${gamesdir}"/data/save || die
	dosym "${GAMES_STATEDIR}"/${PN}/movies "${gamesdir}"/data/movies || die
	dosym "${GAMES_STATEDIR}"/${PN}/objects "${gamesdir}"/data/objects || die

	prepgamesdirs

	# fix a few permissions
	fperms 0755 \
		"${gamesdir}"/libs/{Dwarf_Fortress,libgcc_s.so.1,libgraphics.so,libstdc++.so.6} || die
	fperms -R g+w "${GAMES_STATEDIR}"/${PN} || die
	fperms g+w "${gamesdir}"/data/index || die
	fperms -R g+w "${gamesdir}"/data/{announcement,dipscript,help} || die
}