[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/PYTHON3 v4 11/14] Makefile.uk: Add rule for creating root filesystem



The Python interpreter needs a filesystem where to keep its libraries. This
patch creates a Python virtual environment and installs the Python 3 standard
library in /lib/python3.7 directory. For creating the filesystem the following
command has to be run:

$ make python-rootfs path=<directory>

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 Makefile.uk | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Makefile.uk b/Makefile.uk
index 1e21d91..d5179ab 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -464,3 +464,28 @@ LIBPYTHON3_PREPARED_DEPS = \
 $(LIBPYTHON3_BUILD)/.prepared: $(LIBPYTHON3_PREPARED_DEPS)
 
 UK_PREPARE += $(LIBPYTHON3_BUILD)/.prepared
+
+################################################################################
+# Root filesystem
+################################################################################
+
+# Build root filesystem for Python interpreter
+PYTHON_ROOTFS = $(APP_BASE)/$(path)
+
+# Create virtual environment
+$(PYTHON_ROOTFS)/.keep:
+       python3 -m venv $(PYTHON_ROOTFS) && touch $@
+
+# Configure origin
+$(PYTHON_ROOTFS)/.configured: $(PYTHON_ROOTFS)/.keep
+       mkdir -p $(PYTHON_ROOTFS) &>/dev/null
+       cd $(LIBPYTHON3_SRC) && ./configure --prefix=$(shell realpath 
$(APP_BASE)/$(path)) && touch $@
+
+# Install Python standard library into virtual environment
+$(PYTHON_ROOTFS)/.done: $(PYTHON_ROOTFS)/.configured
+       cd $(LIBPYTHON3_SRC) && make libinstall
+       cp $(LIBPYTHON3_BASE)/_sysconfigdata.py $(PYTHON_ROOTFS)/lib/python3.7/
+       touch $@
+
+.PHONY: python-rootfs
+python-rootfs: $(PYTHON_ROOTFS)/.done
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.