summaryrefslogtreecommitdiff
path: root/games-strategy/s25rttr
diff options
context:
space:
mode:
Diffstat (limited to 'games-strategy/s25rttr')
-rw-r--r--games-strategy/s25rttr/Manifest12
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.8.1-cmake-3.patch23
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.8.1-cmake.patch160
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.8.1-format.patch11
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.8.1-fpic.patch38
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.8.1-gcc6.patch84
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.8.1-miniupnpc-api-14.patch36
-rw-r--r--games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch17
-rw-r--r--games-strategy/s25rttr/metadata.xml12
-rw-r--r--games-strategy/s25rttr/s25rttr-0.8.1-r2.ebuild110
10 files changed, 503 insertions, 0 deletions
diff --git a/games-strategy/s25rttr/Manifest b/games-strategy/s25rttr/Manifest
new file mode 100644
index 000000000000..17c1efd0f793
--- /dev/null
+++ b/games-strategy/s25rttr/Manifest
@@ -0,0 +1,12 @@
+AUX s25rttr-0.8.1-cmake-3.patch 851 SHA256 528b71f7600f2d1aa03c007bd82c77cf6a85b7f79d3f72d138579ea382ee541a SHA512 46f012e386854fbb7f21bbee98855849303501bf946b74a93c87ec9745cf5ec50b903ea3d35ecf9e84c1e4161c1876d43507c97d6bd9af8b5af2f6c9f4cb2805 WHIRLPOOL 1708d01f3a2b68cfff80bdf4fbedf30f0225b06275b5c725b45d7753a32853d1ea3ee1f4b495be96cf18904341fe2dc0ebd282f33317c4ae7454d01175281c56
+AUX s25rttr-0.8.1-cmake.patch 5682 SHA256 8cca5b44171838394bdf209af5b673e5148042550e33acd4a1d3f4d05bcfc679 SHA512 3da2e2837681a191ce3e08cc3338844ff325870b0b364a94b9b870ec36bcf3e7210e0cce15823a6b5bc0a95696cc41e133811773e5317f7e429fa882d0f049da WHIRLPOOL dd4016631daf02f1a825d7b12d2e6119a745ebf945c181d70862357efd620594caaa3df82ef63aa92470ec480343287faff5dc45e385261e80b9fa1d55c3e8fb
+AUX s25rttr-0.8.1-format.patch 694 SHA256 7ad7376b5befcfe9779c038081d187bc06aca5da46d9c172d071302ef2d7e35d SHA512 66e159481ad4e240f0d3be46acb953caa78e00b35b5eaec76db577de2ee1d6fc7faba7ffc6814298165ff4128252cd9fa1a34a7f8086286105a519ec6276dcd9 WHIRLPOOL 9f1d9489cc92d98408d08cea304ee4693283432240f4eba7d63a1513224d725f448433258a20940b70bda63a6f64a808c0ef3642b84a98388ed13e79cee8a0f8
+AUX s25rttr-0.8.1-fpic.patch 1508 SHA256 3d92dc13472b510d39a7b5227248ab438706431ea95729b157973d0bf9128df2 SHA512 23c2f54864205c55bb7f18cb9b6e949640451b4b4de86b2c30a8721fd724c8ba00fd667bc8c07ea31ba8edfb92630afec08e1f52ab861d08887cf639f8cde7a9 WHIRLPOOL fdaa3db1e11bf1e0fc12617bc5f17b0299cf6d3fc52eebee6e53d00c7380eb3622ab9c13fea7968ec704aed30a3b05d379ade84fb0313dfb425bfc006f93a0de
+AUX s25rttr-0.8.1-gcc6.patch 1504 SHA256 2f67486e324b733e32c60e3801456aabed9c7f526dd942ce2a0ee6c3e4e8ae68 SHA512 3a10ee4c6329c1dcc514e2b4d5edec41b56ac72c08955b24eeced94d1c9757703fe0732d833718dd99a4e5d70857a8e84347d8036c683b9b82d37916bd2cf951 WHIRLPOOL e1c1e0fa0ed5cfba621c4a86dec53c791cb5d37cc19a9c3e9744f10309887bd035ebb57ae0e661da94f97af101e1eb3e4be08b89a2c6e76e4b70a33a7269801b
+AUX s25rttr-0.8.1-miniupnpc-api-14.patch 1385 SHA256 96caa43391a3661efdb4e05498a2c0d57244677d91b3dd3dec6d5e678c293d25 SHA512 163a83ac734ff2accca133c20c0e15f7f21140e41661add4229f2a878baebebf09eb82420b2d0b0a7a77042be35608bd00c30006265395e842ae28d64b8986f6 WHIRLPOOL 6fb83e5c8335509dd9fad3ad3545ecaa28c097552aeb3d3db3affef7790de46ac696a2ebedbd7ec008afa74e44be18455cd805267a9a067e37003f8790d2b9bb
+AUX s25rttr-0.8.1-soundconverter.patch 763 SHA256 a3a490b4efb2182400fc9b07a67f66c939a2fe8a58983e85f4cd5125bfc2de37 SHA512 0f16e86057cb1574b8dd2303c49547ce855897683de3af52a437da9304c7bc821bcd3278dae6652fb8a0a358e64c1fa4c0eaec88323ab2dc5a0c56da3ce61afe WHIRLPOOL 3d427181fa8354f5b01e4ebfe8a3d445099163bd705094ee43a7d1b6dcb0f2a873d8262e1a23816ba089b4efa0189c0a3c8c8ad5e5b89595337de9d2aad98163
+DIST s25rttr-0.8.1.tar.xz 39644940 SHA256 683282a1d7d0549bb3a9db64c14aea111fcef79212461a099a2fe2e3960263bf SHA512 31a7d640e1ecd5488ef02d0ed3adcaeb9b5ae5f6af5e006deb4100fde3eb8ec567e34519e9c2b82f38c9972d62790a6f6978d5da6c6dfca7f1c153fa65f22df2 WHIRLPOOL 6558b6235b805489b8bc16b51175c7f46cc4d4887a088d79680826542b65f73f93bcd5801847b6284390a2f0ddbb112cfdb5decd1fb89a8c6ed585280f2f7de4
+EBUILD s25rttr-0.8.1-r2.ebuild 2640 SHA256 caa8835e971c85bada6581b0f52a6b04e6a63c11a0014ba058a9b7a7ddd76a0f SHA512 0fb9e0de437a729753ad25a5a49e077e83871cf523dd51ed69dba43ad0115f00f9eaf6f9d89a8410da19a448defcb2081d012966b3961bb21643753768d8a86d WHIRLPOOL ffeeae60c11496b639b75389842cc27f592a02e18fa9a982fc283cebeb6ebc5248ba875162d38de10eece7fad92c1ed79edabae20b6e0d6c6d9f7b5c7f1894a3
+MISC ChangeLog 5288 SHA256 a41af7e0777465168894f97cb0ca42511fcb36c8a5870b45f27ebc76d07805b6 SHA512 3ab79edef66bf3089897eb749084b947b5cbcec6d53f3cb1e9f64ccf476c0498e8835a5f34e09c9d56244bb2ca9680d68a9eb5279345bd52d70171dbc44fa0c2 WHIRLPOOL 9f3ab6354000945394f8839088b0e88ddc585747bb75c5f555fb9564b36a71d3e3b454befec0f67dc56198ae2fb5dba3a3a131a5a537b2e7e11cc0121353097f
+MISC ChangeLog-2015 1639 SHA256 d9919e0bdd04b2db741f6d87b1313fa17c693d197c631d04cb1f10eb3ef96445 SHA512 e5b0c9e35dfb5660575433b314b0ac76afd57ace40c6e128e6843e24d9b6a19428510c8caa8e605bf3f73dbb9e8868432e61bd5f0ff9d35ed9ecc143b8771e6d WHIRLPOOL a77a840f2537613a6c12d1e46f22565010e444792c690896ddfd4e83c0981ea9e68cdc6320e9cfa398ed54b0369610833d25a2631006e2ab2d095e479bf21543
+MISC metadata.xml 487 SHA256 8d6d8239cb93b14a68c20740466170d923cc3b4b7504bb2fbc80757590ecf3b4 SHA512 2a637b479281ed9b3df211fd2090e9ea42bb7f7bc5cc7fa8b40e8a665e9dbb9206e9f142199d596676fdcc546e3df1550fa8f5a13d81818d484674c4643ab3af WHIRLPOOL c8e820efa3612c76f5eb6f520c41bbb005e0357aa063b6fae06b3ee8d0428ca436d555f2bc66ef295e1de80b34b5ee5841ec14b8847a3cea698e4ab9518ed97b
diff --git a/games-strategy/s25rttr/files/s25rttr-0.8.1-cmake-3.patch b/games-strategy/s25rttr/files/s25rttr-0.8.1-cmake-3.patch
new file mode 100644
index 000000000000..b7e9e424eb08
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-cmake-3.patch
@@ -0,0 +1,23 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fcbfb02..ae1c5f0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,12 +2,12 @@
+ ### $Id: CMakeLists.txt 8341 2012-09-30 12:09:04Z FloSoft $
+ ################################################################################
+
+-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
+-CMAKE_POLICY(SET CMP0003 OLD)
+-
+-IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7 AND ${CMAKE_PATCH_VERSION} GREATER 0)
+- CMAKE_POLICY(SET CMP0015 OLD)
+-ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7 AND ${CMAKE_PATCH_VERSION} GREATER 0)
++CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
++CMAKE_POLICY(SET CMP0003 NEW)
++CMAKE_POLICY(SET CMP0015 NEW)
++IF(NOT CMAKE_VERSION VERSION_LESS 3.1)
++ CMAKE_POLICY(SET CMP0053 NEW)
++ENDIF()
+
+ SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
+
diff --git a/games-strategy/s25rttr/files/s25rttr-0.8.1-cmake.patch b/games-strategy/s25rttr/files/s25rttr-0.8.1-cmake.patch
new file mode 100644
index 000000000000..d8cdfedbb9a0
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-cmake.patch
@@ -0,0 +1,160 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Fri Oct 5 13:33:05 UTC 2012
+
+make build system gentoo-compatible
+provide options for SDL and GLFW video drivers
+
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -19,12 +19,19 @@
+
+ ################################################################################
+
+-INCLUDE(cmake/crosscompile.cmake)
+-
+ PROJECT(s25client)
+
+ ################################################################################
+
++# options
++OPTION(BUILD_GLFW_DRIVER "Build the GLFW video driver" 0)
++OPTION(BUILD_SDL_DRIVER "Build the sdl video driver" 1)
++IF (UNIX)
++ IF (NOT BUILD_SDL_DRIVER AND NOT BUILD_GLFW_DRIVER)
++ MESSAGE(FATAL_ERROR "No video driver selected! Either use SDL or GLFW.")
++ ENDIF (NOT BUILD_SDL_DRIVER AND NOT BUILD_GLFW_DRIVER)
++ENDIF (UNIX)
++
+ SET(PREFIX ${PREFIX} CACHE STRING "Path prefix")
+ SET(BINDIR ${BINDIR} CACHE STRING "Directory for the binaries")
+ SET(DATADIR ${DATADIR} CACHE STRING "Data directory")
+@@ -106,38 +113,6 @@
+ build_paths.h)
+ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/build_version.h.cmake"
+ build_version.h)
+-CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/build/preinstall.sh.cmake"
+- preinstall.sh @ONLY)
+-CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/build/postinstall.sh.cmake"
+- postinstall.sh @ONLY)
+-
+-################################################################################
+-
+-ADD_SUBDIRECTORY(version)
+-
+-ADD_CUSTOM_TARGET(updateversion ALL
+- COMMAND "${CMAKE_BINARY_DIR}/version/src/version" "${CMAKE_SOURCE_DIR}"
+- DEPENDS version
+- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+-)
+-
+-ADD_CUSTOM_TARGET(mrproper
+- COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/build/cleanup.sh"
+- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+-)
+-
+-ADD_CUSTOM_TARGET(create_nightly
+- COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/release/create_release.sh" "nightly" "${CMAKE_SOURCE_DIR}"
+- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+-)
+-
+-ADD_CUSTOM_TARGET(create_stable
+- COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/release/create_release.sh" "stable" "${CMAKE_SOURCE_DIR}"
+- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+-)
+-
+-# preinstall script
+-INSTALL(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/preinstall.cmake")
+
+ ################################################################################
+
+@@ -148,7 +123,6 @@
+ ADD_SUBDIRECTORY(libutil)
+ ADD_SUBDIRECTORY(liblobby)
+ ADD_SUBDIRECTORY(s-c)
+-ADD_SUBDIRECTORY(s25update)
+ ADD_SUBDIRECTORY(src)
+
+ ################################################################################
+@@ -157,7 +131,6 @@
+ INSTALL(CODE "INCLUDE(driver/cmake_install.cmake)")
+ INSTALL(CODE "INCLUDE(libsiedler2/cmake_install.cmake)")
+ INSTALL(CODE "INCLUDE(s-c/cmake_install.cmake)")
+-INSTALL(CODE "INCLUDE(s25update/cmake_install.cmake)")
+ INSTALL(CODE "INCLUDE(src/cmake_install.cmake)")
+
+ # and then dont let him install anything
+--- driver/video/CMakeLists.txt
++++ driver/video/CMakeLists.txt
+@@ -3,7 +3,11 @@
+ #################################################################################
+
+ ADD_SUBDIRECTORY( WinAPI )
+-ADD_SUBDIRECTORY( GLFW )
+-ADD_SUBDIRECTORY( SDL )
++IF(BUILD_GLFW_DRIVER)
++ ADD_SUBDIRECTORY( GLFW )
++ENDIF(BUILD_GLFW_DRIVER)
++IF(BUILD_SDL_DRIVER)
++ ADD_SUBDIRECTORY( SDL )
++ENDIF(BUILD_SDL_DRIVER)
+
+ #################################################################################
+--- driver/video/SDL/src/CMakeLists.txt
++++ driver/video/SDL/src/CMakeLists.txt
+@@ -30,9 +30,9 @@
+ ADD_CUSTOM_COMMAND(TARGET videoSDL POST_BUILD COMMAND ln -fvs SDL/src/${SL_PREFIX}videoSDL${CMAKE_SHARED_LIBRARY_SUFFIX} ../../videoSDL${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+ INSTALL(TARGETS videoSDL
+- RUNTIME DESTINATION ${LIBDIR}/driver/video
+- LIBRARY DESTINATION ${LIBDIR}/driver/video
+- ARCHIVE DESTINATION ${LIBDIR}/driver/video
++ RUNTIME DESTINATION ${LIBDIR}
++ LIBRARY DESTINATION ${LIBDIR}
++ ARCHIVE DESTINATION ${LIBDIR}
+ )
+ ELSE (SDL_FOUND)
+ MESSAGE(WARNING ": SDL library not found: Not building SDL videodriver")
+--- driver/video/GLFW/src/CMakeLists.txt
++++ driver/video/GLFW/src/CMakeLists.txt
+@@ -2,7 +2,7 @@
+ ### $Id$
+ #################################################################################
+
+-IF ("${COMPILEFOR}/${COMPILEARCH}" STREQUAL "linux/i386" )
++IF ("${COMPILEFOR}" STREQUAL "linux" )
+ FIND_LIBRARY(GLFW_LIBRARY glfw)
+
+ IF (GLFW_LIBRARY)
+@@ -21,6 +21,6 @@
+ ELSE (GLFW_LIBRARY)
+ MESSAGE(WARNING ": GLFW library not found: Not building GLFW videodriver")
+ ENDIF (GLFW_LIBRARY)
+-ENDIF ("${COMPILEFOR}/${COMPILEARCH}" STREQUAL "linux/i386" )
++ENDIF ("${COMPILEFOR}" STREQUAL "linux" )
+
+ #################################################################################
+--- driver/audio/SDL/src/CMakeLists.txt
++++ driver/audio/SDL/src/CMakeLists.txt
+@@ -34,9 +34,9 @@
+ ADD_CUSTOM_COMMAND(TARGET audioSDL POST_BUILD COMMAND ln -fvs SDL/src/${SL_PREFIX}audioSDL${CMAKE_SHARED_LIBRARY_SUFFIX} ../../audioSDL${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+ INSTALL(TARGETS audioSDL
+- RUNTIME DESTINATION ${LIBDIR}/driver/audio
+- LIBRARY DESTINATION ${LIBDIR}/driver/audio
+- ARCHIVE DESTINATION ${LIBDIR}/driver/audio
++ RUNTIME DESTINATION ${LIBDIR}
++ LIBRARY DESTINATION ${LIBDIR}
++ ARCHIVE DESTINATION ${LIBDIR}
+ )
+ ELSE (SDLMIXER_FOUND)
+ MESSAGE(WARNING ": SDL_mixer library not found: Not building SDL audiodriver")
+--- build_paths.h.cmake
++++ build_paths.h.cmake
+@@ -41,6 +41,7 @@
+
+ // set game directory (normal $(datadir)/s25rttr/S2)
+ //#define GAMEDIR DATADIR"/S2"
++#cmakedefine GAMEDIR "${GAMEDIR}"
+
+ // set driver directory (normal $(libdir)/driver)
+ //#define DRIVERDIR LIBDIR"/driver"
diff --git a/games-strategy/s25rttr/files/s25rttr-0.8.1-format.patch b/games-strategy/s25rttr/files/s25rttr-0.8.1-format.patch
new file mode 100644
index 000000000000..588a755e829c
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-format.patch
@@ -0,0 +1,11 @@
+--- src/dskGameInterface.cpp.old 2016-02-15 21:11:58.308899794 +0100
++++ src/dskGameInterface.cpp 2016-02-15 21:12:24.564433584 +0100
+@@ -1349,7 +1349,7 @@
+ snprintf(text, sizeof(text), _("Team victory! '%s' and '%s' and '%s' and '%s' are the winners!"), GameClient::inst().GetPlayer(winners[0])->name.c_str(),GameClient::inst().GetPlayer(winners[1])->name.c_str(),GameClient::inst().GetPlayer(winners[2])->name.c_str(),GameClient::inst().GetPlayer(winners[3])->name.c_str());
+ break;
+ default:
+- snprintf(text, sizeof(text), _("Team victory!"));
++ snprintf(text, sizeof(text), "%s", _("Team victory!"));
+ break;
+ }
+ messenger.AddMessage("", 0, CD_SYSTEM, text, COLOR_ORANGE);
diff --git a/games-strategy/s25rttr/files/s25rttr-0.8.1-fpic.patch b/games-strategy/s25rttr/files/s25rttr-0.8.1-fpic.patch
new file mode 100644
index 000000000000..4a1d11ef1704
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-fpic.patch
@@ -0,0 +1,38 @@
+From 2b4f956263864cebb1b9c5ce120c7cd30f512bdb Mon Sep 17 00:00:00 2001
+From: nE0sIghT <ykonotopov@gmail.com>
+Date: Sat, 18 Jul 2015 19:03:05 +0300
+Subject: [PATCH] Fixed build of sdl drivers
+
+---
+ driver/audio/SDL/src/CMakeLists.txt | 1 +
+ driver/video/SDL/src/CMakeLists.txt | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/driver/audio/SDL/src/CMakeLists.txt b/driver/audio/SDL/src/CMakeLists.txt
+index 5ad3f02..5a91cd5 100644
+--- a/driver/audio/SDL/src/CMakeLists.txt
++++ b/driver/audio/SDL/src/CMakeLists.txt
+@@ -20,6 +20,7 @@ IF (SDL_FOUND)
+
+ ADD_LIBRARY(audioSDL SHARED SDL.cpp SDL.h main.h SoundSDL_Music.cpp SoundSDL_Music.h SoundSDL_Effect.cpp SoundSDL_Effect.h ${PROJECT_SOURCE_DIR}/build_version.cpp ../../../src/DriverInterface.cpp ../../../src/tempname.cpp ../../../src/tempname.h)
+
++ ADD_DEFINITIONS(-fPIC)
+ ADD_FLAGS(CMAKE_C_FLAGS -I${SDL_INCLUDE_DIR} -I${SDLMIXER_INCLUDE_DIR})
+ ADD_FLAGS(CMAKE_CXX_FLAGS -I${SDL_INCLUDE_DIR} -I${SDLMIXER_INCLUDE_DIR})
+
+diff --git a/driver/video/SDL/src/CMakeLists.txt b/driver/video/SDL/src/CMakeLists.txt
+index 83d10cf..ca67573 100644
+--- a/driver/video/SDL/src/CMakeLists.txt
++++ b/driver/video/SDL/src/CMakeLists.txt
+@@ -16,6 +16,7 @@ IF (SDL_FOUND)
+
+ ADD_LIBRARY(videoSDL SHARED SDL.cpp SDL.h main.h ../../../../build_version.cpp ../../../src/DriverInterface.cpp)
+
++ ADD_DEFINITIONS(-fPIC)
+ ADD_FLAGS(CMAKE_C_FLAGS -I${SDL_INCLUDE_DIR})
+ ADD_FLAGS(CMAKE_CXX_FLAGS -I${SDL_INCLUDE_DIR})
+
+--
+2.3.6
+
+
diff --git a/games-strategy/s25rttr/files/s25rttr-0.8.1-gcc6.patch b/games-strategy/s25rttr/files/s25rttr-0.8.1-gcc6.patch
new file mode 100644
index 000000000000..957ecf4ddf50
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-gcc6.patch
@@ -0,0 +1,84 @@
+Bug: https://bugs.gentoo.org/610972
+Commit: https://github.com/Return-To-The-Roots/mygettext/commit/3b902a46322b7e88e9d2cdf85ee0912c6565f9a2
+
+--- a/driver/audio/SDL/src/SDL.cpp
++++ b/driver/audio/SDL/src/SDL.cpp
+@@ -175,23 +175,23 @@
+
+ char file[512];
+ if(!tempname(file, 512))
+- return false;
++ return NULL;
+
+ strncat(file, ".wav", 512);
+
+ FILE *dat = fopen(file, "wb");
+ if(!dat)
+- return false;
++ return NULL;
+
+ if(fwrite(data, 1, size, dat) != size)
+- return false;
++ return NULL;
+
+ fclose(dat);
+
+ switch(data_type)
+ {
+ default:
+- return false;
++ return NULL;
+
+ case AudioDriver::AD_WAVE:
+ {
+@@ -233,12 +233,12 @@
+
+ char file[512];
+ if(!tempname(file, 512))
+- return false;
++ return NULL;
+
+ switch(data_type)
+ {
+ default:
+- return false;
++ return NULL;
+
+ case AudioDriver::AD_MIDI:
+ {
+@@ -266,10 +266,10 @@
+
+ FILE *dat = fopen(file, "wb");
+ if(!dat)
+- return false;
++ return NULL;
+
+ if(fwrite(data, 1, size, dat) != size)
+- return false;
++ return NULL;
+
+ fclose(dat);
+
+--- a/src/VideoDriverWrapper.cpp
++++ b/src/VideoDriverWrapper.cpp
+@@ -481,7 +481,7 @@
+ if(videodriver == NULL)
+ {
+ fatal_error("Kein Videotreiber ausgewaehlt!\n");
+- return false;
++ return NULL;
+ }
+
+ return videodriver->GetFunction(extension);
+--- a/mygettext/src/mygettext.h
++++ b/mygettext/src/mygettext.h
+@@ -21,6 +21,9 @@
+
+ #pragma once
+
++// necessarily here
++#include <locale>
++
+ const char *mysetlocale(int category, const char *locale);
+
+ #undef gettext
diff --git a/games-strategy/s25rttr/files/s25rttr-0.8.1-miniupnpc-api-14.patch b/games-strategy/s25rttr/files/s25rttr-0.8.1-miniupnpc-api-14.patch
new file mode 100644
index 000000000000..d2ff0ee1fe39
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-miniupnpc-api-14.patch
@@ -0,0 +1,36 @@
+From 3b08b907235c09ab84e3bb23d1e05fe5a1d1c00e Mon Sep 17 00:00:00 2001
+From: Manuel Zeise <mail@manuel-zeise.de>
+Date: Sun, 3 Jan 2016 16:54:05 +0100
+Subject: [PATCH] Switch for miniUPnPc API version 14 and above
+
+API version 14 of miniUPnPc has introduced a new TTL argument to
+upnpDiscover() with a recommended default value of 2. A new preprocessor
+statement evaluates the API version and selects the correct version of
+upnpDiscover() based on the API version.
+
+--- s25rttr-0.8.1/libutil/src/UPnP.cpp
++++ s25rttr-0.8.1/libutil/src/UPnP.cpp
+@@ -210,7 +210,11 @@
+ UPNPDev* devicelist = NULL;
+ #ifdef UPNPDISCOVER_SUCCESS
+ int upnperror = 0;
++#if (MINIUPNPC_API_VERSION >= 14) /* miniUPnPc API version 14 adds TTL parameter */
++ devicelist = upnpDiscover(2000, NULL, NULL, 0, 0 /* ipv6 */, 2, &upnperror);
++#else
+ devicelist = upnpDiscover(2000, NULL, NULL, 0, 0 /* ipv6 */, &upnperror);
++#endif
+ #else
+ devicelist = upnpDiscover(2000, NULL, NULL, 0);
+ #endif
+@@ -276,7 +280,11 @@
+ UPNPDev* devicelist = NULL;
+ #ifdef UPNPDISCOVER_SUCCESS
+ int upnperror = 0;
++#if (MINIUPNPC_API_VERSION >= 14) /* miniUPnPc API version 14 adds TTL parameter */
++ devicelist = upnpDiscover(2000, NULL, NULL, 0, 0 /* ipv6 */, 2, &upnperror);
++#else
+ devicelist = upnpDiscover(2000, NULL, NULL, 0, 0 /* ipv6 */, &upnperror);
++#endif
+ #else
+ devicelist = upnpDiscover(2000, NULL, NULL, 0);
+ #endif
diff --git a/games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch b/games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch
new file mode 100644
index 000000000000..493d7cb404be
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch
@@ -0,0 +1,17 @@
+From: hasufell <julian.ospald@googlemail.com>
+Date: Mon Apr 30 20:42:28 UTC 2012
+
+relocate executables sound-convert and s-c_resample which get installed
+into datadir by default
+
+--- libutil/src/files.h
++++ libutil/src/files.h
+@@ -140,7 +140,7 @@
+ /* 54 */RTTRDIR "", // unbenutzt
+ /* 55 */SETTINGSDIR "/LSTS/SOUND.LST", // Die konvertierte sound.lst
+ /* 56 */RTTRDIR "/sound.scs", // Das konvertier-script
+- /* 57 */RTTRDIR "", // Basispfad fürn Soundconverter
++ /* 57 */DRIVERDIR "", // Basispfad fürn Soundconverter
+ /* 58 */GAMEDIR "/DATA/MIS0BOBS.LST",
+ /* 59 */GAMEDIR "/DATA/MIS1BOBS.LST",
+ /* 60 */GAMEDIR "/DATA/MIS2BOBS.LST",
diff --git a/games-strategy/s25rttr/metadata.xml b/games-strategy/s25rttr/metadata.xml
new file mode 100644
index 000000000000..e5e3b0f43654
--- /dev/null
+++ b/games-strategy/s25rttr/metadata.xml
@@ -0,0 +1,12 @@
+<?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>
+ <upstream>
+ <changelog>http://www.siedler25.org/index.php?com=dynamic&amp;mod=9&amp;PHPSESSID=e5fa4f90c4db5df0cb1e417e128300b5</changelog>
+ <bugs-to>https://bugs.launchpad.net/s25rttr</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/games-strategy/s25rttr/s25rttr-0.8.1-r2.ebuild b/games-strategy/s25rttr/s25rttr-0.8.1-r2.ebuild
new file mode 100644
index 000000000000..9ecfd153901b
--- /dev/null
+++ b/games-strategy/s25rttr/s25rttr-0.8.1-r2.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils cmake-utils gnome2-utils games
+
+DESCRIPTION="Open Source remake of The Settlers II game (needs original game files)"
+HOMEPAGE="http://www.siedler25.org/"
+# no upstream source tarball yet
+# https://bugs.launchpad.net/s25rttr/+bug/1069546
+SRC_URI="https://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+RDEPEND="app-arch/bzip2
+ media-libs/libsamplerate
+ media-libs/libsdl[X,sound,opengl,video]
+ media-libs/libsndfile
+ media-libs/sdl-mixer[vorbis]
+ net-libs/miniupnpc
+ virtual/libiconv
+ virtual/opengl"
+DEPEND="${RDEPEND}
+ sys-devel/gettext"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cmake.patch \
+ "${FILESDIR}"/${P}-soundconverter.patch \
+ "${FILESDIR}"/${P}-fpic.patch \
+ "${FILESDIR}"/${P}-format.patch \
+ "${FILESDIR}"/${P}-miniupnpc-api-14.patch \
+ "${FILESDIR}"/${P}-cmake-3.patch \
+ "${FILESDIR}"/${P}-gcc6.patch
+}
+
+src_configure() {
+ local arch
+ case ${ARCH} in
+ amd64)
+ arch="x86_64" ;;
+ x86)
+ arch="i386" ;;
+ *) die "Architecture ${ARCH} not yet supported" ;;
+ esac
+
+ local mycmakeargs=(
+ -DCOMPILEFOR="linux"
+ -DCOMPILEARCH="${arch}"
+ -DCMAKE_SKIP_RPATH=YES
+ -DPREFIX="${GAMES_PREFIX}"
+ -DBINDIR="${GAMES_BINDIR}"
+ -DDATADIR="${GAMES_DATADIR}"
+ -DLIBDIR="$(games_get_libdir)/${PN}"
+ -DDRIVERDIR="$(games_get_libdir)/${PN}"
+ -DGAMEDIR="~/.${PN}/S2"
+ -DBUILD_GLFW_DRIVER=OFF
+ )
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ # work around some relative paths (CMAKE_IN_SOURCE_BUILD not supported)
+ ln -s "${CMAKE_USE_DIR}"/RTTR "${CMAKE_BUILD_DIR}"/RTTR || die
+
+ cmake-utils_src_compile
+
+ mv "${CMAKE_USE_DIR}"/RTTR/{sound-convert,s-c_resample} "${T}"/ || die
+}
+
+src_install() {
+ cd "${CMAKE_BUILD_DIR}" || die
+
+ exeinto "$(games_get_libdir)"/${PN}
+ doexe "${T}"/{sound-convert,s-c_resample}
+ exeinto "$(games_get_libdir)"/${PN}/video
+ doexe driver/video/SDL/src/libvideoSDL.so
+ exeinto "$(games_get_libdir)"/${PN}/audio
+ doexe driver/audio/SDL/src/libaudioSDL.so
+
+ insinto "${GAMES_DATADIR}"
+ doins -r "${CMAKE_USE_DIR}"/RTTR
+ dosym ./LSTS/splash.bmp "${GAMES_DATADIR}"/RTTR/splash.bmp
+
+ doicon -s 64 "${CMAKE_USE_DIR}"/debian/${PN}.png
+ dogamesbin src/s25client
+ make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
+ dodoc RTTR/texte/{keyboardlayout.txt,readme.txt}
+
+ prepgamesdirs
+}
+
+pkg_preinst() {
+ games_pkg_preinst
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ elog "Copy your Settlers2 game files into ~/.${PN}/S2"
+
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}