diff options
author | Pacho Ramos <pacho@gentoo.org> | 2012-02-14 08:43:43 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2012-02-14 08:43:43 +0000 |
commit | 531dd02aca734d2cb1111c7ece5e320697a50e4a (patch) | |
tree | d558e95e39319785e6c24f46436aac5ed3e0910f /net-wireless/bluez | |
parent | version bump (diff) | |
download | gentoo-2-531dd02aca734d2cb1111c7ece5e320697a50e4a.tar.gz gentoo-2-531dd02aca734d2cb1111c7ece5e320697a50e4a.tar.bz2 gentoo-2-531dd02aca734d2cb1111c7ece5e320697a50e4a.zip |
Fix compilation problems against bluez, bug #403341 (by Steev Klimaszewski and Marcel Unbehaun); fix needing to enable socket, bug #401065 (by Andreas Eckstein and Ivan ivanov). Drop old.
(Portage version: 2.1.10.46/cvs/Linux x86_64)
Diffstat (limited to 'net-wireless/bluez')
-rw-r--r-- | net-wireless/bluez/ChangeLog | 11 | ||||
-rw-r--r-- | net-wireless/bluez/bluez-4.98-r2.ebuild (renamed from net-wireless/bluez/bluez-4.98.ebuild) | 16 | ||||
-rw-r--r-- | net-wireless/bluez/files/bluez-4.98-fix-header.patch | 71 | ||||
-rw-r--r-- | net-wireless/bluez/files/bluez-4.98-fix-socket.patch | 54 |
4 files changed, 148 insertions, 4 deletions
diff --git a/net-wireless/bluez/ChangeLog b/net-wireless/bluez/ChangeLog index 501808f12f3d..3494fca6e437 100644 --- a/net-wireless/bluez/ChangeLog +++ b/net-wireless/bluez/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-wireless/bluez # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/ChangeLog,v 1.120 2012/02/12 04:03:05 jdhore Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/ChangeLog,v 1.121 2012/02/14 08:43:43 pacho Exp $ + +*bluez-4.98-r2 (14 Feb 2012) + + 14 Feb 2012; Pacho Ramos <pacho@gentoo.org> +bluez-4.98-r2.ebuild, + +files/bluez-4.98-fix-header.patch, +files/bluez-4.98-fix-socket.patch, + -bluez-4.98.ebuild: + Fix compilation problems against bluez, bug #403341 (by Steev Klimaszewski and + Marcel Unbehaun); fix needing to enable socket, bug #401065 (by Andreas + Eckstein and Ivan ivanov). Drop old. 12 Feb 2012; Jeff Horelick <jdhore@gentoo.org> bluez-4.98-r1.ebuild: x86 stable per bug 399745 diff --git a/net-wireless/bluez/bluez-4.98.ebuild b/net-wireless/bluez/bluez-4.98-r2.ebuild index 5b51076b9183..05503e565fdc 100644 --- a/net-wireless/bluez/bluez-4.98.ebuild +++ b/net-wireless/bluez/bluez-4.98-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.98.ebuild,v 1.3 2012/01/26 11:39:09 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.98-r2.ebuild,v 1.1 2012/02/14 08:43:43 pacho Exp $ EAPI="4" PYTHON_DEPEND="test-programs? 2" @@ -20,12 +20,12 @@ SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz LICENSE="GPL-2 LGPL-2.1" SLOT="0" KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86" -IUSE="alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb" +IUSE="alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb readline" CDEPEND=" >=dev-libs/glib-2.14:2 sys-apps/dbus - >=sys-fs/udev-146[extras] + >=sys-fs/udev-169 alsa? ( media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] media-libs/libsndfile @@ -37,6 +37,7 @@ CDEPEND=" >=media-libs/gst-plugins-base-0.10:0.10 ) usb? ( dev-libs/libusb:1 ) + readline? ( sys-libs/readline ) " DEPEND="${CDEPEND} >=dev-util/pkgconfig-0.20 @@ -69,6 +70,12 @@ pkg_setup() { } src_prepare() { + # Fix compilation problems against bluez, bug #403341 + epatch "${FILESDIR}/${PN}-4.98-fix-header.patch" + + # Fix needing to enable socket, bug #401065 + epatch "${FILESDIR}/${PN}-4.98-fix-socket.patch" + if ! use consolekit; then # No consolekit for at_console etc, so we grant plugdev the rights epatch "${FILESDIR}/bluez-plugdev.patch" @@ -82,7 +89,10 @@ src_prepare() { } src_configure() { + use readline || export ac_cv_header_readline_readline_h=no + econf \ + --enable-hid2hci \ --enable-audio \ --enable-bccmd \ --enable-datafiles \ diff --git a/net-wireless/bluez/files/bluez-4.98-fix-header.patch b/net-wireless/bluez/files/bluez-4.98-fix-header.patch new file mode 100644 index 000000000000..5ca087df9ae1 --- /dev/null +++ b/net-wireless/bluez/files/bluez-4.98-fix-header.patch @@ -0,0 +1,71 @@ +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. + +The new variant of the code is in an ifdef and only used for C++ +to avoid unexpected regressions in C applications. + +Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> +--- + lib/bluetooth.h | 30 ++++++++++++++++++++++++++++++ + 1 files changed, 30 insertions(+), 0 deletions(-) + +Index: bluez-4.98/lib/bluetooth.h +=================================================================== +--- bluez-4.98.orig/lib/bluetooth.h 2012-02-05 13:20:23.753659182 +0100 ++++ bluez-4.98/lib/bluetooth.h 2012-02-05 13:26:33.905473976 +0100 +@@ -109,6 +109,12 @@ + #endif + + /* Bluetooth unaligned access */ ++#ifndef __cplusplus ++/* ++ * traditional code, doesn't work in C++ because ++ * of the void * to struct pointer assignment ++ */ ++ + #define bt_get_unaligned(ptr) \ + ({ \ + struct __attribute__((packed)) { \ +@@ -125,6 +131,31 @@ + __p->__v = (val); \ + } while(0) + ++#else /* __cplusplus */ ++ ++/* ++ * modified code with typeof typecast, for C++; ++ * the traditional code continues to be used for ++ * C to avoid unexpected regressions with this ++ * code here (it should work in C and C++, though) ++ */ ++#define bt_get_unaligned(ptr) \ ++({ \ ++ struct __attribute__((packed)) { \ ++ typeof(*(ptr)) __v; \ ++ } *__p = (typeof(__p)) (ptr); \ ++ __p->__v; \ ++}) ++ ++#define bt_put_unaligned(val, ptr) \ ++do { \ ++ struct __attribute__((packed)) { \ ++ typeof(*(ptr)) __v; \ ++ } *__p = (typeof(__p)) (ptr); \ ++ __p->__v = (val); \ ++} while(0) ++#endif /* __cplusplus */ ++ + #if __BYTE_ORDER == __LITTLE_ENDIAN + static inline uint64_t bt_get_le64(void *ptr) + {
\ No newline at end of file diff --git a/net-wireless/bluez/files/bluez-4.98-fix-socket.patch b/net-wireless/bluez/files/bluez-4.98-fix-socket.patch new file mode 100644 index 000000000000..6f16c5fdf96e --- /dev/null +++ b/net-wireless/bluez/files/bluez-4.98-fix-socket.patch @@ -0,0 +1,54 @@ +diff --git a/audio/a2dp.c b/audio/a2dp.c +index c4cdc62..2eebe6b 100644 +--- a/audio/a2dp.c ++++ b/audio/a2dp.c +@@ -1441,9 +1441,9 @@ static struct a2dp_server *find_server(GSList *list, const bdaddr_t *src) + + int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + { +- int sbc_srcs = 1, sbc_sinks = 1; ++ int sbc_srcs = 0, sbc_sinks = 0; + int mpeg12_srcs = 0, mpeg12_sinks = 0; +- gboolean source = TRUE, sink = FALSE, socket = TRUE; ++ gboolean source = TRUE, sink = FALSE, socket = FALSE; + gboolean delay_reporting = FALSE; + char *str; + GError *err = NULL; +@@ -1463,6 +1463,8 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + source = TRUE; + if (strstr(str, "Source")) + sink = TRUE; ++ if (strstr(str, "Socket")) ++ socket = TRUE; + g_free(str); + } + +@@ -1482,18 +1484,14 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + } + + /* Don't register any local sep if Socket is disabled */ +- if (socket == FALSE) { +- sbc_srcs = 0; +- sbc_sinks = 0; +- mpeg12_srcs = 0; +- mpeg12_sinks = 0; ++ if (socket == FALSE) + goto proceed; +- } + + str = g_key_file_get_string(config, "A2DP", "SBCSources", &err); + if (err) { + DBG("audio.conf: %s", err->message); + g_clear_error(&err); ++ sbc_srcs = 1; + } else { + sbc_srcs = atoi(str); + g_free(str); +@@ -1512,6 +1510,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + if (err) { + DBG("audio.conf: %s", err->message); + g_clear_error(&err); ++ sbc_sinks = 1; + } else { + sbc_sinks = atoi(str); + g_free(str); |