]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/bluez5_utils/bluez5_utils.mk
31898556249fc30fceaa6e1a66ba2827d5f14497
[coffee/buildroot.git] / package / bluez5_utils / bluez5_utils.mk
1 ################################################################################
2 #
3 # bluez5_utils
4 #
5 ################################################################################
6
7 BLUEZ5_UTILS_VERSION = 5.49
8 BLUEZ5_UTILS_SOURCE = bluez-$(BLUEZ5_UTILS_VERSION).tar.xz
9 BLUEZ5_UTILS_SITE = $(BR2_KERNEL_MIRROR)/linux/bluetooth
10 BLUEZ5_UTILS_INSTALL_STAGING = YES
11 BLUEZ5_UTILS_DEPENDENCIES = dbus libglib2
12 BLUEZ5_UTILS_LICENSE = GPL-2.0+, LGPL-2.1+
13 BLUEZ5_UTILS_LICENSE_FILES = COPYING COPYING.LIB
14 # 0001-bt_shell-APIs-shall-only-be-build-if-readline-is-pre.patch
15 BLUEZ5_UTILS_AUTORECONF = YES
16
17 BLUEZ5_UTILS_CONF_OPTS = \
18         --enable-tools \
19         --enable-library \
20         --disable-cups
21
22 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_OBEX),y)
23 BLUEZ5_UTILS_CONF_OPTS += --enable-obex
24 BLUEZ5_UTILS_DEPENDENCIES += libical
25 else
26 BLUEZ5_UTILS_CONF_OPTS += --disable-obex
27 endif
28
29 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_CLIENT),y)
30 BLUEZ5_UTILS_CONF_OPTS += --enable-client
31 BLUEZ5_UTILS_DEPENDENCIES += readline
32 else
33 BLUEZ5_UTILS_CONF_OPTS += --disable-client
34 endif
35
36 # experimental plugins
37 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL),y)
38 BLUEZ5_UTILS_CONF_OPTS += --enable-experimental
39 else
40 BLUEZ5_UTILS_CONF_OPTS += --disable-experimental
41 endif
42
43 # enable health plugin
44 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_HEALTH),y)
45 BLUEZ5_UTILS_CONF_OPTS += --enable-health
46 else
47 BLUEZ5_UTILS_CONF_OPTS += --disable-health
48 endif
49
50 # enable midi profile
51 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_MIDI),y)
52 BLUEZ5_UTILS_CONF_OPTS += --enable-midi
53 BLUEZ5_UTILS_DEPENDENCIES += alsa-lib
54 else
55 BLUEZ5_UTILS_CONF_OPTS += --disable-midi
56 endif
57
58 # enable nfc plugin
59 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_NFC),y)
60 BLUEZ5_UTILS_CONF_OPTS += --enable-nfc
61 else
62 BLUEZ5_UTILS_CONF_OPTS += --disable-nfc
63 endif
64
65 # enable sap plugin
66 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_SAP),y)
67 BLUEZ5_UTILS_CONF_OPTS += --enable-sap
68 else
69 BLUEZ5_UTILS_CONF_OPTS += --disable-sap
70 endif
71
72 # enable sixaxis plugin
73 ifeq ($(BR2_PACKAGE_BLUEZ5_PLUGINS_SIXAXIS),y)
74 BLUEZ5_UTILS_CONF_OPTS += --enable-sixaxis
75 else
76 BLUEZ5_UTILS_CONF_OPTS += --disable-sixaxis
77 endif
78
79 # install gatttool (For some reason upstream choose not to do it by default)
80 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED),y)
81 define BLUEZ5_UTILS_INSTALL_GATTTOOL
82         $(INSTALL) -D -m 0755 $(@D)/attrib/gatttool $(TARGET_DIR)/usr/bin/gatttool
83 endef
84 BLUEZ5_UTILS_POST_INSTALL_TARGET_HOOKS += BLUEZ5_UTILS_INSTALL_GATTTOOL
85 # hciattach_bcm43xx defines default firmware path in `/etc/firmware`, but
86 # Broadcom firmware blobs are usually located in `/lib/firmware`.
87 BLUEZ5_UTILS_CONF_ENV += \
88         CPPFLAGS='$(TARGET_CPPFLAGS) -DFIRMWARE_DIR=\"/lib/firmware\"'
89 BLUEZ5_UTILS_CONF_OPTS += --enable-deprecated
90 else
91 BLUEZ5_UTILS_CONF_OPTS += --disable-deprecated
92 endif
93
94 # enable test
95 ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_TEST),y)
96 BLUEZ5_UTILS_CONF_OPTS += --enable-test
97 else
98 BLUEZ5_UTILS_CONF_OPTS += --disable-test
99 endif
100
101 # use udev if available
102 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
103 BLUEZ5_UTILS_CONF_OPTS += --enable-udev
104 BLUEZ5_UTILS_DEPENDENCIES += udev
105 else
106 BLUEZ5_UTILS_CONF_OPTS += --disable-udev
107 endif
108
109 # integrate with systemd if available
110 ifeq ($(BR2_PACKAGE_SYSTEMD),y)
111 BLUEZ5_UTILS_CONF_OPTS += --enable-systemd
112 BLUEZ5_UTILS_DEPENDENCIES += systemd
113 else
114 BLUEZ5_UTILS_CONF_OPTS += --disable-systemd
115 endif
116
117 define BLUEZ5_UTILS_INSTALL_INIT_SYSTEMD
118         mkdir -p $(TARGET_DIR)/etc/systemd/system/bluetooth.target.wants
119         ln -fs ../../../../usr/lib/systemd/system/bluetooth.service \
120                 $(TARGET_DIR)/etc/systemd/system/bluetooth.target.wants/bluetooth.service
121         ln -fs ../../../usr/lib/systemd/system/bluetooth.service \
122                 $(TARGET_DIR)/etc/systemd/system/dbus-org.bluez.service
123 endef
124
125 $(eval $(autotools-package))