1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit autotools toolchain-funcs eutils versionator gnome2-utils
7 MY_PV=$(get_version_component_range -2)
9 VIDEOS_P=${PN}-videos-${VIDEOS_PV}.wz
10 DESCRIPTION="3D real-time strategy game"
11 HOMEPAGE="http://wz2100.net/"
12 SRC_URI="mirror://sourceforge/warzone2100/${P}.tar.xz
13 videos? ( mirror://sourceforge/warzone2100/warzone2100/Videos/${VIDEOS_PV}/high-quality-en/sequences.wz -> ${VIDEOS_P} )"
15 SRC_URI+=" https://github.com/Warzone2100/warzone2100/commit/ef37bca38289f4f79c6533acd93ed326858a3f68.patch -> ${PN}-3.2.3-qt_compile_fix.patch"
17 LICENSE="GPL-2+ CC-BY-SA-3.0 public-domain"
19 KEYWORDS="~amd64 ~x86"
20 # upstream requested debug support
21 IUSE="debug nls sdl videos"
23 # TODO: unbundle miniupnpc and quesoglc
24 # quesoglc-0.7.2 is buggy: http://developer.wz2100.net/ticket/2828
26 >=dev-games/physfs-2[zip]
45 nls? ( virtual/libintl )
50 sdl? ( media-libs/libsdl2[opengl,video,X] )
58 nls? ( sys-devel/gettext )
68 # https://developer.wz2100.net/ticket/4580
69 eapply "${DISTDIR}/${P}-qt_compile_fix.patch"
71 sed -i -e 's/#top_builddir/top_builddir/' po/Makevars || die
72 sed '/appdata\.xml/d' -i icons/Makefile.am || die
78 --docdir=/usr/share/doc/${PF}
79 --localedir=/usr/share/locale
80 --with-distributor="Gentoo ${PF}"
81 --with-icondir=/usr/share/icons/hicolor/128x128/apps
82 --with-applicationdir=/usr/share/applications
83 $(use_enable debug debug relaxed)
85 --with-backend=$(usex sdl "sdl" "qt")
87 econf "${myeconfargs[@]}"
91 emake AR="$(tc-getAR)"
96 rm -f "${D}"/usr/share/doc/${PF}/COPYING*
98 insinto /usr/share/${PN}
99 newins "${DISTDIR}"/${VIDEOS_P} sequences.wz
101 doman doc/warzone2100.6
102 dodoc doc/quickstartguide.pdf
110 gnome2_icon_cache_update
114 gnome2_icon_cache_update