blob: 8d5c5448c060c6d480e6c560f81ba98339a4c6d3 [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=4
CROS_WORKON_COMMIT="4108db99dd5026a5ee5eef1bb486a2c9c34da6de"
CROS_WORKON_TREE="9d499d7d351a956be445f889d5b377cc7f6aa754"
CROS_WORKON_PROJECT="chromiumos/platform/shill"
inherit cros-debug cros-workon toolchain-funcs multilib
DESCRIPTION="Shill Connection Manager for Chromium OS"
HOMEPAGE="http://src.chromium.org"
LICENSE="BSD"
SLOT="0"
IUSE="test -clang -asan +tpm"
KEYWORDS="amd64 arm x86"
REQUIRED_USE="asan? ( clang )"
RDEPEND="chromeos-base/bootstat
tpm? ( chromeos-base/chaps )
chromeos-base/chromeos-minijail
!<chromeos-base/flimflam-0.0.1-r530
chromeos-base/libchrome:180609[cros-debug=]
chromeos-base/libchromeos
chromeos-base/metrics
>=chromeos-base/mobile-providers-0.0.1-r12
chromeos-base/vpn-manager
dev-libs/dbus-c++
>=dev-libs/glib-2.30
dev-libs/libnl:3
dev-libs/nss
dev-libs/protobuf
net-dialup/ppp
net-dns/c-ares
net-libs/libmnl
net-libs/libnetfilter_queue
net-libs/libnfnetlink
net-misc/dhcpcd
net-misc/openvpn
net-wireless/wpa_supplicant[dbus]"
DEPEND="${RDEPEND}
chromeos-base/system_api
chromeos-base/wimax_manager
test? ( dev-cpp/gmock )
dev-cpp/gtest
virtual/modemmanager"
make_flags() {
echo LIBDIR="/usr/$(get_libdir)"
}
src_compile() {
tc-export CC CXX AR RANLIB LD NM PKG_CONFIG
cros-debug-add-NDEBUG
if use clang; then
clang-setup-env
# TODO: remove this flag (crosbug.com/33311)
export EXTRA_CXXFLAGS="-Wno-bind-to-temporary-copy"
fi
emake $(make_flags) shill shims
}
src_test() {
tc-export CC CXX AR RANLIB LD NM PKG_CONFIG
cros-debug-add-NDEBUG
# Build tests
emake $(make_flags) shill_unittest
# Run tests if we're on x86
if ! use x86 && ! use amd64 ; then
echo Skipping tests on non-x86/amd64 platform...
else
for ut in shill ; do
"${S}/${ut}_unittest" \
${GTEST_ARGS} || die "${ut}_unittest failed"
done
fi
}
src_install() {
dobin bin/ff_debug
dobin bin/mm_debug
dobin bin/set_apn
dobin bin/set_arpgw
dobin bin/shill_login_user
dobin bin/shill_logout_user
dobin bin/wpa_debug
dobin shill
# Netfilter queue helper is run directly from init, so install in sbin.
dosbin build/shims/netfilter-queue-helper
local shims_dir="/usr/$(get_libdir)/shill/shims"
exeinto "${shims_dir}"
doexe build/shims/net-diags-upload
doexe build/shims/nss-get-cert
doexe build/shims/openvpn-script
doexe build/shims/set-apn-helper
doexe build/shims/shill-pppd-plugin.so
insinto "${shims_dir}"
doins build/shims/wpa_supplicant.conf
insinto /etc
doins shims/nsswitch.conf
dosym /var/run/shill/resolv.conf /etc/resolv.conf
insinto /etc/dbus-1/system.d
doins shims/org.chromium.flimflam.conf
insinto /usr/share/shill
doins data/cellular_operator_info
# Install introspection XML
insinto /usr/share/dbus-1/interfaces
doins dbus_bindings/org.chromium.flimflam.*.xml
}