games-sports/speed-dreams: fix build w/newer glibc #580054
authorMike Frysinger <vapier@gentoo.org>
Wed, 20 Apr 2016 05:10:03 +0000 (01:10 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 20 Apr 2016 05:10:11 +0000 (01:10 -0400)
games-sports/speed-dreams/files/speed-dreams-1.4.0-math-hack.patch [new file with mode: 0644]
games-sports/speed-dreams/speed-dreams-1.4.0.ebuild

diff --git a/games-sports/speed-dreams/files/speed-dreams-1.4.0-math-hack.patch b/games-sports/speed-dreams/files/speed-dreams-1.4.0-math-hack.patch
new file mode 100644 (file)
index 0000000..32b4f85
--- /dev/null
@@ -0,0 +1,25 @@
+https://sourceforge.net/p/speed-dreams/tickets/952/
+https://bugs.gentoo.org/580054
+
+--- a/src/modules/simu/simuv2/simu.cpp
++++ b/src/modules/simu/simuv2/simu.cpp
+@@ -61,7 +61,7 @@
+     if (isnan(car->ctrl->brakeCmd) || isinf(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
+     if (isnan(car->ctrl->clutchCmd) || isinf(car->ctrl->clutchCmd)) car->ctrl->clutchCmd = 0;
+     if (isnan(car->ctrl->steer) || isinf(car->ctrl->steer)) car->ctrl->steer = 0;
+-    if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear = 0;
++    if (isnan((float)car->ctrl->gear) || isinf((float)car->ctrl->gear)) car->ctrl->gear = 0;
+ #else
+     if (isnan(car->ctrl->accelCmd)) car->ctrl->accelCmd = 0;
+     if (isnan(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
+--- a/src/modules/simu/simuv3/simu.cpp
++++ b/src/modules/simu/simuv3/simu.cpp
+@@ -61,7 +61,7 @@
+     if (isnan(car->ctrl->brakeCmd) || isinf(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
+     if (isnan(car->ctrl->clutchCmd) || isinf(car->ctrl->clutchCmd)) car->ctrl->clutchCmd = 0;
+     if (isnan(car->ctrl->steer) || isinf(car->ctrl->steer)) car->ctrl->steer = 0;
+-    if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear = 0;
++    if (isnan((float)car->ctrl->gear) || isinf((float)car->ctrl->gear)) car->ctrl->gear = 0;
+ #else
+     if (isnan(car->ctrl->accelCmd)) car->ctrl->accelCmd = 0;
+     if (isnan(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
index 835908ebe8a0a4d5a92fa3be114018efe554174b..cee94c8cce338bba872bc8394ea99760ef3bc1ad 100644 (file)
@@ -45,7 +45,8 @@ src_prepare() {
        epatch \
                        "${FILESDIR}"/${P}-asneeded.patch \
                        "${FILESDIR}"/${P}-automake.patch \
-                       "${FILESDIR}"/${P}-libpng15.patch
+                       "${FILESDIR}"/${P}-libpng15.patch \
+                       "${FILESDIR}"/${P}-math-hack.patch
 
        sed -i \
                -e '/ADDCFLAGS/s: -O2::' \
@@ -54,6 +55,7 @@ src_prepare() {
                -e '/COPYING/s:=.*:= \\:' \
                Makefile || die
        sed -i \
+               -e '/LDFLAGS/s:-L/usr/lib::' \
                -e "/^datadir/s:=.*:= ${GAMES_DATADIR}/${PN}:" \
                Make-config.in || die