public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2015-12-08 11:39 Yixun Lan
  0 siblings, 0 replies; 13+ messages in thread
From: Yixun Lan @ 2015-12-08 11:39 UTC (permalink / raw
  To: gentoo-commits

commit:     99e2622db706cdda6a4e23b18bc5fb0d2a665fef
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  8 11:38:26 2015 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Tue Dec  8 11:38:26 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99e2622d

sys-process/criu: version bump to 1.8

Package-Manager: portage-2.2.24

 sys-process/criu/Manifest                      |  1 +
 sys-process/criu/criu-1.8.ebuild               | 72 ++++++++++++++++++++++++++
 sys-process/criu/files/criu-1.8-makefile.patch | 25 +++++++++
 3 files changed, 98 insertions(+)

diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index 03a83ef..6e51d1a 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -1,2 +1,3 @@
 DIST criu-1.6.1.tar.bz2 484598 SHA256 c74810383b7e524be0d909b9a6c1805e0887ac93cf1bfa28f00a87f395879e18 SHA512 59de498035970decc5181c3e464ccf686fce34e9fa5285d0c6777849013b8441a4338ef7f89339953ff83dcaf1b7e95dbbd54432f61a28665fbde979df5e31e8 WHIRLPOOL 07fa8490bca046a17476b59e375a287dacbb13c1a99ac0a05166c5925d997748ca506c1cf3bab2bdae832010f6d87e7aa6f4b4371ce7c7d630120a0f47f1ae23
 DIST criu-1.7.2.tar.bz2 508012 SHA256 f5d377fd2a3c8824c592f6c27147cb4d37333ca0ce8b9c6e85a8b7cd8479b21d SHA512 3e35d90b8cd66b96df193b37907825fbf785eea332146c767b267cbda5b6e1ae6a0d5570945990e4288f6406d8507f6c33a792c5db232cbaf396342a65b53de3 WHIRLPOOL 164cbc9d6a4969e6116644bded88b9aec8a9bc0fb737e69eaacd641376db7d274598ff3647a912ab19155d4097de8a1eaa5ea82642b4f3ba93c01b4a6725493d
+DIST criu-1.8.tar.bz2 534200 SHA256 d1d6693d23181b1cd7378d77c142e41bcac3cb2ae5c71ea4c5b7de01f65575bb SHA512 de3f63613124606be08e5323f465c63811c35c457f4b1a311434aeb02590ebf652845b727b9e10b8a9eb9402c97e772ff044135bec7797cc6e4ad972efc9172d WHIRLPOOL 2f2d18f5fbd1608acfd6ce9e1283cf05a1574b2a141cd4cf29bcacc370ed0bfce488187e40250edeb396daf8fc38f2a2e960ffd8773511a82eebce3a74663e9f

diff --git a/sys-process/criu/criu-1.8.ebuild b/sys-process/criu/criu-1.8.ebuild
new file mode 100644
index 0000000..120c6da
--- /dev/null
+++ b/sys-process/criu/criu-1.8.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs linux-info flag-o-matic
+
+DESCRIPTION="utility to checkpoint/restore a process tree"
+HOMEPAGE="http://criu.org/"
+SRC_URI="http://download.openvz.org/criu/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64"
+IUSE="setproctitle"
+
+RDEPEND="dev-libs/protobuf-c
+	setproctitle? ( dev-libs/libbsd )"
+DEPEND="${RDEPEND}
+	app-text/asciidoc
+	app-text/xmlto"
+
+CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
+	~IA32_EMULATION ~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG"
+
+RESTRICT="test"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-1.3.1-flags.patch
+	epatch "${FILESDIR}"/${PN}-1.8-makefile.patch
+	epatch "${FILESDIR}"/${PN}-1.7-automagic-libbsd.patch
+}
+
+criu_arch() {
+	# criu infers the arch from $(uname -m).  We never want this to happen.
+	case ${ARCH} in
+	amd64) echo "x86_64";;
+	arm64) echo "aarch64";;
+	x86)   echo "i386";;
+	*)     echo "${ARCH}";;
+	esac
+}
+
+src_compile() {
+	emake \
+		CC="$(tc-getCC)" \
+		LD="$(tc-getLD)" \
+		OBJCOPY="$(tc-getOBJCOPY)" \
+		ARCH="$(criu_arch)" \
+		V=1 WERROR=0 \
+		SETPROCTITLE=$(usex setproctitle) \
+		all docs
+}
+
+src_test() {
+	# root privileges are required to dump all necessary info
+	if [[ ${EUID} -eq 0 ]] ; then
+		emake -j1 CC="$(tc-getCC)" ARCH="$(criu_arch)" V=1 WERROR=0 test
+	fi
+}
+
+src_install() {
+	emake \
+		ARCH="$(criu_arch)" \
+		PREFIX="${EPREFIX}"/usr \
+		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
+		DESTDIR="${D}" \
+		install
+
+	dodoc CREDITS README.md
+}

diff --git a/sys-process/criu/files/criu-1.8-makefile.patch b/sys-process/criu/files/criu-1.8-makefile.patch
new file mode 100644
index 0000000..2c1921f
--- /dev/null
+++ b/sys-process/criu/files/criu-1.8-makefile.patch
@@ -0,0 +1,25 @@
+diff --git a/Makefile.inc b/Makefile.inc
+index 5f0a552..4abc9ab 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -15,16 +15,11 @@ PREFIX		?= /usr/local
+ SBINDIR		?= $(PREFIX)/sbin
+ MANDIR		?= $(PREFIX)/share/man
+ SYSTEMDUNITDIR	?= $(PREFIX)/lib/systemd/system/
+-LOGROTATEDIR	?= $(PREFIX)/etc/logrotate.d/
+-LIBDIR		?= $(PREFIX)/lib
+-# For recent Debian/Ubuntu with multiarch support
+-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture \
+-			-qDEB_HOST_MULTIARCH 2>/dev/null)
+-ifneq "$(DEB_HOST_MULTIARCH)" ""
+-LIBDIR		?= $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
+-# For most other systems
+-else ifeq "$(shell uname -m)" "x86_64"
++LOGROTATEDIR	?= $(SYSCONFDIR)/etc/logrotate.d/
++ifeq "$(shell uname -m)" "x86_64"
+ LIBDIR		?= $(PREFIX)/lib64
++else
++LIBDIR		?= $(PREFIX)/lib
+ endif
+ 
+ INCLUDEDIR	?= $(PREFIX)/include/criu


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2016-11-23 10:04 Yixun Lan
  0 siblings, 0 replies; 13+ messages in thread
From: Yixun Lan @ 2016-11-23 10:04 UTC (permalink / raw
  To: gentoo-commits

commit:     6369c31cbec6e0f4fde716eec69757801817c795
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 23 10:04:14 2016 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Wed Nov 23 10:04:55 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6369c31c

sys-process/criu: version bump

Package-Manager: portage-2.3.2

 sys-process/criu/Manifest                          |  1 +
 sys-process/criu/criu-2.8.ebuild                   | 96 ++++++++++++++++++++++
 .../criu/files/criu-2.8-automagic-libbsd.patch     | 17 ++++
 3 files changed, 114 insertions(+)

diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index 586fcb2..4384ba9 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -1,3 +1,4 @@
 DIST criu-2.5.tar.bz2 605226 SHA256 d2a9ffec0b659c3d3a71e1d473e95e36b208b2563f136ce8f471ff9600fcc51a SHA512 ccf942005ff3b2a567726ddb8aa44048c130f1adf6e2cbdf48e919043c84a4e1c03ad0ec34b44263e5764bea62807a2cc0fa1135b929ad3166fb9486c2880570 WHIRLPOOL 9896fe45d4516a73e6b7c403a044d25902ed4a9000b0a0a053ff9d52c053adfb58c8ce0225b9841bc7e2f38de6a8e4fc6d3073d878ea5b09b81cc89cba91de62
 DIST criu-2.6.tar.bz2 614488 SHA256 b85b50296175b1751fa2b26936cbcf5041d08a9fb49c32cb0f2b590e82dea322 SHA512 37c5a207803213e4a98c2ea1b8f781f6bee2d7fb3c004fae4db5c56c64f61ff3177ad3fb314d1225cab4723e05900f55fc4ab466c11e7c9f9a4921634bbf90c5 WHIRLPOOL 5443c16af70b383d935318a9c15f9359d4f69de272533c0f713a2015718dec6f64cad59173664458a0fffc224a8f47b3c846d8cb66ce813f59ba6c32177effa4
 DIST criu-2.7.tar.bz2 618653 SHA256 c9aae64a4d2a6e881225ec14a00527aef228171a11227034b6322c126c2ece04 SHA512 fb80c3d48116489775e23231e93e6385614b57bd3710a2650c540090c3f2464d3a337a43c2d1f6e6a3d1360ca09adaa76cb6298f411add5fba998f3c3a323ed9 WHIRLPOOL 01c5d190691839e1123bc48da6c9add76bab0b6fdb87e840555b92833a9d8605c895fe9f0e6595c7d289d02955ae05b3933fa92a50b73d5b755f304321c4ec8a
+DIST criu-2.8.tar.bz2 623257 SHA256 54d77ee2bd31fb900395eeeda8cd653b334dbeb6594f3c3220d8c9e9f55d21f6 SHA512 cc85cec1fd9dc543e2ab24356f33424bd3b962db6da273db85cd1f1e21d08b12d2b937fe673d369b2d2e2b2aaacb4967e00b67ea811f5318028522a55a892454 WHIRLPOOL 39d083f6d3197c9c8ee52b430b053ff372df0860e28850a4893e19ab9721e562a604adac0d8ecb9529ff7931e7ea05b10e771d187f9ed908b70916530f951fad

diff --git a/sys-process/criu/criu-2.8.ebuild b/sys-process/criu/criu-2.8.ebuild
new file mode 100644
index 00000000..343f811
--- /dev/null
+++ b/sys-process/criu/criu-2.8.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils toolchain-funcs linux-info flag-o-matic python-r1 python-utils-r1
+
+DESCRIPTION="utility to checkpoint/restore a process tree"
+HOMEPAGE="http://criu.org/"
+SRC_URI="http://download.openvz.org/criu/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64"
+IUSE="python setproctitle"
+
+RDEPEND="dev-libs/protobuf-c
+	dev-libs/libnl:3
+	sys-libs/libcap
+	python? ( ${PYTHON_DEPS} )
+	setproctitle? ( dev-libs/libbsd )"
+DEPEND="${RDEPEND}
+	app-text/asciidoc
+	app-text/xmlto"
+RDEPEND="${RDEPEND}
+	python? (
+		dev-libs/protobuf[python,${PYTHON_USEDEP}]
+		dev-python/ipaddr[${PYTHON_USEDEP}]
+	)"
+
+CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
+	~IA32_EMULATION ~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG"
+
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/2.2/${PN}-2.2-flags.patch
+	"${FILESDIR}"/2.4/${PN}-2.4-makefile.patch
+	"${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
+	"${FILESDIR}"/${PN}-2.8-automagic-libbsd.patch
+	"${FILESDIR}"/2.0/${PN}-2.0-sysroot.patch
+	"${FILESDIR}"/2.3/${PN}-2.3-aarch64.patch
+)
+
+criu_arch() {
+	# criu infers the arch from $(uname -m).  We never want this to happen.
+	case ${ARCH} in
+	amd64) echo "x86";;
+	arm64) echo "aarch64";;
+	*)     echo "${ARCH}";;
+	esac
+}
+
+src_compile() {
+	RAW_LDFLAGS="$(raw-ldflags)" emake \
+		CC="$(tc-getCC)" \
+		LD="$(tc-getLD)" \
+		OBJCOPY="$(tc-getOBJCOPY)" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		ARCH="$(criu_arch)" \
+		V=1 WERROR=0 DEBUG=0 \
+		SETPROCTITLE=$(usex setproctitle) \
+		PYCRIU=$(usex python) \
+		all docs
+}
+
+src_test() {
+	# root privileges are required to dump all necessary info
+	if [[ ${EUID} -eq 0 ]] ; then
+		emake -j1 CC="$(tc-getCC)" ARCH="$(criu_arch)" V=1 WERROR=0 test
+	fi
+}
+
+install_crit() {
+	"${PYTHON:-python}" ../scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/"
+}
+
+src_install() {
+	emake \
+		ARCH="$(criu_arch)" \
+		PREFIX="${EPREFIX}"/usr \
+		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
+		DESTDIR="${D}" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		install
+
+	dodoc CREDITS README.md
+
+	if use python ; then
+		cd lib
+		python_foreach_impl install_crit
+	fi
+}

diff --git a/sys-process/criu/files/criu-2.8-automagic-libbsd.patch b/sys-process/criu/files/criu-2.8-automagic-libbsd.patch
new file mode 100644
index 00000000..54781ea
--- /dev/null
+++ b/sys-process/criu/files/criu-2.8-automagic-libbsd.patch
@@ -0,0 +1,17 @@
+diff --git a/Makefile.config b/Makefile.config
+index e0d49d2..d1b2b9d 100644
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -2,10 +2,12 @@ include $(__nmk_dir)utils.mk
+ include $(__nmk_dir)msg.mk
+ include $(SRC_DIR)/scripts/feature-tests.mak
+ 
++ifeq ($(SETPROCTITLE),yes)
+ ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
+         LIBS_FEATURES	+= -lbsd
+         FEATURE_DEFINES	+= -DCONFIG_HAS_LIBBSD
+ endif
++endif
+ 
+ ifeq ($(call pkg-config-check,libselinux),y)
+         LIBS_FEATURES	+= -lselinux


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2016-12-07  5:28 Mike Frysinger
  0 siblings, 0 replies; 13+ messages in thread
