From a9cf3e23a5787de956c3d4fbbc4328ff7888108d Mon Sep 17 00:00:00 2001 From: Steef Hegeman Date: Mon, 8 Jun 2020 01:03:30 +0200 Subject: [PATCH] makefile: do not require git We will now only use git if .git/HEAD is found, otherwise the version info is pulled from version.vala as is. --- .gitignore | 1 - README.md | 1 - makefile | 6 ++++-- version.vala | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 version.vala diff --git a/.gitignore b/.gitignore index 0ed90a7..f0f1504 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ snixembed -version.vala doc diff --git a/README.md b/README.md index e1fbe8a..e10e003 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ for discussion and support. Come say hi! ## Building and installing ### Dependencies -- git (make) - make (make) - vala (make) - gtk+-3.0, gio-2.0, glib-2.0 diff --git a/makefile b/makefile index 3a59be7..afd927a 100644 --- a/makefile +++ b/makefile @@ -12,8 +12,10 @@ VFLAGS := $(foreach flag, $(CFLAGS), -X $(flag)) $(VFLAGS) snixembed: $(SRC) valac -o $@ $(VFLAGS) $(PKG) $(SRC) -version.vala: .git/HEAD .git/index +version.vala: # update version from git if possible +ifneq (,$(wildcard ./.git/HEAD)) echo "const string VERSION = \"$(shell git describe --always --tags --dirty)\";" > $@ +endif doc: $(SRC) valadoc --force -o $@ --internal --private --package-name snixembed $(SRC) $(PKG) @@ -27,4 +29,4 @@ install: snixembed uninstall: rm -f $(DESTDIR)$(PREFIX)$(BINDIR)/snixembed -.PHONY: clean install uninstall +.PHONY: clean install uninstall version.vala diff --git a/version.vala b/version.vala new file mode 100644 index 0000000..b31d3ae --- /dev/null +++ b/version.vala @@ -0,0 +1 @@ +const string VERSION = "0.2.2"; -- 2.45.2