From b7ebc951da8800f711142f69d9d958bde67a112d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 28 Apr 2019 09:54:45 +0100 Subject: gentoo resync : 28.04.2019 --- games-simulation/openttd/Manifest | 7 +- .../openttd/files/openttd-1.6.0-cflags.patch | 42 ----- .../openttd/files/openttd-1.8.0-icu61.patch | 45 ----- .../openttd/files/openttd-1.8.0-icu62.patch | 99 ----------- games-simulation/openttd/openttd-1.8.0.ebuild | 178 -------------------- games-simulation/openttd/openttd-1.9.1.ebuild | 185 +++++++++++++++++++++ 6 files changed, 187 insertions(+), 369 deletions(-) delete mode 100644 games-simulation/openttd/files/openttd-1.6.0-cflags.patch delete mode 100644 games-simulation/openttd/files/openttd-1.8.0-icu61.patch delete mode 100644 games-simulation/openttd/files/openttd-1.8.0-icu62.patch delete mode 100644 games-simulation/openttd/openttd-1.8.0.ebuild create mode 100644 games-simulation/openttd/openttd-1.9.1.ebuild (limited to 'games-simulation/openttd') diff --git a/games-simulation/openttd/Manifest b/games-simulation/openttd/Manifest index 5ec7aef5a5b6..d42aba27033c 100644 --- a/games-simulation/openttd/Manifest +++ b/games-simulation/openttd/Manifest @@ -1,12 +1,9 @@ -AUX openttd-1.6.0-cflags.patch 1028 BLAKE2B bc71e2620a834b37f5957d3da885dcd5e692fcca238c7e87949a36e24029677f036da9773d786b44022e4f8d920ea25f881ed782ec107f9c963558e9411b9d98 SHA512 e29ef624562c717b37496ca2e8353c1c065f776548878e3863420df5431743a6dc80f952699c3738f3fa1dbe77c9a6bf457a7c21241c723db5b1f7865afa180f -AUX openttd-1.8.0-icu61.patch 2009 BLAKE2B a48deea2af2433ffbca27636687c5310da93410af557310fc86cfc0ec0a1dc249b7436a09a995c7f16a1dafb69399bb5c12b9b25f1eeb4e7b0abe481cf9b4158 SHA512 db470433bcc68688b1a4cf71a514879c139300a778feb3f832bff0400b578d4b7720df6e259a86013334a661fce56c66d74aaf709d0027cf9638f006bebca10e -AUX openttd-1.8.0-icu62.patch 4036 BLAKE2B d90afd00fbc8f20f2a71f317d31952711a038d909c6d5ecd81a383a99d37db4607138251ae3c0563cea06f04332c9b233505dc48f01f3882f614c97f87a74734 SHA512 da67257f56dd9a8812a9fdd5a2535ddbd0f23eca931d426500dc762313197ff941f50a39a5a1fd2e47aa12bd5a3eb2a2bb3978a3748dbf06e8c63c7a010f6a1b AUX openttd-1.9.0-cflags.patch 1418 BLAKE2B 4c279bca0360d202d183488f61a19a5abc768cf55c2bb1ebaaa58ecd59f61584d4865bd7fc91260f14bd750b623884b88b6900e1c9cb89c007b32534e62ab510 SHA512 df1eeca21325b09c849191f7a60d0be1eee107a40b3cbb846f5c845d560f61a847ac66c427772c8e980d2ab2f51ccaa539938dd36c143f9af558293f9cf5c755 AUX openttd-1.9.0-dont_compress_manpages.patch 1137 BLAKE2B aa03bf141f1dac450b90ad9b54f4022dc981e041f40cd5ad9b7b522910788fcf30c85ac8ee3ba480c76df67f11b8258de7fe785259796b67bebc1a49ce1ed6e3 SHA512 0985a5826dddfb9a03bfc686de5ae2a36362d635865fde9ec2ee340672556d82517db94197d7de04630ba7558bee5ad4543debafd46e5dfd2bbec2eaa9354a18 AUX openttd.initd-r1 306 BLAKE2B d36e2f405a1b8808c708edd0c66e23d9976c2f5ef0fc2af3430bb8ba287c237dffe3d11cde6428b8ab668886ac4ff5eb4bc4fe5b39f205da4bf3d7773f66f7ef SHA512 bd04f9d812d5d68eebd953e9a667e5138d8e440139eb9c07f8da089495774b7d45e3b23bfb2af38ed053b333d4ead5f4be5c5fa877ad9f9bb0effee5c4a499dc -DIST openttd-1.8.0-source.tar.xz 6521016 BLAKE2B b3a608fd21d21f861af6eba235c028a59f071ab4698cfdcdd499b6ea7ece853679b064935368d95330414a24ac90aaa3c426afc12a2e135d5b0a48170879b807 SHA512 a2d61b3c94a550c8f3a581127df8c3459b1ddff5ba924942c468cbc70e88e0bf4405cecb68a91243b544ead64f215aa8d489a07b38dce507ae7d59e8ec155d7a DIST openttd-1.9.0-source.tar.xz 6575956 BLAKE2B 31d663b2f8aa67d9e3eb7899795468e8641671bb977957fdc6e55c8dedf3f2a00757de67ed034bf6180cc6091006a1b0bfba8af22d09744eb839a54ca662cbd9 SHA512 fcc044ea93810c99e9b3e80676676272c6f0efb43faa7ef4bfa7184aea793680df22504a1831837cc5ae8481e898d0636b992d1ddb8560cd4848463343adba2d -EBUILD openttd-1.8.0.ebuild 4942 BLAKE2B 2ceb5e797c44317559daa6e051a98338aba0fda1cdcf01edb8132ede0f8a648d06491833b0764d0973ac2041c8642619a225b2d90839da44a6c75ab808bc265e SHA512 17185feba1d39f17bf150f95e087f5d31be94cc6c57ef9f62da9de78b6375052a09ea3aed26d4bf4d47a39ff6759752a77281d0fd117c3a459f76ac733dfbe90 +DIST openttd-1.9.1-source.tar.xz 6647548 BLAKE2B fd7d03221bea49345e2163ff700e62a12682f706c1dab3fc741136219b80094bf945dc0cefcd807a643d141841a307141bb760d4b06bf75fa18129c557b149c3 SHA512 44d907299a14fd09ebff980f7c212bbdbd5def880bc56bfe106c3efa8cb32472bbcafdbb145d3f4340a3bc96179418f78fe2ddc62dd067b464eca73313b477c1 EBUILD openttd-1.9.0.ebuild 5059 BLAKE2B 546a1d14347679495b60a397bc55d9a452c461e18c45751943c8f19983d5b5164e03843702f1b26cbe7f0d6e0909303f610f52735c6740e7cdc746d653d910b3 SHA512 abf97e9de9e170c619355f5d0b3dc509da9094c0bc620ed6982f5b47a3cc519ba0338ee500664e288d6e55c24477e610c39ca36d5ea90cce47aa5906cc9655ee +EBUILD openttd-1.9.1.ebuild 5059 BLAKE2B 546a1d14347679495b60a397bc55d9a452c461e18c45751943c8f19983d5b5164e03843702f1b26cbe7f0d6e0909303f610f52735c6740e7cdc746d653d910b3 SHA512 abf97e9de9e170c619355f5d0b3dc509da9094c0bc620ed6982f5b47a3cc519ba0338ee500664e288d6e55c24477e610c39ca36d5ea90cce47aa5906cc9655ee EBUILD openttd-9999.ebuild 4877 BLAKE2B e5e8fce784cc41262792ac0657bbaa241c075ac79edc58b7f1de180a35ca8aba1cc0cd7ac5c315eae6fa258efc2d291cac77590d130d2fc37a075b402cf0fb42 SHA512 aea87497dbdd2fb75681dd1e885eca49b5a500a0508d987b494347fc0bb6e517c79060daef07a70085c27610f77154371a8be37395e3e53ede20dc99caf8221f MISC metadata.xml 752 BLAKE2B 85476f4dbf68d94a5d95e35cff935edfe35caee4bd2a253c7bad747b0915b80f0f7009bf78e419417a05345210bed17dff8f82ce603480c96781323d7d5a89fd SHA512 ddb1fbbe98d5e0bc1e23385b38502603819b89bd1d9285b0193a55efe2263b8ab6e045c7befdc908303eea27de8c9148dbcc8e7b6c035b267f5c8ff0f16b4b56 diff --git a/games-simulation/openttd/files/openttd-1.6.0-cflags.patch b/games-simulation/openttd/files/openttd-1.6.0-cflags.patch deleted file mode 100644 index bb7f768b3798..000000000000 --- a/games-simulation/openttd/files/openttd-1.6.0-cflags.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- 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-1.8.0-icu61.patch b/games-simulation/openttd/files/openttd-1.8.0-icu61.patch deleted file mode 100644 index e4143d82f679..000000000000 --- a/games-simulation/openttd/files/openttd-1.8.0-icu61.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 19076c24c1f3baf2a22d1fa832d5688216cf54a3 Mon Sep 17 00:00:00 2001 -From: Charles Pigott -Date: Sun, 8 Apr 2018 01:06:18 +0100 -Subject: [PATCH] Fix #6690: Compilation with ICU 61 - ---- - src/language.h | 2 +- - src/strings.cpp | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/language.h b/src/language.h -index d33ba81892..ec241dbd8c 100644 ---- a/src/language.h -+++ b/src/language.h -@@ -105,7 +105,7 @@ extern LanguageList _languages; - extern const LanguageMetadata *_current_language; - - #ifdef WITH_ICU_SORT --extern Collator *_current_collator; -+extern icu::Collator *_current_collator; - #endif /* WITH_ICU_SORT */ - - bool ReadLanguagePack(const LanguageMetadata *lang); -diff --git a/src/strings.cpp b/src/strings.cpp -index 1c539d9343..fd7420259a 100644 ---- a/src/strings.cpp -+++ b/src/strings.cpp -@@ -52,7 +52,7 @@ const LanguageMetadata *_current_language = NULL; ///< The currently loaded lang - TextDirection _current_text_dir; ///< Text direction of the currently selected language. - - #ifdef WITH_ICU_SORT --Collator *_current_collator = NULL; ///< Collator for the language currently in use. -+icu::Collator *_current_collator = NULL; ///< Collator for the language currently in use. - #endif /* WITH_ICU_SORT */ - - static uint64 _global_string_params_data[20]; ///< Global array of string parameters. To access, use #SetDParam. -@@ -1795,7 +1795,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang) - - /* Create a collator instance for our current locale. */ - UErrorCode status = U_ZERO_ERROR; -- _current_collator = Collator::createInstance(Locale(_current_language->isocode), status); -+ _current_collator = icu::Collator::createInstance(icu::Locale(_current_language->isocode), status); - /* Sort number substrings by their numerical value. */ - if (_current_collator != NULL) _current_collator->setAttribute(UCOL_NUMERIC_COLLATION, UCOL_ON, status); - /* Avoid using the collator if it is not correctly set. */ diff --git a/games-simulation/openttd/files/openttd-1.8.0-icu62.patch b/games-simulation/openttd/files/openttd-1.8.0-icu62.patch deleted file mode 100644 index 9ba907fa47e5..000000000000 --- a/games-simulation/openttd/files/openttd-1.8.0-icu62.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 55bf7628e299ef2c143e9ac97e87817b5eda3239 Mon Sep 17 00:00:00 2001 -From: Stefan Strogin -Date: Wed, 19 Sep 2018 23:52:10 +0300 -Subject: [PATCH] Fix #6854: Compilation with ICU 62 - ---- - src/gfx_layout.cpp | 18 +++++++++--------- - src/gfx_layout.h | 2 +- - 2 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp -index f5463d401..e13ece0e7 100644 ---- a/src/gfx_layout.cpp -+++ b/src/gfx_layout.cpp -@@ -126,7 +126,7 @@ static size_t AppendToBuffer(UChar *buff, const UChar *buffer_last, WChar c) - * Wrapper for doing layouts with ICU. - */ - class ICUParagraphLayout : public AutoDeleteSmallVector, public ParagraphLayouter { -- ParagraphLayout *p; ///< The actual ICU paragraph layout. -+ icu::ParagraphLayout *p; ///< The actual ICU paragraph layout. - public: - /** Helper for GetLayouter, to get the right type. */ - typedef UChar CharType; -@@ -135,10 +135,10 @@ public: - - /** Visual run contains data about the bit of text with the same font. */ - class ICUVisualRun : public ParagraphLayouter::VisualRun { -- const ParagraphLayout::VisualRun *vr; ///< The actual ICU vr. -+ const icu::ParagraphLayout::VisualRun *vr; ///< The actual ICU vr. - - public: -- ICUVisualRun(const ParagraphLayout::VisualRun *vr) : vr(vr) { } -+ ICUVisualRun(const icu::ParagraphLayout::VisualRun *vr) : vr(vr) { } - - const Font *GetFont() const { return (const Font*)vr->getFont(); } - int GetGlyphCount() const { return vr->getGlyphCount(); } -@@ -150,10 +150,10 @@ public: - - /** A single line worth of VisualRuns. */ - class ICULine : public AutoDeleteSmallVector, public ParagraphLayouter::Line { -- ParagraphLayout::Line *l; ///< The actual ICU line. -+ icu::ParagraphLayout::Line *l; ///< The actual ICU line. - - public: -- ICULine(ParagraphLayout::Line *l) : l(l) -+ ICULine(icu::ParagraphLayout::Line *l) : l(l) - { - for (int i = 0; i < l->countRuns(); i++) { - *this->Append() = new ICUVisualRun(l->getVisualRun(i)); -@@ -173,13 +173,13 @@ public: - } - }; - -- ICUParagraphLayout(ParagraphLayout *p) : p(p) { } -+ ICUParagraphLayout(icu::ParagraphLayout *p) : p(p) { } - ~ICUParagraphLayout() { delete p; } - void Reflow() { p->reflow(); } - - ParagraphLayouter::Line *NextLine(int max_width) - { -- ParagraphLayout::Line *l = p->nextLine(max_width); -+ icu::ParagraphLayout::Line *l = p->nextLine(max_width); - return l == NULL ? NULL : new ICULine(l); - } - }; -@@ -196,7 +196,7 @@ static ParagraphLayouter *GetParagraphLayout(UChar *buff, UChar *buff_end, FontM - } - - /* Fill ICU's FontRuns with the right data. */ -- FontRuns runs(fontMapping.Length()); -+ icu::FontRuns runs(fontMapping.Length()); - for (FontMap::iterator iter = fontMapping.Begin(); iter != fontMapping.End(); iter++) { - runs.add(iter->second, iter->first); - } -@@ -204,7 +204,7 @@ static ParagraphLayouter *GetParagraphLayout(UChar *buff, UChar *buff_end, FontM - LEErrorCode status = LE_NO_ERROR; - /* ParagraphLayout does not copy "buff", so it must stay valid. - * "runs" is copied according to the ICU source, but the documentation does not specify anything, so this might break somewhen. */ -- ParagraphLayout *p = new ParagraphLayout(buff, length, &runs, NULL, NULL, NULL, _current_text_dir == TD_RTL ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, false, status); -+ icu::ParagraphLayout *p = new icu::ParagraphLayout(buff, length, &runs, NULL, NULL, NULL, _current_text_dir == TD_RTL ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, false, status); - if (status != LE_NO_ERROR) { - delete p; - return NULL; -diff --git a/src/gfx_layout.h b/src/gfx_layout.h -index 0a21d9b0c..028f5be63 100644 ---- a/src/gfx_layout.h -+++ b/src/gfx_layout.h -@@ -21,7 +21,7 @@ - - #ifdef WITH_ICU_LAYOUT - #include "layout/ParagraphLayout.h" --#define ICU_FONTINSTANCE : public LEFontInstance -+#define ICU_FONTINSTANCE : public icu::LEFontInstance - #else /* WITH_ICU_LAYOUT */ - #define ICU_FONTINSTANCE - #endif /* WITH_ICU_LAYOUT */ --- -2.19.0 - diff --git a/games-simulation/openttd/openttd-1.8.0.ebuild b/games-simulation/openttd/openttd-1.8.0.ebuild deleted file mode 100644 index 7daebea4a2cc..000000000000 --- a/games-simulation/openttd/openttd-1.8.0.ebuild +++ /dev/null @@ -1,178 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 -inherit gnome2-utils - -MY_PV="${PV/_rc/-RC}" -MY_P="${PN}-${MY_PV}" - -DESCRIPTION="OpenTTD is a clone of Transport Tycoon Deluxe" -HOMEPAGE="http://www.openttd.org/" -SRC_URI="http://binaries.openttd.org/releases/${MY_PV}/${MY_P}-source.tar.xz" - -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 )" - -S="${WORKDIR}/${MY_P}" - -PATCHES=( - "${FILESDIR}"/${PN}-1.6.0-cflags.patch - "${FILESDIR}"/${PN}-1.8.0-icu61.patch - "${FILESDIR}"/${PN}-1.8.0-icu62.patch -) - -src_configure() { - local myopts=( - $(use_with iconv) - $(use_with png) - $(use_with cpu_flags_x86_sse sse) - $(use_with lzo liblzo2) - ) - # 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. - 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 - myopts+=( - $(usex aplaymidi '--with-midi=/usr/bin/aplaymidi' '') - $(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[@]} \ - || 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 -} diff --git a/games-simulation/openttd/openttd-1.9.1.ebuild b/games-simulation/openttd/openttd-1.9.1.ebuild new file mode 100644 index 000000000000..49368f0e59a7 --- /dev/null +++ b/games-simulation/openttd/openttd-1.9.1.ebuild @@ -0,0 +1,185 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit xdg + +MY_PV="${PV/_rc/-RC}" +MY_P="${PN}-${MY_PV}" + +DESCRIPTION="OpenTTD is a clone of Transport Tycoon Deluxe" +HOMEPAGE="http://www.openttd.org/" +if [[ "${PV}" == *9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/OpenTTD/OpenTTD.git" +else + SRC_URI="https://proxy.binaries.openttd.org/openttd-releases/${MY_PV}/${MY_P}-source.tar.xz" + KEYWORDS="~amd64 ~ppc64 ~x86" + S="${WORKDIR}/${MY_P}" +fi + +LICENSE="GPL-2" +SLOT="0" +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 + sys-libs/zlib:= + ) + zlib? ( sys-libs/zlib:= )" +DEPEND="${RDEPEND}" +BDEPEND=" + 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.9.0-cflags.patch + "${FILESDIR}"/${PN}-1.9.0-dont_compress_manpages.patch +) + +src_configure() { + local myopts=( + --binary-dir="bin" + --disable-strip + --doc-dir="share/doc/${PF}" + --install-dir="${D}" + --menu-group="Game;Simulation;" + --prefix-dir="${EPREFIX}/usr" + $(use_with cpu_flags_x86_sse sse) + $(use_with iconv) + $(use_with lzo liblzo2) + $(use_with png) + $(usex debug '--enable-debug=3' '') + # 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. + --without-allegro + + # libtimidity not needed except for some embedded platform + # nevertheless, it will be automagically linked if it is + # installed. Hence, we disable it. + --without-libtimidity + + --without-fluidsynth + ) + + if use dedicated ; then + myopts+=( --enable-dedicated ) + else + myopts+=( + $(usex aplaymidi '--with-midi=/usr/bin/aplaymidi' '') + $(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 ${myopts[@]} || 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() { + xdg_pkg_preinst +} + +pkg_postinst() { + xdg_pkg_postinst + + 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() { + xdg_pkg_postrm +} -- cgit v1.2.3