| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=5 |
| CROS_WORKON_COMMIT="a27c2e84964615fded123086a7d9b139b6e9e1b4" |
| CROS_WORKON_TREE=("6f3abf0e1487e52593fe1b4fc780df5844fa9cc1" "acb56fc1943e108b75ed8a972641a10616afaa88" "dc1506ef7c8cfd2c5ffd1809dac05596ec18773c") |
| CROS_WORKON_LOCALNAME="platform2" |
| CROS_WORKON_PROJECT="chromiumos/platform2" |
| CROS_WORKON_OUTOFTREE_BUILD=1 |
| CROS_WORKON_INCREMENTAL_BUILD=1 |
| CROS_WORKON_SUBTREE="common-mk bluetooth .gn" |
| |
| PLATFORM_SUBDIR="bluetooth" |
| |
| inherit cros-workon platform |
| |
| DESCRIPTION="Bluetooth service for Chromium OS" |
| HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/bluetooth" |
| |
| LICENSE="BSD-Google" |
| SLOT="0" |
| KEYWORDS="*" |
| IUSE="seccomp" |
| |
| RDEPEND=" |
| chromeos-base/libbrillo |
| chromeos-base/newblue |
| net-wireless/bluez" |
| |
| DEPEND="${RDEPEND} |
| chromeos-base/system_api" |
| |
| src_install() { |
| dobin init/scripts/bluetooth-setup.sh |
| dobin "${OUT}"/btdispatch |
| dobin "${OUT}"/newblued |
| |
| insinto /etc/dbus-1/system.d |
| doins dbus/org.chromium.Bluetooth.conf |
| doins dbus/org.chromium.Newblue.conf |
| |
| insinto /etc/init |
| doins init/upstart/bluetooth-setup.conf |
| doins init/upstart/btdispatch.conf |
| doins init/upstart/newblued.conf |
| |
| if use seccomp; then |
| # Install seccomp policy files. |
| insinto /usr/share/policy |
| newins "seccomp_filters/btdispatch-seccomp-${ARCH}.policy" btdispatch-seccomp.policy |
| newins "seccomp_filters/newblued-seccomp-${ARCH}.policy" newblued-seccomp.policy |
| else |
| # Remove seccomp flags from minijail parameters. |
| sed -i '/^env seccomp_flags=/s:=.*:="":' "${ED}"/etc/init/btdispatch.conf || die |
| sed -i '/^env seccomp_flags=/s:=.*:="":' "${ED}"/etc/init/newblued.conf || die |
| fi |
| } |
| |
| platform_pkg_test() { |
| platform_test "run" "${OUT}/bluetooth_test" |
| } |