Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] bluez: update to 5.51.
@ 2019-10-03 10:38 voidlinux-github
  2019-10-03 10:48 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-03 10:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

There is a new pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 19373 bytes --]

From 5a45e59fca20451201315820850421983e36ce51 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  46 +++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  45 ++++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0008-include-string.h.patch |  25 ++++
 srcpkgs/bluez/template                        |  24 +++-
 11 files changed, 380 insertions(+), 102 deletions(-)
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0008-include-string.h.patch

diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..d67fbc85a3f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From e1dbe64f58e9a8dbedcaf0c38a939e5805fc9f70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/8] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 938cfd9c0..d83ee79b1 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..1e8e1f81eba
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,46 @@
+From b8315ed030cd913340a5a94acb94239e111d05eb Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/8] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                                | 4 ++--
+ .../src/{org.bluez.obex.service => org.bluez.obex.service.in} | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (76%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..ea84603db 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 76%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..9c815f246 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@libexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..929a7b195c2
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,45 @@
+From 4fe8f69f718a28b156933a42afaa2d4a0abc571f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/8] allow mesh on non-systemd system
+
+---
+ Makefile.mesh                                              | 2 +-
+ mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+ rename mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} (72%)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+diff --git a/mesh/org.bluez.mesh.service b/mesh/org.bluez.mesh.service.in
+similarity index 72%
+rename from mesh/org.bluez.mesh.service
+rename to mesh/org.bluez.mesh.service.in
+index a61c44455..b04d5ad49 100644
+--- a/mesh/org.bluez.mesh.service
++++ b/mesh/org.bluez.mesh.service.in
+@@ -1,5 +1,5 @@
+ [D-BUS Service]
+ Name=org.bluez.mesh
+-Exec=/bin/false
++Exec=@libexecdir@/bluetooth-meshd
+ User=root
+ SystemdService=dbus-org.bluez.mesh.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..fa3b587c5c4
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 443706f605ee55842e5d3d415a196ab8f5849c70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/8] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 633597659..ec7ca43c0 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..23a6efc4f82
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 761cb3905da645c098cee561f3a0bfe111823ec1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/8] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index 198fef518..11dfddac3 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index af45a6130..7bba06ec9 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..eb311738539 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From bb584147b0b656b7b6b72d53657b9b9a67e8b49f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/8] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-include-string.h.patch b/srcpkgs/bluez/patches/0008-include-string.h.patch
new file mode 100644
index 00000000000..34645e73613
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-include-string.h.patch
@@ -0,0 +1,25 @@
+From aa68811188a4ee0f45393cdb19dbee5a5cfbfde8 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 8/8] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..26dd91fbfd0 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_if mesh --enable-mesh) $(vopt_if nfc --enable-nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
@ 2019-10-03 10:48 ` voidlinux-github
  2019-10-03 10:48 ` voidlinux-github
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-03 10:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 19467 bytes --]

From e9b58d8dc7ecb604f3ea9c06c4eacb261e31805d Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  46 +++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  45 ++++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0008-include-string.h.patch |  25 ++++
 srcpkgs/bluez/template                        |  25 +++-
 11 files changed, 380 insertions(+), 103 deletions(-)
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0008-include-string.h.patch

diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..d67fbc85a3f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From e1dbe64f58e9a8dbedcaf0c38a939e5805fc9f70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/8] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 938cfd9c0..d83ee79b1 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..1e8e1f81eba
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,46 @@
+From b8315ed030cd913340a5a94acb94239e111d05eb Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/8] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                                | 4 ++--
+ .../src/{org.bluez.obex.service => org.bluez.obex.service.in} | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (76%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..ea84603db 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 76%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..9c815f246 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@libexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..929a7b195c2
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,45 @@
+From 4fe8f69f718a28b156933a42afaa2d4a0abc571f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/8] allow mesh on non-systemd system
+
+---
+ Makefile.mesh                                              | 2 +-
+ mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+ rename mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} (72%)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+diff --git a/mesh/org.bluez.mesh.service b/mesh/org.bluez.mesh.service.in
+similarity index 72%
+rename from mesh/org.bluez.mesh.service
+rename to mesh/org.bluez.mesh.service.in
+index a61c44455..b04d5ad49 100644
+--- a/mesh/org.bluez.mesh.service
++++ b/mesh/org.bluez.mesh.service.in
+@@ -1,5 +1,5 @@
+ [D-BUS Service]
+ Name=org.bluez.mesh
+-Exec=/bin/false
++Exec=@libexecdir@/bluetooth-meshd
+ User=root
+ SystemdService=dbus-org.bluez.mesh.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..fa3b587c5c4
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 443706f605ee55842e5d3d415a196ab8f5849c70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/8] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 633597659..ec7ca43c0 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..23a6efc4f82
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 761cb3905da645c098cee561f3a0bfe111823ec1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/8] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index 198fef518..11dfddac3 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index af45a6130..7bba06ec9 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..eb311738539 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From bb584147b0b656b7b6b72d53657b9b9a67e8b49f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/8] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-include-string.h.patch b/srcpkgs/bluez/patches/0008-include-string.h.patch
new file mode 100644
index 00000000000..34645e73613
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-include-string.h.patch
@@ -0,0 +1,25 @@
+From aa68811188a4ee0f45393cdb19dbee5a5cfbfde8 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 8/8] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..ebe676ec671 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_if mesh --enable-mesh) $(vopt_if nfc --enable-nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -68,4 +80,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
  2019-10-03 10:48 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-10-03 10:48 ` voidlinux-github
  2019-10-04  4:39 ` voidlinux-github
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-03 10:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 19467 bytes --]

