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/files/, games-simulation/openttd/
Date: Mon, 28 Jun 2021 22:13:40
Message-Id: 1624918387.65c9998903c9780c36696c189f3a814e331e4270.chewi@gentoo
1 commit: 65c9998903c9780c36696c189f3a814e331e4270
2 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
3 AuthorDate: Fri May 21 16:45:25 2021 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 28 22:13:07 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65c99989
7
8 games-simulation/openttd: update to 1.11.2
9
10 Update version, migrate to cmake, cleanup.
11 Bug: https://bugs.gentoo.org/729000
12
13 Package-Manager: Portage-3.0.18, Repoman-3.0.2
14 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
15 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
16
17 games-simulation/openttd/Manifest | 1 +
18 .../files/openttd-1.11.2_dont_compress_man.patch | 29 ++++++
19 games-simulation/openttd/metadata.xml | 6 +-
20 games-simulation/openttd/openttd-1.11.2.ebuild | 100 +++++++++++++++++++++
21 4 files changed, 135 insertions(+), 1 deletion(-)
22
23 diff --git a/games-simulation/openttd/Manifest b/games-simulation/openttd/Manifest
24 index 1799965afea..4baf99cfbbe 100644
25 --- a/games-simulation/openttd/Manifest
26 +++ b/games-simulation/openttd/Manifest
27 @@ -1 +1,2 @@
28 DIST openttd-1.10.3-source.tar.xz 6815924 BLAKE2B f700304e723fe5c3fa9781432a387e061595bbc8de42f565ad57ac265d9e4bc14cbc659a3f6551019bfb31b8b56b180c272c6753a12b4cd2e13016a98dfe1679 SHA512 d1cd535e8e49f0ac147704341287af1b16bde6725fd9152dd36dcb780559b400da8bb31c4e8eb665a0d11e9b1f5bf8a96be0f97f7a85bd967eec534fdd3dd0d4
29 +DIST openttd-1.11.2-source.tar.xz 6783972 BLAKE2B c71fd98a480566aede29f84afbd100b6d0dfa80311860907a7287d2d5bed74bd492c2b1012cd83f45fe68d60fb0c2378e1384530a84c28bd7fbd907b45110491 SHA512 9a6364bf19627db9f8ec58bfa85fa3a8febf1109f3b5fb9053bef810ac2d0c41df91b58f0b253dd45320a29cae2e8485df794afa7b5240f19759f98fd65c35ea
30
31 diff --git a/games-simulation/openttd/files/openttd-1.11.2_dont_compress_man.patch b/games-simulation/openttd/files/openttd-1.11.2_dont_compress_man.patch
32 new file mode 100644
33 index 00000000000..0dfef300dc5
34 --- /dev/null
35 +++ b/games-simulation/openttd/files/openttd-1.11.2_dont_compress_man.patch
36 @@ -0,0 +1,29 @@
37 +From 985c2f4937573ce80add1aa84e4e57148c0a1815 Mon Sep 17 00:00:00 2001
38 +From: "Azamat H. Hackimov" <azamat.hackimov@×××××.com>
39 +Date: Sun, 23 May 2021 17:39:53 +0300
40 +Subject: [PATCH] Don't compress man file on install
41 +
42 +---
43 + cmake/InstallAndPackage.cmake | 3 +--
44 + 1 file changed, 1 insertion(+), 2 deletions(-)
45 +
46 +diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake
47 +index 9b7d65788..b5b23c95f 100644
48 +--- a/cmake/InstallAndPackage.cmake
49 ++++ b/cmake/InstallAndPackage.cmake
50 +@@ -51,11 +51,10 @@ if(OPTION_INSTALL_FHS)
51 + install(CODE
52 + "
53 + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MAN_SOURCE_FILE} ${MAN_BINARY_FILE})
54 +- execute_process(COMMAND gzip -9 -n -f ${MAN_BINARY_FILE})
55 + "
56 + COMPONENT manual)
57 + install(FILES
58 +- ${MAN_BINARY_FILE}.gz
59 ++ ${MAN_BINARY_FILE}
60 + DESTINATION ${MAN_DESTINATION_DIR}/man6
61 + COMPONENT manual)
62 + endif()
63 +--
64 +2.26.3
65 +
66
67 diff --git a/games-simulation/openttd/metadata.xml b/games-simulation/openttd/metadata.xml
68 index a5465cd55c4..b7a1255795f 100644
69 --- a/games-simulation/openttd/metadata.xml
70 +++ b/games-simulation/openttd/metadata.xml
71 @@ -6,10 +6,14 @@
72 <name>Gentoo Games Project</name>
73 </maintainer>
74 <use>
75 + <flag name="allegro">Add support for Allegro</flag>
76 <flag name="aplaymidi">Enables midi music in game, using aplaymidi as an external player</flag>
77 -
78 + <flag name="fluidsynth">Compile with support for FluidSynth</flag>
79 <flag name="openmedia">Enables the free open media sets: OpenGFX, OpenSFX, OpenMSX, removing the requirement for proprietary TTD assets to play OpenTTD.</flag>
80 <flag name="lzo">Enables LZO compression for savegames. This is only needed to load extremely old savegames. (versions before 0.2)</flag>
81 <flag name="dedicated">Build only the openttd server, and not the client.</flag>
82 </use>
83 + <upstream>
84 + <remote-id type="github">OpenTTD/OpenTTD</remote-id>
85 + </upstream>
86 </pkgmetadata>
87
88 diff --git a/games-simulation/openttd/openttd-1.11.2.ebuild b/games-simulation/openttd/openttd-1.11.2.ebuild
89 new file mode 100644
90 index 00000000000..cd8010bd21f
91 --- /dev/null
92 +++ b/games-simulation/openttd/openttd-1.11.2.ebuild
93 @@ -0,0 +1,100 @@
94 +# Copyright 1999-2021 Gentoo Authors
95 +# Distributed under the terms of the GNU General Public License v2
96 +
97 +EAPI=7
98 +
99 +inherit cmake
100 +
101 +DESCRIPTION="A clone of Transport Tycoon Deluxe"
102 +HOMEPAGE="https://www.openttd.org/"
103 +SRC_URI="https://cdn.openttd.org/openttd-releases/${PV}/${P}-source.tar.xz"
104 +
105 +LICENSE="GPL-2"
106 +SLOT="0"
107 +KEYWORDS="~amd64 ~ppc64 ~x86"
108 +
109 +IUSE="allegro cpu_flags_x86_sse dedicated +fluidsynth icu +lzma lzo +openmedia +png +sdl timidity +truetype zlib"
110 +REQUIRED_USE="!dedicated? ( || ( allegro sdl ) )"
111 +
112 +RESTRICT="test" # needs a graphics set in order to test
113 +
114 +RDEPEND="
115 + !dedicated? (
116 + allegro? ( media-libs/allegro:5 )
117 + fluidsynth? ( media-sound/fluidsynth )
118 + icu? (
119 + dev-libs/icu-layoutex
120 + dev-libs/icu-le-hb
121 + >=dev-libs/icu-58.1:=
122 + )
123 + sdl? ( media-libs/libsdl2[sound,video] )
124 + truetype? (
125 + media-libs/fontconfig
126 + media-libs/freetype:2
127 + sys-libs/zlib:=
128 + )
129 + )
130 + lzma? ( app-arch/xz-utils )
131 + lzo? ( dev-libs/lzo:2 )
132 + png? ( media-libs/libpng:0= )
133 + zlib? ( sys-libs/zlib:= )"
134 +DEPEND="${RDEPEND}"
135 +BDEPEND="virtual/pkgconfig"
136 +PDEPEND="
137 + !dedicated? (
138 + openmedia? (
139 + >=games-misc/openmsx-0.4.0
140 + >=games-misc/opensfx-1.0.1
141 + )
142 + )
143 + openmedia? ( >=games-misc/opengfx-0.6.1 )
144 + timidity? ( media-sound/timidity++ )"
145 +
146 +DOCS=( docs/directory_structure.md )
147 +PATCHES=(
148 + "${FILESDIR}/${P}_dont_compress_man.patch"
149 +)
150 +
151 +src_configure() {
152 + local mycmakeargs=(
153 + -DCMAKE_INSTALL_BINDIR=bin
154 + -DCMAKE_INSTALL_DATADIR=share
155 + -DOPTION_DEDICATED=$(usex dedicated)
156 + -DCMAKE_DISABLE_FIND_PACKAGE_Allegro=$(usex !allegro)
157 + -DCMAKE_DISABLE_FIND_PACKAGE_FREETYPE=$(usex !truetype)
158 + -DCMAKE_DISABLE_FIND_PACKAGE_Fontconfig=$(usex !truetype)
159 + -DCMAKE_DISABLE_FIND_PACKAGE_Fluidsynth=$(usex !fluidsynth)
160 + -DCMAKE_DISABLE_FIND_PACKAGE_ICU=$(usex !icu)
161 + -DCMAKE_DISABLE_FIND_PACKAGE_LIBLZMA=$(usex !lzma)
162 + -DCMAKE_DISABLE_FIND_PACKAGE_LZO=$(usex !lzo)
163 + -DCMAKE_DISABLE_FIND_PACKAGE_PNG=$(usex !png)
164 + -DCMAKE_DISABLE_FIND_PACKAGE_SDL=ON
165 + -DCMAKE_DISABLE_FIND_PACKAGE_SDL2=$(usex !sdl)
166 + -DCMAKE_DISABLE_FIND_PACKAGE_SSE=$(usex !cpu_flags_x86_sse)
167 + -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=$(usex !zlib)
168 + )
169 + cmake_src_configure
170 +}
171 +
172 +src_install() {
173 + cmake_src_install
174 + newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
175 +}
176 +
177 +pkg_postinst() {
178 + if ! use openmedia ; then
179 + elog
180 + elog "OpenTTD was compiled without the 'openmedia' USE flag."
181 + elog
182 + elog "In order to play, you must at least install"
183 + elog "games-misc/opengfx, and games-misc/opensfx, or copy the "
184 + elog "following 6 files from a version of Transport Tycoon Deluxe"
185 + elog "(Windows or DOS) to shared or personal location."
186 + elog "See /usr/share/doc/${PF}/directory_structure.md for more info."
187 + elog
188 + elog "From the Windows version you need: "
189 + elog "sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf"
190 + elog "OR from the DOS version you need: "
191 + elog "SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF"
192 + fi
193 +}