1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils flag-o-matic multilib-minimal multiprocessing pax-utils
8 DESCRIPTION="sandbox'd LD_PRELOAD hack"
9 HOMEPAGE="https://www.gentoo.org/proj/en/portage/sandbox/"
10 SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
17 DEPEND="app-arch/xz-utils
18 >=app-misc/pax-utils-0.1.19" #265376
21 has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
23 sandbox_death_notice() {
24 ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
25 ewarn "FEATURES='-sandbox -usersandbox' emerge sandbox"
28 multilib_src_configure() {
29 filter-lfs-flags #90228
32 host-is-pax && myconf+=( --disable-pch ) #301299 #425524 #572092
39 # Default sandbox build will run with --jobs set to # cpus.
40 emake check TESTSUITEFLAGS="--jobs=$(makeopts_jobs)"
43 multilib_src_install_all() {
44 doenvd "${FILESDIR}"/09sandbox
46 keepdir /var/log/sandbox
47 fowners root:portage /var/log/sandbox
48 fperms 0770 /var/log/sandbox
50 dodoc AUTHORS ChangeLog* NEWS README
54 chown root:portage "${ED}"/var/log/sandbox
55 chmod 0770 "${ED}"/var/log/sandbox
58 for v in ${REPLACING_VERSIONS}; do
59 if [[ ${v} == 1.* ]] ; then
60 local old=$(find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
61 if [[ -n ${old} ]] ; then
62 elog "Removing old sandbox libraries for you:"
63 find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -print -delete
71 for v in ${REPLACING_VERSIONS}; do
72 if [[ ${v} == 1.* ]] ; then
73 chmod 0755 "${EROOT}"/etc/sandbox.d #265376