1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # don't monkey with this ebuild unless contacting portage devs.
11 inherit eutils flag-o-matic multilib-minimal multiprocessing pax-utils
13 DESCRIPTION="sandbox'd LD_PRELOAD hack"
14 HOMEPAGE="https://www.gentoo.org/proj/en/portage/sandbox/"
15 SRC_URI="mirror://gentoo/${P}.tar.xz
16 https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
20 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
23 DEPEND="app-arch/xz-utils
24 >=app-misc/pax-utils-0.1.19" #265376
27 has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
29 sandbox_death_notice() {
30 ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
31 ewarn "FEATURES='-sandbox -usersandbox' emerge sandbox"
35 epatch "${FILESDIR}"/${P}-memory-corruption.patch #568714
36 epatch "${FILESDIR}"/${P}-disable-same.patch
37 epatch "${FILESDIR}"/${P}-fix-opendir.patch #553092
41 multilib_src_configure() {
42 filter-lfs-flags #90228
45 host-is-pax && myconf+=( --disable-pch ) #301299 #425524 #572092
52 # Default sandbox build will run with --jobs set to # cpus.
53 emake check TESTSUITEFLAGS="--jobs=$(makeopts_jobs)"
56 multilib_src_install_all() {
57 doenvd "${FILESDIR}"/09sandbox
59 keepdir /var/log/sandbox
60 fowners root:portage /var/log/sandbox
61 fperms 0770 /var/log/sandbox
64 dodoc AUTHORS ChangeLog* NEWS README
68 chown root:portage "${ED}"/var/log/sandbox
69 chmod 0770 "${ED}"/var/log/sandbox
71 if [[ ${REPLACING_VERSIONS} == 1.* ]] ; then
72 local old=$(find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
73 if [[ -n ${old} ]] ; then
74 elog "Removing old sandbox libraries for you:"
75 find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -print -delete
81 if [[ ${REPLACING_VERSIONS} == 1.* ]] ; then
82 chmod 0755 "${EROOT}"/etc/sandbox.d #265376