From 4b9e79a99d79a676c54e0eb323a186ebf1a4993c Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 8 Sep 2016 23:22:21 +0200 Subject: [PATCH] games-strategy/s25rttr: initial import Change-Id: I9096954d90bd46eb67d0e5eeea1d00cbf70298c1 Reviewed-on: https://galileo.mailstation.de/gerrit/7059 Reviewed-by: Jenkins Reviewed-by: Julian Ospald --- .../files/s25rttr-0.8.1-Fix-cmake-skew.patch | 103 ++++++++++++++++++ .../files/s25rttr-0.8.1-soundconverter.patch | 18 +++ .../s25rttr/s25rttr-0.8.1.exheres-0 | 90 +++++++++++++++ 3 files changed, 211 insertions(+) create mode 100644 packages/games-strategy/s25rttr/files/s25rttr-0.8.1-Fix-cmake-skew.patch create mode 100644 packages/games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch create mode 100644 packages/games-strategy/s25rttr/s25rttr-0.8.1.exheres-0 diff --git a/packages/games-strategy/s25rttr/files/s25rttr-0.8.1-Fix-cmake-skew.patch b/packages/games-strategy/s25rttr/files/s25rttr-0.8.1-Fix-cmake-skew.patch new file mode 100644 index 0000000..e390b9e --- /dev/null +++ b/packages/games-strategy/s25rttr/files/s25rttr-0.8.1-Fix-cmake-skew.patch @@ -0,0 +1,103 @@ +From 69a245c9fd7dba34b7ebda9388670482f86bd7d7 Mon Sep 17 00:00:00 2001 +From: Julian Ospald +Date: Thu, 8 Sep 2016 23:10:58 +0200 +Subject: [PATCH] Fix cmake skew +Upstream: no, most of it is obsolete on master + +* don't use the broken crosscompile stuff +* remove version stuff, since it doesn't work with the tarball +* don't build s25update, we don't need it with the packaged version +* don't build glfw, it's buggy +--- + CMakeLists.txt | 35 ----------------------------------- + build_paths.h.cmake | 1 + + driver/video/CMakeLists.txt | 1 - + 3 files changed, 1 insertion(+), 36 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 90c8eec..93048d4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,8 +19,6 @@ INCLUDE(CMakeMacroEnsureOutOfSourceBuild) + + ################################################################################ + +-INCLUDE(cmake/crosscompile.cmake) +- + PROJECT(s25client) + + ################################################################################ +@@ -106,38 +104,6 @@ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/build_paths.h.cmake" + 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 +114,6 @@ ADD_SUBDIRECTORY(libsiedler2) + ADD_SUBDIRECTORY(libutil) + ADD_SUBDIRECTORY(liblobby) + ADD_SUBDIRECTORY(s-c) +-ADD_SUBDIRECTORY(s25update) + ADD_SUBDIRECTORY(src) + + ################################################################################ +diff --git a/build_paths.h.cmake b/build_paths.h.cmake +index b35105e..38469b9 100644 +--- 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/driver/video/CMakeLists.txt b/driver/video/CMakeLists.txt +index b79f7ec..015c025 100644 +--- a/driver/video/CMakeLists.txt ++++ b/driver/video/CMakeLists.txt +@@ -3,7 +3,6 @@ + ################################################################################# + + ADD_SUBDIRECTORY( WinAPI ) +-ADD_SUBDIRECTORY( GLFW ) + ADD_SUBDIRECTORY( SDL ) + + ################################################################################# +-- +2.10.0 + diff --git a/packages/games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch b/packages/games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch new file mode 100644 index 0000000..25d20b6 --- /dev/null +++ b/packages/games-strategy/s25rttr/files/s25rttr-0.8.1-soundconverter.patch @@ -0,0 +1,18 @@ +From: hasufell +Date: Mon Apr 30 20:42:28 UTC 2012 +Upstream: no, just issue opened https://github.com/Return-To-The-Roots/s25client/issues/590 + +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/packages/games-strategy/s25rttr/s25rttr-0.8.1.exheres-0 b/packages/games-strategy/s25rttr/s25rttr-0.8.1.exheres-0 new file mode 100644 index 0000000..12dd413 --- /dev/null +++ b/packages/games-strategy/s25rttr/s25rttr-0.8.1.exheres-0 @@ -0,0 +1,90 @@ +# Copyright 2016 Julian Ospald +# Distributed under the terms of the GNU General Public License v2 + +require cmake [ api=2 ] +require flag-o-matic +require github [ user="Return-To-The-Roots" project="s25client" ] +require gtk-icon-cache desktop-utils + +SUMMARY="Open Source remake of The Settlers II game (needs original game files)" +HOMEPAGE+=" https://www.siedler25.org/" +DOWNLOADS="mirror://gentoo/${PNV}.tar.xz" + +LICENCES="GPL-3" +SLOT="0" +PLATFORMS="~amd64" +MYOPTIONS="" + +DEPENDENCIES=" + build: + sys-devel/gettext + build+run: + media-libs/SDL:0[X] + media-libs/libsndfile + media-libs/SDL_mixer:0[ogg] + net-libs/miniupnpc + x11-dri/mesa +" + +BUGS_TO="" + +DEFAULT_SRC_PREPARE_PATCHES=( + -p1 "${FILES}"/${PNV}-Fix-cmake-skew.patch + -p0 "${FILES}"/${PNV}-soundconverter.patch +) + +CMAKE_SRC_CONFIGURE_PARAMS=( + -DBINDIR="/usr/$(exhost --target)/bin" + -DCMAKE_SKIP_RPATH=YES + -DCOMPILEFOR="linux" + -DDATADIR="/usr/share" + -DDRIVERDIR="/usr/$(exhost --target)/lib/${PN}" + -DGAMEDIR="~/.${PN}/S2" + -DLIBDIR="/usr/$(exhost --target)/lib/${PN}" + -DPREFIX="/usr" +) + +src_prepare() { + # fixed in master + append-flags -fPIC + + cmake_src_prepare +} + +src_compile() { + # fixed in master: + # https://github.com/Return-To-The-Roots/s25client/blob/201e685abddb29739a419716d527ad2d0352611c/CMakeLists.txt#L360 + edo ln -s "${CMAKE_SOURCE}"/RTTR "${WORK}"/RTTR + + default +} + +# cmake install rules are completely broken +# fixed in master +src_install() { + # binary + dobin src/s25client + + # libexec executables + exeinto /usr/$(exhost --target)/lib/${PN} + doexe "${CMAKE_SOURCE}"/RTTR/{sound-convert,s-c_resample} + edo rm "${CMAKE_SOURCE}"/RTTR/{sound-convert,s-c_resample} + + # drivers + exeinto /usr/$(exhost --target)/lib/${PN}/video + doexe driver/video/SDL/src/libvideoSDL.so + exeinto /usr/$(exhost --target)/lib/${PN}/audio + doexe driver/audio/SDL/src/libaudioSDL.so + + # data files + insinto /usr/share + doins -r "${CMAKE_SOURCE}"/RTTR + dosym ./LSTS/splash.bmp /usr/share/RTTR/splash.bmp + + # shared files + insinto /usr/share/icons/hicolor/64x64/apps + doins "${CMAKE_SOURCE}"/debian/${PN}.png + install_desktop_entry "Name=Settlers RTTR" "Exec=s25client" + dodoc RTTR/texte/{keyboardlayout.txt,readme.txt} +} +