games-strategy/warmux: Fix building with GCC 6
authorDavid Seifert <soap@gentoo.org>
Sat, 17 Dec 2016 10:36:47 +0000 (11:36 +0100)
committerDavid Seifert <soap@gentoo.org>
Sat, 17 Dec 2016 10:37:07 +0000 (11:37 +0100)
Gentoo-bug: 598639

Package-Manager: Portage-2.3.3, Repoman-2.3.1

games-strategy/warmux/files/warmux-11.04.1-fix-c++14.patch [new file with mode: 0644]
games-strategy/warmux/warmux-11.04.1-r1.ebuild

diff --git a/games-strategy/warmux/files/warmux-11.04.1-fix-c++14.patch b/games-strategy/warmux/files/warmux-11.04.1-fix-c++14.patch
new file mode 100644 (file)
index 0000000..223ee47
--- /dev/null
@@ -0,0 +1,14 @@
+In C++14, bool -> T* implicit conversions are not allowed anymore.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=598639
+
+--- a/src/interface/weapon_menu.cpp
++++ b/src/interface/weapon_menu.cpp
+@@ -391,7 +391,7 @@
+ Weapon * WeaponsMenu::UpdateCurrentOverflyItem(const Polygon * poly)
+ {
+   if (!show)
+-    return false;
++    return NULL;
+   const std::vector<PolygonItem *>& items = poly->GetItem();
+   WeaponMenuItem * tmp;
+   Interface::GetInstance()->SetCurrentOverflyWeapon(NULL);
index 6f265a9455b1b11f5e0fe3e56e8025ed7743fe06..17086e76ea79b800b59424312d7d901421f00ab1 100644 (file)
@@ -3,6 +3,7 @@
 # $Id$
 
 EAPI=6
+
 inherit autotools eutils
 
 DESCRIPTION="A free Worms clone"
@@ -14,15 +15,16 @@ SLOT="0"
 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 IUSE="debug nls unicode"
 
-RDEPEND="media-libs/libsdl[joystick,video,X]
+RDEPEND="
+       dev-libs/libxml2
+       media-libs/libsdl[joystick,video,X]
        media-libs/sdl-image[jpeg,png]
        media-libs/sdl-mixer[vorbis]
        media-libs/sdl-ttf
        media-libs/sdl-net
-       >=media-libs/sdl-gfx-2.0.22
-       net-misc/curl
+       media-libs/sdl-gfx
        media-fonts/dejavu
-       dev-libs/libxml2
+       net-misc/curl
        x11-libs/libX11
        nls? ( virtual/libintl )
        unicode? ( dev-libs/fribidi )"
@@ -38,19 +40,19 @@ PATCHES=(
        "${FILESDIR}"/${P}-action.patch
        "${FILESDIR}"/${P}-gcc47.patch
        "${FILESDIR}"/${P}-stat.patch
+       "${FILESDIR}"/${P}-fix-c++14.patch
 )
 
 src_prepare() {
        default
-
        eautoreconf
 }
 
 src_configure() {
        econf \
-               --with-localedir-name=/usr/share/locale \
-               --with-datadir-name=/usr/share/${PN} \
-               --with-font-path=/usr/share/fonts/dejavu/DejaVuSans.ttf \
+               --with-localedir-name="${EPREFIX}"/usr/share/locale \
+               --with-datadir-name="${EPREFIX}"/usr/share/${PN} \
+               --with-font-path="${EPREFIX}"/usr/share/fonts/dejavu/DejaVuSans.ttf \
                $(use_enable debug) \
                $(use_enable nls) \
                $(use_enable unicode fribidi)
@@ -58,7 +60,8 @@ src_configure() {
 
 src_install() {
        default
-       rm -f "${D}/usr/share/${PN}/font/DejaVuSans.ttf"
+
+       rm -f "${ED%/}"/usr/share/${PN}/font/DejaVuSans.ttf || die
        doicon data/icon/warmux.svg
        make_desktop_entry warmux Warmux
 }