[recipes] Show a commit id in the about dialog for non-release builds



commit f309e3055a4a16d7ba20864215aed3e868ee2749
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 14 21:21:30 2016 -0500

    Show a commit id in the about dialog for non-release builds
    
    This is a bit improvised, but it mostly works.

 configure.ac    |    2 +-
 src/Makefile.am |    6 +++++-
 src/gr-app.c    |    5 ++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6435c0d..310dd69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ dnl Define Versioning Information
 dnl ***********************************************************************
 m4_define([major_version],[0])
 m4_define([minor_version],[3])
-m4_define([micro_version],[0])
+m4_define([micro_version],[1])
 m4_define([package_version],[major_version.minor_version.micro_version])
 m4_define([bug_report_url],[https://bugzilla.gnome.org/enter_bug.cgi?product=recipes])
 m4_define([api_version],[major_version])
diff --git a/src/Makefile.am b/src/Makefile.am
index 5c19584..49c8470 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,11 +1,15 @@
 bin_PROGRAMS = recipes
 
+commitid := $(shell $(GIT) log -1 --oneline | cut -f1 -d' ')
+
 recipes_CFLAGS = \
        $(WARN_CFLAGS)                  \
        -Wno-sign-compare               \
        $(RECIPES_CFLAGS)               \
        -DPKGDATADIR=\"$(pkgdatadir)\"  \
        -DLOCALEDIR=\"$(localedir)\"    \
+       -DCOMMIT_ID=\"$(commitid)\"     \
+       -DMICRO_VERSION=$(MICRO_VERSION) \
        -I "$(top_srcdir)/libgd"        \
        -I "$(top_srcdir)/libglnx"
 
@@ -20,7 +24,7 @@ recipes_SOURCES = \
        gr-app.c                \
        gr-category-tile.h      \
        gr-category-tile.c      \
-       gr-chef.h               \
+       gr-chef.h               \
        gr-chef.c               \
        gr-chef-tile.h          \
        gr-chef-tile.c          \
diff --git a/src/gr-app.c b/src/gr-app.c
index 5a9a82e..a42061e 100644
--- a/src/gr-app.c
+++ b/src/gr-app.c
@@ -30,7 +30,6 @@
 #include "gr-cuisine.h"
 #include "gr-shell-search-provider.h"
 
-
 struct _GrApp
 {
         GtkApplication parent_instance;
@@ -103,7 +102,11 @@ about_activated (GSimpleAction *action,
         win = gtk_application_get_active_window (GTK_APPLICATION (app));
         gtk_show_about_dialog (GTK_WINDOW (win),
                                "program-name", "GNOME Recipes",
+#if MICRO_VERSION % 2 == 1
+                               "version", COMMIT_ID,
+#else
                                "version", PACKAGE_VERSION,
+#endif
                                "copyright", "© 2016 Matthias Clasen",
                                "license-type", GTK_LICENSE_GPL_3_0,
                                "comments", _("GNOME loves to cook"),


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