sdk_version.conf: updating TC_PATH, SDK_LATEST_VERSION
[chromiumos/overlays/chromiumos-overlay.git] / chromeos-base / metrics / metrics-9999.ebuild
1 # Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="4"
5 CROS_WORKON_PROJECT="chromiumos/platform/metrics"
6
7 inherit cros-debug cros-workon
8
9 DESCRIPTION="Chrome OS Metrics Collection Utilities"
10 HOMEPAGE="http://www.chromium.org/"
11 SRC_URI=""
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~x86"
16 IUSE="platform2"
17
18 LIBCHROME_VERS="180609"
19
20 RDEPEND="chromeos-base/libchrome:${LIBCHROME_VERS}[cros-debug=]
21         chromeos-base/libchromeos
22         dev-cpp/gflags
23         dev-libs/dbus-glib
24         >=dev-libs/glib-2.0
25         sys-apps/dbus
26         sys-apps/rootdev
27         "
28 DEPEND="${RDEPEND}
29         chromeos-base/system_api
30         dev-cpp/gmock
31         dev-cpp/gtest
32         "
33
34 src_configure() {
35         use platform2 && return 0
36         cros-workon_src_configure
37 }
38
39 src_compile() {
40         use platform2 && return 0
41         tc-export CXX AR PKG_CONFIG
42         cros-debug-add-NDEBUG
43         export BASE_VER=${LIBCHROME_VERS}
44         emake
45 }
46
47 src_test() {
48         use platform2 && return 0
49         tc-export CXX AR PKG_CONFIG
50         cros-debug-add-NDEBUG
51         emake tests
52         if ! use x86 && ! use amd64 ; then
53                 elog "Skipping unit tests on non-x86 platform"
54         else
55                 for test in ./*_test; do
56                         # Always test the shared object we just built by
57                         # adding . to the library path.
58                         LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH} \
59                         "${test}" ${GTEST_ARGS} || die "${test} failed"
60                 done
61         fi
62 }
63
64 src_install() {
65         use platform2 && return 0
66         dobin metrics_{client,daemon} syslog_parser.sh
67
68         dolib.so libmetrics.so
69
70         insinto /usr/include/metrics
71         doins c_metrics_library.h metrics_library{,_mock}.h timer{,_mock}.h
72 }