Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-simulation/openttd/
Date: Thu, 01 Oct 2020 15:47:45
Message-Id: 1601567229.d459427de08494405f9d2595aa166c3aba3c905d.chewi@gentoo
1 commit: d459427de08494405f9d2595aa166c3aba3c905d
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 1 15:47:09 2020 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 1 15:47:09 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d459427d
7
8 games-simulation/openttd: Version bump to 1.10.3
9
10 Closes: https://github.com/gentoo/gentoo/pull/17726
11 Package-Manager: Portage-3.0.6, Repoman-3.0.1
12 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
13
14 games-simulation/openttd/Manifest | 1 +
15 games-simulation/openttd/openttd-1.10.3.ebuild | 183 +++++++++++++++++++++++++
16 2 files changed, 184 insertions(+)
17
18 diff --git a/games-simulation/openttd/Manifest b/games-simulation/openttd/Manifest
19 index 68ea367c705..9a48131e52a 100644
20 --- a/games-simulation/openttd/Manifest
21 +++ b/games-simulation/openttd/Manifest
22 @@ -1 +1,2 @@
23 DIST openttd-1.10.2-source.tar.xz 6766904 BLAKE2B 959d3ba98022d3fd3ddb15844bc2d6f5eb54b470e2dfebdcd784428c1773585c116dd739bd6718879ac6d6ac6942737cd51b71bc77d6d82991fdcea1bc8aec1a SHA512 03de85449a458c76c07d8a28c34f72bc95ab0652c666e5925da43746cdd4e95b0d66360b6e214d1df33f11b5346da2e3b9ca6832ac6628c7d6e5e0a791881683
24 +DIST openttd-1.10.3-source.tar.xz 6815924 BLAKE2B f700304e723fe5c3fa9781432a387e061595bbc8de42f565ad57ac265d9e4bc14cbc659a3f6551019bfb31b8b56b180c272c6753a12b4cd2e13016a98dfe1679 SHA512 d1cd535e8e49f0ac147704341287af1b16bde6725fd9152dd36dcb780559b400da8bb31c4e8eb665a0d11e9b1f5bf8a96be0f97f7a85bd967eec534fdd3dd0d4
25
26 diff --git a/games-simulation/openttd/openttd-1.10.3.ebuild b/games-simulation/openttd/openttd-1.10.3.ebuild
27 new file mode 100644
28 index 00000000000..acf83d2f955
29 --- /dev/null
30 +++ b/games-simulation/openttd/openttd-1.10.3.ebuild
31 @@ -0,0 +1,183 @@
32 +# Copyright 1999-2020 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +inherit toolchain-funcs xdg
38 +
39 +MY_PV="${PV/_rc/-RC}"
40 +MY_P="${PN}-${MY_PV}"
41 +
42 +DESCRIPTION="OpenTTD is a clone of Transport Tycoon Deluxe"
43 +HOMEPAGE="https://www.openttd.org/"
44 +if [[ "${PV}" == *9999 ]] ; then
45 + inherit git-r3
46 + EGIT_REPO_URI="https://github.com/OpenTTD/OpenTTD.git"
47 +else
48 + SRC_URI="https://proxy.binaries.openttd.org/openttd-releases/${MY_PV}/${MY_P}-source.tar.xz"
49 + KEYWORDS="~amd64 ~ppc64 ~x86"
50 + S="${WORKDIR}/${MY_P}"
51 +fi
52 +
53 +LICENSE="GPL-2"
54 +SLOT="0"
55 +IUSE="aplaymidi debug dedicated iconv icu +lzma lzo +openmedia +png cpu_flags_x86_sse +timidity +truetype zlib"
56 +RESTRICT="test" # needs a graphics set in order to test
57 +
58 +RDEPEND="!dedicated? (
59 + media-libs/libsdl2[sound,video]
60 + icu? (
61 + dev-libs/icu-layoutex
62 + dev-libs/icu-le-hb
63 + >=dev-libs/icu-58.1:=
64 + )
65 + truetype? (
66 + media-libs/fontconfig
67 + media-libs/freetype:2
68 + sys-libs/zlib:=
69 + )
70 + )
71 + lzma? ( app-arch/xz-utils )
72 + lzo? ( dev-libs/lzo:2 )
73 + iconv? ( virtual/libiconv )
74 + png? (
75 + media-libs/libpng:0
76 + sys-libs/zlib:=
77 + )
78 + zlib? ( sys-libs/zlib:= )"
79 +DEPEND="${RDEPEND}"
80 +BDEPEND="
81 + virtual/pkgconfig"
82 +PDEPEND="
83 + !dedicated? (
84 + openmedia? (
85 + games-misc/openmsx
86 + games-misc/opensfx
87 + )
88 + aplaymidi? ( media-sound/alsa-utils )
89 + !aplaymidi? ( timidity? ( media-sound/timidity++ ) )
90 + )
91 + openmedia? ( >=games-misc/opengfx-0.4.7 )"
92 +
93 +PATCHES=(
94 + "${FILESDIR}"/${PN}-1.9.0-cflags.patch
95 + "${FILESDIR}"/${PN}-1.9.0-dont_compress_manpages.patch
96 +)
97 +
98 +src_configure() {
99 + local myopts=(
100 + --binary-dir="bin"
101 + --disable-strip
102 + --doc-dir="share/doc/${PF}"
103 + --install-dir="${D}"
104 + --menu-group="Game;Simulation;"
105 + --prefix-dir="${EPREFIX}/usr"
106 + $(use_with cpu_flags_x86_sse sse)
107 + $(use_with iconv)
108 + $(use_with lzma)
109 + $(use_with lzo liblzo2)
110 + $(use_with png)
111 + $(usex debug '--enable-debug=3' '')
112 + # there is an allegro interface available as well as sdl, but
113 + # the configure for it looks broken so the sdl interface is
114 + # always built instead.
115 + --without-allegro
116 +
117 + --without-fluidsynth
118 + )
119 +
120 + if use dedicated ; then
121 + myopts+=( --enable-dedicated )
122 + else
123 + myopts+=(
124 + $(usex aplaymidi '--with-midi=/usr/bin/aplaymidi' '')
125 + $(use_with truetype freetype)
126 + $(use_with icu)
127 + --with-sdl
128 + )
129 + fi
130 + if use png || { use !dedicated && use truetype; } || use zlib ; then
131 + myopts+=( --with-zlib )
132 + else
133 + myopts+=( --without-zlib )
134 + fi
135 +
136 + # configure is a hand-written bash-script, so econf will not work.
137 + # It's all built as C++, upstream uses CFLAGS internally.
138 + CC=$(tc-getCC) CXX=$(tc-getCXX) CFLAGS="" ./configure ${myopts[@]} || die
139 +}
140 +
141 +src_compile() {
142 + emake VERBOSE=1
143 +}
144 +
145 +src_install() {
146 + default
147 + if use dedicated ; then
148 + newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
149 + rm -rf "${ED}"/usr/share/{applications,icons,pixmaps} || die
150 + fi
151 + rm -f "${ED}"/usr/share/doc/${PF}/COPYING || die
152 +}
153 +
154 +pkg_preinst() {
155 + xdg_pkg_preinst
156 +}
157 +
158 +pkg_postinst() {
159 + xdg_pkg_postinst
160 +
161 + if ! use lzo ; then
162 + elog "OpenTTD was built without 'lzo' in USE. While 'lzo' is not"
163 + elog "required, disabling it does mean that loading old savegames"
164 + elog "or scenarios from ancient versions (~0.2) will fail."
165 + elog
166 + fi
167 +
168 + if use dedicated ; then
169 + ewarn "Warning: The init script will kill all running openttd"
170 + ewarn "processes when triggered, including any running client sessions!"
171 + else
172 + if use aplaymidi ; then
173 + elog "You have emerged with 'aplaymidi' for playing MIDI."
174 + elog "This option is for those with a hardware midi device,"
175 + elog "or who have set up ALSA to handle midi ports."
176 + elog "You must set the environment variable ALSA_OUTPUT_PORTS."
177 + elog "Available ports can be listed by using 'aplaymidi -l'."
178 + else
179 + if ! use timidity ; then
180 + elog "OpenTTD was built with neither 'aplaymidi' nor 'timidity'"
181 + elog "in USE. Music may or may not work in-game. If you happen"
182 + elog "to have timidity++ installed, music will work so long"
183 + elog "as it remains installed, but OpenTTD will not depend on it."
184 + fi
185 + fi
186 + if ! use openmedia ; then
187 + elog
188 + elog "OpenTTD was compiled without the 'openmedia' USE flag."
189 + elog
190 + elog "In order to play, you must at least install:"
191 + elog "games-misc/opengfx, and games-misc/opensfx, or copy the "
192 + elog "following 6 files from a version of Transport Tycoon Deluxe"
193 + elog "(windows or DOS) to ~/.openttd/data/ or"
194 + elog "${GAMES_DATADIR}/${PN}/data/."
195 + elog
196 + elog "From the WINDOWS version you need: "
197 + elog "sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf"
198 + elog "OR from the DOS version you need: "
199 + elog "SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF"
200 + elog
201 + elog "File names are case sensitive, but should work either with"
202 + elog "all upper or all lower case names"
203 + elog
204 + elog "In addition, in-game music will be unavailable: for music,"
205 + elog "install games-misc/openmsx, or use the in-game download"
206 + elog "functionality to get a music set"
207 + elog
208 + fi
209 + fi
210 +}
211 +
212 +pkg_postrm() {
213 + xdg_pkg_postrm
214 +}