summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndré Silva <123550+andresilva@users.noreply.github.com>2024-05-10 23:51:53 +0100
committerGitHub <noreply@github.com>2024-05-11 01:51:53 +0300
commita8ab1b1679e639ef23952f1a1d0834859d1c01b7 (patch)
treec24a01a902ca68d73e710f67c89ea0465926d05a /scripts
parent6e594e44162ed5ad8fd9db3e552723e32169158a (diff)
nix: build improvements (#5952)
* scripts: allow using existing variable values in generateVersion.sh * nix: populate versioning variables * nix: remove unused meson input * nix: remove unnecessary hyprland-protocols dependency * Nix: remove nixConfig from flake It's more annoying than helpful. * CI/Nix: fix PR build failure --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generateVersion.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/generateVersion.sh b/scripts/generateVersion.sh
index 6b1afb7b..fdcc4712 100755
--- a/scripts/generateVersion.sh
+++ b/scripts/generateVersion.sh
@@ -1,13 +1,13 @@
#!/bin/sh
cp -fr ./src/version.h.in ./src/version.h
-HASH=$(git rev-parse HEAD)
-BRANCH=$(git branch --show-current)
-MESSAGE=$(git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -e 's/#//g' -e 's/\"//g')
-DATE=$(git show ${GIT_COMMIT_HASH} --no-patch --format=%cd --date=local)
-DIRTY=$(git diff-index --quiet HEAD -- || echo dirty)
-TAG=$(git describe --tags)
-COMMITS=$(git rev-list --count HEAD)
+HASH=${HASH-$(git rev-parse HEAD)}
+BRANCH=${BRANCH-$(git branch --show-current)}
+MESSAGE=${MESSAGE-$(git show | head -n 5 | tail -n 1 | sed -e 's/#//g' -e 's/\"//g')}
+DATE=${DATE-$(git show --no-patch --format=%cd --date=local)}
+DIRTY=${DIRTY-$(git diff-index --quiet HEAD -- || echo dirty)}
+TAG=${TAG-$(git describe --tags)}
+COMMITS=${COMMITS-$(git rev-list --count HEAD)}
sed -i -e "s#@HASH@#${HASH}#" ./src/version.h
sed -i -e "s#@BRANCH@#${BRANCH}#" ./src/version.h