xref: /openbmc/openbmc/poky/meta/recipes-connectivity/bluez5/bluez5.inc (revision c9537f57ab488bf5d90132917b0184e2527970a5)
1SUMMARY = "Linux Bluetooth Stack Userland V5"
2DESCRIPTION = "Linux Bluetooth stack V5 userland components.  These include a system configurations, daemons, tools and system libraries."
3HOMEPAGE = "http://www.bluez.org"
4SECTION = "libs"
5LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
7                    file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
8                    file://src/main.c;beginline=1;endline=24;md5=0ad83ca0dc37ab08af448777c581e7ac"
9DEPENDS = "dbus glib-2.0"
10PROVIDES += "bluez-hcidump"
11RPROVIDES:${PN} += "bluez-hcidump"
12
13RCONFLICTS:${PN} = "bluez4"
14
15PACKAGECONFIG ??= "obex-profiles \
16    readline \
17    ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
18    a2dp-profiles \
19    avrcp-profiles \
20    bap-profiles \
21    bass-profiles \
22    mcp-profiles \
23    ccp-profiles \
24    vcp-profiles \
25    micp-profiles \
26    csip-profiles \
27    asha-profiles \
28    network-profiles \
29    hid-profiles \
30    hog-profiles \
31    tools \
32    deprecated \
33    udev \
34"
35PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
36PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline,"
37PACKAGECONFIG[testing] = "--enable-testing,--disable-testing"
38PACKAGECONFIG[midi] = "--enable-midi,--disable-midi,alsa-lib"
39PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd"
40PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,,cups"
41PACKAGECONFIG[nfc] = "--enable-nfc,--disable-nfc"
42PACKAGECONFIG[sap-profiles] = "--enable-sap,--disable-sap"
43PACKAGECONFIG[a2dp-profiles] = "--enable-a2dp,--disable-a2dp"
44PACKAGECONFIG[avrcp-profiles] = "--enable-avrcp,--disable-avrcp"
45PACKAGECONFIG[network-profiles] = "--enable-network,--disable-network"
46PACKAGECONFIG[hid-profiles] = "--enable-hid,--disable-hid"
47PACKAGECONFIG[hog-profiles] = "--enable-hog,--disable-hog"
48PACKAGECONFIG[health-profiles] = "--enable-health,--disable-health"
49PACKAGECONFIG[bap-profiles] = "--enable-bap,--disable-bap"
50PACKAGECONFIG[bass-profiles] = "--enable-bass,--disable-bass"
51PACKAGECONFIG[mcp-profiles] = "--enable-mcp,--disable-mcp"
52PACKAGECONFIG[ccp-profiles] = "--enable-ccp,--disable-ccp"
53PACKAGECONFIG[vcp-profiles] = "--enable-vcp,--disable-vcp"
54PACKAGECONFIG[micp-profiles] = "--enable-micp,--disable-micp"
55PACKAGECONFIG[csip-profiles] = "--enable-csip,--disable-csip"
56PACKAGECONFIG[asha-profiles] = "--enable-asha,--disable-asha"
57PACKAGECONFIG[sixaxis] = "--enable-sixaxis,--disable-sixaxis"
58PACKAGECONFIG[tools] = "--enable-tools,--disable-tools"
59PACKAGECONFIG[threads] = "--enable-threads,--disable-threads"
60PACKAGECONFIG[deprecated] = "--enable-deprecated,--disable-deprecated"
61PACKAGECONFIG[mesh] = "--enable-mesh --enable-external-ell,--disable-mesh, json-c ell"
62PACKAGECONFIG[btpclient] = "--enable-btpclient --enable-external-ell,--disable-btpclient, ell"
63PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
64PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,python3-docutils-native"
65
66SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
67           file://init \
68           file://run-ptest \
69           file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
70           file://0001-bluez5-disable-aics-tests.patch \
71           "
72S = "${WORKDIR}/bluez-${PV}"
73
74CVE_PRODUCT = "bluez"
75
76inherit autotools pkgconfig systemd update-rc.d ptest gobject-introspection-data
77
78EXTRA_OECONF = "\
79  --enable-test \
80  --enable-datafiles \
81  --enable-library \
82  --enable-pie  \
83  --without-zsh-completion-dir \
84"
85
86CFLAGS += "-DFIRMWARE_DIR=\\"${nonarch_base_libdir}/firmware\\""
87
88# bluez5 builds a large number of useful utilities but does not
89# install them.  Specify which ones we want put into ${PN}-noinst-tools.
90NOINST_TOOLS_READLINE ??= ""
91NOINST_TOOLS_TESTING ??= ""
92NOINST_TOOLS_BT ??= ""
93NOINST_TOOLS = " \
94    ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \
95    ${@bb.utils.contains('PACKAGECONFIG', 'testing', '${NOINST_TOOLS_TESTING}', '', d)} \
96    ${@bb.utils.contains('PACKAGECONFIG', 'tools', '${NOINST_TOOLS_BT}', '', d)} \
97"
98
99do_install:append() {
100	install -d ${D}${INIT_D_DIR}
101	install -m 0755 ${UNPACKDIR}/init ${D}${INIT_D_DIR}/bluetooth
102
103	if [ -f ${D}${sysconfdir}/init.d/bluetooth ]; then
104		sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${sysconfdir}/init.d/bluetooth
105	fi
106
107	# Install desired tools that upstream leaves in build area
108	for f in ${NOINST_TOOLS} ; do
109		install -m 755 ${B}/$f ${D}${bindir}
110	done
111}
112
113PACKAGES =+ "${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
114
115FILES:${PN} += " \
116    ${libdir}/bluetooth/plugins/*.so \
117    ${systemd_unitdir}/ ${datadir}/dbus-1 \
118    ${libdir}/cups \
119"
120FILES:${PN}-dev += " \
121    ${libdir}/bluetooth/plugins/*.la \
122"
123
124FILES:${PN}-obex = "${libexecdir}/bluetooth/obexd \
125                    ${exec_prefix}/lib/systemd/user/obex.service \
126                    ${systemd_system_unitdir}/obex.service \
127                    ${sysconfdir}/systemd/system/multi-user.target.wants/obex.service \
128                    ${datadir}/dbus-1/services/org.bluez.obex.service \
129                    ${sysconfdir}/dbus-1/system.d/obexd.conf \
130                   "
131SYSTEMD_SERVICE:${PN}-obex = "obex.service"
132
133FILES:${PN}-testtools = "${libdir}/bluez/test/*"
134
135def get_noinst_tools_paths (d, bb, tools):
136    s = list()
137    bindir = d.getVar("bindir")
138    for bdp in tools.split():
139        f = os.path.basename(bdp)
140        s.append("%s/%s" % (bindir, f))
141    return "\n".join(s)
142
143FILES:${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}"
144
145RDEPENDS:${PN}-testtools += "python3-core python3-dbus"
146RDEPENDS:${PN}-testtools += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)}"
147
148SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'bluetooth.service', '', d)}"
149INITSCRIPT_PACKAGES = "${PN}"
150INITSCRIPT_NAME:${PN} = "bluetooth"
151
152do_compile_ptest() {
153	oe_runmake buildtests
154}
155
156do_install_ptest() {
157	cp -r ${B}/unit/ ${D}${PTEST_PATH}
158	rm -f ${D}${PTEST_PATH}/unit/*.o
159}
160
161RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-gconv-utf-16"
162