Skip to content

Commit

Permalink
Use git revision as app version
Browse files Browse the repository at this point in the history
better for daily builds
  • Loading branch information
rafaelmardojai committed Sep 13, 2020
1 parent 856bf51 commit 7540596
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions build-aux/meson/revision.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# forked from https://gitlab.gnome.org/World/lollypop/-/blob/master/bin/revision.sh
VERSION="@VERSION@"
if [[ $VERSION != "@VERSION@" ]]
then
echo $VERSION
else
git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
fi
3 changes: 2 additions & 1 deletion src/blanket.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import locale
import gettext

VERSION = '@VERSION@'
REVISION = '@REVISION@'
pkgdatadir = '@pkgdatadir@'
localedir = '@localedir@'

Expand All @@ -45,4 +46,4 @@ if __name__ == '__main__':
resource._register()

from blanket import main
sys.exit(main.main(VERSION))
sys.exit(main.main(REVISION))
6 changes: 6 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
moduledir = join_paths(pkgdatadir, 'blanket')
revision = run_command('../build-aux/meson/revision.sh').stdout().strip()
if revision == ''
revision=meson.project_version()
endif


python = import('python')

conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('VERSION', meson.project_version())
conf.set('REVISION', revision)
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)

Expand Down

0 comments on commit 7540596

Please sign in to comment.