Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
Date: Thu, 19 May 2022 03:33:12
Message-Id: 1652930197.2a5e6fa4194077e9d9d3df3596ff84ea10dd91c3.sam@gentoo
1 commit: 2a5e6fa4194077e9d9d3df3596ff84ea10dd91c3
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 19 03:16:37 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu May 19 03:16:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a5e6fa4
7
8 sys-process/criu: add 3.17
9
10 Closes: https://bugs.gentoo.org/841014
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 sys-process/criu/Manifest | 1 +
14 sys-process/criu/criu-3.17.ebuild | 164 +++++++++++++++++++++
15 .../criu/files/criu-3.17-amdgpu-build-fixes.patch | 98 ++++++++++++
16 3 files changed, 263 insertions(+)
17
18 diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
19 index afc75c58706a..4f343f4a67bd 100644
20 --- a/sys-process/criu/Manifest
21 +++ b/sys-process/criu/Manifest
22 @@ -1,3 +1,4 @@
23 DIST criu-3.14.tar.bz2 881407 BLAKE2B 418412681baf7ec9d3a03afe3860590c857bffcb6c57d01e60b77e85dd5ba2b30deee280c884ba1574665be5fcfd03f3cc058a4b7ae08f66aabe63a80373089b SHA512 97d064c5ffc41daf6e89edd6208b30e4198f313afc6d621d0dc74dadf94c303be70ba448d4e1ced9500f1c65f1bd12206eb88883be398911cc2c995310b17cc6
24 DIST criu-3.15.tar.bz2 913904 BLAKE2B 2a3c7ad7ac32a407493e8908886d2929606e1dd0a1dd499be75cb954c1c4d60d0c59f0524d173dcdd89fa638e1edcc0c31886262069e3478173648ef09b4c159 SHA512 7bfd32053e47b95d10cdd5e99494bff6a21aa3179518179f8c72e870f0aab960dd76c9f6cb6982e5b881472cf6962eefee3cf7d8ae9128b3379bcaecc937ebbc
25 DIST criu-3.16.1.tar.gz 1228535 BLAKE2B 45aa87ee00a18b91474e767dc0326cce6c0942af7771a0c5536751361c171c86ba2065c54587e82b51fd6d7ab116e659324369955086c5237cd7fd26b60d6ce6 SHA512 a558af41f1927a1b1d87f8d11163a5f3d2e4f83a74aba00619b45a6d464d5477a6a0aac3c1b9d9a17e3343a4bf21a3fd6b279b51fa0c347c86c307381a4d0739
26 +DIST criu-3.17.tar.gz 1321713 BLAKE2B 3bc13a7df0da0a17c74e0c12f07b81fe7f294be4d1980647b64c74e35383416ffbc10e7c04398f307bc68ff701f76a9586ea58825057b0df16b40f6aab3cbd0e SHA512 febae66a7820345c0f335f4a49e64c0af5c8ae5d3a394cc0770881b64eab11ca03ad5872f06b0c4ccd1da844c519268dad3b4f8b260267e6d3f582e80d80f804
27
28 diff --git a/sys-process/criu/criu-3.17.ebuild b/sys-process/criu/criu-3.17.ebuild
29 new file mode 100644
30 index 000000000000..4ac0facc8cc2
31 --- /dev/null
32 +++ b/sys-process/criu/criu-3.17.ebuild
33 @@ -0,0 +1,164 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +PYTHON_COMPAT=( python3_{8..10} )
40 +
41 +inherit toolchain-funcs linux-info python-r1
42 +
43 +DESCRIPTION="utility to checkpoint/restore a process tree"
44 +HOMEPAGE="
45 + https://criu.org/
46 + https://github.com/checkpoint-restore/
47 +"
48 +SRC_URI="https://github.com/checkpoint-restore/${PN}/archive/v${PV}/${P}.tar.gz"
49 +
50 +LICENSE="GPL-2 LGPL-2.1"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 -riscv"
53 +IUSE="bpf doc gnutls nftables selinux setproctitle static-libs test"
54 +
55 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
56 +
57 +COMMON_DEPEND="
58 + ${PYTHON_DEPS}
59 + >=dev-libs/protobuf-c-1.4.0:=
60 + dev-libs/libnl:3=
61 + net-libs/libnet:1.1=
62 + sys-libs/libcap:=
63 + bpf? ( dev-libs/libbpf:= )
64 + gnutls? ( net-libs/gnutls:= )
65 + nftables? ( net-libs/gnutls:= )
66 + selinux? ( sys-libs/libselinux:= )
67 + setproctitle? ( dev-libs/libbsd:= )
68 +"
69 +DEPEND="${COMMON_DEPEND}"
70 +BDEPEND="
71 + dev-python/setuptools[${PYTHON_USEDEP}]
72 + doc? (
73 + app-text/asciidoc
74 + app-text/xmlto
75 + )
76 +"
77 +RDEPEND="
78 + ${COMMON_DEPEND}
79 + dev-python/protobuf-python[${PYTHON_USEDEP}]
80 +"
81 +
82 +CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
83 + ~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
84 +
85 +# root access required for tests
86 +RESTRICT="!test? ( test )"
87 +
88 +PATCHES=(
89 + "${FILESDIR}/2.2/criu-2.2-flags.patch"
90 + "${FILESDIR}/2.3/criu-2.3-no-git.patch"
91 + "${FILESDIR}/criu-3.12-automagic-libbsd.patch"
92 + "${FILESDIR}/criu-3.16.1-buildsystem.patch"
93 +
94 + "${FILESDIR}/${P}-amdgpu-build-fixes.patch"
95 +)
96 +
97 +criu_arch() {
98 + # criu infers the arch from $(uname -m). We never want this to happen.
99 + case ${ARCH} in
100 + amd64) echo "x86";;
101 + arm64) echo "aarch64";;
102 + ppc64*) echo "ppc64";;
103 + *) echo "${ARCH}";;
104 + esac
105 +}
106 +
107 +pkg_setup() {
108 + use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
109 + linux-info_pkg_setup
110 +}
111 +
112 +src_prepare() {
113 + default
114 +
115 + use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
116 +}
117 +
118 +criu_use() {
119 + if ! use "${1}"; then
120 + sed \
121 + -e "s:${2:-${1}}:no_${2:-lib${1}}:g" \
122 + -i Makefile.config || die
123 + fi
124 +}
125 +
126 +src_configure() {
127 + # Gold linker generates invalid object file when used with criu's custom
128 + # linker script. Use the bfd linker instead. See https://crbug.com/839665#c3
129 + tc-ld-disable-gold
130 +
131 + # Build system uses this variable as a trigger to append coverage flags
132 + # we'd like to avoid it. https://bugs.gentoo.org/744244
133 + unset GCOV
134 +
135 + # we have to sed the Makdfile.config to disable automagic deps
136 + criu_use selinux
137 + criu_use bpf
138 + criu_use nftables
139 +
140 + emake_opts=(
141 + SETPROCTITLE="$(usex setproctitle)"
142 + NO_GNUTLS="$(usex gnutls '' '1')"
143 + )
144 +
145 + python_setup
146 +}
147 +
148 +criu_emake() {
149 + emake \
150 + AR="$(tc-getAR)" \
151 + ARCH="$(criu_arch)" \
152 + CC="$(tc-getCC)" \
153 + FULL_PYTHON="${PYTHON%.*}" \
154 + HOSTCC="$(tc-getBUILD_CC)" \
155 + LD="$(tc-getLD)" \
156 + LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
157 + LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
158 + OBJCOPY="$(tc-getOBJCOPY)" \
159 + PKG_CONFIG="$(tc-getPKG_CONFIG)" \
160 + PREFIX="${EPREFIX}"/usr \
161 + PYTHON="${EPYTHON%.*}" \
162 + V=1 WERROR=0 DEBUG=0 \
163 + "${emake_opts[@]}" \
164 + "${@}"
165 +}
166 +
167 +build_crit() {
168 + "${EPYTHON}" scripts/crit-setup.py build || die
169 +}
170 +
171 +src_compile() {
172 + local -a targets=(
173 + all
174 + $(usex doc 'docs' '')
175 + )
176 + criu_emake ${targets}
177 +}
178 +
179 +src_test() {
180 + criu_emake unittest
181 +}
182 +
183 +install_crit() {
184 + "${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
185 + python_optimize
186 +}
187 +
188 +src_install() {
189 + criu_emake DESTDIR="${D}" install
190 + python_foreach_impl install_crit
191 +
192 + dodoc CREDITS README.md
193 +
194 + if ! use static-libs; then
195 + find "${D}" -name "*.a" -delete || die
196 + fi
197 +}
198
199 diff --git a/sys-process/criu/files/criu-3.17-amdgpu-build-fixes.patch b/sys-process/criu/files/criu-3.17-amdgpu-build-fixes.patch
200 new file mode 100644
201 index 000000000000..913737215e49
202 --- /dev/null
203 +++ b/sys-process/criu/files/criu-3.17-amdgpu-build-fixes.patch
204 @@ -0,0 +1,98 @@
205 +https://github.com/checkpoint-restore/criu/commit/cd0ed7e5491c7c827b887b2d80cf35e87819278b.patch
206 +https://github.com/checkpoint-restore/criu/commit/2b3763fe6a39033d4e3d3d80e28911d1737ac23b.patch
207 +
208 +From cd0ed7e5491c7c827b887b2d80cf35e87819278b Mon Sep 17 00:00:00 2001
209 +From: Radostin Stoyanov <rstoyanov@×××××××××××××.org>
210 +Date: Sun, 15 May 2022 17:08:18 +0100
211 +Subject: [PATCH] amdgpu/Makefile: Fix include path
212 +
213 +When building packages for CRIU the source directory might have a
214 +name different than 'criu'.
215 +
216 +Fixes: #1877
217 +
218 +Reported-by: @siris
219 +Signed-off-by: Radostin Stoyanov <rstoyanov@×××××××××××××.org>
220 +--- a/plugins/amdgpu/Makefile
221 ++++ b/plugins/amdgpu/Makefile
222 +@@ -2,7 +2,7 @@ PLUGIN_NAME := amdgpu_plugin
223 + PLUGIN_SOBJ := amdgpu_plugin.so
224 +
225 +
226 +-PLUGIN_INCLUDE := -iquote../../../criu/include
227 ++PLUGIN_INCLUDE := -iquote../../include
228 + PLUGIN_INCLUDE += -iquote../../criu/include
229 + PLUGIN_INCLUDE += -iquote../../criu/arch/$(ARCH)/include/
230 + PLUGIN_INCLUDE += -iquote../../
231 +
232 +
233 +From 2b3763fe6a39033d4e3d3d80e28911d1737ac23b Mon Sep 17 00:00:00 2001
234 +From: Radostin Stoyanov <rstoyanov@×××××××××××××.org>
235 +Date: Sun, 8 May 2022 11:07:25 +0100
236 +Subject: [PATCH] amdgpu: Set PLUGINDIR to /usr/lib/criu
237 +
238 +Building the criu packages for Ubuntu/Debian fails with:
239 +
240 + mkdir: cannot create directory '/var/lib/criu': Permission denied
241 +
242 +This patch updates PLUGINDIR with the value /usr/lib/criu
243 +
244 +Fixes: #1877
245 +
246 +Signed-off-by: Radostin Stoyanov <rstoyanov@×××××××××××××.org>
247 +--- a/Makefile.install
248 ++++ b/Makefile.install
249 +@@ -7,7 +7,7 @@ MANDIR ?= $(PREFIX)/share/man
250 + INCLUDEDIR ?= $(PREFIX)/include
251 + LIBEXECDIR ?= $(PREFIX)/libexec
252 + RUNDIR ?= /run
253 +-PLUGINDIR ?= /var/lib/criu
254 ++PLUGINDIR ?= $(PREFIX)/lib/criu
255 +
256 + #
257 + # For recent Debian/Ubuntu with multiarch support.
258 +--- a/criu/include/plugin.h
259 ++++ b/criu/include/plugin.h
260 +@@ -5,7 +5,9 @@
261 + #include "common/compiler.h"
262 + #include "common/list.h"
263 +
264 +-#define CR_PLUGIN_DEFAULT "/var/lib/criu/"
265 ++#ifndef CR_PLUGIN_DEFAULT
266 ++#define CR_PLUGIN_DEFAULT "/usr/lib/criu/"
267 ++#endif
268 +
269 + void cr_plugin_fini(int stage, int err);
270 + int cr_plugin_init(int stage);
271 +--- a/plugins/amdgpu/Makefile
272 ++++ b/plugins/amdgpu/Makefile
273 +@@ -15,7 +15,7 @@ DEPS_NOK := ;
274 + include $(__nmk_dir)msg.mk
275 +
276 + CC := gcc
277 +-PLUGIN_CFLAGS := -g -Wall -Werror -D _GNU_SOURCE -shared -nostartfiles -fPIC
278 ++PLUGIN_CFLAGS := -g -Wall -Werror -D _GNU_SOURCE -shared -nostartfiles -fPIC -DCR_PLUGIN_DEFAULT="$(PLUGINDIR)"
279 + PLUGIN_LDFLAGS := -lpthread -lrt -ldrm -ldrm_amdgpu
280 +
281 + ifeq ($(CONFIG_AMDGPU),y)
282 +@@ -50,16 +50,16 @@ clean: amdgpu_plugin_clean amdgpu_plugin_test_clean
283 + mrproper: clean
284 +
285 + install:
286 +- $(Q) mkdir -p $(PLUGINDIR)
287 + ifeq ($(CONFIG_AMDGPU),y)
288 ++ $(Q) mkdir -p $(DESTDIR)$(PLUGINDIR)
289 + $(E) " INSTALL " $(PLUGIN_NAME)
290 +- $(Q) install -m 644 $(PLUGIN_SOBJ) $(PLUGINDIR)
291 ++ $(Q) install -m 644 $(PLUGIN_SOBJ) $(DESTDIR)$(PLUGINDIR)
292 + endif
293 + .PHONY: install
294 +
295 + uninstall:
296 + ifeq ($(CONFIG_AMDGPU),y)
297 + $(E) " UNINSTALL" $(PLUGIN_NAME)
298 +- $(Q) $(RM) $(PLUGINDIR)/$(PLUGIN_SOBJ)
299 ++ $(Q) $(RM) $(DESTDIR)$(PLUGINDIR)/$(PLUGIN_SOBJ)
300 + endif
301 + .PHONY: uninstall
302 +