From e9b58d8dc7ecb604f3ea9c06c4eacb261e31805d Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  46 +++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  45 ++++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0008-include-string.h.patch |  25 ++++
 srcpkgs/bluez/template                        |  25 +++-
 11 files changed, 380 insertions(+), 103 deletions(-)
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0008-include-string.h.patch

diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..d67fbc85a3f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From e1dbe64f58e9a8dbedcaf0c38a939e5805fc9f70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/8] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 938cfd9c0..d83ee79b1 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..1e8e1f81eba
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,46 @@
+From b8315ed030cd913340a5a94acb94239e111d05eb Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/8] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                                | 4 ++--
+ .../src/{org.bluez.obex.service => org.bluez.obex.service.in} | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (76%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..ea84603db 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 76%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..9c815f246 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@libexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..929a7b195c2
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,45 @@
+From 4fe8f69f718a28b156933a42afaa2d4a0abc571f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/8] allow mesh on non-systemd system
+
+---
+ Makefile.mesh                                              | 2 +-
+ mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+ rename mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} (72%)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+diff --git a/mesh/org.bluez.mesh.service b/mesh/org.bluez.mesh.service.in
+similarity index 72%
+rename from mesh/org.bluez.mesh.service
+rename to mesh/org.bluez.mesh.service.in
+index a61c44455..b04d5ad49 100644
+--- a/mesh/org.bluez.mesh.service
++++ b/mesh/org.bluez.mesh.service.in
+@@ -1,5 +1,5 @@
+ [D-BUS Service]
+ Name=org.bluez.mesh
+-Exec=/bin/false
++Exec=@libexecdir@/bluetooth-meshd
+ User=root
+ SystemdService=dbus-org.bluez.mesh.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..fa3b587c5c4
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 443706f605ee55842e5d3d415a196ab8f5849c70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/8] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 633597659..ec7ca43c0 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..23a6efc4f82
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 761cb3905da645c098cee561f3a0bfe111823ec1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/8] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index 198fef518..11dfddac3 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index af45a6130..7bba06ec9 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..eb311738539 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From bb584147b0b656b7b6b72d53657b9b9a67e8b49f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/8] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-include-string.h.patch b/srcpkgs/bluez/patches/0008-include-string.h.patch
new file mode 100644
index 00000000000..34645e73613
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-include-string.h.patch
@@ -0,0 +1,25 @@
+From aa68811188a4ee0f45393cdb19dbee5a5cfbfde8 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 8/8] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..ebe676ec671 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_if mesh --enable-mesh) $(vopt_if nfc --enable-nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -68,4 +80,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (2 preceding siblings ...)
  2019-10-04  4:39 ` voidlinux-github
@ 2019-10-04  4:39 ` voidlinux-github
  2019-10-04  9:51 ` voidlinux-github
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04  4:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 20652 bytes --]

From 892ed11d0f565dca8262ab45256f8b199363f719 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  46 +++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  45 ++++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0007-include-string.h.patch |  25 ++++
 ...-grant-permission-to-bluetooth-group.patch |  27 ++++
 srcpkgs/bluez/template                        |  25 +++-
 12 files changed, 407 insertions(+), 103 deletions(-)
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch

diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..74a9f772363
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From e1dbe64f58e9a8dbedcaf0c38a939e5805fc9f70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 938cfd9c0..d83ee79b1 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..1d64fb1cd36
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,46 @@
+From b8315ed030cd913340a5a94acb94239e111d05eb Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                                | 4 ++--
+ .../src/{org.bluez.obex.service => org.bluez.obex.service.in} | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (76%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..ea84603db 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 76%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..9c815f246 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@libexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..9190c9cc87d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,45 @@
+From 4fe8f69f718a28b156933a42afaa2d4a0abc571f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh                                              | 2 +-
+ mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+ rename mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} (72%)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+diff --git a/mesh/org.bluez.mesh.service b/mesh/org.bluez.mesh.service.in
+similarity index 72%
+rename from mesh/org.bluez.mesh.service
+rename to mesh/org.bluez.mesh.service.in
+index a61c44455..b04d5ad49 100644
+--- a/mesh/org.bluez.mesh.service
++++ b/mesh/org.bluez.mesh.service.in
+@@ -1,5 +1,5 @@
+ [D-BUS Service]
+ Name=org.bluez.mesh
+-Exec=/bin/false
++Exec=@libexecdir@/bluetooth-meshd
+ User=root
+ SystemdService=dbus-org.bluez.mesh.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..18702427029
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 443706f605ee55842e5d3d415a196ab8f5849c70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/9] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 633597659..ec7ca43c0 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..b59ad47604e
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 761cb3905da645c098cee561f3a0bfe111823ec1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index 198fef518..11dfddac3 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index af45a6130..7bba06ec9 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..15e26437603 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From bb584147b0b656b7b6b72d53657b9b9a67e8b49f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..6387bdb4f85
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From 96827201afb13bad79d4ed6e4bbf9c17e50fed56 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..cd2af3b999f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 34624bb496c3db72fdf98ba4b78d6cc3501851f6 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..ebe676ec671 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_if mesh --enable-mesh) $(vopt_if nfc --enable-nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -68,4 +80,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
  2019-10-03 10:48 ` [PR PATCH] [Updated] " voidlinux-github
  2019-10-03 10:48 ` voidlinux-github
@ 2019-10-04  4:39 ` voidlinux-github
  2019-10-04  4:39 ` voidlinux-github
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04  4:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 20652 bytes --]

From 892ed11d0f565dca8262ab45256f8b199363f719 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  46 +++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  45 ++++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0007-include-string.h.patch |  25 ++++
 ...-grant-permission-to-bluetooth-group.patch |  27 ++++
 srcpkgs/bluez/template                        |  25 +++-
 12 files changed, 407 insertions(+), 103 deletions(-)
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch

diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..74a9f772363
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From e1dbe64f58e9a8dbedcaf0c38a939e5805fc9f70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 938cfd9c0..d83ee79b1 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..1d64fb1cd36
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,46 @@
+From b8315ed030cd913340a5a94acb94239e111d05eb Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                                | 4 ++--
+ .../src/{org.bluez.obex.service => org.bluez.obex.service.in} | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (76%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..ea84603db 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 76%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..9c815f246 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@libexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..9190c9cc87d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,45 @@
+From 4fe8f69f718a28b156933a42afaa2d4a0abc571f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh                                              | 2 +-
+ mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+ rename mesh/{org.bluez.mesh.service => org.bluez.mesh.service.in} (72%)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+diff --git a/mesh/org.bluez.mesh.service b/mesh/org.bluez.mesh.service.in
+similarity index 72%
+rename from mesh/org.bluez.mesh.service
+rename to mesh/org.bluez.mesh.service.in
+index a61c44455..b04d5ad49 100644
+--- a/mesh/org.bluez.mesh.service
++++ b/mesh/org.bluez.mesh.service.in
+@@ -1,5 +1,5 @@
+ [D-BUS Service]
+ Name=org.bluez.mesh
+-Exec=/bin/false
++Exec=@libexecdir@/bluetooth-meshd
+ User=root
+ SystemdService=dbus-org.bluez.mesh.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..18702427029
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 443706f605ee55842e5d3d415a196ab8f5849c70 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/9] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 633597659..ec7ca43c0 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..b59ad47604e
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 761cb3905da645c098cee561f3a0bfe111823ec1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index 198fef518..11dfddac3 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index af45a6130..7bba06ec9 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..15e26437603 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From bb584147b0b656b7b6b72d53657b9b9a67e8b49f Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..6387bdb4f85
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From 96827201afb13bad79d4ed6e4bbf9c17e50fed56 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..cd2af3b999f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 34624bb496c3db72fdf98ba4b78d6cc3501851f6 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..ebe676ec671 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_if mesh --enable-mesh) $(vopt_if nfc --enable-nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -68,4 +80,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (3 preceding siblings ...)
  2019-10-04  4:39 ` voidlinux-github
@ 2019-10-04  9:51 ` voidlinux-github
  2019-10-04  9:51 ` voidlinux-github
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04  9:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 19425 bytes --]

