[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gnu: dbus-c++: Fix build with GCC 7.
From: |
guix-commits |
Subject: |
01/01: gnu: dbus-c++: Fix build with GCC 7. |
Date: |
Wed, 31 Jul 2019 10:53:08 -0400 (EDT) |
mbakke pushed a commit to branch core-updates
in repository guix.
commit 497b2d39427af4aaddbaa8922d4a6a858bbdaee7
Author: Marius Bakke <address@hidden>
Date: Wed Jul 31 16:52:39 2019 +0200
gnu: dbus-c++: Fix build with GCC 7.
* gnu/packages/patches/dbus-c++-gcc-compat.patch,
gnu/packages/patches/dbus-c++-threading-mutex.patch: New files.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/glib.scm (dbus-c++)[source](patches): New field.
[arguments]: End phases on #t.
---
gnu/local.mk | 2 ++
gnu/packages/glib.scm | 5 ++-
gnu/packages/patches/dbus-c++-gcc-compat.patch | 14 ++++++++
.../patches/dbus-c++-threading-mutex.patch | 37 ++++++++++++++++++++++
4 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 27edacb..41f4e4e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -750,6 +750,8 @@ dist_patch_DATA =
\
%D%/packages/patches/cvs-CVE-2017-12836.patch \
%D%/packages/patches/darkice-workaround-fpermissive-error.patch \
%D%/packages/patches/dbus-helper-search-path.patch \
+ %D%/packages/patches/dbus-c++-gcc-compat.patch \
+ %D%/packages/patches/dbus-c++-threading-mutex.patch \
%D%/packages/patches/dealii-mpi-deprecations.patch \
%D%/packages/patches/deja-dup-use-ref-keyword-for-iter.patch \
%D%/packages/patches/dfu-programmer-fix-libusb.patch \
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 438c1f9..3e17330 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -791,6 +791,8 @@ This package provides the library for GLib applications.")
"mirror://sourceforge/dbus-cplusplus/dbus-c%2B%2B/"
version "/libdbus-c%2B%2B-" version ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
+ (patches (search-patches "dbus-c++-gcc-compat.patch"
+ "dbus-c++-threading-mutex.patch"))
(sha256
(base32
"0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw"))))
@@ -812,7 +814,8 @@ This package provides the library for GLib applications.")
(lambda _
(substitute* "include/dbus-c++/eventloop-integration.h"
(("#include <errno.h>")
- "#include <errno.h>\n#include <unistd.h>")))))))
+ "#include <errno.h>\n#include <unistd.h>"))
+ #t)))))
(synopsis "D-Bus API for C++")
(description "This package provides D-Bus client API bindings for the C++
programming language. It also contains the utility
diff --git a/gnu/packages/patches/dbus-c++-gcc-compat.patch
b/gnu/packages/patches/dbus-c++-gcc-compat.patch
new file mode 100644
index 0000000..c4f1268
--- /dev/null
+++ b/gnu/packages/patches/dbus-c++-gcc-compat.patch
@@ -0,0 +1,14 @@
+Fix a string comparison in C++ 11.
+
+Taken from Debian:
+https://sources.debian.org/src/dbus-c++/0.9.0-8.1/debian/patches/06_fix_gcc-7_ftbfs.patch/
+
+--- a/src/pipe.cpp
++++ b/src/pipe.cpp
+@@ -83,5 +83,5 @@ ssize_t Pipe::read(void *buffer, unsigne
+ void Pipe::signal()
+ {
+ // TODO: ignoring return of read/write generates warning; maybe relevant
for eventloop work...
+- ::write(_fd_write, '\0', 1);
++ ::write(_fd_write, "\0", 1);
+ }
diff --git a/gnu/packages/patches/dbus-c++-threading-mutex.patch
b/gnu/packages/patches/dbus-c++-threading-mutex.patch
new file mode 100644
index 0000000..b201700
--- /dev/null
+++ b/gnu/packages/patches/dbus-c++-threading-mutex.patch
@@ -0,0 +1,37 @@
+Description: Fix FTBFS if DBUS_HAS_RECURSIVE_MUTEX is undefined
+Author: Peter Williams <address@hidden>
+Last-Update: 2018-01-26
+
+Taken from Debian:
+https://sources.debian.org/src/dbus-c++/0.9.0-8.1/debian/patches/07_fix_mutex_ftbfs.patch/
+
+--- dbus-c++-0.9.0.orig/include/dbus-c++/dispatcher.h
++++ dbus-c++-0.9.0/include/dbus-c++/dispatcher.h
+@@ -267,6 +267,19 @@ struct Threading
+ return new Mx;
+ }
+
++#ifndef DBUS_HAS_RECURSIVE_MUTEX
++ static bool mutex_free(Mutex *mx)
++ {
++ delete mx;
++ return true;
++ }
++
++ static bool mutex_lock(Mutex *mx)
++ {
++ mx->lock();
++ return true;
++ }
++#else
+ static void mutex_free(Mutex *mx)
+ {
+ delete mx;
+@@ -276,6 +289,7 @@ struct Threading
+ {
+ mx->lock();
+ }
++#endif
+
+ static void mutex_unlock(Mutex *mx)
+ {