[gnome-games] build: Append git tag to version



commit 72d77b039e6c3bffbf66797b4fe74e139059870a
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Jul 15 22:29:53 2018 +0500

    build: Append git tag to version
    
    This will allow seeing git tag or commit hash in About dialog.
    If the app is built from tarball, the tag would be 'stable' or
    'devel' depending on build profile.

 meson.build | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index bc20f9e..276adbb 100644
--- a/meson.build
+++ b/meson.build
@@ -8,9 +8,16 @@ project('gnome-games',
 if get_option('profile') == 'development'
   profile = 'Devel'
   name_suffix = ' (Development)'
+  vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
+  if vcs_tag == ''
+    version_suffix = '-devel'
+  else
+    version_suffix = '-@0@'.format (vcs_tag)
+  endif
 else
   profile = ''
   name_suffix = ''
+  version_suffix = ''
 endif
 
 application_id = 'org.gnome.Games@0@'.format(profile)
@@ -55,7 +62,7 @@ config_h.set_quoted ('NAME_SUFFIX', name_suffix)
 config_h.set_quoted ('OPTIONS_DIR', options_dir)
 config_h.set_quoted ('PLUGINS_DIR', plugins_dir)
 config_h.set_quoted ('PROFILE', profile)
-config_h.set_quoted ('VERSION', meson.project_version ())
+config_h.set_quoted ('VERSION', '@0@@1@'.format (meson.project_version (), version_suffix))
 
 configure_file (output: 'config.h', configuration: config_h)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]