Allow explicit setting of revision string

This lets a packager ensure that the binary object built from an
unpacked source tarball is identical to the binary object created from
a live git tree.

I hope to use it in debian with something like -Drevno=debian/3.36.1-1
during the meson configuration, so that the help dialog box and the
bug reporting logs can identify the specific build.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Daniel Kahn Gillmor 2020-03-29 23:53:24 -04:00
parent 6dd2d1bcc1
commit 43b5213799
2 changed files with 9 additions and 1 deletions

View file

@ -129,7 +129,10 @@ libmessagingmenu_dep = dependency('messaging-menu', version: '>= 12.10', require
# Build variables
geary_id = 'org.gnome.Geary@0@'.format(profile)
geary_version = meson.project_version()
revno = run_command('build-aux/git_version.py').stdout().strip()
revno = get_option('revno')
if revno == ''
revno = run_command('build-aux/git_version.py').stdout().strip()
endif
gnome = import('gnome')
i18n = import('i18n')

View file

@ -58,3 +58,8 @@ option(
value: false,
description: 'Whether to use explicit reference tracking.'
)
option(
'revno',
type: 'string',
description: 'Custom revision string (default extracted from "git describe")'
)