bluez5.inc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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"
  5. LICENSE = "GPLv2+ & LGPLv2.1+"
  6. LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
  7. file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
  8. file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
  9. DEPENDS = "udev dbus-glib glib-2.0"
  10. PROVIDES += "bluez-hcidump"
  11. RPROVIDES_${PN} += "bluez-hcidump"
  12. RCONFLICTS_${PN} = "bluez4"
  13. PACKAGECONFIG ??= "obex-profiles \
  14. readline \
  15. ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
  16. a2dp-profiles \
  17. avrcp-profiles \
  18. network-profiles \
  19. hid-profiles \
  20. hog-profiles \
  21. tools \
  22. deprecated \
  23. "
  24. PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
  25. PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline,"
  26. PACKAGECONFIG[testing] = "--enable-testing,--disable-testing"
  27. PACKAGECONFIG[midi] = "--enable-midi,--disable-midi,alsa-lib"
  28. PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd"
  29. PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,,cups"
  30. PACKAGECONFIG[nfc] = "--enable-nfc,--disable-nfc"
  31. PACKAGECONFIG[sap-profiles] = "--enable-sap,--disable-sap"
  32. PACKAGECONFIG[a2dp-profiles] = "--enable-a2dp,--disable-a2dp"
  33. PACKAGECONFIG[avrcp-profiles] = "--enable-avrcp,--disable-avrcp"
  34. PACKAGECONFIG[network-profiles] = "--enable-network,--disable-network"
  35. PACKAGECONFIG[hid-profiles] = "--enable-hid,--disable-hid"
  36. PACKAGECONFIG[hog-profiles] = "--enable-hog,--disable-hog"
  37. PACKAGECONFIG[health-profiles] = "--enable-health,--disable-health"
  38. PACKAGECONFIG[sixaxis] = "--enable-sixaxis,--disable-sixaxis"
  39. PACKAGECONFIG[tools] = "--enable-tools,--disable-tools"
  40. PACKAGECONFIG[threads] = "--enable-threads,--disable-threads"
  41. PACKAGECONFIG[deprecated] = "--enable-deprecated,--disable-deprecated"
  42. PACKAGECONFIG[mesh] = "--enable-mesh,--disable-mesh, json-c ell"
  43. PACKAGECONFIG[btpclient] = "--enable-btpclient,--disable-btpclient, ell"
  44. SRC_URI = "\
  45. ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
  46. file://out-of-tree.patch \
  47. file://init \
  48. file://run-ptest \
  49. ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
  50. file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
  51. file://0001-test-gatt-Fix-hung-issue.patch \
  52. file://0001-Makefile.am-Fix-a-race-issue-for-tools.patch \
  53. file://CVE-2018-10910.patch \
  54. "
  55. S = "${WORKDIR}/bluez-${PV}"
  56. CVE_PRODUCT = "bluez"
  57. inherit autotools pkgconfig systemd update-rc.d distro_features_check ptest gobject-introspection-data
  58. EXTRA_OECONF = "\
  59. --enable-test \
  60. --enable-datafiles \
  61. --enable-library \
  62. "
  63. # bluez5 builds a large number of useful utilities but does not
  64. # install them. Specify which ones we want put into ${PN}-noinst-tools.
  65. NOINST_TOOLS_READLINE ??= ""
  66. NOINST_TOOLS_TESTING ??= ""
  67. NOINST_TOOLS_BT ??= ""
  68. NOINST_TOOLS = " \
  69. ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \
  70. ${@bb.utils.contains('PACKAGECONFIG', 'testing', '${NOINST_TOOLS_TESTING}', '', d)} \
  71. ${@bb.utils.contains('PACKAGECONFIG', 'tools', '${NOINST_TOOLS_BT}', '', d)} \
  72. "
  73. do_install_append() {
  74. install -d ${D}${INIT_D_DIR}
  75. install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
  76. install -d ${D}${sysconfdir}/bluetooth/
  77. if [ -f ${S}/profiles/network/network.conf ]; then
  78. install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
  79. fi
  80. if [ -f ${S}/profiles/input/input.conf ]; then
  81. install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
  82. fi
  83. if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
  84. sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
  85. fi
  86. # Install desired tools that upstream leaves in build area
  87. for f in ${NOINST_TOOLS} ; do
  88. install -m 755 ${B}/$f ${D}/${bindir}
  89. done
  90. # Patch python tools to use Python 3; they should be source compatible, but
  91. # still refer to Python 2 in the shebang
  92. sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/bluez/test/*
  93. }
  94. PACKAGES =+ "${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
  95. FILES_${PN} += " \
  96. ${libdir}/bluetooth/plugins/*.so \
  97. ${systemd_unitdir}/ ${datadir}/dbus-1 \
  98. ${libdir}/cups \
  99. "
  100. FILES_${PN}-dev += " \
  101. ${libdir}/bluetooth/plugins/*.la \
  102. "
  103. FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
  104. ${exec_prefix}/lib/systemd/user/obex.service \
  105. ${datadir}/dbus-1/services/org.bluez.obex.service \
  106. "
  107. SYSTEMD_SERVICE_${PN}-obex = "obex.service"
  108. FILES_${PN}-testtools = "${libdir}/bluez/test/*"
  109. def get_noinst_tools_paths (d, bb, tools):
  110. s = list()
  111. bindir = d.getVar("bindir")
  112. for bdp in tools.split():
  113. f = os.path.basename(bdp)
  114. s.append("%s/%s" % (bindir, f))
  115. return "\n".join(s)
  116. FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}"
  117. RDEPENDS_${PN}-testtools += "python3 python3-dbus"
  118. RDEPENDS_${PN}-testtools += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)}"
  119. SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'bluetooth.service', '', d)}"
  120. INITSCRIPT_PACKAGES = "${PN}"
  121. INITSCRIPT_NAME_${PN} = "bluetooth"
  122. do_compile_ptest() {
  123. oe_runmake buildtests
  124. }
  125. do_install_ptest() {
  126. cp -r ${B}/unit/ ${D}${PTEST_PATH}
  127. rm -f ${D}${PTEST_PATH}/unit/*.o
  128. }