Line 0
Link Here
|
|
|
1 |
# Copyright 1999-2016 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI=6 |
6 |
|
7 |
inherit multilib versionator |
8 |
|
9 |
MY_PV=$(replace_all_version_separators _ "$(get_version_component_range 2-)") |
10 |
MY_PN=df |
11 |
MY_P=${MY_PN}_${MY_PV} |
12 |
|
13 |
DESCRIPTION="A single-player fantasy game" |
14 |
HOMEPAGE="http://www.bay12games.com/dwarves" |
15 |
SRC_URI="http://www.bay12games.com/dwarves/${MY_P}_linux.tar.bz2" |
16 |
|
17 |
LICENSE="free-noncomm BSD BitstreamVera" |
18 |
SLOT="0" |
19 |
KEYWORDS="~amd64 ~x86 -*" |
20 |
IUSE="debug" |
21 |
|
22 |
RDEPEND="media-libs/glew[abi_x86_32(-)] |
23 |
media-libs/libsdl[abi_x86_32(-),opengl,video,X] |
24 |
media-libs/libsndfile[abi_x86_32(-),alsa] |
25 |
media-libs/sdl-image[abi_x86_32(-),jpeg,png,tiff] |
26 |
media-libs/sdl-ttf[abi_x86_32(-)] |
27 |
sys-libs/zlib[abi_x86_32(-)] |
28 |
virtual/glu[abi_x86_32(-)] |
29 |
x11-libs/gtk+:2[abi_x86_32(-)]" |
30 |
# Yup, openal and ncurses are only needed at compile-time; the code dlopens it at runtime |
31 |
# if requested. |
32 |
DEPEND="${RDEPEND} |
33 |
media-libs/openal[abi_x86_32(-)] |
34 |
sys-libs/ncurses[abi_x86_32(-),unicode] |
35 |
virtual/pkgconfig |
36 |
x11-proto/kbproto[abi_x86_32(-)] |
37 |
x11-proto/xproto[abi_x86_32(-)]" |
38 |
|
39 |
S=${WORKDIR}/${MY_PN}_linux |
40 |
|
41 |
gamesdir="/opt/${PN}" |
42 |
QA_PRESTRIPPED="${gamesdir}/libs/Dwarf_Fortress" |
43 |
RESTRICT="strip" |
44 |
|
45 |
pkg_setup() { |
46 |
multilib_toolchain_setup x86 |
47 |
} |
48 |
|
49 |
src_prepare() { |
50 |
rm libs/*.so* |
51 |
cp "${FILESDIR}"/{dwarf-fortress,Makefile} . |
52 |
default |
53 |
} |
54 |
|
55 |
src_configure() { |
56 |
tc-export CXX PKG_CONFIG |
57 |
CXXFLAGS+=" -D$(use debug || echo N)DEBUG" |
58 |
} |
59 |
|
60 |
src_compile() { |
61 |
default |
62 |
sed -i -e "s:^gamesdir=.*:gamesdir=${gamesdir}:" ${PN} || die |
63 |
} |
64 |
|
65 |
src_install() { |
66 |
# install data-files and libs |
67 |
insinto "${gamesdir}" |
68 |
doins -r raw data libs |
69 |
|
70 |
# install our wrapper |
71 |
dobin ${PN} |
72 |
|
73 |
# install docs |
74 |
dodoc README.linux *.txt |
75 |
|
76 |
fperms 755 "${gamesdir}"/libs/Dwarf_Fortress |
77 |
} |
78 |
|
79 |
pkg_postinst() { |
80 |
elog "System-wide Dwarf Fortress has been installed to ${gamesdir}. This is" |
81 |
elog "symlinked to ~/.dwarf-fortress when ${PN} is run." |
82 |
elog "For more information on what exactly is replaced, see /usr/bin/${PN}." |
83 |
elog "Note: This means that the primary entry point is /usr/bin/${PN}." |
84 |
elog "Do not run ${gamesdir}/libs/Dwarf_Fortress." |
85 |
elog |
86 |
elog "Optional runtime dependencies: install sys-libs/ncurses[$(use amd64 && echo "abi_x86_32,")unicode]" |
87 |
elog "for [PRINT_MODE:TEXT]. Install media-libs/openal$(use amd64 && echo "[abi_x86_32]") for audio output." |
88 |
} |