From 0148f152276f9713011c43b3a39232b318ead1ec Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Sun, 14 Jul 2024 21:44:06 -0600 Subject: [PATCH] run git describe in Makefile make is always run from the src-dir, so capture git desc output there, then it might be usable in the install target. ATM this just echos GIT_VERSION, but it could be passed as an ENVAR= into pip install via INSTALL_ARGS. Maybe pip install can add this into the package info ? Signed-off-by: Jim Cromie --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 4adb6ee..35e0928 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ INSTALL_ARGS := # todo: add --break-system-packages if ubuntu +# Get git version information for make install +GIT_DESCRIBE := $(shell git describe --always --long --dirty) + .PHONY: init init: cd virtme_ng_init && cargo install --path . --root ../virtme/guest @@ -7,4 +10,5 @@ init: # see README.md '* Install from source' install: install_from_source install_from_source: + @echo "Version: $(GIT_DESCRIBE)" BUILD_VIRTME_NG_INIT=1 pip3 install --verbose -r requirements.txt $(INSTALL_ARGS) .