From a256d917bebeef167d8898ead287a05906821791 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 srcpkgs/bluez/files/bluetooth-meshd/run       |  3 +
 ...-without-systemd-in-the-user-session.patch | 59 -----------------
 .../0001-enable-dbus-without-systemd.patch    | 34 ++++++++++
 ...02-allow-obexd-on-non-systemd-system.patch | 54 +++++++++++++++
 .../0002-bluetoothd-dbus-service.patch        | 20 ------
 .../0003-bluetooth-group-can-use-bluez.patch  | 13 ----
 ...0005-include-limits.h-for-musl-build.patch | 66 +++++++++++++++++++
 .../{musl.patch => 0006-musl-fix.patch}       | 21 ++++--
 .../bluez/patches/0007-include-string.h.patch | 25 +++++++
 ...-grant-permission-to-bluetooth-group.patch | 27 ++++++++
 ...fresh-adv_manager-for-non-LE-devices.patch | 51 ++++++++++++++
 srcpkgs/bluez/template                        | 28 ++++++--
 12 files changed, 298 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (4 preceding siblings ...)
  2019-10-04  9:51 ` voidlinux-github
@ 2019-10-04  9:51 ` voidlinux-github
  2019-10-04  9:53 ` voidlinux-github
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04  9:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 19425 bytes --]

From a256d917bebeef167d8898ead287a05906821791 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 srcpkgs/bluez/files/bluetooth-meshd/run       |  3 +
 ...-without-systemd-in-the-user-session.patch | 59 -----------------
 .../0001-enable-dbus-without-systemd.patch    | 34 ++++++++++
 ...02-allow-obexd-on-non-systemd-system.patch | 54 +++++++++++++++
 .../0002-bluetoothd-dbus-service.patch        | 20 ------
 .../0003-bluetooth-group-can-use-bluez.patch  | 13 ----
 ...0005-include-limits.h-for-musl-build.patch | 66 +++++++++++++++++++
 .../{musl.patch => 0006-musl-fix.patch}       | 21 ++++--
 .../bluez/patches/0007-include-string.h.patch | 25 +++++++
 ...-grant-permission-to-bluetooth-group.patch | 27 ++++++++
 ...fresh-adv_manager-for-non-LE-devices.patch | 51 ++++++++++++++
 srcpkgs/bluez/template                        | 28 ++++++--
 12 files changed, 298 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (6 preceding siblings ...)
  2019-10-04  9:53 ` voidlinux-github
@ 2019-10-04  9:53 ` voidlinux-github
  2019-10-04 10:25 ` voidlinux-github
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04  9:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 20628 bytes --]

