Lines 1-18
Link Here
|
1 |
# Copyright 1999-2010 Gentoo Foundation |
1 |
# Copyright 1999-2010 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/games-simulation/openttd/openttd-0.7.5.ebuild,v 1.4 2010/02/10 00:04:57 josejx Exp $ |
3 |
# $Header: $ |
4 |
|
4 |
|
5 |
EAPI=2 |
5 |
EAPI=3 |
6 |
inherit eutils games |
6 |
inherit eutils games |
7 |
|
7 |
|
|
|
8 |
MY_PV=${PV/_rc/-RC} |
9 |
MY_P=${PN}-${MY_PV} |
10 |
|
8 |
DESCRIPTION="OpenTTD is a clone of Transport Tycoon Deluxe" |
11 |
DESCRIPTION="OpenTTD is a clone of Transport Tycoon Deluxe" |
9 |
HOMEPAGE="http://www.openttd.org/" |
12 |
HOMEPAGE="http://www.openttd.org/" |
10 |
SRC_URI="http://binaries.openttd.org/releases/${PV}/${P}-source.tar.bz2" |
13 |
SRC_URI="http://binaries.openttd.org/releases/${MY_PV}/${MY_P}-source.tar.bz2" |
|
|
14 |
S=${WORKDIR}/${MY_P} |
11 |
|
15 |
|
12 |
LICENSE="GPL-2" |
16 |
LICENSE="GPL-2" |
13 |
SLOT="0" |
17 |
SLOT="0" |
14 |
KEYWORDS="~amd64 ppc ppc64 x86" |
18 |
KEYWORDS="~amd64 ~ppc ~x86" |
15 |
IUSE="alsa debug dedicated iconv icu +png +truetype zlib" |
19 |
IUSE="alsa debug dedicated iconv icu lzo +openmedia +png +truetype zlib" |
16 |
RESTRICT="test" |
20 |
RESTRICT="test" |
17 |
|
21 |
|
18 |
DEPEND=" |
22 |
DEPEND=" |
Lines 25-30
DEPEND="
Link Here
|
25 |
sys-libs/zlib |
29 |
sys-libs/zlib |
26 |
) |
30 |
) |
27 |
) |
31 |
) |
|
|
32 |
lzo? ( dev-libs/lzo:2 ) |
28 |
iconv? ( virtual/libiconv ) |
33 |
iconv? ( virtual/libiconv ) |
29 |
png? ( media-libs/libpng ) |
34 |
png? ( media-libs/libpng ) |
30 |
zlib? ( sys-libs/zlib )" |
35 |
zlib? ( sys-libs/zlib )" |
Lines 32-37
RDEPEND="${DEPEND}
Link Here
|
32 |
!dedicated? ( |
37 |
!dedicated? ( |
33 |
alsa? ( media-sound/alsa-utils ) |
38 |
alsa? ( media-sound/alsa-utils ) |
34 |
)" |
39 |
)" |
|
|
40 |
PDEPEND=" |
41 |
openmedia? ( |
42 |
games-misc/opengfx |
43 |
games-misc/opensfx |
44 |
games-misc/openmsx |
45 |
)" |
35 |
|
46 |
|
36 |
src_configure() { |
47 |
src_configure() { |
37 |
local myopts |
48 |
local myopts |
Lines 53-58
src_configure() {
Link Here
|
53 |
myopts="${myopts} --without-zlib" |
64 |
myopts="${myopts} --without-zlib" |
54 |
fi |
65 |
fi |
55 |
|
66 |
|
|
|
67 |
if use lzo ; then |
68 |
myopts="${myopts} --with-liblzo2" |
69 |
else |
70 |
myopts="${myopts} --without-liblzo2" |
71 |
fi |
72 |
|
56 |
# there is an allegro interface available as well as sdl, but |
73 |
# there is an allegro interface available as well as sdl, but |
57 |
# the configure for it looks broken so the sdl interface is |
74 |
# the configure for it looks broken so the sdl interface is |
58 |
# always built instead. |
75 |
# always built instead. |
Lines 61-67
src_configure() {
Link Here
|
61 |
# configure is a hand-written bash-script, so econf will not work |
78 |
# configure is a hand-written bash-script, so econf will not work |
62 |
./configure \ |
79 |
./configure \ |
63 |
--disable-strip \ |
80 |
--disable-strip \ |
64 |
--prefix-dir=/ \ |
81 |
--prefix-dir="${EPREFIX}" \ |
65 |
--binary-dir="${GAMES_BINDIR}" \ |
82 |
--binary-dir="${GAMES_BINDIR}" \ |
66 |
--data-dir="${GAMES_DATADIR}/${PN}" \ |
83 |
--data-dir="${GAMES_DATADIR}/${PN}" \ |
67 |
--install-dir="${D}" \ |
84 |
--install-dir="${D}" \ |
Lines 91-108
src_install() {
Link Here
|
91 |
pkg_postinst() { |
108 |
pkg_postinst() { |
92 |
games_pkg_postinst |
109 |
games_pkg_postinst |
93 |
|
110 |
|
94 |
elog |
111 |
if ! use openmedia ; then |
95 |
elog "In order to play, you must copy the following 6 files from " |
112 |
elog |
96 |
elog "a version of TTD to ${GAMES_DATADIR}/${PN}/data/." |
113 |
elog "OpenTTD was compiled without openmedia USE flags." |
97 |
elog |
114 |
elog |
98 |
elog "From the WINDOWS version you need: " |
115 |
elog "In order to play, you must either install games-misc/opengfx" |
99 |
elog " sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf" |
116 |
elog "as well as games-misc/opensfx or copy the following 6 files" |
100 |
elog "OR from the DOS version you need: " |
117 |
elog "from a version of Transport Tycoon Deluxe (windows or DOS)" |
101 |
elog " SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF" |
118 |
elog "to ~/.openttd/data/ or ${GAMES_DATADIR}/${PN}/data/." |
102 |
elog |
119 |
elog |
103 |
elog "File names are case sensitive so make sure they are " |
120 |
elog "From the WINDOWS version you need: " |
104 |
elog "correct for whichever version you have." |
121 |
elog " sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf" |
105 |
elog |
122 |
elog "OR from the DOS version you need: " |
|
|
123 |
elog " SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF" |
124 |
elog |
125 |
elog "File names are case sensitive so make sure they are " |
126 |
elog "correct for whichever version you have." |
127 |
elog |
128 |
fi |
129 |
|
130 |
if ! use lzo ; then |
131 |
elog "OpenTTD was compiled without lzo2 support." |
132 |
elog "While lzo2 is not required, disabling it does mean that" |
133 |
elog "loading old savegames/scenarios from ancient versions (~0.2)" |
134 |
elog "will be disabled" |
135 |
elog |
136 |
fi |
106 |
|
137 |
|
107 |
if use dedicated ; then |
138 |
if use dedicated ; then |
108 |
ewarn "Warning: The init script will kill all running openttd" |
139 |
ewarn "Warning: The init script will kill all running openttd" |
Lines 112-119
pkg_postinst() {
Link Here
|
112 |
elog "You have emerged with 'aplaymidi' for playing MIDI." |
143 |
elog "You have emerged with 'aplaymidi' for playing MIDI." |
113 |
elog "You have to set the environment variable ALSA_OUTPUT_PORTS." |
144 |
elog "You have to set the environment variable ALSA_OUTPUT_PORTS." |
114 |
elog "Available ports can be listed by using 'aplaymidi -l'." |
145 |
elog "Available ports can be listed by using 'aplaymidi -l'." |
|
|
146 |
if ! use openmedia ; then |
147 |
elog "You have disabled the openmedia use flag, in-game music" |
148 |
elog "will be unavailable unless you install games-misc/openmsx" |
149 |
elog "or install a music set in ~/.openttd/gm or use the in-game" |
150 |
elog "download functionality to get a music set" |
151 |
fi |
115 |
else |
152 |
else |
116 |
elog "alsa not in USE so music will not be played during the game." |
153 |
elog "alsa not in USE so music will not be played during the game." |
|
|
154 |
|
117 |
fi |
155 |
fi |
118 |
fi |
156 |
fi |
119 |
} |
157 |
} |