[arch-commits] Commit in bluez/trunk (PKGBUILD fix-compile-issue.patch)

Andrea Scarpino andrea at archlinux.org
Mon Mar 5 08:53:47 EST 2012


    Date: Monday, March 5, 2012 @ 08:53:46
  Author: andrea
Revision: 152234

upgpkg: bluez 4.98-4

Fix compile issue with C++ (FS#28789)

Added:
  bluez/trunk/fix-compile-issue.patch
Modified:
  bluez/trunk/PKGBUILD

-------------------------+
 PKGBUILD                |   26 +++++++++++++----------
 fix-compile-issue.patch |   50 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-03-05 13:38:37 UTC (rev 152233)
+++ PKGBUILD	2012-03-05 13:53:46 UTC (rev 152234)
@@ -1,11 +1,11 @@
 # $Id$
-# Maintainer:
+# Maintainer: Tom Gundersen <teg at jklm.no>
 # Contributor: Andrea Scarpino <andrea at archlinux.org>
 # Contributor: Geoffroy Carrier <geoffroy at archlinux.org>
 
 pkgname=bluez
 pkgver=4.98
-pkgrel=3
+pkgrel=4
 pkgdesc="Libraries and tools for the Bluetooth protocol stack"
 url="http://www.bluez.org/"
 arch=('i686' 'x86_64')
@@ -13,28 +13,32 @@
 depends=('dbus-core')
 makedepends=('gstreamer0.10-base' 'libusb-compat' 'libsndfile')
 optdepends=("gstreamer0.10-base: bluetooth GStreamer support"
-	"alsa-lib: Audio bluetooth devices support"
-	"dbus-python: to run bluez-simple-agent"
-	"pygobject: to run bluez-simple-agent"
-	"libusb-compat: USB adapters support"
-        "cups: CUPS backend")
+            "alsa-lib: Audio bluetooth devices support"
+            "dbus-python: to run bluez-simple-agent"
+            "pygobject: to run bluez-simple-agent"
+            "libusb-compat: USB adapters support"
+            "cups: CUPS backend")
 conflicts=('bluez-libs' 'bluez-utils')
 provides=('bluez-libs' 'bluez-utils')
 replaces=('bluez-libs' 'bluez-utils')
-options=('!libtool' 'emptydirs')
+options=('!libtool')
 backup=(etc/bluetooth/{main,rfcomm,audio,network,input,serial}.conf
         'etc/conf.d/bluetooth' 'etc/dbus-1/system.d/bluetooth.conf')
 source=("http://www.kernel.org/pub/linux/bluetooth/${pkgname}-${pkgver}.tar.bz2"
-        'bluetooth.conf.d' 'rc.bluetooth' 'fix-a2dp.patch')
+        'bluetooth.conf.d' 'rc.bluetooth'
+        'fix-a2dp.patch'
+        'fix-compile-issue.patch')
 md5sums=('4aca8a0929250212e9a75fb60dd75b05'
          '7412982b440f29fa7f76a41a87fef985'
          '8f9498707f809506928b2e480d3b6789'
-         'd6a34317e56b7c2bd990791d89d6c3cb')
+         'd6a34317e56b7c2bd990791d89d6c3cb'
+         'd81860cd0d7c3ddd2515591453a85e65')
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
 
-  patch -Np1 -i "${srcdir}/fix-a2dp.patch"
+  patch -p1 -i "${srcdir}/fix-a2dp.patch"
+  patch -p1 -i "${srcdir}/fix-compile-issue.patch"
 
   ./configure --prefix=/usr \
     --sysconfdir=/etc \

Added: fix-compile-issue.patch
===================================================================
--- fix-compile-issue.patch	                        (rev 0)
+++ fix-compile-issue.patch	2012-03-05 13:53:46 UTC (rev 152234)
@@ -0,0 +1,50 @@
+From 4002cf271e3939714296c535a1ed8d4f0d5ac005 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly at intel.com>
+Date: Mon, 16 Jan 2012 11:11:55 +0100
+Subject: [PATCH] lib: Fix compile issue when using in C++
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+The compiler error is:
+ /usr/include/bluetooth/bluetooth.h::131:9: error: invalid conversion from 'void*' to 'bt_get_le64(void*)::<anonymous struct>*'
+ ...
+
+The reason is that C++, in contrast to C, does not allow conversion of
+void * to anything, and this code gets compiled as C++ when the app is
+written in C++. The macro with the assignment itself is older, but only
+recent Bluez starts to use it in inline functions, thus triggering the
+problem.
+
+This patch keeps the "struct __attribute__((packed))" magic and merely
+changes the typecast so that it works in C and C++. Like the existing
+macro this patch relies on support for typeof.
+---
+ lib/bluetooth.h |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/bluetooth.h b/lib/bluetooth.h
+index ea7373d..0541842 100644
+--- a/lib/bluetooth.h
++++ b/lib/bluetooth.h
+@@ -141,7 +141,7 @@ enum {
+ ({						\
+ 	struct __attribute__((packed)) {	\
+ 		typeof(*(ptr)) __v;		\
+-	} *__p = (void *) (ptr);		\
++	} *__p = (typeof(__p)) (ptr);		\
+ 	__p->__v;				\
+ })
+ 
+@@ -149,7 +149,7 @@ enum {
+ do {						\
+ 	struct __attribute__((packed)) {	\
+ 		typeof(*(ptr)) __v;		\
+-	} *__p = (void *) (ptr);		\
++	} *__p = (typeof(__p)) (ptr);		\
+ 	__p->__v = (val);			\
+ } while(0)
+ 
+-- 
+1.7.6.5
+



More information about the arch-commits mailing list