From: Mike Frysinger @ 2016-12-07  5:28 UTC (permalink / raw
  To: gentoo-commits

commit:     94e0974c2fa5702886fdf83a3a24dd18f77c3a6a
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  7 05:27:51 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Dec  7 05:27:51 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94e0974c

sys-process/criu: fix build w/newer glibc #580454

 sys-process/criu/criu-2.8.ebuild                |  1 +
 sys-process/criu/files/criu-2.8-sysmacros.patch | 98 +++++++++++++++++++++++++
 2 files changed, 99 insertions(+)

diff --git a/sys-process/criu/criu-2.8.ebuild b/sys-process/criu/criu-2.8.ebuild
index 343f811..b16c810 100644
--- a/sys-process/criu/criu-2.8.ebuild
+++ b/sys-process/criu/criu-2.8.ebuild
@@ -43,6 +43,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.8-automagic-libbsd.patch
 	"${FILESDIR}"/2.0/${PN}-2.0-sysroot.patch
 	"${FILESDIR}"/2.3/${PN}-2.3-aarch64.patch
+	"${FILESDIR}"/${P}-sysmacros.patch #580454
 )
 
 criu_arch() {

diff --git a/sys-process/criu/files/criu-2.8-sysmacros.patch b/sys-process/criu/files/criu-2.8-sysmacros.patch
new file mode 100644
index 00000000..68bba80
--- /dev/null
+++ b/sys-process/criu/files/criu-2.8-sysmacros.patch
@@ -0,0 +1,98 @@
+https://bugs.gentoo.org/580454
+https://github.com/xemul/criu/pull/257
+
+From 6913c0004eaa4fd11bf3efc8c37fb05108cf18ee Mon Sep 17 00:00:00 2001
+From: Yixun Lan <dlan@gentoo.org>
+Date: Wed, 7 Dec 2016 00:24:42 -0500
+Subject: [PATCH] include sys/sysmacros.h for minor/major/makedev funcs
+
+Since glibc is moving away from implicitly including sys/sysmacros.h
+all the time via sys/types.h, include the header directly in more
+places.  This seems to cover most makedev/major/minor usage.
+
+Signed-off-by: Yixun Lan <dlan@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ criu/file-lock.c           | 1 +
+ criu/include/util.h        | 1 +
+ criu/kerndat.c             | 1 +
+ criu/proc_parse.c          | 1 +
+ test/zdtm/lib/fs.h         | 1 +
+ test/zdtm/static/console.c | 1 +
+ 6 files changed, 6 insertions(+)
+
+diff --git a/criu/file-lock.c b/criu/file-lock.c
+index 1ab1e5886965..11d8a194937a 100644
+--- a/criu/file-lock.c
++++ b/criu/file-lock.c
+@@ -5,6 +5,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ 
+ #include "cr_options.h"
+ #include "imgset.h"
+diff --git a/criu/include/util.h b/criu/include/util.h
+index 8eaee33391c5..1aa40e863acb 100644
+--- a/criu/include/util.h
++++ b/criu/include/util.h
+@@ -10,6 +10,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/statfs.h>
++#include <sys/sysmacros.h>
+ #include <dirent.h>
+ 
+ #include "int.h"
+diff --git a/criu/kerndat.c b/criu/kerndat.c
+index f9675bd7ec1d..aeef1b7f6640 100644
+--- a/criu/kerndat.c
++++ b/criu/kerndat.c
+@@ -7,6 +7,7 @@
+ #include <sys/mman.h>
+ #include <errno.h>
+ #include <sys/syscall.h>
++#include <sys/sysmacros.h>
+ 
+ #include "int.h"
+ #include "log.h"
+diff --git a/criu/proc_parse.c b/criu/proc_parse.c
+index 3f84cdaad99a..a86d31769ded 100644
+--- a/criu/proc_parse.c
++++ b/criu/proc_parse.c
+@@ -9,6 +9,7 @@
+ #include <string.h>
+ #include <ctype.h>
+ #include <linux/fs.h>
++#include <sys/sysmacros.h>
+ 
+ #include "types.h"
+ #include "common/list.h"
+diff --git a/test/zdtm/lib/fs.h b/test/zdtm/lib/fs.h
+index 972c49b4a068..972b15abad0c 100644
+--- a/test/zdtm/lib/fs.h
++++ b/test/zdtm/lib/fs.h
+@@ -6,6 +6,7 @@
+ #endif
+ 
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ 
+ #include <limits.h>
+ 
+diff --git a/test/zdtm/static/console.c b/test/zdtm/static/console.c
+index a86b14639729..41246aea0298 100644
+--- a/test/zdtm/static/console.c
++++ b/test/zdtm/static/console.c
+@@ -8,6 +8,7 @@
+ 
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ 
+ #include "zdtmtst.h"
+ 
+-- 
+2.11.0.rc2
+


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2019-07-29  2:43 Matthias Maier
  0 siblings, 0 replies; 13+ messages in thread
From: Matthias Maier @ 2019-07-29  2:43 UTC (permalink / raw
  To: gentoo-commits

commit:     a513ac76630b5c4dfe3b37d8757665292d0be101
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 29 02:41:45 2019 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 02:43:12 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a513ac76

sys-process/criu: fix build

Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>

 sys-process/criu/criu-3.12.ebuild                       |  3 +--
 sys-process/criu/files/criu-3.12-automagic-libbsd.patch | 13 +++++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/sys-process/criu/criu-3.12.ebuild b/sys-process/criu/criu-3.12.ebuild
index 09d8af6c2b8..9001e1cf751 100644
--- a/sys-process/criu/criu-3.12.ebuild
+++ b/sys-process/criu/criu-3.12.ebuild
@@ -46,8 +46,7 @@ RESTRICT="test"
 PATCHES=(
 	"${FILESDIR}"/2.2/${PN}-2.2-flags.patch
 	"${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
-	"${FILESDIR}"/${PN}-2.8-automagic-libbsd.patch
-	"${FILESDIR}"/2.0/${PN}-2.0-sysroot.patch
+	"${FILESDIR}"/${PN}-3.12-automagic-libbsd.patch
 )
 
 criu_arch() {

diff --git a/sys-process/criu/files/criu-3.12-automagic-libbsd.patch b/sys-process/criu/files/criu-3.12-automagic-libbsd.patch
new file mode 100644
index 00000000000..7794f82e519
--- /dev/null
+++ b/sys-process/criu/files/criu-3.12-automagic-libbsd.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.config b/Makefile.config
+index a853705..27bb91f 100644
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -2,7 +2,7 @@ include $(__nmk_dir)utils.mk
+ include $(__nmk_dir)msg.mk
+ include scripts/feature-tests.mak
+ 
+-ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
++ifeq ($(SETPROCTITLE)$(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),yestrue)
+         LIBS_FEATURES	+= -lbsd
+         FEATURE_DEFINES	+= -DCONFIG_HAS_LIBBSD
+ else


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2020-04-25 11:29 Sergei Trofimovich
  0 siblings, 0 replies; 13+ messages in thread
From: Sergei Trofimovich @ 2020-04-25 11:29 UTC (permalink / raw
  To: gentoo-commits

commit:     58bfbf51627caf280e9b644e5df8f4f0f35ffd54
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 25 11:27:14 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Apr 25 11:29:37 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58bfbf51

sys-process/criu: tweak for gcc-10, bug #707942

Closes: https://bugs.gentoo.org/707942
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 sys-process/criu/criu-3.12.ebuild             |  3 +-
 sys-process/criu/files/criu-3.12-gcc-10.patch | 76 +++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/sys-process/criu/criu-3.12.ebuild b/sys-process/criu/criu-3.12.ebuild
index 9321be89fc0..7b5158f5f9b 100644
--- a/sys-process/criu/criu-3.12.ebuild
+++ b/sys-process/criu/criu-3.12.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -47,6 +47,7 @@ PATCHES=(
 	"${FILESDIR}"/2.2/${PN}-2.2-flags.patch
 	"${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
 	"${FILESDIR}"/${PN}-3.12-automagic-libbsd.patch
+	"${FILESDIR}"/${PN}-3.12-gcc-10.patch # backport
 )
 
 criu_arch() {

diff --git a/sys-process/criu/files/criu-3.12-gcc-10.patch b/sys-process/criu/files/criu-3.12-gcc-10.patch
new file mode 100644
index 00000000000..ff277b5b22d
--- /dev/null
+++ b/sys-process/criu/files/criu-3.12-gcc-10.patch
@@ -0,0 +1,76 @@
+https://bugs.gentoo.org/707942
+
+From 10d9dcdb6e2fbe4646ff3f27cd35376ebaeeb0f9 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sun, 2 Feb 2020 18:45:59 +0000
+Subject: [PATCH] criu: fix build failure against gcc-10
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On gcc-10 (and gcc-9 -fno-common) build fails as:
+
+```
+ld: criu/arch/x86/crtools.o:criu/include/cr_options.h:159:
+  multiple definition of `rpc_cfg_file'; criu/arch/x86/cpu.o:criu/include/cr_options.h:159: first defined here
+make[2]: *** [scripts/nmk/scripts/build.mk:164: criu/arch/x86/crtools.built-in.o] Error 1
+```
+
+gcc-10 will change the default from -fcommon to fno-common:
+https://gcc.gnu.org/PR85678.
+
+The error also happens if CFLAGS=-fno-common passed explicitly.
+
+Reported-by: Toralf Förster
+Bug: https://bugs.gentoo.org/707942
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ criu/config.c             | 1 +
+ criu/include/cr_options.h | 2 +-
+ criu/include/pstree.h     | 2 +-
+ criu/include/tun.h        | 2 +-
+ 4 files changed, 4 insertions(+), 3 deletions(-)
+
+--- a/criu/config.c
++++ b/criu/config.c
+@@ -30,6 +30,7 @@
+ #include "common/xmalloc.h"
+ 
+ struct cr_options opts;
++char *rpc_cfg_file;
+ 
+ static int count_elements(char **to_count)
+ {
+--- a/criu/include/cr_options.h
++++ b/criu/include/cr_options.h
+@@ -156,7 +156,7 @@ struct cr_options {
+ };
+ 
+ extern struct cr_options opts;
+-char *rpc_cfg_file;
++extern char *rpc_cfg_file;
+ 
+ extern int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd, int state);
+ extern int check_options(void);
+--- a/criu/include/pstree.h
++++ b/criu/include/pstree.h
+@@ -42,7 +42,7 @@ enum {
+ };
+ #define FDS_EVENT (1 << FDS_EVENT_BIT)
+ 
+-struct pstree_item *current;
++extern struct pstree_item *current;
+ 
+ struct rst_info;
+ /* See alloc_pstree_item() for details */
+--- a/criu/include/tun.h
++++ b/criu/include/tun.h
+@@ -5,7 +5,7 @@
+ #define TUN_MINOR	200
+ #endif
+ 
+-struct ns_id *ns;
++extern struct ns_id *ns;
+ 
+ #include <linux/netlink.h>
+ 


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2021-09-05  5:57 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2021-09-05  5:57 UTC (permalink / raw
  To: gentoo-commits

commit:     24ba952b3ff906ee79987fcfb100ca495a23675d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  5 05:57:18 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep  5 05:57:18 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24ba952b

sys-process/criu: add patch for >=dev-libs/protobuf-c-1.4.0

Could be adapted to earlier versions in theory.

Closes: https://bugs.gentoo.org/809092
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/criu/criu-3.15-r1.ebuild               | 140 +++++++++++++++++
 .../criu/files/criu-3.15-protobuf-c-1.4.0.patch    | 168 +++++++++++++++++++++
 2 files changed, 308 insertions(+)

diff --git a/sys-process/criu/criu-3.15-r1.ebuild b/sys-process/criu/criu-3.15-r1.ebuild
new file mode 100644
index 00000000000..bb76d9a19d3
--- /dev/null
+++ b/sys-process/criu/criu-3.15-r1.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8,9} )
+
+inherit toolchain-funcs linux-info python-r1
+
+DESCRIPTION="utility to checkpoint/restore a process tree"
+HOMEPAGE="https://criu.org/"
+SRC_URI="https://download.openvz.org/criu/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64"
+IUSE="doc selinux setproctitle static-libs"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+	${PYTHON_DEPS}
+	>=dev-libs/protobuf-c-1.4.0:=
+	dev-libs/libnl:3
+	net-libs/libnet:1.1
+	sys-libs/libcap
+	selinux? ( sys-libs/libselinux )
+	setproctitle? ( dev-libs/libbsd )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	doc? (
+		app-text/asciidoc
+		app-text/xmlto
+	)"
+RDEPEND="${RDEPEND}
+	dev-python/protobuf-python[${PYTHON_USEDEP}]"
+
+CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
+	~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
+
+# root access required for tests
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/2.2/${PN}-2.2-flags.patch
+	"${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
+	"${FILESDIR}"/${PN}-3.12-automagic-libbsd.patch
+	"${FILESDIR}"/${PN}-3.15-pkg-config.patch
+	"${FILESDIR}"/${PN}-3.15-protobuf-c-1.4.0.patch
+)
+
+criu_arch() {
+	# criu infers the arch from $(uname -m).  We never want this to happen.
+	case ${ARCH} in
+		amd64) echo "x86";;
+		arm64) echo "aarch64";;
+		ppc64*) echo "ppc64";;
+		*)     echo "${ARCH}";;
+	esac
+}
+
+pkg_setup() {
+	use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
+	linux-info_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	if ! use selinux; then
+		sed \
+			-e 's:libselinux:no_libselinux:g' \
+			-i Makefile.config || die
+	fi
+
+	use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
+}
+
+src_configure() {
+	# Gold linker generates invalid object file when used with criu's custom
+	# linker script.  Use the bfd linker instead. See https://crbug.com/839665#c3
+	tc-ld-disable-gold
+
+	# Build system uses this variable as a trigger to append coverage flags
+	# we'd like to avoid it. https://bugs.gentoo.org/744244
+	unset GCOV
+
+	python_setup
+}
+
+src_compile() {
+	local target="all $(usex doc 'docs' '')"
+	emake \
+		HOSTCC="$(tc-getBUILD_CC)" \
+		CC="$(tc-getCC)" \
+		LD="$(tc-getLD)" \
+		AR="$(tc-getAR)" \
+		PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+		PYTHON="${EPYTHON%.?}" \
+		FULL_PYTHON="${PYTHON%.?}" \
+		OBJCOPY="$(tc-getOBJCOPY)" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		ARCH="$(criu_arch)" \
+		V=1 WERROR=0 DEBUG=0 \
+		SETPROCTITLE=$(usex setproctitle) \
+		${target}
+}
+
+src_test() {
+	# root privileges are required to dump all necessary info
+	if [[ ${EUID} -eq 0 ]] ; then
+		emake -j1 CC="$(tc-getCC)" ARCH="$(criu_arch)" V=1 WERROR=0 test
+	fi
+}
+
+install_crit() {
+	"${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
+	python_optimize
+}
+
+src_install() {
+	emake \
+		ARCH="$(criu_arch)" \
+		PREFIX="${EPREFIX}"/usr \
+		PYTHON="${EPYTHON%.?}" \
+		FULL_PYTHON="${PYTHON%.?}" \
+		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
+		DESTDIR="${D}" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		V=1 WERROR=0 DEBUG=0 \
+		install
+
+	use doc && dodoc CREDITS README.md
+
+	python_foreach_impl install_crit
+
+	if ! use static-libs; then
+		find "${D}" -name "*.a" -delete || die
+	fi
+}

diff --git a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
new file mode 100644
index 00000000000..ea0b9134c68
--- /dev/null
+++ b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
@@ -0,0 +1,168 @@
+https://bugs.gentoo.org/809092
+https://github.com/checkpoint-restore/criu/commit/1c25914a5dd1eb385937dffdd85901c3f5e39b8c
+
+From 1c25914a5dd1eb385937dffdd85901c3f5e39b8c Mon Sep 17 00:00:00 2001
+From: Zeyad Yasser <zeyady98@gmail.com>
+Date: Thu, 22 Jul 2021 11:39:34 +0200
+Subject: [PATCH] protobuf: remove leading underscores from protobuf structs
+
+Fixes: #1560
+
+The latest protobuf-c compiler breaks CRIU because they removed
+leading underscores from structs in 1.4.0.
+
+This replaces those definitions with the standard generated structs.
+
+v2: remove struct _VmaEntry, struct _CredsEntry and struct _CoreEntry
+
+Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
+---
+ criu/include/irmap.h            | 8 +++++---
+ criu/include/parasite-syscall.h | 8 +++-----
+ criu/include/pstree.h           | 2 +-
+ criu/include/rst_info.h         | 5 ++---
+ criu/include/shmem.h            | 1 -
+ criu/mem.c                      | 2 +-
+ lib/c/criu.h                    | 3 ++-
+ 7 files changed, 14 insertions(+), 15 deletions(-)
+
+diff --git a/criu/include/irmap.h b/criu/include/irmap.h
+index 033f71e372..188d753f4d 100644
+--- a/criu/include/irmap.h
++++ b/criu/include/irmap.h
+@@ -1,13 +1,15 @@
+ #ifndef __CR_IRMAP__H__
+ #define __CR_IRMAP__H__
++
++#include "images/fh.pb-c.h"
++
+ char *irmap_lookup(unsigned int s_dev, unsigned long i_ino);
+-struct _FhEntry;
+ int irmap_queue_cache(unsigned int dev, unsigned long ino,
+-		struct _FhEntry *fh);
++		FhEntry *fh);
+ int irmap_predump_prep(void);
+ int irmap_predump_run(void);
+ int check_open_handle(unsigned int s_dev, unsigned long i_ino,
+-		struct _FhEntry *f_handle);
++		FhEntry *f_handle);
+ int irmap_load_cache(void);
+ int irmap_scan_path_add(char *path);
+ #endif
+diff --git a/criu/include/parasite-syscall.h b/criu/include/parasite-syscall.h
+index c86a724fd1..afba95a9e7 100644
+--- a/criu/include/parasite-syscall.h
++++ b/criu/include/parasite-syscall.h
+@@ -11,8 +11,6 @@ struct parasite_dump_misc;
+ struct parasite_drain_fd;
+ struct vm_area_list;
+ struct pstree_item;
+-struct _CredsEntry;
+-struct _CoreEntry;
+ struct list_head;
+ struct cr_imgset;
+ struct fd_opts;
+@@ -31,11 +29,11 @@ extern int parasite_dump_posix_timers_seized(struct proc_posix_timers_stat *proc
+ 		struct parasite_ctl *ctl, struct pstree_item *);
+ 
+ extern int parasite_dump_misc_seized(struct parasite_ctl *ctl, struct parasite_dump_misc *misc);
+-extern int parasite_dump_creds(struct parasite_ctl *ctl, struct _CredsEntry *ce);
+-extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, struct _CoreEntry *core);
++extern int parasite_dump_creds(struct parasite_ctl *ctl, CredsEntry *ce);
++extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, CoreEntry *core);
+ extern int parasite_dump_thread_seized(struct parasite_thread_ctl *tctl,
+ 				       struct parasite_ctl *ctl, int id,
+-				       struct pid *tid, struct _CoreEntry *core);
++				       struct pid *tid, CoreEntry *core);
+ extern int dump_thread_core(int pid, CoreEntry *core,
+ 					const struct parasite_dump_thread *dt);
+ 
+diff --git a/criu/include/pstree.h b/criu/include/pstree.h
+index 61ab0ce0eb..17d22e791e 100644
+--- a/criu/include/pstree.h
++++ b/criu/include/pstree.h
+@@ -113,7 +113,7 @@ extern int prepare_task_entries(void);
+ extern int prepare_dummy_task_state(struct pstree_item *pi);
+ 
+ extern int get_task_ids(struct pstree_item *);
+-extern struct _TaskKobjIdsEntry *root_ids;
++extern TaskKobjIdsEntry *root_ids;
+ 
+ extern void core_entry_free(CoreEntry *core);
+ extern CoreEntry *core_entry_alloc(int alloc_thread_info, int alloc_tc);
+diff --git a/criu/include/rst_info.h b/criu/include/rst_info.h
+index 3283849e44..3dc119a931 100644
+--- a/criu/include/rst_info.h
++++ b/criu/include/rst_info.h
+@@ -5,6 +5,7 @@
+ #include "common/list.h"
+ #include "vma.h"
+ #include "kerndat.h"
++#include "images/mm.pb-c.h"
+ 
+ struct task_entries {
+ 	int nr_threads, nr_tasks, nr_helpers;
+@@ -25,8 +26,6 @@ struct fdt {
+ 	futex_t			fdt_lock;
+ };
+ 
+-struct _MmEntry;
+-
+ struct rst_info {
+ 	struct list_head	fds;
+ 
+@@ -40,7 +39,7 @@ struct rst_info {
+ 	struct fdt		*fdt;
+ 
+ 	struct vm_area_list	vmas;
+-	struct _MmEntry		*mm;
++	MmEntry		*mm;
+ 	struct list_head	vma_io;
+ 	unsigned int		pages_img_id;
+ 
+diff --git a/criu/include/shmem.h b/criu/include/shmem.h
+index 9afdb799af..798e28f347 100644
+--- a/criu/include/shmem.h
++++ b/criu/include/shmem.h
+@@ -5,7 +5,6 @@
+ #include "common/lock.h"
+ #include "images/vma.pb-c.h"
+ 
+-struct _VmaEntry;
+ struct vma_area;
+ 
+ extern int collect_shmem(int pid, struct vma_area *vma);
+diff --git a/criu/mem.c b/criu/mem.c
+index 9fabe4c470..b0a76e4da9 100644
+--- a/criu/mem.c
++++ b/criu/mem.c
+@@ -1230,7 +1230,7 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr)
+ 
+ static int maybe_disable_thp(struct pstree_item *t, struct page_read *pr)
+ {
+-	struct _MmEntry *mm = rsti(t)->mm;
++	MmEntry *mm = rsti(t)->mm;
+ 
+ 	/*
+ 	 * There is no need to disable it if the page read doesn't
+diff --git a/lib/c/criu.h b/lib/c/criu.h
+index 3d64939584..d2bfbf958c 100644
+--- a/lib/c/criu.h
++++ b/lib/c/criu.h
+@@ -22,6 +22,7 @@
+ #include <stdbool.h>
+ 
+ #include "version.h"
++#include "rpc.pb-c.h"
+ 
+ #ifdef __GNUG__
+ 	extern "C" {
+@@ -112,7 +113,7 @@ void criu_set_pidfd_store_sk(int sk);
+  * some non-existing one is reported.
+  */
+ 
+-typedef struct _CriuNotify *criu_notify_arg_t;
++typedef CriuNotify *criu_notify_arg_t;
+ void criu_set_notify_cb(int (*cb)(char *action, criu_notify_arg_t na));
+ 
+ /* Get pid of root task. 0 if not available */


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2021-11-04 21:10 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2021-11-04 21:10 UTC (permalink / raw
  To: gentoo-commits

commit:     582a26d6ebc8a93a086e2117dca3f9e712998832
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov  4 21:09:38 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov  4 21:09:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=582a26d6

sys-process/criu: add additional protobuf-c patch

Closes: https://bugs.gentoo.org/809092
Closes: https://bugs.gentoo.org/814056
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/criu/{criu-3.15-r1.ebuild => criu-3.15-r2.ebuild} | 0
 sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch       | 2 ++
 2 files changed, 2 insertions(+)

diff --git a/sys-process/criu/criu-3.15-r1.ebuild b/sys-process/criu/criu-3.15-r2.ebuild
similarity index 100%
rename from sys-process/criu/criu-3.15-r1.ebuild
rename to sys-process/criu/criu-3.15-r2.ebuild

diff --git a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
index ea0b9134c68..5e57fa08497 100644
--- a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
+++ b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
@@ -1,5 +1,7 @@
 https://bugs.gentoo.org/809092
+https://bugs.gentoo.org/814056
 https://github.com/checkpoint-restore/criu/commit/1c25914a5dd1eb385937dffdd85901c3f5e39b8c
+https://github.com/checkpoint-restore/criu/commit/6a15dbdefa5c23a75eb3d1137681404588a16efa
 
 From 1c25914a5dd1eb385937dffdd85901c3f5e39b8c Mon Sep 17 00:00:00 2001
 From: Zeyad Yasser <zeyady98@gmail.com>


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2021-12-01 20:34 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2021-12-01 20:34 UTC (permalink / raw
  To: gentoo-commits

commit:     106d32bbb4359104c8b08e5a8f6c55f5830650f1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  1 20:33:15 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec  1 20:34:24 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=106d32bb

sys-process/criu: really add extra protobuf-c hunk

Doh!

Bug: https://bugs.gentoo.org/814056
Closes: https://bugs.gentoo.org/822006
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{criu-3.15-r2.ebuild => criu-3.15-r3.ebuild}   |  0
 .../criu/files/criu-3.15-protobuf-c-1.4.0.patch    | 24 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/sys-process/criu/criu-3.15-r2.ebuild b/sys-process/criu/criu-3.15-r3.ebuild
similarity index 100%
rename from sys-process/criu/criu-3.15-r2.ebuild
rename to sys-process/criu/criu-3.15-r3.ebuild

diff --git a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
index 5e57fa084975..86d9cd31724d 100644
--- a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
+++ b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
@@ -168,3 +168,27 @@ index 3d64939584..d2bfbf958c 100644
  void criu_set_notify_cb(int (*cb)(char *action, criu_notify_arg_t na));
  
  /* Get pid of root task. 0 if not available */
+From: Radostin Stoyanov <radostin@redhat.com>
+Date: Fri, 3 Sep 2021 14:14:41 +0100
+Subject: [PATCH] lib: install images/rpc.pb-c.h
+
+Since commit 1c25914 compiling crun with libcriu also requires
+/usr/include/criu/rpc.pb-c.h
+
+Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
+---
+ lib/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index f9b66701e0..575a7bad3f 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -1,6 +1,6 @@
+ CRIU_SO			:= libcriu.so
+ CRIU_A			:= libcriu.a
+-UAPI_HEADERS		:= lib/c/criu.h images/rpc.proto criu/include/version.h
++UAPI_HEADERS		:= lib/c/criu.h images/rpc.proto images/rpc.pb-c.h criu/include/version.h
+ 
+ #
+ # File to keep track of files installed by setup.py


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2021-12-02  0:17 Patrick McLean
  0 siblings, 0 replies; 13+ messages in thread
From: Patrick McLean @ 2021-12-02  0:17 UTC (permalink / raw
  To: gentoo-commits

commit:     2cf0d86c1a22dfed20f3dda2601adc96986bca9f
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  2 00:17:10 2021 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Dec  2 00:17:45 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cf0d86c

sys-process/criu: Version bump to 3.16.1 (bug #827955)

Closes: https://bugs.gentoo.org/827955
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 sys-process/criu/Manifest                          |   1 +
 sys-process/criu/criu-3.16.1.ebuild                | 162 +++++++++++++++++++++
 .../criu/files/criu-3.16.1-buildsystem.patch       |  56 +++++++
 sys-process/criu/metadata.xml                      |   4 +-
 4 files changed, 222 insertions(+), 1 deletion(-)

diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index 84332204a0a5..afc75c58706a 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -1,2 +1,3 @@
 DIST criu-3.14.tar.bz2 881407 BLAKE2B 418412681baf7ec9d3a03afe3860590c857bffcb6c57d01e60b77e85dd5ba2b30deee280c884ba1574665be5fcfd03f3cc058a4b7ae08f66aabe63a80373089b SHA512 97d064c5ffc41daf6e89edd6208b30e4198f313afc6d621d0dc74dadf94c303be70ba448d4e1ced9500f1c65f1bd12206eb88883be398911cc2c995310b17cc6
 DIST criu-3.15.tar.bz2 913904 BLAKE2B 2a3c7ad7ac32a407493e8908886d2929606e1dd0a1dd499be75cb954c1c4d60d0c59f0524d173dcdd89fa638e1edcc0c31886262069e3478173648ef09b4c159 SHA512 7bfd32053e47b95d10cdd5e99494bff6a21aa3179518179f8c72e870f0aab960dd76c9f6cb6982e5b881472cf6962eefee3cf7d8ae9128b3379bcaecc937ebbc
+DIST criu-3.16.1.tar.gz 1228535 BLAKE2B 45aa87ee00a18b91474e767dc0326cce6c0942af7771a0c5536751361c171c86ba2065c54587e82b51fd6d7ab116e659324369955086c5237cd7fd26b60d6ce6 SHA512 a558af41f1927a1b1d87f8d11163a5f3d2e4f83a74aba00619b45a6d464d5477a6a0aac3c1b9d9a17e3343a4bf21a3fd6b279b51fa0c347c86c307381a4d0739

diff --git a/sys-process/criu/criu-3.16.1.ebuild b/sys-process/criu/criu-3.16.1.ebuild
new file mode 100644
index 000000000000..ff46a299a4af
--- /dev/null
+++ b/sys-process/criu/criu-3.16.1.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit toolchain-funcs linux-info python-r1
+
+DESCRIPTION="utility to checkpoint/restore a process tree"
+HOMEPAGE="
+	https://criu.org/
+	https://github.com/checkpoint-restore/
+"
+SRC_URI="https://github.com/checkpoint-restore/${PN}/archive/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64"
+IUSE="bpf doc gnutls nftables selinux setproctitle static-libs test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="
+	${PYTHON_DEPS}
+	>=dev-libs/protobuf-c-1.4.0:=
+	dev-libs/libnl:3=
+	net-libs/libnet:1.1=
+	sys-libs/libcap:=
+	bpf? ( dev-libs/libbpf:= )
+	gnutls? ( net-libs/gnutls:= )
+	nftables? ( net-libs/gnutls:= )
+	selinux? ( sys-libs/libselinux:= )
+	setproctitle? ( dev-libs/libbsd:= )
+"
+DEPEND="${COMMON_DEPEND}"
+BDEPEND="
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	doc? (
+		app-text/asciidoc
+		app-text/xmlto
+	)
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	dev-python/protobuf-python[${PYTHON_USEDEP}]
+"
+
+CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
+	~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
+
+# root access required for tests
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	"${FILESDIR}/2.2/criu-2.2-flags.patch"
+	"${FILESDIR}/2.3/criu-2.3-no-git.patch"
+	"${FILESDIR}/criu-3.12-automagic-libbsd.patch"
+	"${FILESDIR}/criu-3.16.1-buildsystem.patch"
+)
+
+criu_arch() {
+	# criu infers the arch from $(uname -m).  We never want this to happen.
+	case ${ARCH} in
+		amd64) echo "x86";;
+		arm64) echo "aarch64";;
+		ppc64*) echo "ppc64";;
+		*)     echo "${ARCH}";;
+	esac
+}
+
+pkg_setup() {
+	use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
+	linux-info_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
+}
+
+criu_use() {
+	if ! use "${1}"; then
+		sed \
+			-e "s:${2:-${1}}:no_${2:-lib${1}}:g" \
+			-i Makefile.config || die
+	fi
+}
+
+src_configure() {
+	# Gold linker generates invalid object file when used with criu's custom
+	# linker script.  Use the bfd linker instead. See https://crbug.com/839665#c3
+	tc-ld-disable-gold
+
+	# Build system uses this variable as a trigger to append coverage flags
+	# we'd like to avoid it. https://bugs.gentoo.org/744244
+	unset GCOV
+
+	# we have to sed the Makdfile.config to disable automagic deps
+	criu_use selinux
+	criu_use bpf
+	criu_use nftables
+
+	emake_opts=(
+		SETPROCTITLE="$(usex setproctitle)"
+		NO_GNUTLS="$(usex gnutls '' '1')"
+	)
+
+	python_setup
+}
+
+criu_emake() {
+	emake \
+		AR="$(tc-getAR)" \
+		ARCH="$(criu_arch)" \
+		CC="$(tc-getCC)" \
+		FULL_PYTHON="${PYTHON%.*}" \
+		HOSTCC="$(tc-getBUILD_CC)" \
+		LD="$(tc-getLD)" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
+		OBJCOPY="$(tc-getOBJCOPY)" \
+		PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+		PREFIX="${EPREFIX}"/usr \
+		PYTHON="${EPYTHON%.*}" \
+		V=1 WERROR=0 DEBUG=0 \
+		"${emake_opts[@]}" \
+		"${@}"
+}
+
+build_crit() {
+	"${EPYTHON}" scripts/crit-setup.py build || die
+}
+
+src_compile() {
+	local -a targets=(
+		all
+		$(usex doc 'docs' '')
+	)
+	criu_emake ${targets}
+}
+
+src_test() {
+	criu_emake unittest
+}
+
+install_crit() {
+	"${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
+	python_optimize
+}
+
+src_install() {
+	criu_emake DESTDIR="${D}" install
+	python_foreach_impl install_crit
+
+	dodoc CREDITS README.md
+
+	if ! use static-libs; then
+		find "${D}" -name "*.a" -delete || die
+	fi
+}

diff --git a/sys-process/criu/files/criu-3.16.1-buildsystem.patch b/sys-process/criu/files/criu-3.16.1-buildsystem.patch
new file mode 100644
index 000000000000..7b83d1c8fe51
--- /dev/null
+++ b/sys-process/criu/files/criu-3.16.1-buildsystem.patch
@@ -0,0 +1,56 @@
+diff --git a/Makefile.config b/Makefile.config
+index 6e3e1b062..830a66e83 100644
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -5,9 +5,6 @@ include scripts/feature-tests.mak
+ ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
+         LIBS_FEATURES	+= -lbsd
+         FEATURE_DEFINES	+= -DCONFIG_HAS_LIBBSD
+-else
+-        $(info Note: Building without setproctitle() and strlcpy() support.)
+-        $(info $(info)      To enable these features, please install libbsd-devel (RPM) / libbsd-dev (DEB).)
+ endif
+ 
+ ifeq ($(call pkg-config-check,libselinux),y)
+@@ -25,8 +22,6 @@ ifeq ($(NO_GNUTLS)x$(call pkg-config-check,gnutls),xy)
+         LIBS_FEATURES	+= -lgnutls
+         export CONFIG_GNUTLS := y
+         FEATURE_DEFINES	+= -DCONFIG_GNUTLS
+-else
+-        $(info Note: Building without GnuTLS support)
+ endif
+ 
+ ifeq ($(call pkg-config-check,libnftables),y)
+@@ -41,9 +36,6 @@ ifeq ($(call pkg-config-check,libnftables),y)
+                 $(warning Warn: you have libnftables installed but it has incompatible API)
+                 $(warning Warn: Building without nftables support)
+         endif
+-else
+-        $(warning Warn: you have no libnftables installed)
+-        $(warning Warn: Building without nftables support)
+ endif
+ 
+ export LIBS += $(LIBS_FEATURES)
+diff --git a/lib/Makefile b/lib/Makefile
+index 575a7bad3..af88668c5 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -58,8 +58,6 @@ install: lib-c lib-a lib-py crit/crit lib/c/criu.pc.in
+ 	$(Q) mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
+ 	$(Q) sed -e 's,@version@,$(CRIU_VERSION),' -e 's,@libdir@,$(LIBDIR),' -e 's,@includedir@,$(dir $(INCLUDEDIR)/criu/),' lib/c/criu.pc.in > lib/c/criu.pc
+ 	$(Q) install -m 644 lib/c/criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
+-	$(E) "  INSTALL " crit
+-	$(Q) $(PYTHON) scripts/crit-setup.py install --prefix=$(DESTDIR)$(PREFIX) --record $(CRIT_SETUP_FILES)
+ .PHONY: install
+ 
+ uninstall:
+diff --git a/scripts/crit-setup.py b/scripts/crit-setup.py
+index 871e55921..50745c294 100644
+--- a/scripts/crit-setup.py
++++ b/scripts/crit-setup.py
+@@ -1,4 +1,4 @@
+-from distutils.core import setup
++from setuptools import setup
+ 
+ setup(name="crit",
+       version="0.0.1",

diff --git a/sys-process/criu/metadata.xml b/sys-process/criu/metadata.xml
index fd89c4dad3f8..bec8a7d57bfc 100644
--- a/sys-process/criu/metadata.xml
+++ b/sys-process/criu/metadata.xml
@@ -10,6 +10,8 @@
 		<name>Gentoo Virtualization Project</name>
 	</maintainer>
 	<use>
-		<flag name="setproctitle">Make process titles of service workers to be more verbose</flag>
+		<flag name="setproctitle">Use <pkg>dev-libs/libbsd</pkg> to make process titles of service workers to be more verbose</flag>
+		<flag name="bpf">Add support for BPF programs via <pkg>dev-libs/libbpf</pkg></flag>
+		<flag name="nftables">Add support for <pkg>net-firewall/nftables</pkg></flag>
 	</use>
 </pkgmetadata>


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2022-05-19  3:33 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2022-05-19  3:33 UTC (permalink / raw
  To: gentoo-commits

commit:     2a5e6fa4194077e9d9d3df3596ff84ea10dd91c3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu May 19 03:16:37 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 19 03:16:37 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a5e6fa4

sys-process/criu: add 3.17

Closes: https://bugs.gentoo.org/841014
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/criu/Manifest                          |   1 +
 sys-process/criu/criu-3.17.ebuild                  | 164 +++++++++++++++++++++
 .../criu/files/criu-3.17-amdgpu-build-fixes.patch  |  98 ++++++++++++
 3 files changed, 263 insertions(+)

diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index afc75c58706a..4f343f4a67bd 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -1,3 +1,4 @@
 DIST criu-3.14.tar.bz2 881407 BLAKE2B 418412681baf7ec9d3a03afe3860590c857bffcb6c57d01e60b77e85dd5ba2b30deee280c884ba1574665be5fcfd03f3cc058a4b7ae08f66aabe63a80373089b SHA512 97d064c5ffc41daf6e89edd6208b30e4198f313afc6d621d0dc74dadf94c303be70ba448d4e1ced9500f1c65f1bd12206eb88883be398911cc2c995310b17cc6
 DIST criu-3.15.tar.bz2 913904 BLAKE2B 2a3c7ad7ac32a407493e8908886d2929606e1dd0a1dd499be75cb954c1c4d60d0c59f0524d173dcdd89fa638e1edcc0c31886262069e3478173648ef09b4c159 SHA512 7bfd32053e47b95d10cdd5e99494bff6a21aa3179518179f8c72e870f0aab960dd76c9f6cb6982e5b881472cf6962eefee3cf7d8ae9128b3379bcaecc937ebbc
 DIST criu-3.16.1.tar.gz 1228535 BLAKE2B 45aa87ee00a18b91474e767dc0326cce6c0942af7771a0c5536751361c171c86ba2065c54587e82b51fd6d7ab116e659324369955086c5237cd7fd26b60d6ce6 SHA512 a558af41f1927a1b1d87f8d11163a5f3d2e4f83a74aba00619b45a6d464d5477a6a0aac3c1b9d9a17e3343a4bf21a3fd6b279b51fa0c347c86c307381a4d0739
+DIST criu-3.17.tar.gz 1321713 BLAKE2B 3bc13a7df0da0a17c74e0c12f07b81fe7f294be4d1980647b64c74e35383416ffbc10e7c04398f307bc68ff701f76a9586ea58825057b0df16b40f6aab3cbd0e SHA512 febae66a7820345c0f335f4a49e64c0af5c8ae5d3a394cc0770881b64eab11ca03ad5872f06b0c4ccd1da844c519268dad3b4f8b260267e6d3f582e80d80f804

diff --git a/sys-process/criu/criu-3.17.ebuild b/sys-process/criu/criu-3.17.ebuild
new file mode 100644
index 000000000000..4ac0facc8cc2
--- /dev/null
+++ b/sys-process/criu/criu-3.17.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit toolchain-funcs linux-info python-r1
+
+DESCRIPTION="utility to checkpoint/restore a process tree"
+HOMEPAGE="
+	https://criu.org/
+	https://github.com/checkpoint-restore/
+"
+SRC_URI="https://github.com/checkpoint-restore/${PN}/archive/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 -riscv"
+IUSE="bpf doc gnutls nftables selinux setproctitle static-libs test"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="
+	${PYTHON_DEPS}
+	>=dev-libs/protobuf-c-1.4.0:=
+	dev-libs/libnl:3=
+	net-libs/libnet:1.1=
+	sys-libs/libcap:=
+	bpf? ( dev-libs/libbpf:= )
+	gnutls? ( net-libs/gnutls:= )
+	nftables? ( net-libs/gnutls:= )
+	selinux? ( sys-libs/libselinux:= )
+	setproctitle? ( dev-libs/libbsd:= )
+"
+DEPEND="${COMMON_DEPEND}"
+BDEPEND="
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	doc? (
+		app-text/asciidoc
+		app-text/xmlto
+	)
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	dev-python/protobuf-python[${PYTHON_USEDEP}]
+"
+
+CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
+	~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
+
+# root access required for tests
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	"${FILESDIR}/2.2/criu-2.2-flags.patch"
+	"${FILESDIR}/2.3/criu-2.3-no-git.patch"
+	"${FILESDIR}/criu-3.12-automagic-libbsd.patch"
+	"${FILESDIR}/criu-3.16.1-buildsystem.patch"
+
+	"${FILESDIR}/${P}-amdgpu-build-fixes.patch"
+)
+
+criu_arch() {
+	# criu infers the arch from $(uname -m).  We never want this to happen.
+	case ${ARCH} in
+		amd64) echo "x86";;
+		arm64) echo "aarch64";;
+		ppc64*) echo "ppc64";;
+		*)     echo "${ARCH}";;
+	esac
+}
+
+pkg_setup() {
+	use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
+	linux-info_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
+}
+
+criu_use() {
+	if ! use "${1}"; then
+		sed \
+			-e "s:${2:-${1}}:no_${2:-lib${1}}:g" \
+			-i Makefile.config || die
+	fi
+}
+
+src_configure() {
+	# Gold linker generates invalid object file when used with criu's custom
+	# linker script.  Use the bfd linker instead. See https://crbug.com/839665#c3
+	tc-ld-disable-gold
+
+	# Build system uses this variable as a trigger to append coverage flags
+	# we'd like to avoid it. https://bugs.gentoo.org/744244
+	unset GCOV
+
+	# we have to sed the Makdfile.config to disable automagic deps
+	criu_use selinux
+	criu_use bpf
+	criu_use nftables
+
+	emake_opts=(
+		SETPROCTITLE="$(usex setproctitle)"
+		NO_GNUTLS="$(usex gnutls '' '1')"
+	)
+
+	python_setup
+}
+
+criu_emake() {
+	emake \
+		AR="$(tc-getAR)" \
+		ARCH="$(criu_arch)" \
+		CC="$(tc-getCC)" \
+		FULL_PYTHON="${PYTHON%.*}" \
+		HOSTCC="$(tc-getBUILD_CC)" \
+		LD="$(tc-getLD)" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
+		OBJCOPY="$(tc-getOBJCOPY)" \
+		PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+		PREFIX="${EPREFIX}"/usr \
+		PYTHON="${EPYTHON%.*}" \
+		V=1 WERROR=0 DEBUG=0 \
+		"${emake_opts[@]}" \
+		"${@}"
+}
+
+build_crit() {
+	"${EPYTHON}" scripts/crit-setup.py build || die
+}
+
+src_compile() {
+	local -a targets=(
+		all
+		$(usex doc 'docs' '')
+	)
+	criu_emake ${targets}
+}
+
+src_test() {
+	criu_emake unittest
+}
+
+install_crit() {
+	"${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
+	python_optimize
+}
+
+src_install() {
+	criu_emake DESTDIR="${D}" install
+	python_foreach_impl install_crit
+
+	dodoc CREDITS README.md
+
+	if ! use static-libs; then
+		find "${D}" -name "*.a" -delete || die
+	fi
+}

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
new file mode 100644
index 000000000000..913737215e49
--- /dev/null
+++ b/sys-process/criu/files/criu-3.17-amdgpu-build-fixes.patch
@@ -0,0 +1,98 @@
+https://github.com/checkpoint-restore/criu/commit/cd0ed7e5491c7c827b887b2d80cf35e87819278b.patch
+https://github.com/checkpoint-restore/criu/commit/2b3763fe6a39033d4e3d3d80e28911d1737ac23b.patch
+
+From cd0ed7e5491c7c827b887b2d80cf35e87819278b Mon Sep 17 00:00:00 2001
+From: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+Date: Sun, 15 May 2022 17:08:18 +0100
+Subject: [PATCH] amdgpu/Makefile: Fix include path
+
+When building packages for CRIU the source directory might have a
+name different than 'criu'.
+
+Fixes: #1877
+
+Reported-by: @siris
+Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+--- a/plugins/amdgpu/Makefile
++++ b/plugins/amdgpu/Makefile
+@@ -2,7 +2,7 @@ PLUGIN_NAME		:= amdgpu_plugin
+ PLUGIN_SOBJ		:= amdgpu_plugin.so
+ 
+ 
+-PLUGIN_INCLUDE  	:= -iquote../../../criu/include
++PLUGIN_INCLUDE  	:= -iquote../../include
+ PLUGIN_INCLUDE  	+= -iquote../../criu/include
+ PLUGIN_INCLUDE  	+= -iquote../../criu/arch/$(ARCH)/include/
+ PLUGIN_INCLUDE  	+= -iquote../../
+
+
+From 2b3763fe6a39033d4e3d3d80e28911d1737ac23b Mon Sep 17 00:00:00 2001
+From: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+Date: Sun, 8 May 2022 11:07:25 +0100
+Subject: [PATCH] amdgpu: Set PLUGINDIR to /usr/lib/criu
+
+Building the criu packages for Ubuntu/Debian fails with:
+
+	mkdir: cannot create directory '/var/lib/criu': Permission denied
+
+This patch updates PLUGINDIR with the value /usr/lib/criu
+
+Fixes: #1877
+
+Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+--- a/Makefile.install
++++ b/Makefile.install
+@@ -7,7 +7,7 @@ MANDIR		?= $(PREFIX)/share/man
+ INCLUDEDIR	?= $(PREFIX)/include
+ LIBEXECDIR	?= $(PREFIX)/libexec
+ RUNDIR		?= /run
+-PLUGINDIR	?= /var/lib/criu
++PLUGINDIR	?= $(PREFIX)/lib/criu
+ 
+ #
+ # For recent Debian/Ubuntu with multiarch support.
+--- a/criu/include/plugin.h
++++ b/criu/include/plugin.h
+@@ -5,7 +5,9 @@
+ #include "common/compiler.h"
+ #include "common/list.h"
+ 
+-#define CR_PLUGIN_DEFAULT "/var/lib/criu/"
++#ifndef CR_PLUGIN_DEFAULT
++#define CR_PLUGIN_DEFAULT "/usr/lib/criu/"
++#endif
+ 
+ void cr_plugin_fini(int stage, int err);
+ int cr_plugin_init(int stage);
+--- a/plugins/amdgpu/Makefile
++++ b/plugins/amdgpu/Makefile
+@@ -15,7 +15,7 @@ DEPS_NOK 		:= ;
+ include $(__nmk_dir)msg.mk
+ 
+ CC      		:= gcc
+-PLUGIN_CFLAGS  		:= -g -Wall -Werror -D _GNU_SOURCE -shared -nostartfiles -fPIC
++PLUGIN_CFLAGS  		:= -g -Wall -Werror -D _GNU_SOURCE -shared -nostartfiles -fPIC -DCR_PLUGIN_DEFAULT="$(PLUGINDIR)"
+ PLUGIN_LDFLAGS		:= -lpthread -lrt -ldrm -ldrm_amdgpu
+ 
+ ifeq ($(CONFIG_AMDGPU),y)
+@@ -50,16 +50,16 @@ clean: amdgpu_plugin_clean amdgpu_plugin_test_clean
+ mrproper: clean
+ 
+ install:
+-	$(Q) mkdir -p $(PLUGINDIR)
+ ifeq ($(CONFIG_AMDGPU),y)
++	$(Q) mkdir -p $(DESTDIR)$(PLUGINDIR)
+ 	$(E) "  INSTALL " $(PLUGIN_NAME)
+-	$(Q) install -m 644 $(PLUGIN_SOBJ) $(PLUGINDIR)
++	$(Q) install -m 644 $(PLUGIN_SOBJ) $(DESTDIR)$(PLUGINDIR)
+ endif
+ .PHONY: install
+ 
+ uninstall:
+ ifeq ($(CONFIG_AMDGPU),y)
+ 	$(E) " UNINSTALL" $(PLUGIN_NAME)
+-	$(Q) $(RM) $(PLUGINDIR)/$(PLUGIN_SOBJ)
++	$(Q) $(RM) $(DESTDIR)$(PLUGINDIR)/$(PLUGIN_SOBJ)
+ endif
+ .PHONY: uninstall
+


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2022-09-03  0:33 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2022-09-03  0:33 UTC (permalink / raw
  To: gentoo-commits

commit:     359a6c0eb116c0f9afbf6afa94b7e8936ed5ffc5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  3 00:33:29 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep  3 00:33:38 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=359a6c0e

sys-process/criu: add additional glibc-2.36 fix

Closes: https://bugs.gentoo.org/868099
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/criu/criu-3.17-r1.ebuild               |  1 +
 .../criu/files/criu-3.17-glibc-2.36-deux.patch     | 99 ++++++++++++++++++++++
 2 files changed, 100 insertions(+)

diff --git a/sys-process/criu/criu-3.17-r1.ebuild b/sys-process/criu/criu-3.17-r1.ebuild
index ac5e1722d999..92fb5dbc8119 100644
--- a/sys-process/criu/criu-3.17-r1.ebuild
+++ b/sys-process/criu/criu-3.17-r1.ebuild
@@ -61,6 +61,7 @@ PATCHES=(
 
 	"${FILESDIR}/${P}-amdgpu-build-fixes.patch"
 	"${FILESDIR}/${PN}-3.17-glibc-2.36.patch"
+	"${FILESDIR}/${PN}-3.17-glibc-2.36-deux.patch"
 )
 
 criu_arch() {

diff --git a/sys-process/criu/files/criu-3.17-glibc-2.36-deux.patch b/sys-process/criu/files/criu-3.17-glibc-2.36-deux.patch
new file mode 100644
index 000000000000..ca911d82779d
--- /dev/null
+++ b/sys-process/criu/files/criu-3.17-glibc-2.36-deux.patch
@@ -0,0 +1,99 @@
+https://github.com/checkpoint-restore/criu/commit/517c0947050e63aac72f63a3bf373d76264723b9
+https://bugs.gentoo.org/868099
+
+From: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+Date: Wed, 24 Aug 2022 21:20:30 +0200
+Subject: [PATCH] mount: add definition for FSOPEN_CLOEXEC
+
+A recent change in glibc introduced `enum fsconfig_command` [1] and as a
+result the compilation of criu fails with the following errors
+
+In file included from criu/pie/util.c:3:
+/usr/include/sys/mount.h:240:6: error: redeclaration of 'enum fsconfig_command'
+  240 | enum fsconfig_command
+      |      ^~~~~~~~~~~~~~~~
+In file included from /usr/include/sys/mount.h:32:
+criu/include/linux/mount.h:11:6: note: originally defined here
+   11 | enum fsconfig_command {
+      |      ^~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:242:3: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
+  242 |   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
+      |   ^~~~~~~~~~~~~~~~~
+criu/include/linux/mount.h:12:9: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
+   12 |         FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
+      |         ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:244:3: error: redeclaration of enumerator 'FSCONFIG_SET_STRING'
+  244 |   FSCONFIG_SET_STRING     = 1,    /* Set parameter, supplying a string value */
+      |   ^~~~~~~~~~~~~~~~~~~
+criu/include/linux/mount.h:14:9: note: previous definition of 'FSCONFIG_SET_STRING' with type 'enum fsconfig_command'
+   14 |         FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */
+      |         ^~~~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:246:3: error: redeclaration of enumerator 'FSCONFIG_SET_BINARY'
+  246 |   FSCONFIG_SET_BINARY     = 2,    /* Set parameter, supplying a binary blob value */
+      |   ^~~~~~~~~~~~~~~~~~~
+criu/include/linux/mount.h:16:9: note: previous definition of 'FSCONFIG_SET_BINARY' with type 'enum fsconfig_command'
+   16 |         FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */
+      |         ^~~~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:248:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH'
+  248 |   FSCONFIG_SET_PATH       = 3,    /* Set parameter, supplying an object by path */
+      |   ^~~~~~~~~~~~~~~~~
+criu/include/linux/mount.h:18:9: note: previous definition of 'FSCONFIG_SET_PATH' with type 'enum fsconfig_command'
+   18 |         FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */
+      |         ^~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:250:3: error: redeclaration of enumerator 'FSCONFIG_SET_PATH_EMPTY'
+  250 |   FSCONFIG_SET_PATH_EMPTY = 4,    /* Set parameter, supplying an object by (empty) path */
+      |   ^~~~~~~~~~~~~~~~~~~~~~~
+criu/include/linux/mount.h:20:9: note: previous definition of 'FSCONFIG_SET_PATH_EMPTY' with type 'enum fsconfig_command'
+   20 |         FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */
+      |         ^~~~~~~~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:252:3: error: redeclaration of enumerator 'FSCONFIG_SET_FD'
+  252 |   FSCONFIG_SET_FD         = 5,    /* Set parameter, supplying an object by fd */
+      |   ^~~~~~~~~~~~~~~
+criu/include/linux/mount.h:22:9: note: previous definition of 'FSCONFIG_SET_FD' with type 'enum fsconfig_command'
+   22 |         FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */
+      |         ^~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:254:3: error: redeclaration of enumerator 'FSCONFIG_CMD_CREATE'
+  254 |   FSCONFIG_CMD_CREATE     = 6,    /* Invoke superblock creation */
+      |   ^~~~~~~~~~~~~~~~~~~
+criu/include/linux/mount.h:24:9: note: previous definition of 'FSCONFIG_CMD_CREATE' with type 'enum fsconfig_command'
+   24 |         FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */
+      |         ^~~~~~~~~~~~~~~~~~~
+/usr/include/sys/mount.h:256:3: error: redeclaration of enumerator 'FSCONFIG_CMD_RECONFIGURE'
+  256 |   FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
+      |   ^~~~~~~~~~~~~~~~~~~~~~~~
+criu/include/linux/mount.h:26:9: note: previous definition of 'FSCONFIG_CMD_RECONFIGURE' with type 'enum fsconfig_command'
+   26 |         FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
+
+This patch adds definition for FSOPEN_CLOEXEC to solve this problem. In particular,
+sys/mount.h includes ifndef check for FSOPEN_CLOEXEC surrounding `enum fsconfig_command`.
+
+[1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=7eae6a91e9b1670330c9f15730082c91c0b1d570
+
+Reported-by: Younes Manton (@ymanton)
+Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
+--- a/criu/include/linux/mount.h
++++ b/criu/include/linux/mount.h
+@@ -6,7 +6,7 @@
+ 
+ /* Copied from /usr/include/sys/mount.h */
+ 
+-#ifndef FSCONFIG_CMD_CREATE
++#ifndef FSOPEN_CLOEXEC
+ /* The type of fsconfig call made.   */
+ enum fsconfig_command {
+ 	FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
+@@ -26,7 +26,13 @@ enum fsconfig_command {
+ 	FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
+ #define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
+ };
+-#endif // FSCONFIG_CMD_CREATE
++
++#endif // FSOPEN_CLOEXEC
++
++/* fsopen flags. With the redundant definition, we check if the kernel,
++ * glibc value and our value still match.
++ */
++#define FSOPEN_CLOEXEC 0x00000001
+ 
+ #ifndef MS_MGC_VAL
+ /* Magic mount flag number. Has to be or-ed to the flag values.  */


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2023-05-01 12:49 Sam James
  0 siblings, 0 replies; 13+ messages in thread
From: Sam James @ 2023-05-01 12:49 UTC (permalink / raw
  To: gentoo-commits

commit:     65fbfa15aa71be1fde62e9fcbffbda0b3d69f336
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May  1 12:48:06 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  1 12:49:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65fbfa15

sys-process/criu: drop 3.15, 3.15-r3, 3.16.1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/criu/Manifest                          |   2 -
 sys-process/criu/criu-3.15-r3.ebuild               | 140 ---------------
 sys-process/criu/criu-3.15.ebuild                  | 139 ---------------
 sys-process/criu/criu-3.16.1.ebuild                | 162 -----------------
 sys-process/criu/files/criu-3.15-pkg-config.patch  | 141 ---------------
 .../criu/files/criu-3.15-protobuf-c-1.4.0.patch    | 194 ---------------------
 6 files changed, 778 deletions(-)

diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index 8e3b332bc860..17a9661b07b3 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -1,3 +1 @@
-DIST criu-3.15.tar.bz2 913904 BLAKE2B 2a3c7ad7ac32a407493e8908886d2929606e1dd0a1dd499be75cb954c1c4d60d0c59f0524d173dcdd89fa638e1edcc0c31886262069e3478173648ef09b4c159 SHA512 7bfd32053e47b95d10cdd5e99494bff6a21aa3179518179f8c72e870f0aab960dd76c9f6cb6982e5b881472cf6962eefee3cf7d8ae9128b3379bcaecc937ebbc
-DIST criu-3.16.1.tar.gz 1228535 BLAKE2B 45aa87ee00a18b91474e767dc0326cce6c0942af7771a0c5536751361c171c86ba2065c54587e82b51fd6d7ab116e659324369955086c5237cd7fd26b60d6ce6 SHA512 a558af41f1927a1b1d87f8d11163a5f3d2e4f83a74aba00619b45a6d464d5477a6a0aac3c1b9d9a17e3343a4bf21a3fd6b279b51fa0c347c86c307381a4d0739
 DIST criu-3.17.tar.gz 1321713 BLAKE2B 3bc13a7df0da0a17c74e0c12f07b81fe7f294be4d1980647b64c74e35383416ffbc10e7c04398f307bc68ff701f76a9586ea58825057b0df16b40f6aab3cbd0e SHA512 febae66a7820345c0f335f4a49e64c0af5c8ae5d3a394cc0770881b64eab11ca03ad5872f06b0c4ccd1da844c519268dad3b4f8b260267e6d3f582e80d80f804

diff --git a/sys-process/criu/criu-3.15-r3.ebuild b/sys-process/criu/criu-3.15-r3.ebuild
deleted file mode 100644
index f4108c16202b..000000000000
--- a/sys-process/criu/criu-3.15-r3.ebuild
+++ /dev/null
@@ -1,140 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_9 )
-
-inherit toolchain-funcs linux-info python-r1
-
-DESCRIPTION="utility to checkpoint/restore a process tree"
-HOMEPAGE="https://criu.org/"
-SRC_URI="https://download.openvz.org/criu/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ppc64 -riscv"
-IUSE="doc selinux setproctitle static-libs"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="
-	${PYTHON_DEPS}
-	>=dev-libs/protobuf-c-1.4.0:=
-	dev-libs/libnl:3
-	net-libs/libnet:1.1
-	sys-libs/libcap
-	selinux? ( sys-libs/libselinux )
-	setproctitle? ( dev-libs/libbsd )"
-DEPEND="${RDEPEND}"
-BDEPEND="
-	doc? (
-		app-text/asciidoc
-		app-text/xmlto
-	)"
-RDEPEND="${RDEPEND}
-	dev-python/protobuf-python[${PYTHON_USEDEP}]"
-
-CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
-	~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
-
-# root access required for tests
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/2.2/${PN}-2.2-flags.patch
-	"${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
-	"${FILESDIR}"/${PN}-3.12-automagic-libbsd.patch
-	"${FILESDIR}"/${PN}-3.15-pkg-config.patch
-	"${FILESDIR}"/${PN}-3.15-protobuf-c-1.4.0.patch
-)
-
-criu_arch() {
-	# criu infers the arch from $(uname -m).  We never want this to happen.
-	case ${ARCH} in
-		amd64) echo "x86";;
-		arm64) echo "aarch64";;
-		ppc64*) echo "ppc64";;
-		*)     echo "${ARCH}";;
-	esac
-}
-
-pkg_setup() {
-	use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
-	linux-info_pkg_setup
-}
-
-src_prepare() {
-	default
-
-	if ! use selinux; then
-		sed \
-			-e 's:libselinux:no_libselinux:g' \
-			-i Makefile.config || die
-	fi
-
-	use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
-}
-
-src_configure() {
-	# Gold linker generates invalid object file when used with criu's custom
-	# linker script.  Use the bfd linker instead. See https://crbug.com/839665#c3
-	tc-ld-disable-gold
-
-	# Build system uses this variable as a trigger to append coverage flags
-	# we'd like to avoid it. https://bugs.gentoo.org/744244
-	unset GCOV
-
-	python_setup
-}
-
-src_compile() {
-	local target="all $(usex doc 'docs' '')"
-	emake \
-		HOSTCC="$(tc-getBUILD_CC)" \
-		CC="$(tc-getCC)" \
-		LD="$(tc-getLD)" \
-		AR="$(tc-getAR)" \
-		PKG_CONFIG="$(tc-getPKG_CONFIG)" \
-		PYTHON="${EPYTHON%.?}" \
-		FULL_PYTHON="${PYTHON%.?}" \
-		OBJCOPY="$(tc-getOBJCOPY)" \
-		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
-		ARCH="$(criu_arch)" \
-		V=1 WERROR=0 DEBUG=0 \
-		SETPROCTITLE=$(usex setproctitle) \
-		${target}
-}
-
-src_test() {
-	# root privileges are required to dump all necessary info
-	if [[ ${EUID} -eq 0 ]] ; then
-		emake -j1 CC="$(tc-getCC)" ARCH="$(criu_arch)" V=1 WERROR=0 test
-	fi
-}
-
-install_crit() {
-	"${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
-	python_optimize
-}
-
-src_install() {
-	emake \
-		ARCH="$(criu_arch)" \
-		PREFIX="${EPREFIX}"/usr \
-		PYTHON="${EPYTHON%.?}" \
-		FULL_PYTHON="${PYTHON%.?}" \
-		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
-		DESTDIR="${D}" \
-		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
-		V=1 WERROR=0 DEBUG=0 \
-		install
-
-	use doc && dodoc CREDITS README.md
-
-	python_foreach_impl install_crit
-
-	if ! use static-libs; then
-		find "${D}" -name "*.a" -delete || die
-	fi
-}

diff --git a/sys-process/criu/criu-3.15.ebuild b/sys-process/criu/criu-3.15.ebuild
deleted file mode 100644
index 283d46ee4859..000000000000
--- a/sys-process/criu/criu-3.15.ebuild
+++ /dev/null
@@ -1,139 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_9 )
-
-inherit toolchain-funcs linux-info python-r1
-
-DESCRIPTION="utility to checkpoint/restore a process tree"
-HOMEPAGE="https://criu.org/"
-SRC_URI="https://download.openvz.org/criu/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 ppc64 -riscv"
-IUSE="doc selinux setproctitle static-libs"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="
-	${PYTHON_DEPS}
-	dev-libs/protobuf-c
-	dev-libs/libnl:3
-	net-libs/libnet:1.1
-	sys-libs/libcap
-	selinux? ( sys-libs/libselinux )
-	setproctitle? ( dev-libs/libbsd )"
-DEPEND="${RDEPEND}
-	doc? (
-		app-text/asciidoc
-		app-text/xmlto
-	)"
-RDEPEND="${RDEPEND}
-	dev-python/protobuf-python[${PYTHON_USEDEP}]
-"
-
-CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
-	~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
-
-# root access required for tests
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/2.2/${PN}-2.2-flags.patch
-	"${FILESDIR}"/2.3/${PN}-2.3-no-git.patch
-	"${FILESDIR}"/${PN}-3.12-automagic-libbsd.patch
-	"${FILESDIR}"/${PN}-3.15-pkg-config.patch
-)
-
-criu_arch() {
-	# criu infers the arch from $(uname -m).  We never want this to happen.
-	case ${ARCH} in
-		amd64) echo "x86";;
-		arm64) echo "aarch64";;
-		ppc64*) echo "ppc64";;
-		*)     echo "${ARCH}";;
-	esac
-}
-
-pkg_setup() {
-	use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
-	linux-info_pkg_setup
-}
-
-src_prepare() {
-	default
-
-	if ! use selinux; then
-		sed \
-			-e 's:libselinux:no_libselinux:g' \
-			-i Makefile.config || die
-	fi
-
-	use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
-}
-
-src_configure() {
-	# Gold linker generates invalid object file when used with criu's custom
-	# linker script.  Use the bfd linker instead. See https://crbug.com/839665#c3
-	tc-ld-disable-gold
-
-	# Build system uses this variable as a trigger to append coverage flags
-	# we'd like to avoid it. https://bugs.gentoo.org/744244
-	unset GCOV
-
-	python_setup
-}
-
-src_compile() {
-	local target="all $(usex doc 'docs' '')"
-	emake \
-		HOSTCC="$(tc-getBUILD_CC)" \
-		CC="$(tc-getCC)" \
-		LD="$(tc-getLD)" \
-		AR="$(tc-getAR)" \
-		PKG_CONFIG="$(tc-getPKG_CONFIG)" \
-		PYTHON="${EPYTHON%.?}" \
-		FULL_PYTHON="${PYTHON%.?}" \
-		OBJCOPY="$(tc-getOBJCOPY)" \
-		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
-		ARCH="$(criu_arch)" \
-		V=1 WERROR=0 DEBUG=0 \
-		SETPROCTITLE=$(usex setproctitle) \
-		${target}
-}
-
-src_test() {
-	# root privileges are required to dump all necessary info
-	if [[ ${EUID} -eq 0 ]] ; then
-		emake -j1 CC="$(tc-getCC)" ARCH="$(criu_arch)" V=1 WERROR=0 test
-	fi
-}
-
-install_crit() {
-	"${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
-	python_optimize
-}
-
-src_install() {
-	emake \
-		ARCH="$(criu_arch)" \
-		PREFIX="${EPREFIX}"/usr \
-		PYTHON="${EPYTHON%.?}" \
-		FULL_PYTHON="${PYTHON%.?}" \
-		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
-		DESTDIR="${D}" \
-		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
-		V=1 WERROR=0 DEBUG=0 \
-		install
-
-	use doc && dodoc CREDITS README.md
-
-	python_foreach_impl install_crit
-
-	if ! use static-libs; then
-		find "${D}" -name "*.a" -delete || die
-	fi
-}

diff --git a/sys-process/criu/criu-3.16.1.ebuild b/sys-process/criu/criu-3.16.1.ebuild
deleted file mode 100644
index 7c36938828cc..000000000000
--- a/sys-process/criu/criu-3.16.1.ebuild
+++ /dev/null
@@ -1,162 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..10} )
-
-inherit toolchain-funcs linux-info python-r1
-
-DESCRIPTION="utility to checkpoint/restore a process tree"
-HOMEPAGE="
-	https://criu.org/
-	https://github.com/checkpoint-restore/
-"
-SRC_URI="https://github.com/checkpoint-restore/${PN}/archive/v${PV}/${P}.tar.gz"
-
-LICENSE="GPL-2 LGPL-2.1"
-SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ppc64 -riscv"
-IUSE="bpf doc gnutls nftables selinux setproctitle static-libs test"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-COMMON_DEPEND="
-	${PYTHON_DEPS}
-	>=dev-libs/protobuf-c-1.4.0:=
-	dev-libs/libnl:3=
-	net-libs/libnet:1.1=
-	sys-libs/libcap:=
-	bpf? ( dev-libs/libbpf:= )
-	gnutls? ( net-libs/gnutls:= )
-	nftables? ( net-libs/gnutls:= )
-	selinux? ( sys-libs/libselinux:= )
-	setproctitle? ( dev-libs/libbsd:= )
-"
-DEPEND="${COMMON_DEPEND}"
-BDEPEND="
-	dev-python/setuptools[${PYTHON_USEDEP}]
-	doc? (
-		app-text/asciidoc
-		app-text/xmlto
-	)
-"
-RDEPEND="
-	${COMMON_DEPEND}
-	dev-python/protobuf-python[${PYTHON_USEDEP}]
-"
-
-CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
-	~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
-
-# root access required for tests
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	"${FILESDIR}/2.2/criu-2.2-flags.patch"
-	"${FILESDIR}/2.3/criu-2.3-no-git.patch"
-	"${FILESDIR}/criu-3.12-automagic-libbsd.patch"
-	"${FILESDIR}/criu-3.16.1-buildsystem.patch"
-)
-
-criu_arch() {
-	# criu infers the arch from $(uname -m).  We never want this to happen.
-	case ${ARCH} in
-		amd64) echo "x86";;
-		arm64) echo "aarch64";;
-		ppc64*) echo "ppc64";;
-		*)     echo "${ARCH}";;
-	esac
-}
-
-pkg_setup() {
-	use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
-	linux-info_pkg_setup
-}
-
-src_prepare() {
-	default
-
-	use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
-}
-
-criu_use() {
-	if ! use "${1}"; then
-		sed \
-			-e "s:${2:-${1}}:no_${2:-lib${1}}:g" \
-			-i Makefile.config || die
-	fi
-}
-
-src_configure() {
-	# Gold linker generates invalid object file when used with criu's custom
-	# linker script.  Use the bfd linker instead. See https://crbug.com/839665#c3
-	tc-ld-disable-gold
-
-	# Build system uses this variable as a trigger to append coverage flags
-	# we'd like to avoid it. https://bugs.gentoo.org/744244
-	unset GCOV
-
-	# we have to sed the Makdfile.config to disable automagic deps
-	criu_use selinux
-	criu_use bpf
-	criu_use nftables
-
-	emake_opts=(
-		SETPROCTITLE="$(usex setproctitle)"
-		NO_GNUTLS="$(usex gnutls '' '1')"
-	)
-
-	python_setup
-}
-
-criu_emake() {
-	emake \
-		AR="$(tc-getAR)" \
-		ARCH="$(criu_arch)" \
-		CC="$(tc-getCC)" \
-		FULL_PYTHON="${PYTHON%.*}" \
-		HOSTCC="$(tc-getBUILD_CC)" \
-		LD="$(tc-getLD)" \
-		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
-		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
-		OBJCOPY="$(tc-getOBJCOPY)" \
-		PKG_CONFIG="$(tc-getPKG_CONFIG)" \
-		PREFIX="${EPREFIX}"/usr \
-		PYTHON="${EPYTHON%.*}" \
-		V=1 WERROR=0 DEBUG=0 \
-		"${emake_opts[@]}" \
-		"${@}"
-}
-
-build_crit() {
-	"${EPYTHON}" scripts/crit-setup.py build || die
-}
-
-src_compile() {
-	local -a targets=(
-		all
-		$(usex doc 'docs' '')
-	)
-	criu_emake ${targets}
-}
-
-src_test() {
-	criu_emake unittest
-}
-
-install_crit() {
-	"${EPYTHON}" scripts/crit-setup.py install --root="${D}" --prefix="${EPREFIX}/usr/" || die
-	python_optimize
-}
-
-src_install() {
-	criu_emake DESTDIR="${D}" install
-	python_foreach_impl install_crit
-
-	dodoc CREDITS README.md
-
-	if ! use static-libs; then
-		find "${D}" -name "*.a" -delete || die
-	fi
-}

diff --git a/sys-process/criu/files/criu-3.15-pkg-config.patch b/sys-process/criu/files/criu-3.15-pkg-config.patch
deleted file mode 100644
index 69d83bfc399a..000000000000
--- a/sys-process/criu/files/criu-3.15-pkg-config.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-https://github.com/checkpoint-restore/criu/pull/1517
-
-From d72536d9a821f9ff64f5dd62c9f8a282e3e5ec85 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@chromium.org>
-Date: Wed, 16 Jun 2021 15:43:04 -0400
-Subject: [PATCH] build: respect $PKG_CONFIG settings
-
-The build needs to respect $PKG_CONFIG env var like other standard
-build systems and the the upstream pkg-config project itself.  This
-allows the package builder to point it to the right tool when doing
-a cross-compile build.  Otherwise the host pkg-config tool is used
-which won't have access to the packages in the cross sysroot.
-
-Signed-off-by: Mike Frysinger <vapier@chromium.org>
----
- Makefile.config              | 2 +-
- criu/Makefile                | 2 +-
- scripts/nmk/scripts/tools.mk | 1 +
- scripts/nmk/scripts/utils.mk | 2 +-
- test/zdtm/Makefile.inc       | 8 +++++---
- test/zdtm/lib/Makefile       | 2 +-
- test/zdtm/static/Makefile    | 2 +-
- 7 files changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/Makefile.config b/Makefile.config
-index 3d99e680be7f..6e3e1b062256 100644
---- a/Makefile.config
-+++ b/Makefile.config
-@@ -30,7 +30,7 @@ else
- endif
- 
- ifeq ($(call pkg-config-check,libnftables),y)
--        LIB_NFTABLES	:= $(shell pkg-config --libs libnftables)
-+        LIB_NFTABLES	:= $(shell $(PKG_CONFIG) --libs libnftables)
-         ifeq ($(call try-cc,$(FEATURE_TEST_NFTABLES_LIB_API_0),$(LIB_NFTABLES)),true)
-                 LIBS_FEATURES	+= $(LIB_NFTABLES)
-                 FEATURE_DEFINES	+= -DCONFIG_HAS_NFTABLES_LIB_API_0
-diff --git a/criu/Makefile b/criu/Makefile
-index ceb49ce09925..11d454c81026 100644
---- a/criu/Makefile
-+++ b/criu/Makefile
-@@ -27,7 +27,7 @@ CFLAGS			+= -iquote include
- CFLAGS			+= -iquote images
- CFLAGS			+= -iquote $(ARCH_DIR)/include
- CFLAGS			+= -iquote .
--CFLAGS			+= $(shell pkg-config --cflags libnl-3.0)
-+CFLAGS			+= $(shell $(PKG_CONFIG) --cflags libnl-3.0)
- CFLAGS			+= $(CONFIG-DEFINES)
- 
- ifeq ($(GMON),1)
-diff --git a/scripts/nmk/scripts/tools.mk b/scripts/nmk/scripts/tools.mk
-index c5794401c734..1681d4e9092b 100644
---- a/scripts/nmk/scripts/tools.mk
-+++ b/scripts/nmk/scripts/tools.mk
-@@ -17,6 +17,7 @@ AR		:= $(CROSS_COMPILE)ar
- STRIP		:= $(CROSS_COMPILE)strip
- OBJCOPY		:= $(CROSS_COMPILE)objcopy
- OBJDUMP		:= $(CROSS_COMPILE)objdump
-+PKG_CONFIG	?= pkg-config
- NM		:= $(CROSS_COMPILE)nm
- MAKE		:= make
- MKDIR		:= mkdir -p
-diff --git a/scripts/nmk/scripts/utils.mk b/scripts/nmk/scripts/utils.mk
-index b9790615ca7f..f93fdf911cef 100644
---- a/scripts/nmk/scripts/utils.mk
-+++ b/scripts/nmk/scripts/utils.mk
-@@ -16,7 +16,7 @@ try-asm = $(call try-compile,assembler-with-cpp,$(1),$(2),$(3))
- 
- # pkg-config-check
- # Usage: ifeq ($(call pkg-config-check, library),y)
--pkg-config-check = $(shell sh -c 'pkg-config $(1) && echo y')
-+pkg-config-check = $(shell sh -c '$(PKG_CONFIG) $(1) && echo y')
- 
- #
- # Remove duplicates.
-diff --git a/test/zdtm/Makefile.inc b/test/zdtm/Makefile.inc
-index 43763321f956..e4af9c51e9e4 100644
---- a/test/zdtm/Makefile.inc
-+++ b/test/zdtm/Makefile.inc
-@@ -37,6 +37,7 @@ HOSTCC	?= gcc
- ifeq ($(origin CC), default)
-         CC := $(CROSS_COMPILE)$(HOSTCC)
- endif
-+PKG_CONFIG ?= pkg-config
- CFLAGS	+= -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
- CFLAGS	+= -Wdeclaration-after-statement -Wstrict-prototypes
- CFLAGS	+= $(USERCFLAGS)
-@@ -54,8 +55,9 @@ endif
- RM := rm -f --one-file-system
- 
- ifeq ($(COMPAT_TEST),y)
-+$(error bad juju)
-         # Firstly look for 32-bit libs and then in standard path.
--        PKG_CONFIG_PATH := $(shell pkg-config --variable pc_path pkg-config)
-+        PKG_CONFIG_PATH := $(shell $(PKG_CONFIG) --variable pc_path pkg-config)
-         PKG_CONFIG_PATH := /usr/lib32/pkgconfig:$(PKG_CONFIG_PATH)
- ifeq ($(ARCH),x86)
-         export CFLAGS += -m32
-@@ -66,11 +68,11 @@ endif
- endif
- 
- define pkg-libs
--        $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" pkg-config --libs $(1))
-+        $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(PKG_CONFIG) --libs $(1))
- endef
- 
- define pkg-cflags
--        $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" pkg-config --cflags $(1))
-+        $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(PKG_CONFIG) --cflags $(1))
- endef
- 
- %.d: %.c
-diff --git a/test/zdtm/lib/Makefile b/test/zdtm/lib/Makefile
-index 05fe64e91703..5ecf8bccf27b 100644
---- a/test/zdtm/lib/Makefile
-+++ b/test/zdtm/lib/Makefile
-@@ -6,7 +6,7 @@ LIB	:= libzdtmtst.a
- 
- LIBSRC	:= datagen.c msg.c parseargs.c test.c streamutil.c lock.c ns.c tcp.c unix.c fs.c sysctl.c
- 
--pkg-config-check = $(shell sh -c 'pkg-config $(1) && echo y')
-+pkg-config-check = $(shell sh -c '$(PKG_CONFIG) $(1) && echo y')
- ifeq ($(call pkg-config-check,libbpf),y)
- LIBSRC	+= bpfmap_zdtm.c
- endif
-diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
-index e60fe6dc2d66..c5f3c98be3ed 100644
---- a/test/zdtm/static/Makefile
-+++ b/test/zdtm/static/Makefile
-@@ -241,7 +241,7 @@ TST_NOFILE	:=				\
- 		sigtrap01			\
- #		jobctl00			\
- 
--pkg-config-check = $(shell sh -c 'pkg-config $(1) && echo y')
-+pkg-config-check = $(shell sh -c '$(PKG_CONFIG) $(1) && echo y')
- ifeq ($(call pkg-config-check,libbpf),y)
- TST_NOFILE	+=				\
- 		bpf_hash			\
--- 
-2.31.1
-

diff --git a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch b/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
deleted file mode 100644
index 86d9cd31724d..000000000000
--- a/sys-process/criu/files/criu-3.15-protobuf-c-1.4.0.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-https://bugs.gentoo.org/809092
-https://bugs.gentoo.org/814056
-https://github.com/checkpoint-restore/criu/commit/1c25914a5dd1eb385937dffdd85901c3f5e39b8c
-https://github.com/checkpoint-restore/criu/commit/6a15dbdefa5c23a75eb3d1137681404588a16efa
-
-From 1c25914a5dd1eb385937dffdd85901c3f5e39b8c Mon Sep 17 00:00:00 2001
-From: Zeyad Yasser <zeyady98@gmail.com>
-Date: Thu, 22 Jul 2021 11:39:34 +0200
-Subject: [PATCH] protobuf: remove leading underscores from protobuf structs
-
-Fixes: #1560
-
-The latest protobuf-c compiler breaks CRIU because they removed
-leading underscores from structs in 1.4.0.
-
-This replaces those definitions with the standard generated structs.
-
-v2: remove struct _VmaEntry, struct _CredsEntry and struct _CoreEntry
-
-Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
----
- criu/include/irmap.h            | 8 +++++---
- criu/include/parasite-syscall.h | 8 +++-----
- criu/include/pstree.h           | 2 +-
- criu/include/rst_info.h         | 5 ++---
- criu/include/shmem.h            | 1 -
- criu/mem.c                      | 2 +-
- lib/c/criu.h                    | 3 ++-
- 7 files changed, 14 insertions(+), 15 deletions(-)
-
-diff --git a/criu/include/irmap.h b/criu/include/irmap.h
-index 033f71e372..188d753f4d 100644
---- a/criu/include/irmap.h
-+++ b/criu/include/irmap.h
-@@ -1,13 +1,15 @@
- #ifndef __CR_IRMAP__H__
- #define __CR_IRMAP__H__
-+
-+#include "images/fh.pb-c.h"
-+
- char *irmap_lookup(unsigned int s_dev, unsigned long i_ino);
--struct _FhEntry;
- int irmap_queue_cache(unsigned int dev, unsigned long ino,
--		struct _FhEntry *fh);
-+		FhEntry *fh);
- int irmap_predump_prep(void);
- int irmap_predump_run(void);
- int check_open_handle(unsigned int s_dev, unsigned long i_ino,
--		struct _FhEntry *f_handle);
-+		FhEntry *f_handle);
- int irmap_load_cache(void);
- int irmap_scan_path_add(char *path);
- #endif
-diff --git a/criu/include/parasite-syscall.h b/criu/include/parasite-syscall.h
-index c86a724fd1..afba95a9e7 100644
---- a/criu/include/parasite-syscall.h
-+++ b/criu/include/parasite-syscall.h
-@@ -11,8 +11,6 @@ struct parasite_dump_misc;
- struct parasite_drain_fd;
- struct vm_area_list;
- struct pstree_item;
--struct _CredsEntry;
--struct _CoreEntry;
- struct list_head;
- struct cr_imgset;
- struct fd_opts;
-@@ -31,11 +29,11 @@ extern int parasite_dump_posix_timers_seized(struct proc_posix_timers_stat *proc
- 		struct parasite_ctl *ctl, struct pstree_item *);
- 
- extern int parasite_dump_misc_seized(struct parasite_ctl *ctl, struct parasite_dump_misc *misc);
--extern int parasite_dump_creds(struct parasite_ctl *ctl, struct _CredsEntry *ce);
--extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, struct _CoreEntry *core);
-+extern int parasite_dump_creds(struct parasite_ctl *ctl, CredsEntry *ce);
-+extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, CoreEntry *core);
- extern int parasite_dump_thread_seized(struct parasite_thread_ctl *tctl,
- 				       struct parasite_ctl *ctl, int id,
--				       struct pid *tid, struct _CoreEntry *core);
-+				       struct pid *tid, CoreEntry *core);
- extern int dump_thread_core(int pid, CoreEntry *core,
- 					const struct parasite_dump_thread *dt);
- 
-diff --git a/criu/include/pstree.h b/criu/include/pstree.h
-index 61ab0ce0eb..17d22e791e 100644
---- a/criu/include/pstree.h
-+++ b/criu/include/pstree.h
-@@ -113,7 +113,7 @@ extern int prepare_task_entries(void);
- extern int prepare_dummy_task_state(struct pstree_item *pi);
- 
- extern int get_task_ids(struct pstree_item *);
--extern struct _TaskKobjIdsEntry *root_ids;
-+extern TaskKobjIdsEntry *root_ids;
- 
- extern void core_entry_free(CoreEntry *core);
- extern CoreEntry *core_entry_alloc(int alloc_thread_info, int alloc_tc);
-diff --git a/criu/include/rst_info.h b/criu/include/rst_info.h
-index 3283849e44..3dc119a931 100644
---- a/criu/include/rst_info.h
-+++ b/criu/include/rst_info.h
-@@ -5,6 +5,7 @@
- #include "common/list.h"
- #include "vma.h"
- #include "kerndat.h"
-+#include "images/mm.pb-c.h"
- 
- struct task_entries {
- 	int nr_threads, nr_tasks, nr_helpers;
-@@ -25,8 +26,6 @@ struct fdt {
- 	futex_t			fdt_lock;
- };
- 
--struct _MmEntry;
--
- struct rst_info {
- 	struct list_head	fds;
- 
-@@ -40,7 +39,7 @@ struct rst_info {
- 	struct fdt		*fdt;
- 
- 	struct vm_area_list	vmas;
--	struct _MmEntry		*mm;
-+	MmEntry		*mm;
- 	struct list_head	vma_io;
- 	unsigned int		pages_img_id;
- 
-diff --git a/criu/include/shmem.h b/criu/include/shmem.h
-index 9afdb799af..798e28f347 100644
---- a/criu/include/shmem.h
-+++ b/criu/include/shmem.h
-@@ -5,7 +5,6 @@
- #include "common/lock.h"
- #include "images/vma.pb-c.h"
- 
--struct _VmaEntry;
- struct vma_area;
- 
- extern int collect_shmem(int pid, struct vma_area *vma);
-diff --git a/criu/mem.c b/criu/mem.c
-index 9fabe4c470..b0a76e4da9 100644
---- a/criu/mem.c
-+++ b/criu/mem.c
-@@ -1230,7 +1230,7 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr)
- 
- static int maybe_disable_thp(struct pstree_item *t, struct page_read *pr)
- {
--	struct _MmEntry *mm = rsti(t)->mm;
-+	MmEntry *mm = rsti(t)->mm;
- 
- 	/*
- 	 * There is no need to disable it if the page read doesn't
-diff --git a/lib/c/criu.h b/lib/c/criu.h
-index 3d64939584..d2bfbf958c 100644
---- a/lib/c/criu.h
-+++ b/lib/c/criu.h
-@@ -22,6 +22,7 @@
- #include <stdbool.h>
- 
- #include "version.h"
-+#include "rpc.pb-c.h"
- 
- #ifdef __GNUG__
- 	extern "C" {
-@@ -112,7 +113,7 @@ void criu_set_pidfd_store_sk(int sk);
-  * some non-existing one is reported.
-  */
- 
--typedef struct _CriuNotify *criu_notify_arg_t;
-+typedef CriuNotify *criu_notify_arg_t;
- void criu_set_notify_cb(int (*cb)(char *action, criu_notify_arg_t na));
- 
- /* Get pid of root task. 0 if not available */
-From: Radostin Stoyanov <radostin@redhat.com>
-Date: Fri, 3 Sep 2021 14:14:41 +0100
-Subject: [PATCH] lib: install images/rpc.pb-c.h
-
-Since commit 1c25914 compiling crun with libcriu also requires
-/usr/include/criu/rpc.pb-c.h
-
-Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
----
- lib/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/Makefile b/lib/Makefile
-index f9b66701e0..575a7bad3f 100644
---- a/lib/Makefile
-+++ b/lib/Makefile
-@@ -1,6 +1,6 @@
- CRIU_SO			:= libcriu.so
- CRIU_A			:= libcriu.a
--UAPI_HEADERS		:= lib/c/criu.h images/rpc.proto criu/include/version.h
-+UAPI_HEADERS		:= lib/c/criu.h images/rpc.proto images/rpc.pb-c.h criu/include/version.h
- 
- #
- # File to keep track of files installed by setup.py


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/
@ 2024-02-22 18:38 Patrick McLean
  0 siblings, 0 replies; 13+ messages in thread
From: Patrick McLean @ 2024-02-22 18:38 UTC (permalink / raw
  To: gentoo-commits

commit:     41f8984d9a016a06ada5379333d02ecab48b0b47
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 22 18:38:04 2024 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Feb 22 18:38:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41f8984d

sys-process/criu: add 3.19

Closes: https://bugs.gentoo.org/910304
Closes: https://bugs.gentoo.org/887179
Closes: https://bugs.gentoo.org/832081
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 sys-process/criu/Manifest                          |   1 +
 sys-process/criu/criu-3.19.ebuild                  | 196 +++++++++++++++++++++
 sys-process/criu/files/criu-3.19-buildsystem.patch |  33 ++++
 3 files changed, 230 insertions(+)

diff --git a/sys-process/criu/Manifest b/sys-process/criu/Manifest
index 8c033e463e65..4fd5b7cfc5d1 100644
--- a/sys-process/criu/Manifest
+++ b/sys-process/criu/Manifest
@@ -1,2 +1,3 @@
 DIST criu-3.17.tar.gz 1321713 BLAKE2B 3bc13a7df0da0a17c74e0c12f07b81fe7f294be4d1980647b64c74e35383416ffbc10e7c04398f307bc68ff701f76a9586ea58825057b0df16b40f6aab3cbd0e SHA512 febae66a7820345c0f335f4a49e64c0af5c8ae5d3a394cc0770881b64eab11ca03ad5872f06b0c4ccd1da844c519268dad3b4f8b260267e6d3f582e80d80f804
 DIST criu-3.18.tar.gz 1354367 BLAKE2B 3e6613bc44355d4544541ec399ca462eed12203327f832e3c72ea2ccc772afbe2947f760de452b776299af36576880b189ce7583ce7f74c12225d86d1247c2ab SHA512 3d15554ebd2d08c8904c23b0aba00d505891c14caa4790c2fd12ad6b20bf4058fd210f1d03fd63aacc5ad8bc47e341396b48abbeb474f1fd43c3023fd1ff9171
+DIST criu-3.19.tar.gz 1379938 BLAKE2B c55c8e9cf7752ac1e6d7d99a3f87f98440f2054026bec2d5bed76ff5838e8e2dfa2a5fa9c8d17d60fc6da165260187d002ede6fa49f6902a0a6fe8461b12b479 SHA512 d243818cdac51580c952a80e9164786a67ce5e294c0faa6dc700f5e8da8e36495f0b64f5c27b345ede7d6697ed7a69fa4e9a85cef451f32e3ffeb78564884571

diff --git a/sys-process/criu/criu-3.19.ebuild b/sys-process/criu/criu-3.19.ebuild
new file mode 100644
index 000000000000..2b1575bbe858
--- /dev/null
+++ b/sys-process/criu/criu-3.19.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+inherit fcaps flag-o-matic toolchain-funcs linux-info distutils-r1
+
+DESCRIPTION="utility to checkpoint/restore a process tree"
+HOMEPAGE="
+	https://criu.org/
+	https://github.com/checkpoint-restore/
+"
+SRC_URI="https://github.com/checkpoint-restore/${PN}/archive/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 -riscv"
+IUSE="bpf doc gnutls nftables selinux setproctitle static-libs test video_cards_amdgpu"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="
+	${PYTHON_DEPS}
+	>=dev-libs/protobuf-c-1.4.0:=
+	dev-libs/libnl:3=
+	net-libs/libnet:1.1=
+	sys-libs/libcap:=
+	bpf? ( dev-libs/libbpf:= )
+	gnutls? ( net-libs/gnutls:= )
+	nftables? ( net-libs/gnutls:= )
+	selinux? ( sys-libs/libselinux:= )
+	setproctitle? ( dev-libs/libbsd:= )
+	video_cards_amdgpu? ( x11-libs/libdrm[video_cards_amdgpu] )
+"
+DEPEND="
+	${COMMON_DEPEND}
+"
+BDEPEND="
+	doc? (
+		app-text/asciidoc
+		app-text/xmlto
+	)
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	dev-python/protobuf-python[${PYTHON_USEDEP}]
+"
+
+CONFIG_CHECK="~CHECKPOINT_RESTORE ~NAMESPACES ~PID_NS ~FHANDLE ~EVENTFD ~EPOLL ~INOTIFY_USER
+	~UNIX_DIAG ~INET_DIAG ~INET_UDP_DIAG ~PACKET_DIAG ~NETLINK_DIAG ~TUN ~NETFILTER_XT_MARK"
+
+# root access required for tests
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	"${FILESDIR}/2.2/criu-2.2-flags.patch"
+	"${FILESDIR}/2.3/criu-2.3-no-git.patch"
+	"${FILESDIR}/criu-3.12-automagic-libbsd.patch"
+	"${FILESDIR}/criu-3.19-buildsystem.patch"
+)
+
+FILECAPS=(
+	-m 0755 cap_checkpoint_restore usr/sbin/criu
+)
+
+criu_arch() {
+	# criu infers the arch from $(uname -m).  We never want this to happen.
+	case ${ARCH} in
+		amd64) echo "x86";;
+		arm64) echo "aarch64";;
+		ppc64*) echo "ppc64";;
+		*)     echo "${ARCH}";;
+	esac
+}
+
+pkg_setup() {
+	use amd64 && CONFIG_CHECK+=" ~IA32_EMULATION"
+	linux-info_pkg_setup
+}
+
+src_prepare() {
+	distutils-r1_src_prepare
+	use doc || sed -i 's_\(install: \)install-man _\1_g' Makefile.install
+}
+
+criu_use() {
+	if ! use "${1}"; then
+		sed \
+			-e "s:${2:-${1}}:no_${2:-lib${1}}:g" \
+			-i Makefile.config || die
+	fi
+}
+
+criu_python() {
+	local -x \
+		CRIU_VERSION_MAJOR="$(ver_cut 1)" \
+		CRIU_VERSION_MINOR=$(ver_cut 2) \
+		CRIU_VERSION_SUBLEVEL=$(ver_cut 3)
+
+	"${@}"
+}
+
+src_configure() {
+	# Gold linker generates invalid object file when used with criu's custom
+	# linker script.  Use the bfd linker instead. See https://crbug.com/839665#c3
+	tc-ld-force-bfd
+
+	# the build system is quite sensitive to weird cflags
+	strip-unsupported-flags
+	filter-flags
+
+	# CRIUs doesn't like LTO https://bugs.gentoo.org/910304
+	filter-lto
+
+	# Build system uses this variable as a trigger to append coverage flags
+	# we'd like to avoid it. https://bugs.gentoo.org/744244
+	unset GCOV
+
+	# we have to sed the Makefile.config to disable automagic deps
+	criu_use selinux
+	criu_use bpf
+	criu_use nftables
+	criu_use video_cards_amdgpu libdrm
+
+	emake_opts=(
+		SETPROCTITLE="$(usex setproctitle)"
+		NO_GNUTLS="$(usex gnutls '' '1')"
+	)
+
+	python_setup
+	pushd crit >/dev/null || die
+	criu_python distutils-r1_src_configure
+	popd >/dev/null || die
+}
+
+criu_emake() {
+	emake \
+		AR="$(tc-getAR)" \
+		ARCH="$(criu_arch)" \
+		CC="$(tc-getCC)" \
+		FULL_PYTHON="${PYTHON%.*}" \
+		HOSTCC="$(tc-getBUILD_CC)" \
+		LD="$(tc-getLD)" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		LOGROTATEDIR="${EPREFIX}"/etc/logrotate.d \
+		OBJCOPY="$(tc-getOBJCOPY)" \
+		PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+		PREFIX="${EPREFIX}"/usr \
+		PYTHON="${EPYTHON%.*}" \
+		PYTHON_EXTERNALLY_MANAGED=1 \
+		V=1 WERROR=0 DEBUG=0 \
+		"${emake_opts[@]}" \
+		"${@}"
+}
+
+src_compile() {
+	local -a targets=(
+		all
+		$(usex video_cards_amdgpu 'amdgpu_plugin' '')
+		$(usex doc 'docs' '')
+	)
+	criu_emake ${targets[*]}
+
+	pushd crit >/dev/null || die
+	criu_python distutils-r1_src_compile
+	popd >/dev/null || die
+}
+
+src_test() {
+	criu_emake unittest
+}
+
+python_install() {
+	local -x \
+		CRIU_VERSION_MAJOR="$(ver_cut 1)" \
+		CRIU_VERSION_MINOR=$(ver_cut 2) \
+		CRIU_VERSION_SUBLEVEL=$(ver_cut 3)
+
+	distutils-r1_python_install
+}
+
+src_install() {
+	criu_emake DESTDIR="${D}" install
+
+	pushd crit >/dev/null || die
+	criu_python distutils-r1_src_install
+	popd >/dev/null || die
+
+	dodoc CREDITS README.md
+
+	if ! use static-libs; then
+		find "${D}" -name "*.a" -delete || die
+	fi
+}

diff --git a/sys-process/criu/files/criu-3.19-buildsystem.patch b/sys-process/criu/files/criu-3.19-buildsystem.patch
new file mode 100644
index 000000000000..2b439ad01d2b
--- /dev/null
+++ b/sys-process/criu/files/criu-3.19-buildsystem.patch
@@ -0,0 +1,33 @@
+diff --git a/Makefile.config b/Makefile.config
+index 8f2b5208e..19f6f72d3 100644
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -5,9 +5,6 @@ include scripts/feature-tests.mak
+ ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
+         LIBS_FEATURES	+= -lbsd
+         FEATURE_DEFINES	+= -DCONFIG_HAS_LIBBSD
+-else
+-        $(info Note: Building without setproctitle() and strlcpy() support.)
+-        $(info $(info)      To enable these features, please install libbsd-devel (RPM) / libbsd-dev (DEB).)
+ endif
+ 
+ ifeq ($(call pkg-config-check,libselinux),y)
+@@ -33,8 +30,6 @@ ifeq ($(NO_GNUTLS)x$(call pkg-config-check,gnutls),xy)
+         LIBS_FEATURES	+= -lgnutls
+         export CONFIG_GNUTLS := y
+         FEATURE_DEFINES	+= -DCONFIG_GNUTLS
+-else
+-        $(info Note: Building without GnuTLS support)
+ endif
+ 
+ ifeq ($(call pkg-config-check,libnftables),y)
+@@ -49,9 +44,6 @@ ifeq ($(call pkg-config-check,libnftables),y)
+                 $(warning Warn: you have libnftables installed but it has incompatible API)
+                 $(warning Warn: Building without nftables support)
+         endif
+-else
+-        $(warning Warn: you have no libnftables installed)
+-        $(warning Warn: Building without nftables support)
+ endif
+ 
+ export LIBS += $(LIBS_FEATURES)


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-02-22 18:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-05  5:57 [gentoo-commits] repo/gentoo:master commit in: sys-process/criu/files/, sys-process/criu/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-02-22 18:38 Patrick McLean
2023-05-01 12:49 Sam James
2022-09-03  0:33 Sam James
2022-05-19  3:33 Sam James
2021-12-02  0:17 Patrick McLean
2021-12-01 20:34 Sam James
2021-11-04 21:10 Sam James
2020-04-25 11:29 Sergei Trofimovich
2019-07-29  2:43 Matthias Maier
2016-12-07  5:28 Mike Frysinger
2016-11-23 10:04 Yixun Lan
2015-12-08 11:39 Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox