summaryrefslogtreecommitdiff
path: root/games-strategy/s25rttr
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /games-strategy/s25rttr
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'games-strategy/s25rttr')
-rw-r--r--games-strategy/s25rttr/Manifest10
-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-r3.ebuild111
10 files changed, 502 insertions, 0 deletions
diff --git a/games-strategy/s25rttr/Manifest b/games-strategy/s25rttr/Manifest
new file mode 100644
index 000000000000..56eb1652559e
--- /dev/null
+++ b/games-strategy/s25rttr/Manifest
@@ -0,0 +1,10 @@
+AUX s25rttr-0.8.1-cmake-3.patch 851 BLAKE2B 212aacf9ab7d37f41b0f1ade26fac67f015c62c02058874910af7d8e0123bd39a1f1301e0296ec906ce55f38e006bbdba6f30d9b98f35439639ea778f8272c22 SHA512 46f012e386854fbb7f21bbee98855849303501bf946b74a93c87ec9745cf5ec50b903ea3d35ecf9e84c1e4161c1876d43507c97d6bd9af8b5af2f6c9f4cb2805
+AUX s25rttr-0.8.1-cmake.patch 5706 BLAKE2B 5b9d796e1e6815336eb9a9006e321a66e6c733ebd514b5ff92ae542e6078a9dc2366dc7e01cc310ea758c903dceebb545a860fa09fe462fd5fa00bf2202c3647 SHA512 0a53ea20225d616686aff2ef2d98ae5dc5394e28db9be554102332705de5418cd5dd895075923924c7ada0e8bbcc2b9825203e531b3fffa531dc4232d9463fa3
+AUX s25rttr-0.8.1-format.patch 698 BLAKE2B f4ad85af1c05e4a6ace8da4a62e75673a773698170a430a716aef0219d08badfef01fb3b9d71b225549e541a3f7dc9be754c18f349c522c046f4ec8b83125385 SHA512 f0ba023f3d6fff3970cfcfc132c44e4dcff41ed91faee74b5ad513bce3bd625d6528511114fad70f6d3f5cdfc6e471ecef07a607be6a082ca7f3a0b71477d8cc
+AUX s25rttr-0.8.1-fpic.patch 1508 BLAKE2B f53042695c3fa65fb2ced0afb8307fd9e56d12d2b6ad0bef2c309720177d3466eb61a7bd0ed89c9f4c6ff3ff45faf9fab5e7e4b7d26f4a6dbb957f030805df31 SHA512 23c2f54864205c55bb7f18cb9b6e949640451b4b4de86b2c30a8721fd724c8ba00fd667bc8c07ea31ba8edfb92630afec08e1f52ab861d08887cf639f8cde7a9
+AUX s25rttr-0.8.1-gcc6.patch 1504 BLAKE2B 6cbb0fcd59ebedbb0e9faf49bc192944b70ceee9a0abdc3b5256717672da190a6337ed2ad4d52d28aedc1b0e29704c9fe36b6a67aafe9aceb28bd350895efb12 SHA512 3a10ee4c6329c1dcc514e2b4d5edec41b56ac72c08955b24eeced94d1c9757703fe0732d833718dd99a4e5d70857a8e84347d8036c683b9b82d37916bd2cf951
+AUX s25rttr-0.8.1-miniupnpc-api-14.patch 1385 BLAKE2B a5fe9c6937dfe154685ac1e0debab0b5ef3e6c3e27a792f947e1c5a93f772f2d9829602c87db76d9a421d723e652c01f3e015643801d0c136002164f366a5fca SHA512 163a83ac734ff2accca133c20c0e15f7f21140e41661add4229f2a878baebebf09eb82420b2d0b0a7a77042be35608bd00c30006265395e842ae28d64b8986f6
+AUX s25rttr-0.8.1-soundconverter.patch 767 BLAKE2B 7a3772caa5624ee18a73cff0fb41531798022ef845feb4e1bb7bae560207efe82fb084fec7c0d9dfdde02c293db6fe3c2ea9290a5a6fd59cc59fee37a32693b7 SHA512 e62de5e040e89d53b73a0b7202eab0b32382656978e6c4471b1f3b996c9c679c9de13a8db671d719a79b985b062be3e67e75dacd4d9b5efb58e63c30bde1c10c
+DIST s25rttr-0.8.1.tar.xz 39644940 BLAKE2B 80268ac6ee20da983b4c3a90d8a9ebd5903734547fb48036963f435498a3395964afba990498a306a89009da50d023982a1dbd502e1ed618734c6a8d44ba2368 SHA512 31a7d640e1ecd5488ef02d0ed3adcaeb9b5ae5f6af5e006deb4100fde3eb8ec567e34519e9c2b82f38c9972d62790a6f6978d5da6c6dfca7f1c153fa65f22df2
+EBUILD s25rttr-0.8.1-r3.ebuild 2561 BLAKE2B f13028cb9ecc8411759492da43b3203c22ef701d81c7f84641c79f1ea1a727ff68f66b4cf8fee5c5fba1b28439fcb14ee6588d7e973f030f7cddea78181080bb SHA512 d08a0c4eccab8a1cd85efca0f794ff36b340b8326e103df69fbed55a48a530a8315e73635d0b8bc3647df2c3b5c346a7371633e3073919992259f9c295d02f1f
+MISC metadata.xml 463 BLAKE2B 33a0cc242b253cb1a3446cc2705cfb32bf0cd125c990bf0b8d527c3c9de546c390dd8fbad984c2a2a6264a25e0f889b63e86287024aa666dfdac94a5aacc3664 SHA512 dd5ea72d1f7ceda9bb2f033c8482e2978924ebee1a61e00fb515b0b0e846553bb1a4024aa739ae1f51608dcb90d0138d6679df1133a8140bfa2bfdb48163c885
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..14f2edb52df5
--- /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
+
+--- a/CMakeLists.txt
++++ b/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
+--- a/driver/video/CMakeLists.txt
++++ b/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)
+
+ #################################################################################
+--- a/driver/video/SDL/src/CMakeLists.txt
++++ b/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")
+--- a/driver/video/GLFW/src/CMakeLists.txt
++++ b/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" )
+
+ #################################################################################
+--- a/driver/audio/SDL/src/CMakeLists.txt
++++ b/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")
+--- a/build_paths.h.cmake
++++ b/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..3d50543b9c0e
--- /dev/null
+++ b/games-strategy/s25rttr/files/s25rttr-0.8.1-format.patch
@@ -0,0 +1,11 @@
+--- a/src/dskGameInterface.cpp.old 2016-02-15 21:11:58.308899794 +0100
++++ b/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..1cc7686b850d
--- /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
+
+--- a/libutil/src/files.h
++++ b/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..7603c5eda305
--- /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-r3.ebuild b/games-strategy/s25rttr/s25rttr-0.8.1-r3.ebuild
new file mode 100644
index 000000000000..47531d7e1d95
--- /dev/null
+++ b/games-strategy/s25rttr/s25rttr-0.8.1-r3.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils desktop gnome2-utils readme.gentoo-r1
+
+DESCRIPTION="Open Source remake of The Settlers II game (needs original game files)"
+HOMEPAGE="https://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
+"
+
+DOCS=( RTTR/texte/{keyboardlayout.txt,readme.txt} )
+
+DOC_CONTENTS="Copy your Settlers2 game files into ~/.${PN}/S2"
+
+PATCHES=(
+ "${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="/usr/"
+ -DBINDIR="/usr/bin"
+ -DDATADIR="/usr/share"
+ -DLIBDIR="/usr/$(get_libdir)/${PN}"
+ -DDRIVERDIR="/usr/$(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 /usr/"$(get_libdir)"/${PN}
+ doexe "${T}"/{sound-convert,s-c_resample}
+ exeinto /usr/"$(get_libdir)"/${PN}/video
+ doexe driver/video/SDL/src/libvideoSDL.so
+ exeinto /usr/"$(get_libdir)"/${PN}/audio
+ doexe driver/audio/SDL/src/libaudioSDL.so
+
+ insinto /usr/share
+ doins -r "${CMAKE_USE_DIR}"/RTTR
+ dosym ./LSTS/splash.bmp /usr/share/RTTR/splash.bmp
+
+ doicon -s 64 "${CMAKE_USE_DIR}"/debian/${PN}.png
+ dobin src/s25client
+ make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
+
+ einstalldocs
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}