2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
2022-03-19 02:16:23 +00:00
|
|
|
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_NAME="bluez"
|
2024-01-22 14:52:33 +00:00
|
|
|
PKG_VERSION="5.72"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LICENSE="GPL"
|
|
|
|
PKG_SITE="http://www.bluez.org/"
|
2022-03-19 02:16:23 +00:00
|
|
|
PKG_URL="https://www.kernel.org/pub/linux/bluetooth/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
2023-11-29 05:19:27 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain dbus glib readline systemd json-c alsa-lib"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LONGDESC="Bluetooth Tools and System Daemons for Linux."
|
|
|
|
PKG_TOOLCHAIN="autotools"
|
|
|
|
PKG_BUILD_FLAGS="+lto"
|
|
|
|
|
|
|
|
if build_with_debug; then
|
|
|
|
BLUEZ_CONFIG="--enable-debug"
|
|
|
|
else
|
|
|
|
BLUEZ_CONFIG="--disable-debug"
|
|
|
|
fi
|
|
|
|
|
2023-08-09 10:29:28 +00:00
|
|
|
BLUEZ_CONFIG+=" --enable-monitor --enable-test"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET="--disable-dependency-tracking \
|
|
|
|
--disable-silent-rules \
|
2022-11-08 21:17:24 +00:00
|
|
|
--enable-library \
|
2022-02-05 14:23:32 +00:00
|
|
|
--enable-udev \
|
|
|
|
--disable-cups \
|
|
|
|
--disable-obex \
|
|
|
|
--enable-client \
|
|
|
|
--enable-systemd \
|
2023-08-09 10:29:28 +00:00
|
|
|
--enable-tools \
|
|
|
|
--enable-deprecated \
|
2022-02-05 14:23:32 +00:00
|
|
|
--enable-datafiles \
|
2022-03-19 02:16:23 +00:00
|
|
|
--disable-manpages \
|
2022-02-05 14:23:32 +00:00
|
|
|
--disable-experimental \
|
|
|
|
--enable-sixaxis \
|
2023-08-09 10:29:28 +00:00
|
|
|
--enable-sap \
|
|
|
|
--enable-a2dp \
|
|
|
|
--enable-avrcp \
|
2023-11-28 22:53:30 +00:00
|
|
|
--enable-btpclient \
|
|
|
|
--enable-midi \
|
|
|
|
--enable-mesh \
|
|
|
|
--enable-hid2hci \
|
|
|
|
--enable-experimental \
|
2023-08-09 10:29:28 +00:00
|
|
|
--enable-hid \
|
2022-02-05 14:23:32 +00:00
|
|
|
--with-gnu-ld \
|
2022-03-19 02:16:23 +00:00
|
|
|
${BLUEZ_CONFIG} \
|
2022-02-05 14:23:32 +00:00
|
|
|
storagedir=/storage/.cache/bluetooth"
|
|
|
|
|
|
|
|
pre_configure_target() {
|
|
|
|
# bluez fails to build in subdirs
|
2022-03-19 02:16:23 +00:00
|
|
|
cd ${PKG_BUILD}
|
|
|
|
rm -rf .${TARGET_NAME}
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-19 02:16:23 +00:00
|
|
|
export LIBS="-lncurses -ltinfo"
|
|
|
|
}
|
|
|
|
|
|
|
|
post_configure_target() {
|
|
|
|
libtool_remove_rpath libtool
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
post_makeinstall_target() {
|
2022-03-19 02:16:23 +00:00
|
|
|
safe_remove ${INSTALL}/usr/lib/systemd
|
|
|
|
safe_remove ${INSTALL}/usr/bin/bluemoon
|
|
|
|
safe_remove ${INSTALL}/usr/bin/ciptool
|
|
|
|
safe_remove ${INSTALL}/usr/share/dbus-1
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-11-28 22:53:30 +00:00
|
|
|
mkdir -p ${INSTALL}/etc/dbus-1/system.d
|
|
|
|
cp src/bluetooth.conf ${INSTALL}/etc/dbus-1/system.d
|
|
|
|
|
2022-03-19 02:16:23 +00:00
|
|
|
mkdir -p ${INSTALL}/etc/bluetooth
|
|
|
|
cp src/main.conf ${INSTALL}/etc/bluetooth
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2024-01-22 14:52:33 +00:00
|
|
|
cat <<EOF >${INSTALL}/etc/bluetooth/input.conf
|
|
|
|
[General]
|
|
|
|
ClassicBondedOnly=false
|
|
|
|
EOF
|
|
|
|
|
2022-03-19 02:16:23 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/share/services
|
|
|
|
cp -P ${PKG_DIR}/default.d/*.conf ${INSTALL}/usr/share/services
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2024-01-22 14:52:33 +00:00
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
# bluez looks in /etc/firmware/
|
2022-03-19 02:16:23 +00:00
|
|
|
ln -sf /usr/lib/firmware ${INSTALL}/etc/firmware
|
|
|
|
|
2022-11-10 21:38:33 +00:00
|
|
|
# libbluetooth required for bluez-alsa
|
2022-11-08 21:17:24 +00:00
|
|
|
# sed -i 's/-lbluetooth//g' ${PKG_BUILD}/lib/bluez.pc
|
2022-03-19 02:16:23 +00:00
|
|
|
cp -P ${PKG_BUILD}/lib/bluez.pc ${SYSROOT_PREFIX}/usr/lib/pkgconfig
|
2022-11-08 21:17:24 +00:00
|
|
|
cp -P -r ${PKG_BUILD}/lib/bluetooth ${SYSROOT_PREFIX}/usr/include/
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
post_install() {
|
|
|
|
enable_service bluetooth-defaults.service
|
2023-01-20 03:03:40 +00:00
|
|
|
#enable_service bluetooth.service
|
2023-01-23 22:41:38 +00:00
|
|
|
#enable_service obex.service
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|