From 43b52137999bf0db923c8a9a20e28d85ba17affa Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Sun, 29 Mar 2020 23:53:24 -0400 Subject: [PATCH] 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 --- meson.build | 5 ++++- meson_options.txt | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6a5bb77d..0f79826f 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/meson_options.txt b/meson_options.txt index 043f3142..5f7f7608 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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")' +)