1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 EBZR_REPO_URI="lp:s25rttr"
9 inherit eutils cmake-utils bzr games
11 DESCRIPTION="Open Source remake of The Settlers II game"
12 HOMEPAGE="http://www.siedler25.org/"
19 RDEPEND="app-arch/bzip2
20 media-libs/libsamplerate
21 media-libs/libsdl[X,audio,video]
31 epatch "${FILESDIR}"/${PV}-cmake.patch
32 # date Mon Apr 30 2012
33 epatch "${FILESDIR}"/${PV}-soundconverter.patch
37 # build system does not set the version for us
38 # will prevent us from connecting to other players
40 mydate=$(bzr version-info "${EBZR_STORE_DIR}/${EBZR_PROJECT}" 2> /dev/null \
41 | awk '{if ($1 == "date:") {gsub("-", "",$2); print $2}}')
44 -DPREFIX="${GAMES_PREFIX}"
45 -DBINDIR="${GAMES_BINDIR}"
46 -DDATADIR="${GAMES_DATADIR}"
47 -DLIBDIR="$(games_get_libdir)/${PN}"
48 -DDRIVERDIR="$(games_get_libdir)/${PN}"
49 -DGAMEDIR="~/.${PN}/S2"
50 -DWINDOW_VERSION="${mydate}"
51 -DWINDOW_REVISION="${EBZR_REVNO}"
54 cmake-utils_src_configure
58 # build system uses some relative paths
59 # CMAKE_IN_SOURCE_BUILD fails/unsupported
60 ln -s "${CMAKE_USE_DIR}"/RTTR "${CMAKE_BUILD_DIR}"/RTTR || die
62 cmake-utils_src_compile
66 cd "${CMAKE_BUILD_DIR}" || die
69 exeinto "$(games_get_libdir)"/${PN}
70 doexe RTTR/{sound-convert,s-c_resample} || die
71 exeinto "$(games_get_libdir)"/${PN}/video
72 doexe driver/video/SDL/src/libvideoSDL.so || die
73 exeinto "$(games_get_libdir)"/${PN}/audio
74 doexe driver/audio/SDL/src/libaudioSDL.so || die
77 insinto "${GAMES_DATADIR}"
78 rm RTTR/{sound-convert,s-c_resample} || die
81 # icon, bin, wrapper, docs
82 doicon "${CMAKE_USE_DIR}"/debian/${PN}.png || die
83 dogamesbin src/s25client || die
84 make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
85 dodoc RTTR/texte/{keyboardlayout.txt,readme.txt} || die
93 elog "Copy your Settlers2 cdrom content into ~/.${PN}/S2"