summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <tim.orling@konsulko.com>2024-03-02 13:56:03 -0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2024-03-15 17:17:19 +0000
commitcd11ca9de3ea8d1c1efaabe0a7d9c4daea56a15b (patch)
tree55263dce656a30149cc4e706f88965a2534a59ac
parent9b4acf5185324c244b62aa9e9791fa4afa0bcdb5 (diff)
downloadmeta-virtualization-cd11ca9de3ea8d1c1efaabe0a7d9c4daea56a15b.tar.gz
criu: fix pycriu build of wheel
Inherit python_setuptools_build_meta instead of setuptools3, as this is the build-backend declared in the pyproject.toml We seem to need python3-protobuf-native as a DEPENDS, but then the dependency check complains because our version in meta-python is python3-protobuf_4.25.bb Workaround this (for now?) by telling python3 -m build to --skip-dependency-check This allows criu to _build_. Whether it is functional and proper is a different story. Signed-off-by: Tim Orling <tim.orling@konsulko.com>
-rw-r--r--recipes-containers/criu/criu_git.bb12
-rw-r--r--recipes-containers/criu/files/0004-pycriu-attr-pycriu.version.__version__.patch20
-rw-r--r--recipes-containers/criu/files/0005-pycriu-skip-dependency-check-during-build.patch30
3 files changed, 53 insertions, 9 deletions
diff --git a/recipes-containers/criu/criu_git.bb b/recipes-containers/criu/criu_git.bb
index c4539e34..b06fa636 100644
--- a/recipes-containers/criu/criu_git.bb
+++ b/recipes-containers/criu/criu_git.bb
@@ -20,11 +20,13 @@ SRC_URI = "git://github.com/checkpoint-restore/criu.git;branch=master;protocol=h
20 file://0001-criu-Skip-documentation-install.patch \ 20 file://0001-criu-Skip-documentation-install.patch \
21 file://0002-criu-Change-libraries-install-directory.patch \ 21 file://0002-criu-Change-libraries-install-directory.patch \
22 file://0003-crit-pycriu-build-and-install-wheels.patch \ 22 file://0003-crit-pycriu-build-and-install-wheels.patch \
23 file://0004-pycriu-attr-pycriu.version.__version__.patch \
24 file://0005-pycriu-skip-dependency-check-during-build.patch \
23 " 25 "
24 26
25COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" 27COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
26 28
27DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet" 29DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet python3-protobuf-native"
28RDEPENDS:${PN} = "bash cgroup-lite" 30RDEPENDS:${PN} = "bash cgroup-lite"
29 31
30S = "${WORKDIR}/git" 32S = "${WORKDIR}/git"
@@ -55,7 +57,6 @@ export HOST_SYS
55export HOSTCFLAGS = "${BUILD_CFLAGS}" 57export HOSTCFLAGS = "${BUILD_CFLAGS}"
56 58
57inherit python_setuptools_build_meta 59inherit python_setuptools_build_meta
58#inherit setuptools3
59inherit pkgconfig 60inherit pkgconfig
60 61
61B = "${S}" 62B = "${S}"
@@ -73,10 +74,6 @@ do_compile:prepend() {
73 ln -s ${PKG_CONFIG_SYSROOT_DIR}/usr/include/google/protobuf/descriptor.proto ${S}/images/google/protobuf/descriptor.proto 74 ln -s ${PKG_CONFIG_SYSROOT_DIR}/usr/include/google/protobuf/descriptor.proto ${S}/images/google/protobuf/descriptor.proto
74} 75}
75 76
76#PEP517_SOURCE_PATH ="${S}/lib"
77
78#do_compile[network] = "1"
79
80do_compile () { 77do_compile () {
81 #python_pep517_do_compile 78 #python_pep517_do_compile
82 #export PEP517_SOURCE_PATH="${S}/crit" 79 #export PEP517_SOURCE_PATH="${S}/crit"
@@ -87,12 +84,9 @@ do_compile () {
87 oe_runmake FULL_PYTHON=${PYTHON} PYTHON=nativepython3 84 oe_runmake FULL_PYTHON=${PYTHON} PYTHON=nativepython3
88} 85}
89 86
90#do_install[network] = "1"
91
92do_install () { 87do_install () {
93 export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages" 88 export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages"
94 export PEP517_WHEEL_PATH="${PEP517_WHEEL_PATH}" 89 export PEP517_WHEEL_PATH="${PEP517_WHEEL_PATH}"
95 #oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" PLUGINDIR="${localstatedir}/lib" PIP_BREAK_SYSTEM_PACKAGES=1 install
96 oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" PLUGINDIR="${localstatedir}/lib" FULL_PYTHON=${PYTHON} PYTHON=nativepython3 install 90 oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" PLUGINDIR="${localstatedir}/lib" FULL_PYTHON=${PYTHON} PYTHON=nativepython3 install
97 91
98 # python3's distutils has a feature of rewriting the interpeter on setup installed 92 # python3's distutils has a feature of rewriting the interpeter on setup installed
diff --git a/recipes-containers/criu/files/0004-pycriu-attr-pycriu.version.__version__.patch b/recipes-containers/criu/files/0004-pycriu-attr-pycriu.version.__version__.patch
new file mode 100644
index 00000000..e05c8835
--- /dev/null
+++ b/recipes-containers/criu/files/0004-pycriu-attr-pycriu.version.__version__.patch
@@ -0,0 +1,20 @@
1From a2b17e7b082786e2d7b7585b33815572c9c521f0 Mon Sep 17 00:00:00 2001
2From: Tim Orling <tim.orling@konsulko.com>
3Date: Sat, 2 Mar 2024 13:47:46 -0800
4Subject: [PATCH] pycriu: attr pycriu.version.__version__
5
6Signed-off-by: Tim Orling <tim.orling@konsulko.com>
7---
8 lib/pyproject.toml | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/lib/pyproject.toml b/lib/pyproject.toml
12index 8eb4b7084..5a92f8540 100644
13--- a/lib/pyproject.toml
14+++ b/lib/pyproject.toml
15@@ -16,4 +16,4 @@ requires-python = ">=3.6"
16 packages = ["pycriu", "pycriu.images"]
17
18 [tool.setuptools.dynamic]
19-version = {attr = "pycriu.__version__"}
20+version = {attr = "pycriu.version.__version__"}
diff --git a/recipes-containers/criu/files/0005-pycriu-skip-dependency-check-during-build.patch b/recipes-containers/criu/files/0005-pycriu-skip-dependency-check-during-build.patch
new file mode 100644
index 00000000..c293131d
--- /dev/null
+++ b/recipes-containers/criu/files/0005-pycriu-skip-dependency-check-during-build.patch
@@ -0,0 +1,30 @@
1From 2ec745ac11357e3243ef1f23f817c276518ce7cb Mon Sep 17 00:00:00 2001
2From: Tim Orling <tim.orling@konsulko.com>
3Date: Sat, 2 Mar 2024 13:48:54 -0800
4Subject: [PATCH] pycriu: --skip-dependency-check during build
5
6It complains about needing protobuf<4, python3-protobuf is 4.25 in meta-python
7
8Signed-off-by: Tim Orling <tim.orling@konsulko.com>
9---
10 lib/Makefile | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/lib/Makefile b/lib/Makefile
14index b5f147482..e3faa7a06 100644
15--- a/lib/Makefile
16+++ b/lib/Makefile
17@@ -66,11 +66,11 @@ ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0)
18 $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install"
19 else
20 $(E) " INSTALL " pycriu
21- $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
22+ $(Q) $(PYTHON) -m build --no-isolation --wheel --skip-dependency-check --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
23 endif
24 else
25 $(E) " BUILD " pycriu
26- $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
27+ $(Q) $(PYTHON) -m build --no-isolation --wheel --skip-dependency-check --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
28 $(E) " INSTALL " pycriu
29 #nativepython3 -m installer ${INSTALL_WHEEL_COMPILE_BYTECODE} --interpreter "${USRBINPATH}/env ${PEP517_INSTALL_PYTHON}" --destdir=${D} ${PEP517_WHEEL_PATH}/*.whl
30