[arch-commits] Commit in easystroke/trunk (2 files)

Lukas Fleischer lfleischer at archlinux.org
Fri May 19 17:51:28 UTC 2017


    Date: Friday, May 19, 2017 @ 17:51:24
  Author: lfleischer
Revision: 228594

upgpkg: easystroke 0.6.0-15

Rebuild against boost 1.64.0.

Added:
  easystroke/trunk/easystroke-0.6.0-gcc7-build-fix.patch
Modified:
  easystroke/trunk/PKGBUILD

---------------------------------------+
 PKGBUILD                              |    8 +++++-
 easystroke-0.6.0-gcc7-build-fix.patch |   40 ++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-05-19 17:50:35 UTC (rev 228593)
+++ PKGBUILD	2017-05-19 17:51:24 UTC (rev 228594)
@@ -3,7 +3,7 @@
 
 pkgname=easystroke
 pkgver=0.6.0
-pkgrel=14
+pkgrel=15
 pkgdesc='Use mouse gestures to initiate commands and hotkeys.'
 arch=('i686' 'x86_64')
 url='http://easystroke.sourceforge.net/'
@@ -11,12 +11,18 @@
 depends=('gtkmm3' 'boost-libs' 'libxtst' 'dbus-glib' 'xorg-server')
 makedepends=('boost' 'inputproto' 'intltool' 'gettext' 'xorg-server-devel' 'help2man')
 source=("http://downloads.sourceforge.net/easystroke/${pkgname}-${pkgver}.tar.gz"
+        'easystroke-0.6.0-gcc7-build-fix.patch'
         'replace-sigc-group-with-lambda.patch')
 md5sums=('3b4f25d02a6b5ac57a8b7a06545869db'
+         '4b0cb9354798cfab1ce21d04bb1ff002'
          '4a27e1336df773e2f1cd67788477cc3b')
 
 prepare() {
   cd "${pkgname}-${pkgver}"
+
+  # Fix compilation with GCC 7.
+  patch -Np1 -i ../easystroke-0.6.0-gcc7-build-fix.patch
+
   # fix build with libsigc++ 2.6; also build in C++11 mode
   # (not sure if the lambda is correct, but seems to work)
   patch -Np1 -i ../replace-sigc-group-with-lambda.patch

Added: easystroke-0.6.0-gcc7-build-fix.patch
===================================================================
--- easystroke-0.6.0-gcc7-build-fix.patch	                        (rev 0)
+++ easystroke-0.6.0-gcc7-build-fix.patch	2017-05-19 17:51:24 UTC (rev 228594)
@@ -0,0 +1,40 @@
+From 9e2c32390c5c253aade3bb703e51841748d2c37e Mon Sep 17 00:00:00 2001
+From: Jonathan Wakely <jwakely at redhat.com>
+Date: Sat, 28 Jan 2017 01:26:00 +0000
+Subject: [PATCH] Remove abs(float) function that clashes with std::abs(float)
+
+Depending on which C++ standard library headers have been included there
+might an abs(float) function already declared in the global namespace,
+so the definition in this file conflicts with it. This cause a build
+failure with GCC 7, which conforms more closely to the C++ standard with
+respect to overloads of abs.
+
+Including <cmath> and adding a using-declaration for std::abs ensures
+that the standard std::abs(float) function is available. This solution
+should be portable to all compilers.
+---
+ handler.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/handler.cc b/handler.cc
+index 8830ea2..685b1ff 100644
+--- a/handler.cc
++++ b/handler.cc
+@@ -23,6 +23,8 @@
+ #include <X11/extensions/XTest.h>
+ #include <X11/XKBlib.h>
+ #include <X11/Xproto.h>
++#include <cmath>  // std::abs(float)
++using std::abs;
+ 
+ XState *xstate = nullptr;
+ 
+@@ -533,8 +535,6 @@ class WaitForPongHandler : public Handler, protected Timeout {
+ 	virtual Grabber::State grab_mode() { return parent->grab_mode(); }
+ };
+ 
+-static inline float abs(float x) { return x > 0 ? x : -x; }
+-
+ class AbstractScrollHandler : public Handler {
+ 	bool have_x, have_y;
+ 	float last_x, last_y;



More information about the arch-commits mailing list