1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-utils desktop gnome2-utils readme.gentoo-r1
8 DESCRIPTION="Open Source remake of The Settlers II game (needs original game files)"
9 HOMEPAGE="https://www.siedler25.org/"
10 # no upstream source tarball yet
11 # https://bugs.launchpad.net/s25rttr/+bug/1069546
12 SRC_URI="https://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz"
16 KEYWORDS="~amd64 ~x86"
21 media-libs/libsamplerate
22 media-libs/libsdl[X,sound,opengl,video]
24 media-libs/sdl-mixer[vorbis]
33 DOCS=( RTTR/texte/{keyboardlayout.txt,readme.txt} )
35 DOC_CONTENTS="Copy your Settlers2 game files into ~/.${PN}/S2"
38 "${FILESDIR}"/${P}-cmake.patch
39 "${FILESDIR}"/${P}-soundconverter.patch
40 "${FILESDIR}"/${P}-fpic.patch
41 "${FILESDIR}"/${P}-format.patch
42 "${FILESDIR}"/${P}-miniupnpc-api-14.patch
43 "${FILESDIR}"/${P}-cmake-3.patch
44 "${FILESDIR}"/${P}-gcc6.patch
50 -DCMAKE_SKIP_RPATH=YES
53 -DDATADIR="/usr/share"
54 -DLIBDIR="/usr/$(get_libdir)/${PN}"
55 -DDRIVERDIR="/usr/$(get_libdir)/${PN}"
56 -DGAMEDIR="~/.${PN}/S2"
57 -DBUILD_GLFW_DRIVER=OFF
60 cmake-utils_src_configure
64 # work around some relative paths (CMAKE_IN_SOURCE_BUILD not supported)
65 ln -s "${CMAKE_USE_DIR}"/RTTR "${CMAKE_BUILD_DIR}"/RTTR || die
67 cmake-utils_src_compile
69 mv "${CMAKE_USE_DIR}"/RTTR/{sound-convert,s-c_resample} "${T}"/ || die
73 cd "${CMAKE_BUILD_DIR}" || die
75 exeinto /usr/"$(get_libdir)"/${PN}
76 doexe "${T}"/{sound-convert,s-c_resample}
77 exeinto /usr/"$(get_libdir)"/${PN}/video
78 doexe driver/video/SDL/src/libvideoSDL.so
79 exeinto /usr/"$(get_libdir)"/${PN}/audio
80 doexe driver/audio/SDL/src/libaudioSDL.so
83 doins -r "${CMAKE_USE_DIR}"/RTTR
84 dosym ./LSTS/splash.bmp /usr/share/RTTR/splash.bmp
86 doicon -s 64 "${CMAKE_USE_DIR}"/debian/${PN}.png
88 make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
91 readme.gentoo_create_doc
95 gnome2_icon_cache_update
96 readme.gentoo_print_elog
100 gnome2_icon_cache_update