1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake toolchain-funcs user 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"
22 >=dev-libs/boost-1.50:=[nls,threads,icu]
23 >=media-libs/libsdl2-2.0.4:0[joystick,video,X]
26 !libressl? ( dev-libs/openssl:0= )
27 libressl? ( dev-libs/libressl:0= )
28 >=media-libs/fontconfig-2.4.1
29 >=media-libs/sdl2-image-2.0.0[jpeg,png]
30 >=media-libs/sdl2-mixer-2.0.0[vorbis]
31 >=media-libs/sdl2-ttf-2.0.12
33 >=x11-libs/pango-1.22.0
34 >=x11-libs/cairo-1.10.0
36 dbus? ( sys-apps/dbus )
37 fribidi? ( dev-libs/fribidi )
49 enewuser ${PN} -1 /bin/bash -1 ${PN}
58 doc/CMakeLists.txt || die
61 # respect LINGUAS (bug #483316)
62 if [[ ${LINGUAS+set} ]] ; then
64 for lang in $(cat po/LINGUAS) ; do
65 has ${lang} ${LINGUAS} && langs+=( ${lang} )
67 echo "${langs[@]}" > po/LINGUAS || die
72 filter-flags -ftracer -fomit-frame-pointer
73 if [[ $(gcc-major-version) -eq 3 ]] ; then
74 filter-flags -fstack-protector
75 append-flags -fno-stack-protector
81 if use dedicated || use server ; then
83 -DENABLE_CAMPAIGN_SERVER="ON"
87 -DFIFO_DIR="/run/wesnothd"
91 -DENABLE_CAMPAIGN_SERVER="OFF"
97 -DENABLE_GAME="$(usex !dedicated)"
98 -DENABLE_DESKTOP_ENTRY="$(usex !dedicated)"
99 -DENABLE_NLS="$(usex nls)"
100 -DENABLE_NOTIFICATIONS="$(usex dbus)"
101 -DENABLE_FRIBIDI="$(usex fribidi)"
102 -DENABLE_STRICT_COMPILATION="OFF"
108 local DOCS=( README.md changelog.md )
110 if use dedicated || use server; then
111 rmdir "${ED}/run/wesnothd" || die
112 newinitd "${FILESDIR}"/wesnothd.rc-r1 wesnothd