From c2632cab5fa20fbd30e1ee3a1dcec0486f724dff Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 srcpkgs/bluez/files/bluetooth-meshd/run       |  3 +
 ...-without-systemd-in-the-user-session.patch | 59 -----------------
 .../0001-enable-dbus-without-systemd.patch    | 34 ++++++++++
 ...02-allow-obexd-on-non-systemd-system.patch | 54 +++++++++++++++
 .../0002-bluetoothd-dbus-service.patch        | 20 ------
 ...003-allow-mesh-on-non-systemd-system.patch | 29 ++++++++
 .../0003-bluetooth-group-can-use-bluez.patch  | 13 ----
 ...0005-include-limits.h-for-musl-build.patch | 66 +++++++++++++++++++
 .../{musl.patch => 0006-musl-fix.patch}       | 21 ++++--
 .../bluez/patches/0007-include-string.h.patch | 25 +++++++
 ...-grant-permission-to-bluetooth-group.patch | 27 ++++++++
 ...fresh-adv_manager-for-non-LE-devices.patch | 51 ++++++++++++++
 srcpkgs/bluez/template                        | 28 ++++++--
 13 files changed, 327 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..2cf6f73442d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,29 @@
+From 32a425c3f9b42a55824c044a6b486c9c12e65a65 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (5 preceding siblings ...)
  2019-10-04  9:51 ` voidlinux-github
@ 2019-10-04  9:53 ` voidlinux-github
  2019-10-04  9:53 ` voidlinux-github
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04  9:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 20628 bytes --]

From c2632cab5fa20fbd30e1ee3a1dcec0486f724dff Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 srcpkgs/bluez/files/bluetooth-meshd/run       |  3 +
 ...-without-systemd-in-the-user-session.patch | 59 -----------------
 .../0001-enable-dbus-without-systemd.patch    | 34 ++++++++++
 ...02-allow-obexd-on-non-systemd-system.patch | 54 +++++++++++++++
 .../0002-bluetoothd-dbus-service.patch        | 20 ------
 ...003-allow-mesh-on-non-systemd-system.patch | 29 ++++++++
 .../0003-bluetooth-group-can-use-bluez.patch  | 13 ----
 ...0005-include-limits.h-for-musl-build.patch | 66 +++++++++++++++++++
 .../{musl.patch => 0006-musl-fix.patch}       | 21 ++++--
 .../bluez/patches/0007-include-string.h.patch | 25 +++++++
 ...-grant-permission-to-bluetooth-group.patch | 27 ++++++++
 ...fresh-adv_manager-for-non-LE-devices.patch | 51 ++++++++++++++
 srcpkgs/bluez/template                        | 28 ++++++--
 13 files changed, 327 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..2cf6f73442d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,29 @@
+From 32a425c3f9b42a55824c044a6b486c9c12e65a65 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (8 preceding siblings ...)
  2019-10-04 10:25 ` voidlinux-github
@ 2019-10-04 10:25 ` voidlinux-github
  2019-10-04 10:26 ` voidlinux-github
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04 10:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 23971 bytes --]

From f7b9f85f3251898e8919690efd8f1486f720dfbd Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 srcpkgs/bluez/files/bluetooth-meshd/run       |   3 +
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  54 ++++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  29 ++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0007-include-string.h.patch |  25 ++++
 ...-grant-permission-to-bluetooth-group.patch |  27 ++++
 ...fresh-adv_manager-for-non-LE-devices.patch |  51 +++++++
 srcpkgs/bluez/template                        |  28 +++-
 14 files changed, 456 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..2cf6f73442d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,29 @@
+From 32a425c3f9b42a55824c044a6b486c9c12e65a65 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..1cd573cc039
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 2a2eb634d481ab4eed0a444321dc12338de96d6a Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/9] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 501ec10fe..6b6219c56 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (7 preceding siblings ...)
  2019-10-04  9:53 ` voidlinux-github
@ 2019-10-04 10:25 ` voidlinux-github
  2019-10-04 10:25 ` voidlinux-github
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04 10:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 23971 bytes --]

From f7b9f85f3251898e8919690efd8f1486f720dfbd Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

---
 srcpkgs/bluez/files/bluetooth-meshd/run       |   3 +
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  54 ++++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  29 ++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0007-include-string.h.patch |  25 ++++
 ...-grant-permission-to-bluetooth-group.patch |  27 ++++
 ...fresh-adv_manager-for-non-LE-devices.patch |  51 +++++++
 srcpkgs/bluez/template                        |  28 +++-
 14 files changed, 456 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..2cf6f73442d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,29 @@
+From 32a425c3f9b42a55824c044a6b486c9c12e65a65 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..1cd573cc039
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 2a2eb634d481ab4eed0a444321dc12338de96d6a Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/9] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 501ec10fe..6b6219c56 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (9 preceding siblings ...)
  2019-10-04 10:25 ` voidlinux-github
@ 2019-10-04 10:26 ` voidlinux-github
  2019-10-04 10:26 ` voidlinux-github
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04 10:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 24000 bytes --]

From 518c6009da1c4cbf63991acdbfd7a4fcf53ead61 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

mesh option is under testing
---
 srcpkgs/bluez/files/bluetooth-meshd/run       |   3 +
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  54 ++++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  29 ++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0007-include-string.h.patch |  25 ++++
 ...-grant-permission-to-bluetooth-group.patch |  27 ++++
 ...fresh-adv_manager-for-non-LE-devices.patch |  51 +++++++
 srcpkgs/bluez/template                        |  28 +++-
 14 files changed, 456 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..2cf6f73442d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,29 @@
