blob: ecefb7b593e8b7fc6f11832bb6adc3ad48e7c906 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "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 = "GPLv2+ & LGPLv2.1+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
7 file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
8 file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
9DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck readline"
10PROVIDES += "bluez-hcidump"
11RPROVIDES_${PN} += "bluez-hcidump"
12
13RCONFLICTS_${PN} = "bluez4"
14
15PACKAGECONFIG ??= "obex-profiles"
16PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
17PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
18
19SRC_URI = "\
20 ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060021 file://out-of-tree.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022 file://init \
23 file://run-ptest \
24 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
25 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026"
27S = "${WORKDIR}/bluez-${PV}"
28
Patrick Williamsc0f7c042017-02-23 20:41:17 -060029inherit autotools pkgconfig systemd update-rc.d distro_features_check ptest
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030
31EXTRA_OECONF = "\
32 --enable-tools \
33 --disable-cups \
34 --enable-test \
35 --enable-datafiles \
36 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)} \
37 --enable-library \
38"
39
40# bluez5 builds a large number of useful utilities but does not
41# install them. Specify which ones we want put into ${PN}-noinst-tools.
42NOINST_TOOLS_READLINE ??= ""
43NOINST_TOOLS_EXPERIMENTAL ??= ""
44NOINST_TOOLS = " \
45 ${NOINST_TOOLS_READLINE} \
46 ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', d)} \
47"
48
49do_install_append() {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050050 install -d ${D}${INIT_D_DIR}
51 install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
52
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 install -d ${D}${sysconfdir}/bluetooth/
54 if [ -f ${S}/profiles/audio/audio.conf ]; then
55 install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
56 fi
57 if [ -f ${S}/profiles/network/network.conf ]; then
58 install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
59 fi
60 if [ -f ${S}/profiles/input/input.conf ]; then
61 install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
62 fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050063
Patrick Williamsc0f7c042017-02-23 20:41:17 -060064 if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
65 sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
66 fi
67
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068 # Install desired tools that upstream leaves in build area
69 for f in ${NOINST_TOOLS} ; do
70 install -m 755 ${B}/$f ${D}/${bindir}
71 done
Patrick Williamsc0f7c042017-02-23 20:41:17 -060072
73 # Patch python tools to use Python 3; they should be source compatible, but
74 # still refer to Python 2 in the shebang
75 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/bluez/test/*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076}
77
78ALLOW_EMPTY_libasound-module-bluez = "1"
79PACKAGES =+ "libasound-module-bluez ${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
80
81FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060082FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${systemd_unitdir}/ ${datadir}/dbus-1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083FILES_${PN}-dev += "\
84 ${libdir}/bluetooth/plugins/*.la \
85 ${libdir}/alsa-lib/*.la \
86"
87
88FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
89 ${exec_prefix}/lib/systemd/user/obex.service \
90 ${datadir}/dbus-1/services/org.bluez.obex.service \
91 "
92SYSTEMD_SERVICE_${PN}-obex = "obex.service"
93
94FILES_${PN}-testtools = "${libdir}/bluez/test/*"
95
96def get_noinst_tools_paths (d, bb, tools):
97 s = list()
98 bindir = d.getVar("bindir", True)
99 for bdp in tools.split():
100 f = os.path.basename(bdp)
101 s.append("%s/%s" % (bindir, f))
102 return "\n".join(s)
103
104FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS', True))}"
105
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600106RDEPENDS_${PN}-testtools += "python3 python3-dbus python3-pygobject"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500107
108SYSTEMD_SERVICE_${PN} = "bluetooth.service"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500109INITSCRIPT_PACKAGES = "${PN}"
110INITSCRIPT_NAME_${PN} = "bluetooth"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111
112EXCLUDE_FROM_WORLD = "1"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500113
114do_compile_ptest() {
115 oe_runmake buildtests
116}
117
118do_install_ptest() {
119 cp -r ${B}/unit/ ${D}${PTEST_PATH}
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600120 rm -f ${D}${PTEST_PATH}/unit/*.o
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500121}