summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2020-01-25 03:58:32 -0500
committerMike Frysinger <vapier@gentoo.org>2020-01-25 03:58:58 -0500
commit62cb6701ed08aaa7afcc397577bb4734293ebdc2 (patch)
treedc51bd38c876148b40f521e0f9734e1116948fbb /sys-apps/minijail
parentwww-client/vivaldi-snapshot: Old (diff)
downloadgentoo-62cb6701ed08aaa7afcc397577bb4734293ebdc2.tar.gz
gentoo-62cb6701ed08aaa7afcc397577bb4734293ebdc2.tar.bz2
gentoo-62cb6701ed08aaa7afcc397577bb4734293ebdc2.zip
sys-apps/minijail: version bump to 12
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sys-apps/minijail')
-rw-r--r--sys-apps/minijail/Manifest1
-rw-r--r--sys-apps/minijail/files/minijail-12-makefile.patch41
-rw-r--r--sys-apps/minijail/minijail-12.ebuild77
3 files changed, 119 insertions, 0 deletions
diff --git a/sys-apps/minijail/Manifest b/sys-apps/minijail/Manifest
index 96fa50c32caa..b48d120cca46 100644
--- a/sys-apps/minijail/Manifest
+++ b/sys-apps/minijail/Manifest
@@ -1 +1,2 @@
+DIST minijail-12.tar.gz 157030 BLAKE2B 55a1bb2aeb31290c211da8b8322672abadab7a2729b0afd6eafce9854a51320a2515bedc54864debc7ede6e437607dad8532ae76c14828d6c4f4265fec404dbe SHA512 feb829fc113f0041b9ab25e845560af47408f3d5f0704cdf756d0b8162ae7aae331c350908c3b17a4a5593ffa7326044f222a35e6794471cd5ed60173b2befa2
DIST minijail-9.tar.gz 118700 BLAKE2B 7d2959d5dd71bd9d8d8a0b7c278dab66771740f73acec20f19502da33990ca858796b4734676ffedc404cef72eee8c419c669ba7092ac00cbafa2e410564aba2 SHA512 6d05fbe8615f410e8314045d11f7a3638f563f3311f7d52b5a0c47cad8692d11b0a7db4fbb45141b56453a9beb0de7683d58e5298f0a27029aa017539bb48717
diff --git a/sys-apps/minijail/files/minijail-12-makefile.patch b/sys-apps/minijail/files/minijail-12-makefile.patch
new file mode 100644
index 000000000000..10d97197bb02
--- /dev/null
+++ b/sys-apps/minijail/files/minijail-12-makefile.patch
@@ -0,0 +1,41 @@
+--- a/Makefile
++++ b/Makefile
+@@ -46,9 +46,9 @@ ifeq ($(USE_SYSTEM_GTEST),no)
+ GTEST_CXXFLAGS := -std=gnu++14
+ GTEST_LIBS := gtest.a
+ else
+-GTEST_CXXFLAGS := $(shell gtest-config --cxxflags 2>/dev/null || \
++GTEST_CXXFLAGS ?= $(shell gtest-config --cxxflags 2>/dev/null || \
+ echo "-pthread")
+-GTEST_LIBS := $(shell gtest-config --libs 2>/dev/null || \
++GTEST_LIBS ?= $(shell gtest-config --libs 2>/dev/null || \
+ echo "-lgtest -pthread -lpthread")
+ endif
+
+@@ -73,6 +73,7 @@ clean: CLEAN(minijail0)
+
+
+ CC_LIBRARY(libminijail.so): LDLIBS += -lcap
++CC_LIBRARY(libminijail.so): LDFLAGS += -Wl,-soname,libminijail.so
+ CC_LIBRARY(libminijail.so): $(CORE_OBJECT_FILES)
+ clean: CLEAN(libminijail.so)
+
+@@ -91,6 +92,7 @@ TEST(CXX_BINARY(libminijail_unittest)): CC_LIBRARY(libminijailpreload.so)
+
+
+ CC_LIBRARY(libminijailpreload.so): LDLIBS += -lcap -ldl
++CC_LIBRARY(libminijailpreload.so): LDFLAGS += -Wl,-soname,libminijail.so
+ CC_LIBRARY(libminijailpreload.so): libminijailpreload.o $(CORE_OBJECT_FILES)
+ clean: CLEAN(libminijailpreload.so)
+
+--- a/common.mk
++++ b/common.mk
+@@ -323,7 +323,7 @@ COMMON_CFLAGS := -Wall -Wunused -Wno-unused-parameter -Werror -Wformat=2 \
+ -fno-strict-aliasing $(SSP_CFLAGS) -O1
+ CXXFLAGS += $(COMMON_CFLAGS) $(COMMON_CFLAGS-$(CXXDRIVER)) -std=gnu++14
+ CFLAGS += $(COMMON_CFLAGS) $(COMMON_CFLAGS-$(CDRIVER)) -std=gnu11
+-CPPFLAGS += -D_FORTIFY_SOURCE=2
++CPPFLAGS +=
+
+ # Enable large file support.
+ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
diff --git a/sys-apps/minijail/minijail-12.ebuild b/sys-apps/minijail/minijail-12.ebuild
new file mode 100644
index 000000000000..bf20c5f832a1
--- /dev/null
+++ b/sys-apps/minijail/minijail-12.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2020 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 ~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"
+)
+
+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
+}