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