www-client/google-chrome-beta: automated update (84.0.4147.30)
[gentoo.git] / games-strategy / s25rttr / s25rttr-0.8.1-r3.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cmake-utils desktop gnome2-utils readme.gentoo-r1
7
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"
13
14 LICENSE="GPL-3"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="debug"
18
19 RDEPEND="
20         app-arch/bzip2
21         media-libs/libsamplerate
22         media-libs/libsdl[X,sound,opengl,video]
23         media-libs/libsndfile
24         media-libs/sdl-mixer[vorbis]
25         net-libs/miniupnpc
26         virtual/libiconv
27         virtual/opengl
28 "
29 DEPEND="${RDEPEND}
30         sys-devel/gettext
31 "
32
33 DOCS=( RTTR/texte/{keyboardlayout.txt,readme.txt} )
34
35 DOC_CONTENTS="Copy your Settlers2 game files into ~/.${PN}/S2"
36
37 PATCHES=(
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
45 )
46
47 src_configure() {
48         local mycmakeargs=(
49                 -DCOMPILEFOR="linux"
50                 -DCMAKE_SKIP_RPATH=YES
51                 -DPREFIX="/usr/"
52                 -DBINDIR="/usr/bin"
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
58         )
59
60         cmake-utils_src_configure
61 }
62
63 src_compile() {
64         # work around some relative paths (CMAKE_IN_SOURCE_BUILD not supported)
65         ln -s "${CMAKE_USE_DIR}"/RTTR "${CMAKE_BUILD_DIR}"/RTTR || die
66
67         cmake-utils_src_compile
68
69         mv "${CMAKE_USE_DIR}"/RTTR/{sound-convert,s-c_resample} "${T}"/ || die
70 }
71
72 src_install() {
73         cd "${CMAKE_BUILD_DIR}" || die
74
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
81
82         insinto /usr/share
83         doins -r "${CMAKE_USE_DIR}"/RTTR
84         dosym ./LSTS/splash.bmp /usr/share/RTTR/splash.bmp
85
86         doicon -s 64 "${CMAKE_USE_DIR}"/debian/${PN}.png
87         dobin src/s25client
88         make_desktop_entry "s25client" "Settlers RTTR" "${PN}"
89
90         einstalldocs
91         readme.gentoo_create_doc
92 }
93
94 pkg_postinst() {
95         gnome2_icon_cache_update
96         readme.gentoo_print_elog
97 }
98
99 pkg_postrm() {
100         gnome2_icon_cache_update
101 }