diff options
author | krishjainx <kjain7@u.rochester.edu> | 2023-06-29 03:39:29 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-06-29 12:46:57 +0100 |
commit | 185d6bf7e799347eb83dac97e676619f4f62084a (patch) | |
tree | d63fe20d41b3aad755d4842ad5ce31fa4a0347a5 /sys-apps/minijail/minijail-18.ebuild | |
parent | net-vpn/openvpn: Keyword 2.6.4 ppc, #907389 (diff) | |
download | gentoo-185d6bf7e799347eb83dac97e676619f4f62084a.tar.gz gentoo-185d6bf7e799347eb83dac97e676619f4f62084a.tar.bz2 gentoo-185d6bf7e799347eb83dac97e676619f4f62084a.zip |
sys-apps/minijail: add v18
Signed-off-by: Krish Jain <kjain7@u.rochester.edu>
Closes: https://github.com/gentoo/gentoo/pull/31663
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps/minijail/minijail-18.ebuild')
-rw-r--r-- | sys-apps/minijail/minijail-18.ebuild | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/sys-apps/minijail/minijail-18.ebuild b/sys-apps/minijail/minijail-18.ebuild new file mode 100644 index 000000000000..ed7487be73ac --- /dev/null +++ b/sys-apps/minijail/minijail-18.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit linux-info toolchain-funcs + +DESCRIPTION="helper binary and library for sandboxing & restricting privs of service" +HOMEPAGE="https://android.googlesource.com/platform/external/minijail" + +# Use GitHub mirror as Gitiles doesn't generate stable tarballs. +SRC_URI="https://github.com/google/${PN}/archive/linux-v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~riscv ~x86" +IUSE="+seccomp test" +RESTRICT="!test? ( test )" + +RDEPEND="sys-libs/libcap-ng:=" +DEPEND="${RDEPEND} + test? ( + virtual/pkgconfig + >=dev-cpp/gtest-1.8.0:= + )" + +S="${WORKDIR}/${PN}-linux-v${PV}" + +PATCHES=( + "${FILESDIR}/minijail-12-makefile.patch" + "${FILESDIR}/minijail-17-no-werror.patch" +) + +pkg_pretend() { + local CONFIG_CHECK="~NAMESPACES ~UTS_NS ~IPC_NS ~USER_NS ~PID_NS ~NET_NS + ~SECCOMP ~SECCOMP_FILTER ~CGROUPS" + check_extra_config +} + +src_configure() { + export LIBDIR="/usr/$(get_libdir)" + export USE_seccomp="$(usex seccomp)" + export USE_SYSTEM_GTEST=yes + if use test; then + export GTEST_CXXFLAGS="$($(tc-getPKG_CONFIG) --cflags gtest_main)" + export GTEST_LIBS="$($(tc-getPKG_CONFIG) --libs gtest_main)" + else + export GTEST_CXXFLAGS='' GTEST_LIBS='' + fi + export VERBOSE=1 +} + +src_compile() { + tc-env_build emake all parse_seccomp_policy +} + +src_test() { + GTEST_FILTER="-NamespaceTest.test_tmpfs_userns:NamespaceTest.test_namespaces" \ + tc-env_build emake tests +} + +src_install() { + dosbin minijail0 + dolib.so libminijail{,preload}.so + dobin parse_seccomp_policy + + doman minijail0.[15] + dodoc README.md + + local include_dir="/usr/include" + + "${S}"/platform2_preinstall.sh "${PV}" "${include_dir}" + insinto "/usr/$(get_libdir)/pkgconfig" + doins libminijail.pc + + insinto "${include_dir}" + doins libminijail.h scoped_minijail.h +} |