| # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=4 |
| |
| CROS_WORKON_BLACKLIST=1 |
| CROS_WORKON_LOCALNAME="aosp/external/minijail" |
| CROS_WORKON_PROJECT="platform/external/minijail" |
| CROS_WORKON_REPO="https://android.googlesource.com" |
| CROS_WORKON_DESTDIR="${S}" |
| |
| inherit cros-debug cros-workon eutils toolchain-funcs |
| |
| DESCRIPTION="Chrome OS helper binary for restricting privs of services." |
| HOMEPAGE="http://www.chromium.org/" |
| SRC_URI="" |
| |
| LICENSE="BSD-Google" |
| SLOT="0" |
| KEYWORDS="~*" |
| IUSE="+seccomp test" |
| |
| RDEPEND="sys-libs/libcap" |
| DEPEND="test? ( dev-cpp/gtest ) |
| test? ( dev-cpp/gmock ) |
| ${RDEPEND}" |
| |
| src_compile() { |
| tc-export CC CXX AR RANLIB LD NM PKG_CONFIG |
| cros-debug-add-NDEBUG |
| export CCFLAGS="$CFLAGS" |
| |
| # Only build the tools. |
| emake LIBDIR=$(get_libdir) USE_seccomp=$(usex seccomp) |
| } |
| |
| src_test() { |
| tc-export CC CXX AR RANLIB LD NM PKG_CONFIG |
| cros-debug-add-NDEBUG |
| export CCFLAGS="$CFLAGS" |
| |
| # TODO(crbug.com/689060): Re-enable on ARM. |
| if use x86 || use amd64 ; then |
| emake USE_SYSTEM_GTEST=yes tests |
| fi |
| } |
| |
| src_install() { |
| into / |
| dosbin minijail0 |
| dolib.so libminijail.so |
| dolib.so libminijailpreload.so |
| |
| local include_dir="/usr/include/chromeos" |
| |
| "${S}"/platform2_preinstall.sh "${PV}" "${include_dir}" |
| insinto "/usr/$(get_libdir)/pkgconfig" |
| doins libminijail.pc |
| |
| insinto "${include_dir}" |
| doins libminijail.h |
| doins scoped_minijail.h |
| } |