games-simulation/openttd-0.7.0: fixes
[otih-overlay.git] / games-simulation / openttd / openttd-0.7.0.ebuild
blob753e74470cb10aa756a15ace4a8f7390d9955f6e
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI="2"
7 inherit eutils games
9 DESCRIPTION="OpenTTD is a clone of Transport Tycoon Deluxe"
10 HOMEPAGE="http://www.openttd.org/"
11 SRC_URI="http://binaries.openttd.org/releases/${PV}/${P}-source.tar.bz2"
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="amd64 ppc ppc64 x86"
16 IUSE="alsa debug dedicated iconv icu +png +truetype +zlib"
17 RESTRICT="test"
19 DEPEND="
20 !dedicated? (
21 media-libs/libsdl[X]
22 media-libs/sdl-image[png]
23 truetype? (
24 media-libs/fontconfig
25 media-libs/freetype:2
28 icu? ( dev-libs/icu )
29 iconv? ( virtual/libiconv )
30 png? ( media-libs/libpng )
31 zlib? ( sys-libs/zlib )"
32 RDEPEND="${DEPEND}
33 !dedicated? (
34 alsa? ( media-sound/alsa-utils[midi] )
37 src_configure() {
38 local myopts=""
39 use debug && myopts="${myopts} --enable-debug=3"
41 use dedicated && myopts="${myopts} --enable-dedicated"
42 if use alsa; then
43 myopts="${myopts} --with-midi=/usr/bin/aplaymidi"
46 # there is available allegro interface as opposite for sdl, but we always
47 # prefer sdl more and the configure for the other one looks broken.
49 # configure is a hand-written sh-script, so econf will not work
50 ./configure \
51 --disable-strip \
52 --prefix-dir=/usr \
53 --binary-dir=games/bin \
54 --data-dir=share/games/${PN} \
55 --install-dir="${D}" \
56 --doc-dir=share/doc/${PF} \
57 --menu-group="Game;Simulation;" \
58 --with-sdl \
59 $(use_with iconv) \
60 $(use_with truetype freetype) \
61 $(use_with png) \
62 $(use_with zlib) \
63 $(use_with icu) \
64 $(use_with zlib) \
65 ${myopts} \
66 || die "configure failed"
69 src_install() {
70 emake DESTDIR="${D}" install || die "emake install failed"
72 prepgamesdirs
75 pkg_postinst() {
76 games_pkg_postinst
78 elog
79 elog "In order to play, you must copy the following 6 files from "
80 elog "a version of TTD to ${GAMES_DATADIR}/${PN}/data/."
81 elog
82 elog "From the WINDOWS version you need: "
83 elog " sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf"
84 elog "OR from the DOS version you need: "
85 elog " SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF"
86 elog
87 elog "File names are case sensitive so make sure they are "
88 elog "correct for whichever version you have."
89 elog
91 if use dedicated ; then
92 ewarn "Warning: The init script will kill all running openttd"
93 ewarn "processes when run, including any running client sessions!"
94 else
95 if use alsa ; then
96 elog "You have emerged with 'aplaymidi' for playing MIDI."
97 elog "You have to set the environment variable ALSA_OUTPUT_PORTS."
98 elog "Available ports can be listed by using 'aplaymidi -l'."
99 else
100 elog "alsa not in USE so music will not be played during the game."
102 elog