+From 32a425c3f9b42a55824c044a6b486c9c12e65a65 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..1cd573cc039
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 2a2eb634d481ab4eed0a444321dc12338de96d6a Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/9] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 501ec10fe..6b6219c56 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (10 preceding siblings ...)
  2019-10-04 10:26 ` voidlinux-github
@ 2019-10-04 10:26 ` voidlinux-github
  2019-10-04 10:31 ` voidlinux-github
  2019-10-07  9:28 ` [PR PATCH] [Merged]: " voidlinux-github
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04 10:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by zdtcd against master on the void-packages repository

https://github.com/zdtcd/void-packages bluez
https://github.com/void-linux/void-packages/pull/14996

[WIP] bluez: update to 5.51.


A patch file from https://github.com/void-linux/void-packages/pull/14996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bluez-14996.patch --]
[-- Type: text/x-diff, Size: 24000 bytes --]

From 518c6009da1c4cbf63991acdbfd7a4fcf53ead61 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 3 Oct 2019 12:41:33 +0700
Subject: [PATCH] bluez: update to 5.51.

mesh option is under testing
---
 srcpkgs/bluez/files/bluetooth-meshd/run       |   3 +
 ...-without-systemd-in-the-user-session.patch |  59 --------
 .../0001-enable-dbus-without-systemd.patch    |  34 +++++
 ...02-allow-obexd-on-non-systemd-system.patch |  54 ++++++++
 .../0002-bluetoothd-dbus-service.patch        |  20 ---
 ...003-allow-mesh-on-non-systemd-system.patch |  29 ++++
 .../0003-bluetooth-group-can-use-bluez.patch  |  13 --
 ...04-include-sys-time.h-for-musl-build.patch | 129 ++++++++++++++++++
 ...0005-include-limits.h-for-musl-build.patch |  66 +++++++++
 .../{musl.patch => 0006-musl-fix.patch}       |  21 ++-
 .../bluez/patches/0007-include-string.h.patch |  25 ++++
 ...-grant-permission-to-bluetooth-group.patch |  27 ++++
 ...fresh-adv_manager-for-non-LE-devices.patch |  51 +++++++
 srcpkgs/bluez/template                        |  28 +++-
 14 files changed, 456 insertions(+), 103 deletions(-)
 create mode 100755 srcpkgs/bluez/files/bluetooth-meshd/run
 delete mode 100644 srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
 create mode 100644 srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
 create mode 100644 srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
 create mode 100644 srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
 delete mode 100644 srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
 create mode 100644 srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
 create mode 100644 srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
 rename srcpkgs/bluez/patches/{musl.patch => 0006-musl-fix.patch} (52%)
 create mode 100644 srcpkgs/bluez/patches/0007-include-string.h.patch
 create mode 100644 srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
 create mode 100644 srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch

