From 67c011572a6b700ea8eeee14ef37fe9c894f06e3 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Mon, 30 Jul 2018 17:09:43 -0400 Subject: criu: uprev to version 3.10 A fairly straightforward uprev requiring minimal patch refreshing since a few hunks were failing due to conflicts with upstream updates. Unfortunately upstream starting using the now overloaded "PYTHON" variable in their Makefiles, this is not the path to the python executable but rather the name 'python2' or 'python3' which is used to determine which local directories to include. Due to this we must explicitly assign values to 'PYTHON_FULL' and 'PYTHON'. We use 'python2' since we are using 'setuptools' and therefore are explicitly using python v2, at some point we might want to make this recipe work with either python v2 or v3 but for now we continue to explicitly use v2. Instead of using version specific filename we switch to using _git.bb which is inline with similar 'git' recipes found in oe-core and other repos. Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- recipes-containers/criu/criu_3.9.bb | 87 ---------------------- recipes-containers/criu/criu_git.bb | 87 ++++++++++++++++++++++ .../files/0001-criu-Fix-toolchain-hardcode.patch | 13 ++-- ...e-overwrite-install-lib-to-allow-multiarc.patch | 6 +- 4 files changed, 97 insertions(+), 96 deletions(-) delete mode 100644 recipes-containers/criu/criu_3.9.bb create mode 100644 recipes-containers/criu/criu_git.bb diff --git a/recipes-containers/criu/criu_3.9.bb b/recipes-containers/criu/criu_3.9.bb deleted file mode 100644 index 36c356db..00000000 --- a/recipes-containers/criu/criu_3.9.bb +++ /dev/null @@ -1,87 +0,0 @@ -SUMMARY = "CRIU" -DESCRIPTION = "Checkpoint/Restore In Userspace, or CRIU, is a software tool for \ -Linux operating system. Using this tool, you can freeze a running application \ -(or part of it) and checkpoint it to a hard drive as a collection of files. \ -You can then use the files to restore and run the application from the point \ -it was frozen at. The distinctive feature of the CRIU project is that it is \ -mainly implemented in user space" -HOMEPAGE = "http://criu.org" -SECTION = "console/tools" -LICENSE = "GPLv2" - -EXCLUDE_FROM_WORLD = "1" - -LIC_FILES_CHKSUM = "file://COPYING;md5=412de458544c1cb6a2b512cd399286e2" - -SRCREV = "202b7745bd0c37a1732ebe2fb009a157d338bf95" -PV = "3.9+git${SRCPV}" - -SRC_URI = "git://github.com/xemul/criu.git;protocol=git \ - file://0001-criu-Fix-toolchain-hardcode.patch \ - file://0002-criu-Skip-documentation-install.patch \ - file://0001-criu-Change-libraries-install-directory.patch \ - file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ - " - -COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" - -DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet" -RDEPENDS_${PN} = "bash" - -S = "${WORKDIR}/git" - -# -# CRIU just can be built on ARMv7 and ARMv6, so the Makefile check -# if the ARCH is ARMv7 or ARMv6. -# ARM BSPs need set CRIU_BUILD_ARCH variable for building CRIU. -# -EXTRA_OEMAKE_arm += "ARCH=arm UNAME-M=${CRIU_BUILD_ARCH} WERROR=0" -EXTRA_OEMAKE_x86-64 += "ARCH=x86 WERROR=0" -EXTRA_OEMAKE_aarch64 += "ARCH=arm64 WERROR=0" - -EXTRA_OEMAKE_append += "SBINDIR=${sbindir} LIBDIR=${libdir} INCLUDEDIR=${includedir} PIEGEN=no" -EXTRA_OEMAKE_append += "LOGROTATEDIR=${sysconfdir} SYSTEMDUNITDIR=${systemd_unitdir}" - -CFLAGS += "-D__USE_GNU -D_GNU_SOURCE " - -CFLAGS += " -I${STAGING_INCDIR} -I${STAGING_INCDIR}/libnl3" -CFLAGS_arm += "-D__WORDSIZE" - -# overide LDFLAGS to allow criu to build without: "x86_64-poky-linux-ld: unrecognized option '-Wl,-O1'" -export LDFLAGS="" -export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3" - -export BUILD_SYS -export HOST_SYS - -inherit setuptools - -PACKAGECONFIG ??= "" -PACKAGECONFIG[selinux] = ",,libselinux" - -CLEANBROKEN = "1" - -do_compile_prepend() { - rm -rf ${S}/images/google/protobuf/descriptor.proto - ln -s ${PKG_CONFIG_SYSROOT_DIR}/usr/include/google/protobuf/descriptor.proto ${S}/images/google/protobuf/descriptor.proto -} - -do_compile () { - oe_runmake -} - -do_install () { - export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages" - oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" install -} - -FILES_${PN} += "${systemd_unitdir}/ \ - ${libdir}/python2.7/site-packages/ \ - ${libdir}/pycriu/ \ - ${libdir}/crit-0.0.1-py2.7.egg-info \ - " - -FILES_${PN}-staticdev += " \ - ${libexecdir}/compel/std.lib.a \ - ${libexecdir}/compel/fds.lib.a \ - " diff --git a/recipes-containers/criu/criu_git.bb b/recipes-containers/criu/criu_git.bb new file mode 100644 index 00000000..00de417b --- /dev/null +++ b/recipes-containers/criu/criu_git.bb @@ -0,0 +1,87 @@ +SUMMARY = "CRIU" +DESCRIPTION = "Checkpoint/Restore In Userspace, or CRIU, is a software tool for \ +Linux operating system. Using this tool, you can freeze a running application \ +(or part of it) and checkpoint it to a hard drive as a collection of files. \ +You can then use the files to restore and run the application from the point \ +it was frozen at. The distinctive feature of the CRIU project is that it is \ +mainly implemented in user space" +HOMEPAGE = "http://criu.org" +SECTION = "console/tools" +LICENSE = "GPLv2" + +EXCLUDE_FROM_WORLD = "1" + +LIC_FILES_CHKSUM = "file://COPYING;md5=412de458544c1cb6a2b512cd399286e2" + +SRCREV = "c49eab368a68682475c4e693258246e04232e6d2" +PV = "3.10+git${SRCPV}" + +SRC_URI = "git://github.com/xemul/criu.git;protocol=git \ + file://0001-criu-Fix-toolchain-hardcode.patch \ + file://0002-criu-Skip-documentation-install.patch \ + file://0001-criu-Change-libraries-install-directory.patch \ + file://lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch \ + " + +COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" + +DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet" +RDEPENDS_${PN} = "bash" + +S = "${WORKDIR}/git" + +# +# CRIU just can be built on ARMv7 and ARMv6, so the Makefile check +# if the ARCH is ARMv7 or ARMv6. +# ARM BSPs need set CRIU_BUILD_ARCH variable for building CRIU. +# +EXTRA_OEMAKE_arm += "ARCH=arm UNAME-M=${CRIU_BUILD_ARCH} WERROR=0" +EXTRA_OEMAKE_x86-64 += "ARCH=x86 WERROR=0" +EXTRA_OEMAKE_aarch64 += "ARCH=arm64 WERROR=0" + +EXTRA_OEMAKE_append += "SBINDIR=${sbindir} LIBDIR=${libdir} INCLUDEDIR=${includedir} PIEGEN=no" +EXTRA_OEMAKE_append += "LOGROTATEDIR=${sysconfdir} SYSTEMDUNITDIR=${systemd_unitdir}" + +CFLAGS += "-D__USE_GNU -D_GNU_SOURCE " + +CFLAGS += " -I${STAGING_INCDIR} -I${STAGING_INCDIR}/libnl3" +CFLAGS_arm += "-D__WORDSIZE" + +# overide LDFLAGS to allow criu to build without: "x86_64-poky-linux-ld: unrecognized option '-Wl,-O1'" +export LDFLAGS="" +export C_INCLUDE_PATH="${STAGING_INCDIR}/libnl3" + +export BUILD_SYS +export HOST_SYS + +inherit setuptools + +PACKAGECONFIG ??= "" +PACKAGECONFIG[selinux] = ",,libselinux" + +CLEANBROKEN = "1" + +do_compile_prepend() { + rm -rf ${S}/images/google/protobuf/descriptor.proto + ln -s ${PKG_CONFIG_SYSROOT_DIR}/usr/include/google/protobuf/descriptor.proto ${S}/images/google/protobuf/descriptor.proto +} + +do_compile () { + oe_runmake FULL_PYTHON=${PYTHON} PYTHON=python2 +} + +do_install () { + export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages" + oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" FULL_PYTHON=${PYTHON} PYTHON=python2 install +} + +FILES_${PN} += "${systemd_unitdir}/ \ + ${libdir}/python2.7/site-packages/ \ + ${libdir}/pycriu/ \ + ${libdir}/crit-0.0.1-py2.7.egg-info \ + " + +FILES_${PN}-staticdev += " \ + ${libexecdir}/compel/std.lib.a \ + ${libexecdir}/compel/fds.lib.a \ + " diff --git a/recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch b/recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch index d1f136c4..838cbdc9 100644 --- a/recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch +++ b/recipes-containers/criu/files/0001-criu-Fix-toolchain-hardcode.patch @@ -33,7 +33,7 @@ diff --git a/scripts/nmk/scripts/include.mk b/scripts/nmk/scripts/include.mk index 04ccb3a..0d63bc7 100644 --- a/scripts/nmk/scripts/include.mk +++ b/scripts/nmk/scripts/include.mk -@@ -20,7 +20,7 @@ SUBARCH := $(shell uname -m | sed \ +@@ -22,7 +22,7 @@ SUBARCH := $(shell uname -m | sed \ -e s/aarch64.*/aarch64/) ARCH ?= $(SUBARCH) @@ -46,7 +46,7 @@ diff --git a/scripts/nmk/scripts/tools.mk b/scripts/nmk/scripts/tools.mk index 56dba84..1698821 100644 --- a/scripts/nmk/scripts/tools.mk +++ b/scripts/nmk/scripts/tools.mk -@@ -2,30 +2,30 @@ ifndef ____nmk_defined__tools +@@ -2,31 +2,31 @@ ifndef ____nmk_defined__tools # # System tools shorthands @@ -68,9 +68,7 @@ index 56dba84..1698821 100644 -MKDIR := mkdir -p -AWK := awk -PERL := perl --PYTHON := python --FIND := find --SH := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ +-FULL_PYTHON := $(shell which python2 2>/dev/null || which python3 2>/dev/null) +CC ?= $(CROSS_COMPILE)$(HOSTCC) +CPP ?= $(CC) -E +AS ?= $(CROSS_COMPILE)as @@ -83,7 +81,10 @@ index 56dba84..1698821 100644 +MKDIR ?= mkdir -p +AWK ?= awk +PERL ?= perl -+PYTHON ?= python ++FULL_PYTHON ?= $(shell which python2 2>/dev/null || which python3 2>/dev/null) + PYTHON ?= $(shell basename $(FULL_PYTHON)) +-FIND := find +-SH := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ +FIND ?= find +SH ?= $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ diff --git a/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch b/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch index 59e7bcbf..70ccb287 100644 --- a/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch +++ b/recipes-containers/criu/files/lib-Makefile-overwrite-install-lib-to-allow-multiarc.patch @@ -17,12 +17,12 @@ diff --git a/lib/Makefile b/lib/Makefile index b1bb057..06f5c5d 100644 --- a/lib/Makefile +++ b/lib/Makefile -@@ -56,7 +56,7 @@ install: lib-c lib-py crit/crit lib/c/criu.pc.in +@@ -53,7 +53,7 @@ install: lib-c lib-py crit/crit lib/c/criu.pc.in $(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_BIN) scripts/crit-setup.py install --prefix=$(DESTDIR)$(PREFIX) --record $(CRIT_SETUP_FILES) -+ $(Q) $(PYTHON_BIN) scripts/crit-setup.py install --prefix=$(DESTDIR)$(PREFIX) --record $(CRIT_SETUP_FILES) --install-lib=$(DESTDIR)$(INSTALL_LIB) +- $(Q) $(PYTHON) scripts/crit-setup.py install --prefix=$(DESTDIR)$(PREFIX) --record $(CRIT_SETUP_FILES) ++ $(Q) $(PYTHON) scripts/crit-setup.py install --prefix=$(DESTDIR)$(PREFIX) --record $(CRIT_SETUP_FILES) --install-lib=$(DESTDIR)$(INSTALL_LIB) .PHONY: install uninstall: -- cgit v1.2.3-54-g00ecf