Skip to content

Commit

Permalink
Merge pull request openwrt#5988 from diizzyy/patch-9
Browse files Browse the repository at this point in the history
bluez: Update to 5.49
  • Loading branch information
hnyman authored May 6, 2018
2 parents 9dc0862 + a994320 commit f73f39e
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 59 deletions.
20 changes: 11 additions & 9 deletions utils/bluez/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=bluez
PKG_VERSION:=5.47
PKG_VERSION:=5.49
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
PKG_HASH:=cf75bf7cd5d564f21cc4a2bd01d5c39ce425397335fd47d9bbe43af0a58342c8
PKG_HASH:=33301d7a514c73d535ee1f91c2aed1af1f2e53efe11d3ac06bcf0d7abed2ce95

PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
Expand Down Expand Up @@ -55,7 +55,7 @@ $(call Package/bluez/Default)
SECTION:=utils
CATEGORY:=Utilities
TITLE+= utilities
DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS) +dbus
endef

define Package/bluez-daemon
Expand All @@ -70,10 +70,13 @@ define Package/bluez-daemon/conffiles
/etc/bluetooth/main.conf
/etc/bluetooth/network.conf
/etc/bluetooth/input.conf
/etc/bluetooth/audio.conf
/etc/bluetooth/keys
/etc/config/bluetooth
endef

TARGET_CFLAGS += -D_GNU_SOURCE -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections

CONFIGURE_ARGS += \
--enable-static \
--enable-shared \
Expand All @@ -94,9 +97,6 @@ CONFIGURE_ARGS += \
--disable-udev \
--enable-deprecated

TARGET_CPPFLAGS += \
-D_GNU_SOURCE

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/
Expand All @@ -120,6 +120,7 @@ define Package/bluez-utils/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/btattach $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/
$(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/
Expand All @@ -130,6 +131,7 @@ define Package/bluez-utils/install
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/mpris-proxy $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/
Expand All @@ -144,12 +146,12 @@ define Package/bluez-daemon/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
$(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bluetooth.conf $(1)/etc/dbus-1/system.d/bluetooth.conf
$(INSTALL_DIR) $(1)/etc/bluetooth
$(INSTALL_DIR) $(1)/etc/bluetooth/keys
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
$(INSTALL_DATA) ./files/audio.conf $(1)/etc/bluetooth/audio.conf
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
endef
Expand Down
1 change: 0 additions & 1 deletion utils/bluez/files/audio.conf

This file was deleted.

37 changes: 0 additions & 37 deletions utils/bluez/files/bluetooth.dbus

This file was deleted.

1 change: 1 addition & 0 deletions utils/bluez/files/bluetoothd.init
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ USE_PROCD=1
PROG=/usr/bin/bluetoothd

start_service() {
ln -snf /etc/bluetooth/keys/ /var/lib/bluetooth
procd_open_instance
procd_set_param command "$PROG" -n
procd_close_instance
Expand Down
22 changes: 10 additions & 12 deletions utils/bluez/patches/201-readline.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
--- a/Makefile.in 2017-09-14 11:47:06.000000000 +0200
+++ b/Makefile.in 2017-09-15 02:52:39.315926972 +0200
@@ -2447,7 +2447,7 @@
@CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c
@@ -2472,7 +2472,7 @@
@CLIENT_TRUE@ client/gatt.h client/gatt.c

@CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
-@CLIENT_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
+@CLIENT_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses

@MESH_TRUE@mesh_meshctl_SOURCES = mesh/main.c \
@MESH_TRUE@ mesh/mesh-net.h \
@@ -2468,7 +2468,7 @@
@@ -2491,7 +2491,7 @@

@MESH_TRUE@mesh_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
@MESH_TRUE@ lib/libbluetooth-internal.la \
Expand All @@ -18,7 +18,7 @@

@MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
@MONITOR_TRUE@ monitor/display.h monitor/display.c \
@@ -2724,7 +2724,7 @@
@@ -2747,7 +2747,7 @@
@READLINE_TRUE@ tools/obex-client-tool.c

@READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \
Expand All @@ -27,17 +27,15 @@

@READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
@READLINE_TRUE@ tools/obex-server-tool.c
@@ -2734,17 +2734,17 @@
@READLINE_TRUE@ client/display.h client/display.c

@@ -2756,15 +2756,15 @@
@READLINE_TRUE@tools_bluetooth_player_SOURCES = tools/bluetooth-player.c
@READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
@READLINE_TRUE@ src/libshared-glib.la \
-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
+@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses

@READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c \
@READLINE_TRUE@ client/display.h client/display.c

@READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la \
@READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c
@READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
+@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses

Expand All @@ -48,7 +46,7 @@

@DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
@DEPRECATED_TRUE@@READLINE_TRUE@ attrib/gattrib.c btio/btio.c \
@@ -2753,7 +2753,7 @@
@@ -2773,7 +2773,7 @@
@DEPRECATED_TRUE@@READLINE_TRUE@ client/display.h

@DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
Expand Down
10 changes: 10 additions & 0 deletions utils/bluez/patches/202-fix-endianness.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/src/shared/util.h.old 2016-09-26 07:29:00.000000000 -0500
+++ b/src/shared/util.h 2017-12-27 22:49:50.538716424 -0600
@@ -26,6 +26,7 @@
#include <alloca.h>
#include <byteswap.h>
#include <string.h>
+#include <endian.h>

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define le16_to_cpu(val) (val)
61 changes: 61 additions & 0 deletions utils/bluez/patches/203-obexd_without_systemd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Submitted By: Armin K. <krejzi at email dot com>
Date: 2013-04-29
Initial Package Version: 5.17
Upstream Status: unknown
Origin: Arch Linux (Giovanni Campagna)
Description: Allow using obexd without systemd in the user session

Not all sessions run systemd --user (actually, the majority
doesn't), so the dbus daemon must be able to spawn obexd
directly, and to do so it needs the full path of the daemon.
---
Makefile.obexd | 4 ++--
obexd/src/org.bluez.obex.service | 4 ----
obexd/src/org.bluez.obex.service.in | 4 ++++
3 files changed, 6 insertions(+), 6 deletions(-)
delete mode 100644 obexd/src/org.bluez.obex.service
create mode 100644 obexd/src/org.bluez.obex.service.in

diff --git a/Makefile.obexd b/Makefile.obexd
index 3760867..142e7c3 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -2,12 +2,12 @@
if SYSTEMD
systemduserunitdir = @SYSTEMD_USERUNITDIR@
systemduserunit_DATA = obexd/src/obex.service
+endif

dbussessionbusdir = @DBUS_SESSIONBUSDIR@
dbussessionbus_DATA = obexd/src/org.bluez.obex.service
-endif

-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in

obex_plugindir = $(libdir)/obex/plugins

diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
deleted file mode 100644
index a538088..0000000
--- a/obexd/src/org.bluez.obex.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.bluez.obex
-Exec=/bin/false
-SystemdService=dbus-org.bluez.obex.service
diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
new file mode 100644
index 0000000..9c815f2
--- /dev/null
+++ b/obexd/src/org.bluez.obex.service.in
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.bluez.obex
+Exec=@libexecdir@/obexd
+SystemdService=dbus-org.bluez.obex.service
--
1.8.3.1


0 comments on commit f73f39e

Please sign in to comment.