dev-qt/qtopengl: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / games-strategy / wesnoth / wesnoth-1.14.11.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit cmake toolchain-funcs xdg
7
8 DESCRIPTION="Battle for Wesnoth - A fantasy turn-based strategy game"
9 HOMEPAGE="http://www.wesnoth.org
10         https://github.com/wesnoth/wesnoth"
11 SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 # uneven minor versions are development versions
16 if [[ $(( $(ver_cut 2) % 2 )) == 0 ]] ; then
17         KEYWORDS="~amd64 ~x86"
18 fi
19 IUSE="dbus dedicated doc fribidi libressl nls server"
20
21 RDEPEND="
22         acct-group/wesnoth
23         acct-user/wesnoth
24         >=dev-libs/boost-1.50:=[nls,threads,icu]
25         >=media-libs/libsdl2-2.0.4:0[joystick,video,X]
26         !dedicated? (
27                 dev-libs/glib:2
28                 !libressl? ( dev-libs/openssl:0= )
29                 libressl? ( dev-libs/libressl:0= )
30                 >=media-libs/fontconfig-2.4.1
31                 >=media-libs/sdl2-image-2.0.0[jpeg,png]
32                 >=media-libs/sdl2-mixer-2.0.0[vorbis]
33                 >=media-libs/sdl2-ttf-2.0.12
34                 media-libs/libvorbis
35                 >=x11-libs/pango-1.22.0
36                 >=x11-libs/cairo-1.10.0
37                 sys-libs/readline:0=
38                 dbus? ( sys-apps/dbus )
39                 fribidi? ( dev-libs/fribidi )
40         )"
41 DEPEND="${RDEPEND}
42         x11-libs/libX11
43 "
44 BDEPEND="
45         sys-devel/gettext
46         virtual/pkgconfig
47 "
48
49 src_prepare() {
50         cmake_src_prepare
51
52         if ! use doc ; then
53                 sed -i \
54                         -e '/manual/d' \
55                         doc/CMakeLists.txt || die
56         fi
57
58         # respect LINGUAS (bug #483316)
59         if [[ ${LINGUAS+set} ]] ; then
60                 local lang langs=()
61                 for lang in $(cat po/LINGUAS) ; do
62                         has ${lang} ${LINGUAS} && langs+=( ${lang} )
63                 done
64                 echo "${langs[@]}" > po/LINGUAS || die
65         fi
66 }
67
68 src_configure() {
69         filter-flags -ftracer -fomit-frame-pointer
70         if [[ $(gcc-major-version) -eq 3 ]] ; then
71                 filter-flags -fstack-protector
72                 append-flags -fno-stack-protector
73         fi
74
75         # Work around eclass
76         append-flags -UNDEBUG
77
78         if use dedicated || use server ; then
79                 mycmakeargs=(
80                         -DENABLE_CAMPAIGN_SERVER="ON"
81                         -DENABLE_SERVER="ON"
82                         -DSERVER_UID="${PN}"
83                         -DSERVER_GID="${PN}"
84                         -DFIFO_DIR="/run/wesnothd"
85                         )
86         else
87                 mycmakeargs=(
88                         -DENABLE_CAMPAIGN_SERVER="OFF"
89                         -DENABLE_SERVER="OFF"
90                         )
91         fi
92         mycmakeargs+=(
93                 -Wno-dev
94                 -DENABLE_GAME="$(usex !dedicated)"
95                 -DENABLE_DESKTOP_ENTRY="$(usex !dedicated)"
96                 -DENABLE_NLS="$(usex nls)"
97                 -DENABLE_NOTIFICATIONS="$(usex dbus)"
98                 -DENABLE_FRIBIDI="$(usex fribidi)"
99                 -DENABLE_STRICT_COMPILATION="OFF"
100                 )
101         cmake_src_configure
102 }
103
104 src_install() {
105         local DOCS=( README.md changelog.md )
106         cmake_src_install
107         if use dedicated || use server; then
108                 rmdir "${ED}/run/wesnothd" || die
109                 newinitd "${FILESDIR}"/wesnothd.rc-r1 wesnothd
110         fi
111 }