summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzamat H. Hackimov <azamat.hackimov@gmail.com>2021-05-21 19:45:25 +0300
committerJames Le Cuirot <chewi@gentoo.org>2021-06-28 23:13:07 +0100
commit65c9998903c9780c36696c189f3a814e331e4270 (patch)
tree2685cc5169458037bcda993978cf3451cb86caf1 /games-simulation
parentgames-misc/opensfx: remove old version (diff)
downloadgentoo-65c9998903c9780c36696c189f3a814e331e4270.tar.gz
gentoo-65c9998903c9780c36696c189f3a814e331e4270.tar.bz2
gentoo-65c9998903c9780c36696c189f3a814e331e4270.zip
games-simulation/openttd: update to 1.11.2
Update version, migrate to cmake, cleanup. Bug: https://bugs.gentoo.org/729000 Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'games-simulation')
-rw-r--r--games-simulation/openttd/Manifest1
-rw-r--r--games-simulation/openttd/files/openttd-1.11.2_dont_compress_man.patch29
-rw-r--r--games-simulation/openttd/metadata.xml6
-rw-r--r--games-simulation/openttd/openttd-1.11.2.ebuild100
4 files changed, 135 insertions, 1 deletions
diff --git a/games-simulation/openttd/Manifest b/games-simulation/openttd/Manifest
index 1799965afeac..4baf99cfbbe1 100644
--- a/games-simulation/openttd/Manifest
+++ b/games-simulation/openttd/Manifest
@@ -1 +1,2 @@
DIST openttd-1.10.3-source.tar.xz 6815924 BLAKE2B f700304e723fe5c3fa9781432a387e061595bbc8de42f565ad57ac265d9e4bc14cbc659a3f6551019bfb31b8b56b180c272c6753a12b4cd2e13016a98dfe1679 SHA512 d1cd535e8e49f0ac147704341287af1b16bde6725fd9152dd36dcb780559b400da8bb31c4e8eb665a0d11e9b1f5bf8a96be0f97f7a85bd967eec534fdd3dd0d4
+DIST openttd-1.11.2-source.tar.xz 6783972 BLAKE2B c71fd98a480566aede29f84afbd100b6d0dfa80311860907a7287d2d5bed74bd492c2b1012cd83f45fe68d60fb0c2378e1384530a84c28bd7fbd907b45110491 SHA512 9a6364bf19627db9f8ec58bfa85fa3a8febf1109f3b5fb9053bef810ac2d0c41df91b58f0b253dd45320a29cae2e8485df794afa7b5240f19759f98fd65c35ea
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
new file mode 100644
index 000000000000..0dfef300dc5e
--- /dev/null
+++ b/games-simulation/openttd/files/openttd-1.11.2_dont_compress_man.patch
@@ -0,0 +1,29 @@
+From 985c2f4937573ce80add1aa84e4e57148c0a1815 Mon Sep 17 00:00:00 2001
+From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
+Date: Sun, 23 May 2021 17:39:53 +0300
+Subject: [PATCH] Don't compress man file on install
+
+---
+ cmake/InstallAndPackage.cmake | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake
+index 9b7d65788..b5b23c95f 100644
+--- a/cmake/InstallAndPackage.cmake
++++ b/cmake/InstallAndPackage.cmake
+@@ -51,11 +51,10 @@ if(OPTION_INSTALL_FHS)
+ install(CODE
+ "
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MAN_SOURCE_FILE} ${MAN_BINARY_FILE})
+- execute_process(COMMAND gzip -9 -n -f ${MAN_BINARY_FILE})
+ "
+ COMPONENT manual)
+ install(FILES
+- ${MAN_BINARY_FILE}.gz
++ ${MAN_BINARY_FILE}
+ DESTINATION ${MAN_DESTINATION_DIR}/man6
+ COMPONENT manual)
+ endif()
+--
+2.26.3
+
diff --git a/games-simulation/openttd/metadata.xml b/games-simulation/openttd/metadata.xml
index a5465cd55c4a..b7a1255795fb 100644
--- a/games-simulation/openttd/metadata.xml
+++ b/games-simulation/openttd/metadata.xml
@@ -6,10 +6,14 @@
<name>Gentoo Games Project</name>
</maintainer>
<use>
+ <flag name="allegro">Add support for Allegro</flag>
<flag name="aplaymidi">Enables midi music in game, using aplaymidi as an external player</flag>
-
+ <flag name="fluidsynth">Compile with support for FluidSynth</flag>
<flag name="openmedia">Enables the free open media sets: OpenGFX, OpenSFX, OpenMSX, removing the requirement for proprietary TTD assets to play OpenTTD.</flag>
<flag name="lzo">Enables LZO compression for savegames. This is only needed to load extremely old savegames. (versions before 0.2)</flag>
<flag name="dedicated">Build only the openttd server, and not the client.</flag>
</use>
+ <upstream>
+ <remote-id type="github">OpenTTD/OpenTTD</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/games-simulation/openttd/openttd-1.11.2.ebuild b/games-simulation/openttd/openttd-1.11.2.ebuild
new file mode 100644
index 000000000000..cd8010bd21f5
--- /dev/null
+++ b/games-simulation/openttd/openttd-1.11.2.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="A clone of Transport Tycoon Deluxe"
+HOMEPAGE="https://www.openttd.org/"
+SRC_URI="https://cdn.openttd.org/openttd-releases/${PV}/${P}-source.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+
+IUSE="allegro cpu_flags_x86_sse dedicated +fluidsynth icu +lzma lzo +openmedia +png +sdl timidity +truetype zlib"
+REQUIRED_USE="!dedicated? ( || ( allegro sdl ) )"
+
+RESTRICT="test" # needs a graphics set in order to test
+
+RDEPEND="
+ !dedicated? (
+ allegro? ( media-libs/allegro:5 )
+ fluidsynth? ( media-sound/fluidsynth )
+ icu? (
+ dev-libs/icu-layoutex
+ dev-libs/icu-le-hb
+ >=dev-libs/icu-58.1:=
+ )
+ sdl? ( media-libs/libsdl2[sound,video] )
+ truetype? (
+ media-libs/fontconfig
+ media-libs/freetype:2
+ sys-libs/zlib:=
+ )
+ )
+ lzma? ( app-arch/xz-utils )
+ lzo? ( dev-libs/lzo:2 )
+ png? ( media-libs/libpng:0= )
+ zlib? ( sys-libs/zlib:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+PDEPEND="
+ !dedicated? (
+ openmedia? (
+ >=games-misc/openmsx-0.4.0
+ >=games-misc/opensfx-1.0.1
+ )
+ )
+ openmedia? ( >=games-misc/opengfx-0.6.1 )
+ timidity? ( media-sound/timidity++ )"
+
+DOCS=( docs/directory_structure.md )
+PATCHES=(
+ "${FILESDIR}/${P}_dont_compress_man.patch"
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_BINDIR=bin
+ -DCMAKE_INSTALL_DATADIR=share
+ -DOPTION_DEDICATED=$(usex dedicated)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Allegro=$(usex !allegro)
+ -DCMAKE_DISABLE_FIND_PACKAGE_FREETYPE=$(usex !truetype)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Fontconfig=$(usex !truetype)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Fluidsynth=$(usex !fluidsynth)
+ -DCMAKE_DISABLE_FIND_PACKAGE_ICU=$(usex !icu)
+ -DCMAKE_DISABLE_FIND_PACKAGE_LIBLZMA=$(usex !lzma)
+ -DCMAKE_DISABLE_FIND_PACKAGE_LZO=$(usex !lzo)
+ -DCMAKE_DISABLE_FIND_PACKAGE_PNG=$(usex !png)
+ -DCMAKE_DISABLE_FIND_PACKAGE_SDL=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_SDL2=$(usex !sdl)
+ -DCMAKE_DISABLE_FIND_PACKAGE_SSE=$(usex !cpu_flags_x86_sse)
+ -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=$(usex !zlib)
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
+}
+
+pkg_postinst() {
+ if ! use openmedia ; then
+ elog
+ elog "OpenTTD was compiled without the 'openmedia' USE flag."
+ elog
+ elog "In order to play, you must at least install"
+ elog "games-misc/opengfx, and games-misc/opensfx, or copy the "
+ elog "following 6 files from a version of Transport Tycoon Deluxe"
+ elog "(Windows or DOS) to shared or personal location."
+ elog "See /usr/share/doc/${PF}/directory_structure.md for more info."
+ elog
+ elog "From the Windows version you need: "
+ elog "sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf"
+ elog "OR from the DOS version you need: "
+ elog "SAMPLE.CAT TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF"
+ fi
+}