Gentoo Archives: gentoo-commits

From: Sergey Popov <pinkbyte@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/proot/, sys-apps/proot/files/
Date: Fri, 21 Jan 2022 09:05:53
Message-Id: 1642755939.b678ff1362a8416e109899b4794446c8380dbd5f.pinkbyte@gentoo
1 commit: b678ff1362a8416e109899b4794446c8380dbd5f
2 Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 21 09:02:19 2022 +0000
4 Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 21 09:05:39 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b678ff13
7
8 sys-apps/proot: version bump
9
10 Closes: https://bugs.gentoo.org/716836
11 Closes: https://bugs.gentoo.org/829854
12 Package-Manager: Portage-3.0.28, Repoman-3.0.3
13 Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
14
15 sys-apps/proot/Manifest | 1 +
16 .../proot/files/proot-5.3.0-lib-paths-fix.patch | 21 +++++++
17 sys-apps/proot/files/proot-5.3.0-makefile.patch | 11 ++++
18 sys-apps/proot/proot-5.3.0.ebuild | 72 ++++++++++++++++++++++
19 4 files changed, 105 insertions(+)
20
21 diff --git a/sys-apps/proot/Manifest b/sys-apps/proot/Manifest
22 index 37f988ee1d1a..c2ba3bb5e4d5 100644
23 --- a/sys-apps/proot/Manifest
24 +++ b/sys-apps/proot/Manifest
25 @@ -1 +1,2 @@
26 DIST proot-5.1.0.tar.gz 253251 BLAKE2B 8dc147d6c6ee303baf0c86f2fa4a8c17a58e76d9da9432635fc70ee06a65aa748ad617735012a1a18a520775fbe38c2264dcccefb681e8e829a5e7e1ddb05cca SHA512 26be26d405a8bcbe94377c3e9c18a571e4b61e3074f0716b0db3517d147d9d4a07c80f7312171cf9580ac7748e72e688efaf1b8e4a0ca3bfc31c802aa351346f
27 +DIST proot-5.3.0.tar.gz 224436 BLAKE2B 431ea8e1d1de5b9babe377b6f8bc04313f968dd5967f8ee4e2c8ab6be860f85cf201a6e7ca3c7299da7d142d6a034903724440ad94bd234a23df66ebc0e175ad SHA512 371767a0f759440bd9da86567c3eb81bcaea57ba93f954e858c69ae88b130d8c28fbac9d9748721f6b23e216527290d9f5cd5a9ca2809303d0aeaf53c325c161
28
29 diff --git a/sys-apps/proot/files/proot-5.3.0-lib-paths-fix.patch b/sys-apps/proot/files/proot-5.3.0-lib-paths-fix.patch
30 new file mode 100644
31 index 000000000000..188caa4eaf41
32 --- /dev/null
33 +++ b/sys-apps/proot/files/proot-5.3.0-lib-paths-fix.patch
34 @@ -0,0 +1,21 @@
35 +--- a/src/execve/ldso.c 2022-01-21 11:42:37.539816477 +0300
36 ++++ b/src/execve/ldso.c 2022-01-21 11:42:40.490817464 +0300
37 +@@ -506,18 +506,10 @@
38 + /* 6. /lib, /usr/lib + /usr/local/lib */
39 + if (IS_CLASS32(elf_header))
40 + status = add_host_ldso_paths(host_ldso_paths,
41 +-#if defined(ARCH_X86) || defined(ARCH_X86_64)
42 +- "/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:"
43 +-#endif
44 + "/lib32:/usr/lib32:/usr/local/lib32"
45 + ":/lib:/usr/lib:/usr/local/lib");
46 + else
47 + status = add_host_ldso_paths(host_ldso_paths,
48 +-#if defined(ARCH_X86_64)
49 +- "/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:"
50 +-#elif defined(ARCH_ARM64)
51 +- "/lib/aarch64-linux-gnu:/usr/lib/aarch64-linux-gnu:"
52 +-#endif
53 + "/lib64:/usr/lib64:/usr/local/lib64"
54 + ":/lib:/usr/lib:/usr/local/lib");
55 + if (status < 0)
56
57 diff --git a/sys-apps/proot/files/proot-5.3.0-makefile.patch b/sys-apps/proot/files/proot-5.3.0-makefile.patch
58 new file mode 100644
59 index 000000000000..15d7fc916b0e
60 --- /dev/null
61 +++ b/sys-apps/proot/files/proot-5.3.0-makefile.patch
62 @@ -0,0 +1,11 @@
63 +--- a/src/GNUmakefile 2022-01-21 11:40:00.957743804 +0300
64 ++++ b/src/GNUmakefile 2022-01-21 11:40:34.876741798 +0300
65 +@@ -21,8 +21,8 @@
66 + HAS_PYTHON_CONFIG := $(shell ${PYTHON}-config --ldflags ${PYTHON_EMBED} 2>/dev/null)
67 +
68 + CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH)
69 +-CFLAGS += -g -Wall -Wextra -O2
70 ++CFLAGS += -Wall -Wextra
71 + CFLAGS += $(shell pkg-config --cflags talloc libarchive)
72 + LDFLAGS += -Wl,-z,noexecstack
73 + LDFLAGS += $(shell pkg-config --libs talloc libarchive)
74
75 diff --git a/sys-apps/proot/proot-5.3.0.ebuild b/sys-apps/proot/proot-5.3.0.ebuild
76 new file mode 100644
77 index 000000000000..c9e3baeeab35
78 --- /dev/null
79 +++ b/sys-apps/proot/proot-5.3.0.ebuild
80 @@ -0,0 +1,72 @@
81 +# Copyright 1999-2022 Gentoo Authors
82 +# Distributed under the terms of the GNU General Public License v2
83 +
84 +EAPI=8
85 +MY_PN="PRoot"
86 +
87 +inherit toolchain-funcs
88 +
89 +SRC_URI="https://github.com/proot-me/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
90 +KEYWORDS="~amd64 ~x86"
91 +
92 +DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
93 +HOMEPAGE="https://proot-me.github.io"
94 +
95 +LICENSE="GPL-2"
96 +SLOT="0"
97 +IUSE="care doc test"
98 +
99 +RDEPEND="care? ( app-arch/libarchive:0= )
100 + sys-libs/talloc"
101 +BDEPEND="dev-python/docutils"
102 +DEPEND="${RDEPEND}
103 + care? ( dev-libs/uthash )
104 + test? ( dev-util/valgrind )"
105 +
106 +# Breaks sandbox
107 +RESTRICT="test"
108 +
109 +PATCHES=(
110 + "${FILESDIR}/${PN}-5.3.0-makefile.patch"
111 + "${FILESDIR}/${PN}-5.3.0-lib-paths-fix.patch"
112 +)
113 +
114 +src_compile() {
115 + # build the proot and care targets
116 + emake -C src V=1 \
117 + CC="$(tc-getCC)" \
118 + OBJCOPY="$(tc-getOBJCOPY)" \
119 + OBJDUMP="$(tc-getOBJDUMP)" \
120 + STRIP="$(tc-getSTRIP)" \
121 + CHECK_VERSION="true" \
122 + CAREBUILDENV="ok" \
123 + proot $(use care && echo "care")
124 + emake -C doc SUFFIX=".py" proot/man.1
125 +}
126 +
127 +src_install() {
128 + use care && dobin src/care
129 + dobin src/proot
130 + dodoc doc/proot/*.rst
131 + newman doc/proot/man.1 proot.1
132 +}
133 +
134 +src_test() {
135 + emake -C tests -j1 CC="$(tc-getCC)"
136 +}
137 +
138 +pkg_postinst() {
139 + elog "If you have segfaults on recent (>4.8) kernels"
140 + elog "try to disable seccomp support like so:"
141 + elog "'export PROOT_NO_SECCOMP=1'"
142 + elog "prior to running proot"
143 +
144 + if use care; then
145 + elog "You have enabled 'care' USE flag, that builds and installs"
146 + elog "dynamically linked care binary."
147 + elog "Upstream does NOT support such way of building CARE,"
148 + elog "it provides only prebuilt binaries."
149 + elog "CARE also has known problems on hardened systems"
150 + elog "Please do NOT file bugs about them to https://bugs.gentoo.org"
151 + fi
152 +}