1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils cmake-utils gnome2-utils readme.gentoo-r1
7 DESCRIPTION="Open Source remake of The Settlers II game (needs original game files)"
8 HOMEPAGE="https://www.siedler25.org/"
9 # no upstream source tarball yet
10 # https://bugs.launchpad.net/s25rttr/+bug/1069546
11 SRC_URI="https://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz"
15 KEYWORDS="~amd64 ~x86"
20 media-libs/libsamplerate
21 media-libs/libsdl[X,sound,opengl,video]
23 media-libs/sdl-mixer[vorbis]
33 "${FILESDIR}"/${P}-cmake.patch
34 "${FILESDIR}"/${P}-soundconverter.patch
35 "${FILESDIR}"/${P}-fpic.patch
36 "${FILESDIR}"/${P}-format.patch
37 "${FILESDIR}"/${P}-miniupnpc-api-14.patch
38 "${FILESDIR}"/${P}-cmake-3.patch
39 "${FILESDIR}"/${P}-gcc6.patch
42 DOC_CONTENTS="Copy your Settlers2 game files into ~/.${PN}/S2"
51 *) die "Architecture ${ARCH} not yet supported" ;;
56 -DCOMPILEARCH="${arch}"
57 -DCMAKE_SKIP_RPATH=YES
60 -DDATADIR="/usr/share"
61 -DLIBDIR="/usr/$(get_libdir)/${PN}"
62 -DDRIVERDIR="/usr/$(get_libdir)/${PN}"
63 -DGAMEDIR="~/.${PN}/S2"
64 -DBUILD_GLFW_DRIVER=OFF
67 cmake-utils_src_configure
71 # work around some relative paths (CMAKE_IN_SOURCE_BUILD not supported)
72 ln -s "${CMAKE_USE_DIR}"/RTTR "${CMAKE_BUILD_DIR}"/RTTR || die
74 cmake-utils_src_compile
76 mv "${CMAKE_USE_DIR}"/RTTR/{sound-convert,s-c_resample} "${T}"/ || die
80 cd "${CMAKE_BUILD_DIR}" || die
82 exeinto /usr/"$(get_libdir)"/${PN}
83 doexe "${T}"/{sound-convert,s-c_resample}
84 exeinto /usr/"$(get_libdir)"/${PN}/video
85 doexe driver/video/SDL/src/libvideoSDL.so
86 exeinto /usr/"$(get_libdir)"/${PN}/audio
87 doexe driver/audio/SDL/src/libaudioSDL.so
90 doins -r "${CMAKE_USE_DIR}"/RTTR
91 dosym ./LSTS/splash.bmp /usr/share/RTTR/splash.bmp
93 doicon -s 64 "${CMAKE_USE_DIR}"/debian/${PN}.png
95 make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
97 dodoc RTTR/texte/{keyboardlayout.txt,readme.txt}
98 readme.gentoo_create_doc
106 gnome2_icon_cache_update
107 readme.gentoo_print_elog
111 gnome2_icon_cache_update