summaryrefslogtreecommitdiff
path: root/games-simulation/openttd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-simulation/openttd
reinit the tree, so we can have metadata
Diffstat (limited to 'games-simulation/openttd')
-rw-r--r--games-simulation/openttd/Manifest8
-rw-r--r--games-simulation/openttd/files/openttd-1.6.0-cflags.patch42
-rw-r--r--games-simulation/openttd/files/openttd.initd19
-rw-r--r--games-simulation/openttd/files/openttd.initd-r113
-rw-r--r--games-simulation/openttd/metadata.xml15
-rw-r--r--games-simulation/openttd/openttd-1.7.1-r1.ebuild170
6 files changed, 267 insertions, 0 deletions
diff --git a/games-simulation/openttd/Manifest b/games-simulation/openttd/Manifest
new file mode 100644
index 000000000000..03949a6d1610
--- /dev/null
+++ b/games-simulation/openttd/Manifest
@@ -0,0 +1,8 @@
+AUX openttd-1.6.0-cflags.patch 1028 SHA256 8a26bfb808fd14f45328255df11e7f3867111fd06570302a43a2807cfc06154e SHA512 e29ef624562c717b37496ca2e8353c1c065f776548878e3863420df5431743a6dc80f952699c3738f3fa1dbe77c9a6bf457a7c21241c723db5b1f7865afa180f WHIRLPOOL f6117b87252bf166c433982cfb7424cb297a633e0f9b74b24b198d028e94158a427dcaac3e0df4944923a08f6c7067a2a36eecd3748c0b7c2e3aa98e4d3e57b3
+AUX openttd.initd 412 SHA256 33636c93caf64d887c6546125f2228baa982d2284f1f2b8cf0d18f958854fce5 SHA512 eb14a32baa8a6601945e5f0cd844e2dc9620661ee4ab841d5085b75a0fb4a1ea8698b9292a489d63792d1163a13c7843795ef843fe0babdeac0a0468313667a3 WHIRLPOOL d1bed260829f85edaf8b149f9306661cabdfcf9569a130709644538989fe237ba952990785527af5d0bfdc8438866a0e97a08c6c3e88caa232d832a7294df682
+AUX openttd.initd-r1 306 SHA256 c12af8baf0a8e00805cedfa8509cc5a3718727c43488ca69991954e0ade95877 SHA512 bd04f9d812d5d68eebd953e9a667e5138d8e440139eb9c07f8da089495774b7d45e3b23bfb2af38ed053b333d4ead5f4be5c5fa877ad9f9bb0effee5c4a499dc WHIRLPOOL b7245a1dc98679d71e1f6150dd3ff0f673a4349b85d1d06c7835b879eb7074cb4633cab609fa17410f47f066bc6abc07fe9bc58376b703ad09c970ebe6b2687d
+DIST openttd-1.7.1-source.tar.gz 10090311 SHA256 9f7a5f5051dc9f43e8eec00bd56755a20846c8738ffcd4bb1f2e1eae334f3371 SHA512 4a0d2ee424374b50fe0d089b86ff16b5de3159848a38143ca6745e349b6126567f1e4beda9afe2e6bc21ffffce1166acf719d3f5c95703a14c1379f8857e83d3 WHIRLPOOL 65d0ee93dad5b865b1de362dc2259e8528bed273f640a9ec9097cf177cd507068f2fc093bfca1b55b0fa2865b9f7f3b68cf4d2caf1f9290ecaa61e46af2c60d9
+EBUILD openttd-1.7.1-r1.ebuild 4809 SHA256 27c3668eef1a47becac18b716ed0b052d5a176416a66e5b9a6ecc48549b89734 SHA512 364f66566e5fff2362684b90b58a5cde95e6d4c66c6b09280de17a7b789c97f96f4902f359cdfb0a5d22283d9f10a1bce10c3f64f6548b6b9a29058bc2981963 WHIRLPOOL 946a6d9d2bc231458d623c84b3c51b89c9889a56a3ff9f6d845b44f77693faf266b2fe7f1a97944ab53de79ab83aabf08f5aca4f8a48885265e4b5b02cf99c7f
+MISC ChangeLog 5625 SHA256 fbe6d1d032a0926401127fa5a2982be98726aea143da83eafa5ee4c2bfe7e66f SHA512 7d9a94be3322d3da6a5276e5dfc542a243ed00fec85ba9870fd102a5bec6888e43db30130b880c908aaad382fb287595bbde8d1b8415d367dcd89599e9f8adea WHIRLPOOL d9025dd3a67f69986137a07a0ac4a232d16c5854a9697b06e1aa015fcc3467bf9084e83c5662523cb19f3f5e12a51a24e652defc0bad4870b0edd164e03a8ff8
+MISC ChangeLog-2015 21727 SHA256 6b6c6dc3d30edde71ca1ac8170eb30a12244520a28ffad70da43e31261f44b90 SHA512 13e5a75ee2354087f8d83ce99f02e82a4ccffd9da27ddd522ce7546c22242a451c0ae7162cd928e8d168d391b016893f88c8c3edb2ae99162cb52985d282a155 WHIRLPOOL 8a15ea4fa4ea3d3ac6f159cf2a7f2b8d813285821b53e1ee12cbb1a19977591487af1e762d8d47e2ed860afdfdcb25a64cffbafea93a51ef9c76714fca84e4ea
+MISC metadata.xml 752 SHA256 ba1994fc2b479775b9975087608a39691f6be59143b37eb297711a2c1e52ee8f SHA512 ddb1fbbe98d5e0bc1e23385b38502603819b89bd1d9285b0193a55efe2263b8ab6e045c7befdc908303eea27de8c9148dbcc8e7b6c035b267f5c8ff0f16b4b56 WHIRLPOOL ee7764113e5045feca77fa8a5962f57790725f4752a46eea5e531c20eb62cebf5053741eeb8a24baf4917424e158ace9ddb57c751557f458fcc1c7ea222e18a8
diff --git a/games-simulation/openttd/files/openttd-1.6.0-cflags.patch b/games-simulation/openttd/files/openttd-1.6.0-cflags.patch
new file mode 100644
index 000000000000..bb7f768b3798
--- /dev/null
+++ b/games-simulation/openttd/files/openttd-1.6.0-cflags.patch
@@ -0,0 +1,42 @@
+--- openttd-1.4.4/config.lib
++++ openttd-1.4.4/config.lib
+@@ -1450,12 +1450,6 @@
+ CFLAGS="-I/gg/os-include -noixemul -fstrict-aliasing -fexpensive-optimizations -mcpu=604 -fno-inline -mstring -mmultiple $CFLAGS"
+ LDFLAGS="$LDFLAGS -noixemul"
+ fi
+-
+- if [ "$enable_profiling" = "0" ]; then
+- # -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible)
+- CFLAGS="-fomit-frame-pointer $CFLAGS"
+- fi
+- CFLAGS="-O2 $CFLAGS"
+ else
+ OBJS_SUBDIR="debug"
+
+@@ -1466,14 +1460,6 @@
+ CFLAGS="$CFLAGS -G0"
+ fi
+ fi
+- if [ $enable_debug -ge 2 ]; then
+- CFLAGS="$CFLAGS -fno-inline"
+- fi
+- if [ $enable_debug -ge 3 ]; then
+- CFLAGS="$CFLAGS -O0"
+- else
+- CFLAGS="$CFLAGS -O2"
+- fi
+ fi
+
+ if [ $enable_debug -le 2 ]; then
+@@ -1498,11 +1484,6 @@
+ CFLAGS="$CFLAGS -fno-expensive-optimizations"
+ fi
+
+- if [ "$enable_profiling" != "0" ]; then
+- CFLAGS="$CFLAGS -pg"
+- LDFLAGS="$LDFLAGS -pg"
+- fi
+-
+ if [ "$with_threads" = "0" ]; then
+ CFLAGS="$CFLAGS -DNO_THREADS"
+ fi
diff --git a/games-simulation/openttd/files/openttd.initd b/games-simulation/openttd/files/openttd.initd
new file mode 100644
index 000000000000..7a719587c7d6
--- /dev/null
+++ b/games-simulation/openttd/files/openttd.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting OpenTTD dedicated server"
+ start-stop-daemon --start -q --exec /usr/games/bin/openttd -- -D -f > /dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping OpenTTD dedicated server"
+ start-stop-daemon --stop -q -n openttd
+ eend $?
+}
diff --git a/games-simulation/openttd/files/openttd.initd-r1 b/games-simulation/openttd/files/openttd.initd-r1
new file mode 100644
index 000000000000..0bfeefddf6d6
--- /dev/null
+++ b/games-simulation/openttd/files/openttd.initd-r1
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+description="OpenTTD dedicated game server"
+pidfile="/run/${SVCNAME}.pid"
+command="/usr/bin/openttd"
+command_args="-D"
+command_background="true"
+
+depend() {
+ need net
+}
diff --git a/games-simulation/openttd/metadata.xml b/games-simulation/openttd/metadata.xml
new file mode 100644
index 000000000000..a5465cd55c4a
--- /dev/null
+++ b/games-simulation/openttd/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="aplaymidi">Enables midi music in game, using aplaymidi as an external player</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>
+</pkgmetadata>
diff --git a/games-simulation/openttd/openttd-1.7.1-r1.ebuild b/games-simulation/openttd/openttd-1.7.1-r1.ebuild
new file mode 100644
index 000000000000..db191da82343
--- /dev/null
+++ b/games-simulation/openttd/openttd-1.7.1-r1.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils gnome2-utils
+
+DESCRIPTION="OpenTTD is a clone of Transport Tycoon Deluxe"
+HOMEPAGE="http://www.openttd.org/"
+SRC_URI="http://binaries.openttd.org/releases/${PV}/${P}-source.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc64 x86"
+IUSE="aplaymidi debug dedicated iconv icu lzo +openmedia +png cpu_flags_x86_sse +timidity +truetype zlib"
+RESTRICT="test" # needs a graphics set in order to test
+
+RDEPEND="!dedicated? (
+ media-libs/libsdl[sound,X,video]
+ icu? (
+ dev-libs/icu-layoutex
+ dev-libs/icu-le-hb
+ >=dev-libs/icu-58.1:=
+ )
+ truetype? (
+ media-libs/fontconfig
+ media-libs/freetype:2
+ sys-libs/zlib
+ )
+ )
+ lzo? ( dev-libs/lzo:2 )
+ iconv? ( virtual/libiconv )
+ png? ( media-libs/libpng:0 )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+PDEPEND="
+ !dedicated? (
+ openmedia? (
+ games-misc/openmsx
+ games-misc/opensfx
+ )
+ aplaymidi? ( media-sound/alsa-utils )
+ !aplaymidi? ( timidity? ( media-sound/timidity++ ) )
+ )
+ openmedia? ( >=games-misc/opengfx-0.4.7 )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.6.0-cflags.patch
+)
+
+src_configure() {
+ local myopts=()
+ # there is an allegro interface available as well as sdl, but
+ # the configure for it looks broken so the sdl interface is
+ # always built instead.
+ local myopts+=( --without-allegro )
+
+ # libtimidity not needed except for some embedded platform
+ # nevertheless, it will be automagically linked if it is
+ # installed. Hence, we disable it.
+ myopts+=( --without-libtimidity )
+
+ use debug && myopts+=( --enable-debug=3 )
+
+ if use dedicated ; then
+ myopts+=( --enable-dedicated )
+ else
+ use aplaymidi && myopts+=( --with-midi='/usr/bin/aplaymidi' )
+ myopts+=(
+ $(use_with truetype freetype)
+ $(use_with icu)
+ --with-sdl
+ )
+ fi
+ if use png || { use !dedicated && use truetype; } || use zlib ; then
+ myopts+=( --with-zlib )
+ else
+ myopts+=( --without-zlib )
+ fi
+
+ # configure is a hand-written bash-script, so econf will not work.
+ # It's all built as C++, upstream uses CFLAGS internally.
+ CFLAGS="" ./configure \
+ --disable-strip \
+ --prefix-dir="${EPREFIX%/}/usr" \
+ --binary-dir="bin" \
+ --install-dir="${D}" \
+ --menu-group="Game;Simulation;" \
+ ${myopts[@]} \
+ $(use_with iconv) \
+ $(use_with png) \
+ $(use_with cpu_flags_x86_sse sse) \
+ $(use_with lzo liblzo2) \
+ || die
+}
+
+src_compile() {
+ emake VERBOSE=1
+}
+
+src_install() {
+ default
+ if use dedicated ; then
+ newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
+ rm -rf "${ED}"/usr/share/{applications,icons,pixmaps}
+ fi
+ rm -f "${ED}"/usr/share/doc/${PF}/COPYING
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+
+ if ! use lzo ; then
+ elog "OpenTTD was built without 'lzo' in USE. While 'lzo' is not"
+ elog "required, disabling it does mean that loading old savegames"
+ elog "or scenarios from ancient versions (~0.2) will fail."
+ elog
+ fi
+
+ if use dedicated ; then
+ ewarn "Warning: The init script will kill all running openttd"
+ ewarn "processes when triggered, including any running client sessions!"
+ else
+ if use aplaymidi ; then
+ elog "You have emerged with 'aplaymidi' for playing MIDI."
+ elog "This option is for those with a hardware midi device,"
+ elog "or who have set up ALSA to handle midi ports."
+ elog "You must set the environment variable ALSA_OUTPUT_PORTS."
+ elog "Available ports can be listed by using 'aplaymidi -l'."
+ else
+ if ! use timidity ; then
+ elog "OpenTTD was built with neither 'aplaymidi' nor 'timidity'"
+ elog "in USE. Music may or may not work in-game. If you happen"
+ elog "to have timidity++ installed, music will work so long"
+ elog "as it remains installed, but OpenTTD will not depend on it."
+ fi
+ fi
+ 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 ~/.openttd/data/ or"
+ elog "${GAMES_DATADIR}/${PN}/data/."
+ 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"
+ elog
+ elog "File names are case sensitive, but should work either with"
+ elog "all upper or all lower case names"
+ elog
+ elog "In addition, in-game music will be unavailable: for music,"
+ elog "install games-misc/openmsx, or use the in-game download"
+ elog "functionality to get a music set"
+ elog
+ fi
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}