diff options
Diffstat (limited to 'recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch')
-rw-r--r-- | recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch b/recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch new file mode 100644 index 00000000..2da96f44 --- /dev/null +++ b/recipes-containers/criu/files/0003-crit-pycriu-build-and-install-wheels.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From 40d2f0735d668dca893a5f0e787f1f11af74cf25 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tim Orling <tim.orling@konsulko.com> | ||
3 | Date: Fri, 1 Mar 2024 22:22:37 -0800 | ||
4 | Subject: [PATCH] crit/pycriu: build and install wheels | ||
5 | |||
6 | Rather than using heavy handed pip (which requires network access to | ||
7 | fetch the index), mimic what we do in python_pep517.bbclass do_compile | ||
8 | and do_install for both crit/ and lib/pycriu | ||
9 | |||
10 | Signed-off-by: Tim Orling <tim.orling@konsulko.com> | ||
11 | --- | ||
12 | crit/Makefile | 8 ++++++-- | ||
13 | lib/Makefile | 11 +++++++++-- | ||
14 | 2 files changed, 15 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/crit/Makefile b/crit/Makefile | ||
17 | index 9a856db6d..9b36f4be1 100644 | ||
18 | --- a/crit/Makefile | ||
19 | +++ b/crit/Makefile | ||
20 | @@ -1,5 +1,7 @@ | ||
21 | PYTHON_EXTERNALLY_MANAGED := $(shell $(PYTHON) -c 'import os, sysconfig; print(int(os.path.isfile(os.path.join(sysconfig.get_path("stdlib"), "EXTERNALLY-MANAGED"))))') | ||
22 | PIP_BREAK_SYSTEM_PACKAGES := 0 | ||
23 | +PEP517_SOURCE_PATH := ./crit | ||
24 | +PEP517_BUILD_OPTS := | ||
25 | |||
26 | VERSION_FILE := $(if $(obj),$(addprefix $(obj)/,crit/version.py),crit/version.py) | ||
27 | |||
28 | @@ -16,11 +18,13 @@ ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) | ||
29 | $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" | ||
30 | else | ||
31 | $(E) " INSTALL " crit | ||
32 | - $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit | ||
33 | + $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) | ||
34 | endif | ||
35 | else | ||
36 | + $(E) " BUILD " crit | ||
37 | + $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) | ||
38 | $(E) " INSTALL " crit | ||
39 | - $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit | ||
40 | + $(Q) $(PYTHON) -m installer $(INSTALL_WHEEL_COMPILE_BYTECODE) --interpreter "$(USRBINPATH)/env $(PEP517_INSTALL_PYTHON)" --destdir=$(DESTDIR) $(PEP517_WHEEL_PATH)/crit-*.whl | ||
41 | endif | ||
42 | .PHONY: install | ||
43 | |||
44 | diff --git a/lib/Makefile b/lib/Makefile | ||
45 | index ae371e78e..b5f147482 100644 | ||
46 | --- a/lib/Makefile | ||
47 | +++ b/lib/Makefile | ||
48 | @@ -1,6 +1,9 @@ | ||
49 | CRIU_SO := libcriu.so | ||
50 | CRIU_A := libcriu.a | ||
51 | UAPI_HEADERS := lib/c/criu.h images/rpc.proto images/rpc.pb-c.h criu/include/version.h | ||
52 | +PEP517_SOURCE_PATH := ./lib | ||
53 | +PEP517_BUILD_OPTS := | ||
54 | +INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0" | ||
55 | |||
56 | all-y += lib-c lib-a lib-py | ||
57 | |||
58 | @@ -63,11 +66,15 @@ ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) | ||
59 | $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" | ||
60 | else | ||
61 | $(E) " INSTALL " pycriu | ||
62 | - $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./lib | ||
63 | + $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) | ||
64 | endif | ||
65 | else | ||
66 | + $(E) " BUILD " pycriu | ||
67 | + $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS) | ||
68 | $(E) " INSTALL " pycriu | ||
69 | - $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./lib | ||
70 | + #nativepython3 -m installer ${INSTALL_WHEEL_COMPILE_BYTECODE} --interpreter "${USRBINPATH}/env ${PEP517_INSTALL_PYTHON}" --destdir=${D} ${PEP517_WHEEL_PATH}/*.whl | ||
71 | + | ||
72 | + $(Q) $(PYTHON) -m installer $(INSTALL_WHEEL_COMPILE_BYTECODE) --interpreter "$(USRBINPATH)/env $(PEP517_INSTALL_PYTHON)" --destdir=$(DESTDIR) $(PEP517_WHEEL_PATH)/pycriu-*.whl | ||
73 | endif | ||
74 | .PHONY: install | ||
75 | |||