1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils cmake-utils gnome2-utils games
8 DESCRIPTION="Open Source remake of The Settlers II game (needs original game files)"
9 HOMEPAGE="http://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"
19 RDEPEND="app-arch/bzip2
20 media-libs/libsamplerate
21 media-libs/libsdl[X,sound,opengl,video]
23 media-libs/sdl-mixer[vorbis]
27 glfw? ( <media-libs/glfw-3 )"
32 epatch "${FILESDIR}"/${P}-cmake.patch \
33 "${FILESDIR}"/${P}-soundconverter.patch \
34 "${FILESDIR}"/${P}-fpic.patch
44 *) die "Architecture ${ARCH} not yet supported" ;;
49 -DCOMPILEARCH="${arch}"
50 -DCMAKE_SKIP_RPATH=YES
51 -DPREFIX="${GAMES_PREFIX}"
52 -DBINDIR="${GAMES_BINDIR}"
53 -DDATADIR="${GAMES_DATADIR}"
54 -DLIBDIR="$(games_get_libdir)/${PN}"
55 -DDRIVERDIR="$(games_get_libdir)/${PN}"
56 -DGAMEDIR="~/.${PN}/S2"
57 $(cmake-utils_use_build glfw GLFW_DRIVER)
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 "$(games_get_libdir)"/${PN}
76 doexe "${T}"/{sound-convert,s-c_resample}
77 exeinto "$(games_get_libdir)"/${PN}/video
78 doexe driver/video/SDL/src/libvideoSDL.so
79 use glfw && doexe driver/video/GLFW/src/libvideoGLFW.so
80 exeinto "$(games_get_libdir)"/${PN}/audio
81 doexe driver/audio/SDL/src/libaudioSDL.so
83 insinto "${GAMES_DATADIR}"
84 doins -r "${CMAKE_USE_DIR}"/RTTR
85 dosym ./LSTS/splash.bmp "${GAMES_DATADIR}"/RTTR/splash.bmp
87 doicon -s 64 "${CMAKE_USE_DIR}"/debian/${PN}.png
88 dogamesbin src/s25client
89 make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
90 dodoc RTTR/texte/{keyboardlayout.txt,readme.txt}
102 elog "Copy your Settlers2 game files into ~/.${PN}/S2"
104 gnome2_icon_cache_update
108 gnome2_icon_cache_update