1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake toolchain-funcs xdg
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"
15 # uneven minor versions are development versions
16 if [[ $(( $(ver_cut 2) % 2 )) == 0 ]] ; then
17 KEYWORDS="~amd64 ~x86"
19 IUSE="dbus dedicated doc fribidi libressl nls server"
24 >=dev-libs/boost-1.50:=[nls,threads,icu]
25 >=media-libs/libsdl2-2.0.4:0[joystick,video,X]
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
35 >=x11-libs/pango-1.22.0
36 >=x11-libs/cairo-1.10.0
38 dbus? ( sys-apps/dbus )
39 fribidi? ( dev-libs/fribidi )
55 doc/CMakeLists.txt || die
58 # respect LINGUAS (bug #483316)
59 if [[ ${LINGUAS+set} ]] ; then
61 for lang in $(cat po/LINGUAS) ; do
62 has ${lang} ${LINGUAS} && langs+=( ${lang} )
64 echo "${langs[@]}" > po/LINGUAS || die
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
78 if use dedicated || use server ; then
80 -DENABLE_CAMPAIGN_SERVER="ON"
84 -DFIFO_DIR="/run/wesnothd"
88 -DENABLE_CAMPAIGN_SERVER="OFF"
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"
105 local DOCS=( README.md changelog.md )
107 if use dedicated || use server; then
108 rmdir "${ED}/run/wesnothd" || die
109 newinitd "${FILESDIR}"/wesnothd.rc-r1 wesnothd