diff --git a/srcpkgs/bluez/files/bluetooth-meshd/run b/srcpkgs/bluez/files/bluetooth-meshd/run
new file mode 100755
index 00000000000..752dbcc37bf
--- /dev/null
+++ b/srcpkgs/bluez/files/bluetooth-meshd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+exec /usr/libexec/bluetooth/bluetooth-meshd --nodetach >/dev/null
diff --git a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch b/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
deleted file mode 100644
index 15da2636673..00000000000
--- a/srcpkgs/bluez/patches/0001-Allow-using-obexd-without-systemd-in-the-user-session.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] 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
---- Makefile.obexd
-+++ 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
---- 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
-+++ 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
-
-
diff --git a/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
new file mode 100644
index 00000000000..5b9c7dc708c
--- /dev/null
+++ b/srcpkgs/bluez/patches/0001-enable-dbus-without-systemd.patch
@@ -0,0 +1,34 @@
+From 2625ab38ae27754205d060f09e3a18f7648d5167 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:09 +0700
+Subject: [PATCH 1/9] enable dbus without systemd
+
+---
+ Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 404e6a460..0884156fa 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -40,14 +40,14 @@ conf_DATA =
+ 
+ statedir = $(localstatedir)/lib/bluetooth
+ state_DATA =
++
++dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
++dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
+ systemdsystemunit_DATA = src/bluetooth.service
+-
+-dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
+-dbussystembus_DATA = src/org.bluez.service
+ endif
+ 
+ EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
new file mode 100644
index 00000000000..4ea752cd685
--- /dev/null
+++ b/srcpkgs/bluez/patches/0002-allow-obexd-on-non-systemd-system.patch
@@ -0,0 +1,54 @@
+From 82099f711ecd8281cebad23b53aadb8c875bc235 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:57:55 +0700
+Subject: [PATCH 2/9] allow obexd on non-systemd system
+
+---
+ Makefile.obexd                                              | 6 +++---
+ .../{org.bluez.obex.service => org.bluez.obex.service.in}   | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+ rename obexd/src/{org.bluez.obex.service => org.bluez.obex.service.in} (74%)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index d36874770..c9996288c 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -1,12 +1,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
+ 
+ if OBEX
+ 
+@@ -106,6 +106,6 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
+ 	$(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+ 
+-CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service
++CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service obexd/src/org.bluez.obex.service
+ 
+ EXTRA_DIST += obexd/src/genbuiltin
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service.in
+similarity index 74%
+rename from obexd/src/org.bluez.obex.service
+rename to obexd/src/org.bluez.obex.service.in
+index a53808884..543d7bc07 100644
+--- a/obexd/src/org.bluez.obex.service
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -1,4 +1,4 @@
+ [D-BUS Service]
+ Name=org.bluez.obex
+-Exec=/bin/false
++Exec=@pkglibexecdir@/obexd
+ SystemdService=dbus-org.bluez.obex.service
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch b/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
deleted file mode 100644
index b7856185dff..00000000000
--- a/srcpkgs/bluez/patches/0002-bluetoothd-dbus-service.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.am.orig	2014-07-30 12:30:56.483179384 +0200
-+++ Makefile.am	2014-07-30 12:31:30.858387791 +0200
-@@ -39,14 +39,14 @@ conf_DATA =
- 
- statedir = $(localstatedir)/lib/bluetooth
- state_DATA =
-+
-+dbussystembusdir = @DBUS_SYSTEMBUSDIR@
-+dbussystembus_DATA = src/org.bluez.service
- endif
- 
- if SYSTEMD
- systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
- systemdsystemunit_DATA = src/bluetooth.service
--
--dbussystembusdir = @DBUS_SYSTEMBUSDIR@
--dbussystembus_DATA = src/org.bluez.service
- endif
- 
- EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
diff --git a/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
new file mode 100644
index 00000000000..2cf6f73442d
--- /dev/null
+++ b/srcpkgs/bluez/patches/0003-allow-mesh-on-non-systemd-system.patch
@@ -0,0 +1,29 @@
+From 32a425c3f9b42a55824c044a6b486c9c12e65a65 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:58:18 +0700
+Subject: [PATCH 3/9] allow mesh on non-systemd system
+
+---
+ Makefile.mesh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.mesh b/Makefile.mesh
+index 90979cbc0..9e6e2c2ca 100644
+--- a/Makefile.mesh
++++ b/Makefile.mesh
+@@ -2,11 +2,11 @@ if MESH
+ 
+ if DATAFILES
+ dbus_DATA += mesh/bluetooth-mesh.conf
++dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ if SYSTEMD
+ systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+-dbussystembus_DATA += mesh/org.bluez.mesh.service
+ endif
+ 
+ mesh_sources = mesh/mesh.h mesh/mesh.c \
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch b/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
deleted file mode 100644
index 7a72e60944e..00000000000
--- a/srcpkgs/bluez/patches/0003-bluetooth-group-can-use-bluez.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/bluetooth.conf
-+++ src/bluetooth.conf
-@@ -28,6 +28,10 @@
-     <allow send_destination="org.bluez"/>
-   </policy>
- 
-+  <policy group="bluetooth">
-+    <allow send_destination="org.bluez"/>
-+  </policy>
-+
-   <!-- allow users of lp group (printing subsystem) to 
-        communicate with bluetoothd -->
-   <policy group="lp">
diff --git a/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
new file mode 100644
index 00000000000..1cd573cc039
--- /dev/null
+++ b/srcpkgs/bluez/patches/0004-include-sys-time.h-for-musl-build.patch
@@ -0,0 +1,129 @@
+From 2a2eb634d481ab4eed0a444321dc12338de96d6a Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 12:59:56 +0700
+Subject: [PATCH 4/9] include sys/time.h for musl build
+
+---
+ mesh/appkey.c         | 1 +
+ mesh/crypto.c         | 1 +
+ mesh/friend.c         | 1 +
+ mesh/manager.c        | 1 +
+ mesh/mesh.c           | 1 +
+ mesh/net.c            | 2 +-
+ mesh/pb-adv.c         | 1 +
+ mesh/prov-acceptor.c  | 1 +
+ mesh/prov-initiator.c | 1 +
+ 9 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/appkey.c b/mesh/appkey.c
+index 6c65454c1..a455c83b6 100644
+--- a/mesh/appkey.c
++++ b/mesh/appkey.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/crypto.c b/mesh/crypto.c
+index cebdffe45..e1689c6d7 100644
+--- a/mesh/crypto.c
++++ b/mesh/crypto.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include <linux/if_alg.h>
+diff --git a/mesh/friend.c b/mesh/friend.c
+index da2772870..ee48a3cc7 100644
+--- a/mesh/friend.c
++++ b/mesh/friend.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/manager.c b/mesh/manager.c
+index 501ec10fe..6b6219c56 100644
+--- a/mesh/manager.c
++++ b/mesh/manager.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/mesh.c b/mesh/mesh.c
+index b660a7ef2..3ea8b2cb4 100644
+--- a/mesh/mesh.c
++++ b/mesh/mesh.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-io.h"
+diff --git a/mesh/net.c b/mesh/net.c
+index 2785039db..740e3c3af 100644
+--- a/mesh/net.c
++++ b/mesh/net.c
+@@ -22,7 +22,7 @@
+ #endif
+ 
+ #define _GNU_SOURCE
+-
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
+index 6b4a70052..481f4ac8d 100644
+--- a/mesh/pb-adv.c
++++ b/mesh/pb-adv.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "mesh/mesh-defs.h"
+diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
+index 57eb1e750..50989b217 100644
+--- a/mesh/prov-acceptor.c
++++ b/mesh/prov-acceptor.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+diff --git a/mesh/prov-initiator.c b/mesh/prov-initiator.c
+index eb59f53f1..65cf194e6 100644
+--- a/mesh/prov-initiator.c
++++ b/mesh/prov-initiator.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <sys/time.h>
+ #include <ell/ell.h>
+ 
+ #include "src/shared/ecc.h"
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
new file mode 100644
index 00000000000..0de1d253c1f
--- /dev/null
+++ b/srcpkgs/bluez/patches/0005-include-limits.h-for-musl-build.patch
@@ -0,0 +1,66 @@
+From 9ac712db3c9913d6e00635e120d77541dcc51b6b Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:13 +0700
+Subject: [PATCH 5/9] include limits.h for musl build
+
+---
+ mesh/keyring.c          | 2 +-
+ mesh/mesh-config-json.c | 1 +
+ mesh/node.c             | 1 +
+ mesh/util.c             | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mesh/keyring.c b/mesh/keyring.c
+index 3a7f92f9f..d5765983c 100644
+--- a/mesh/keyring.c
++++ b/mesh/keyring.c
+@@ -24,9 +24,9 @@
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <dirent.h>
+ 
+ #include <sys/stat.h>
+ 
+diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
+index cafa2fdd7..74ca49590 100644
+--- a/mesh/mesh-config-json.c
++++ b/mesh/mesh-config-json.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <ftw.h>
+ #include <libgen.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/mesh/node.c b/mesh/node.c
+index b6824f505..15dcb977f 100644
+--- a/mesh/node.c
++++ b/mesh/node.c
+@@ -23,6 +23,7 @@
+ 
+ #define _GNU_SOURCE
+ #include <dirent.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <sys/time.h>
+ 
+diff --git a/mesh/util.c b/mesh/util.c
+index 1455bdec3..e441a2ed8 100644
+--- a/mesh/util.c
++++ b/mesh/util.c
+@@ -24,6 +24,7 @@
+ #define _GNU_SOURCE
+ #include <dirent.h>
+ #include <ftw.h>
++#include <limits.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <sys/time.h>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/musl.patch b/srcpkgs/bluez/patches/0006-musl-fix.patch
similarity index 52%
rename from srcpkgs/bluez/patches/musl.patch
rename to srcpkgs/bluez/patches/0006-musl-fix.patch
index 033a1165fd5..ab0a588137e 100644
--- a/srcpkgs/bluez/patches/musl.patch
+++ b/srcpkgs/bluez/patches/0006-musl-fix.patch
@@ -1,10 +1,20 @@
+From d1d8408c9a7c7b5ffa30371f246cc18085e11313 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 13:00:27 +0700
+Subject: [PATCH 6/9] musl fix
+
 Including <linux/if_bridge.h> causes the inclusion of <linux/in6.h>,
 which defines 'struct in6_addr', already defined in <netinet/in.h>.
 Remove <linux/if_bridge.h> to fix musl build.
+---
+ tools/bneptest.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
---- tools/bneptest.c.orig	2015-07-30 21:17:18.000000000 +0200
-+++ tools/bneptest.c	2017-03-01 19:27:43.579458817 +0100
-@@ -36,7 +36,6 @@
+diff --git a/tools/bneptest.c b/tools/bneptest.c
+index 8bc7596b6..6b3956cfa 100644
+--- a/tools/bneptest.c
++++ b/tools/bneptest.c
+@@ -37,7 +37,6 @@
  #include <net/if.h>
  #include <linux/sockios.h>
  #include <netinet/in.h>
@@ -12,7 +22,7 @@ Remove <linux/if_bridge.h> to fix musl build.
  
  #include <glib.h>
  
-@@ -50,6 +49,9 @@
+@@ -51,6 +50,9 @@
  #include "lib/bnep.h"
  #include "profiles/network/bnep.h"
  
@@ -22,3 +32,6 @@ Remove <linux/if_bridge.h> to fix musl build.
  enum {
  	MODE_LISTEN,
  	MODE_CONNECT,
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0007-include-string.h.patch b/srcpkgs/bluez/patches/0007-include-string.h.patch
new file mode 100644
index 00000000000..e1cff41df49
--- /dev/null
+++ b/srcpkgs/bluez/patches/0007-include-string.h.patch
@@ -0,0 +1,25 @@
+From fe1a76a03b9cbc28621d53680eb9ff4a2bd31778 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Thu, 3 Oct 2019 16:31:01 +0700
+Subject: [PATCH 7/9] include string.h
+
+---
+ android/client/if-hf-client.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c
+index f701a814c..b44eb4291 100644
+--- a/android/client/if-hf-client.c
++++ b/android/client/if-hf-client.c
+@@ -16,6 +16,8 @@
+  */
+ 
+ #define _GNU_SOURCE
++#include <string.h>
++
+ #include "if-main.h"
+ #include "../hal-utils.h"
+ 
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
new file mode 100644
index 00000000000..ec8a1f554af
--- /dev/null
+++ b/srcpkgs/bluez/patches/0008-grant-permission-to-bluetooth-group.patch
@@ -0,0 +1,27 @@
+From 05853e46e66868228468fc73d86f221b12edaef1 Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Fri, 4 Oct 2019 11:36:47 +0700
+Subject: [PATCH 8/9] grant permission to bluetooth group
+
+---
+ src/bluetooth.conf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/bluetooth.conf b/src/bluetooth.conf
+index 8a1e25801..75dd7d670 100644
+--- a/src/bluetooth.conf
++++ b/src/bluetooth.conf
+@@ -22,6 +22,10 @@
+     <allow send_interface="org.mpris.MediaPlayer2.Player"/>
+   </policy>
+ 
++  <policy group="bluetooth">
++    <allow send_destination="org.bluez"/>
++  </policy>
++
+   <policy context="default">
+     <allow send_destination="org.bluez"/>
+   </policy>
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
new file mode 100644
index 00000000000..b78dd879800
--- /dev/null
+++ b/srcpkgs/bluez/patches/0009-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch
@@ -0,0 +1,51 @@
+From 3b357802d24ae4f918a1b001b6930280909ef87e Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: [PATCH 9/9] adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0  btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1  0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+    adapter=0x556fe53f7c70) at src/adapter.c:543
+2  new_settings_callback (index=<optimized out>, length=<optimized out>,
+    param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3  0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+    status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+    length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4  0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+    user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5  0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+    cond=<optimized out>, user_data=<optimized out>)
+    at src/shared/io-glib.c:170
+6  0x00007fe351c980e5 in g_main_context_dispatch ()
+   from /usr/lib64/libglib-2.0.so.0
+7  0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8  0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9  0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+    at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/adapter.c b/src/adapter.c
+index cef25616f..17018ecac 100644
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -546,7 +546,8 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
+ 		g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ 					ADAPTER_INTERFACE, "Discoverable");
+ 		store_adapter_info(adapter);
+-		btd_adv_manager_refresh(adapter->adv_manager);
++		if (adapter->supported_settings & MGMT_SETTING_LE)
++			btd_adv_manager_refresh(adapter->adv_manager);
+ 	}
+ 
+ 	if (changed_mask & MGMT_SETTING_BONDABLE) {
+-- 
+2.23.0
+
diff --git a/srcpkgs/bluez/template b/srcpkgs/bluez/template
index c096e8386f7..9286b93a542 100644
--- a/srcpkgs/bluez/template
+++ b/srcpkgs/bluez/template
@@ -1,21 +1,33 @@
 # Template file for 'bluez'
 pkgname=bluez
-version=5.50
-revision=5
+version=5.51
+revision=1
 build_style=gnu-configure
 configure_args="--with-udevdir=/usr/lib/udev --disable-systemd
- --enable-sixaxis --enable-threads --enable-library --enable-deprecated"
+ --enable-sixaxis --enable-threads --enable-library --enable-deprecated
+ $(vopt_enable mesh) $(vopt_enable nfc)"
 hostmakedepends="automake flex libtool pkg-config"
 makedepends="cups-devel eudev-libudev-devel libglib-devel libical-devel
- readline-devel"
+ readline-devel $(vopt_if mesh json-c-devel)"
 short_desc="Bluetooth tools and daemons"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Doan Tran Cong Danh <congdanhqx@gmail.com>"
 license="GPL-2.0-or-later, LGPL-2.1-or-later"
 homepage="http://www.bluez.org/"
 distfiles="${KERNEL_SITE}/bluetooth/$pkgname-$version.tar.xz"
-checksum=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
+checksum=ebedfb359f62957940822f1d0b39fcee30422380e435608dad06bb3913d5ebba
 conf_files="/etc/bluetooth/main.conf"
 system_groups="bluetooth"
+build_options="mesh nfc"
+patch_args="-Np1"
+
+post_patch() {
+	find android -name '*.h' -exec \
+		sed -i\
+			-e 's/__BEGIN_DECLS/#ifdef __cplusplus\nextern "C" {\n#endif/' \
+			-e 's/__END_DECLS/#ifdef __cplusplus\n}\n#endif/' \
+			-e '/#include .sys\/cdefs.h/d' \
+			{} +
+}
 
 pre_configure() {
 	autoreconf -fi
@@ -24,6 +36,9 @@ pre_configure() {
 post_install() {
 	vinstall ${wrksrc}/src/main.conf 644 etc/bluetooth
 	vsv bluetoothd
+	if [ $build_option_mesh ]; then
+		vsv bluetooth-meshd
+	fi
 }
 
 libbluetooth_package() {
@@ -68,4 +83,3 @@ bluez-deprecated_package() {
 		vmove usr/share/man/man1/sdptool.1
 	}
 }
-

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (11 preceding siblings ...)
  2019-10-04 10:26 ` voidlinux-github
@ 2019-10-04 10:31 ` voidlinux-github
  2019-10-07  9:28 ` [PR PATCH] [Merged]: " voidlinux-github
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-04 10:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

New comment by zdtcd on void-packages repository

https://github.com/void-linux/void-packages/pull/14996#issuecomment-538343694

Comment:
I'm testing mesh option.
My laptop has NFC but I haven't figure out how to enable it.

Hence, I leave those option disabled by default for now.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Merged]: bluez: update to 5.51.
  2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
                   ` (12 preceding siblings ...)
  2019-10-04 10:31 ` voidlinux-github
@ 2019-10-07  9:28 ` voidlinux-github
  13 siblings, 0 replies; 15+ messages in thread
From: voidlinux-github @ 2019-10-07  9:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

There's a merged pull request on the void-packages repository

bluez: update to 5.51.
https://github.com/void-linux/void-packages/pull/14996

Description:


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-10-07  9:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03 10:38 [PR PATCH] [WIP] bluez: update to 5.51 voidlinux-github
2019-10-03 10:48 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-03 10:48 ` voidlinux-github
2019-10-04  4:39 ` voidlinux-github
2019-10-04  4:39 ` voidlinux-github
2019-10-04  9:51 ` voidlinux-github
2019-10-04  9:51 ` voidlinux-github
2019-10-04  9:53 ` voidlinux-github
2019-10-04  9:53 ` voidlinux-github
2019-10-04 10:25 ` voidlinux-github
2019-10-04 10:25 ` voidlinux-github
2019-10-04 10:26 ` voidlinux-github
2019-10-04 10:26 ` voidlinux-github
2019-10-04 10:31 ` voidlinux-github
2019-10-07  9:28 ` [PR PATCH] [Merged]: " voidlinux-github

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).