summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Knight <james.d.knight@live.com>2024-08-03 12:31:14 -0400
committerSimon Ser <contact@emersion.fr>2024-08-03 18:37:17 +0200
commitdd4691fc3b202f8d14badee927ce701c358bf4a9 (patch)
tree8a30a34faa900219f406a7e79a7af8e9f6e4e792
parent469d9d4d77a91d41cda517ea0a5ecca3ffd6eb20 (diff)
downloadswaybg-dd4691fc3b202f8d14badee927ce701c358bf4a9.tar.gz
swaybg-dd4691fc3b202f8d14badee927ce701c358bf4a9.tar.bz2
build: include swaybg version in version string when using git
Update the version population to always include the swaybg fixed version string in the final version. Signed-off-by: James Knight <james.d.knight@live.com>
-rw-r--r--meson.build10
1 files changed, 7 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 87a513c..0620758 100644
--- a/meson.build
+++ b/meson.build
@@ -40,10 +40,14 @@ scdoc = find_program('scdoc', required: get_option('man-pages'), native: true)
version = '"@0@"'.format(meson.project_version())
if git.found()
- git_commit_hash = run_command([git, 'describe', '--always', '--tags'], check: false)
+ git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: false)
git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false)
- if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0
- version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash.stdout().strip(), git_branch.stdout().strip())
+ if git_commit.returncode() == 0 and git_branch.returncode() == 0
+ version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format(
+ meson.project_version(),
+ git_commit.stdout().strip(),
+ git_branch.stdout().strip(),
+ )
endif
endif