pidgin/pidgin

Merged in default (pull request #653)

2019-11-19, Gary Kramlich
e58dfcea3500
Merged in default (pull request #653)

Add PURPLE_VERSION and PURPLE_EXTRA_VERSION to libpurple/version.h and clean up some other related stuff

Approved-by: Elliott Sales de Andrade
Approved-by: John Bailey
--- a/libpurple/version.h.in Mon Nov 18 20:37:58 2019 -0600
+++ b/libpurple/version.h.in Tue Nov 19 04:05:30 2019 +0000
@@ -22,6 +22,7 @@
#ifndef PURPLE_VERSION_H
#define PURPLE_VERSION_H
+
/**
* SECTION:version
* @section_id: libpurple-version
@@ -50,9 +51,36 @@
*/
#define PURPLE_MICRO_VERSION (@PURPLE_MICRO_VERSION@)
-#define PURPLE_VERSION_CHECK(x,y,z) ((x) == PURPLE_MAJOR_VERSION && \
- ((y) < PURPLE_MINOR_VERSION || \
- ((y) == PURPLE_MINOR_VERSION && (z) <= PURPLE_MICRO_VERSION)))
+/**
+ * PURPLE_EXTRA_VERSION:
+ *
+ * The "extra" part of the version number if anything. Typical values are
+ * "devel", "beta1", "rc2", etc.
+ */
+#define PURPLE_EXTRA_VERSION ("@PURPLE_EXTRA_VERSION@")
+
+/**
+ * PURPLE_VERSION
+ *
+ * The entire version as a string.
+ */
+#define PURPLE_VERSION ("@PURPLE_VERSION@")
+
+/**
+ * PURPLE_VERSION_CHECK:
+ * @major: The major version to check for.
+ * @minor: The minor version to check for.
+ * @micro: The micro version to check for.
+ *
+ * Checks the version of libpurple being compiled against. See
+ * #purple_version_check for a runtime check.
+ *
+ * Returns: %TRUE if the version of libpurple is the same or newer than the
+ * passed-in version.
+ */
+#define PURPLE_VERSION_CHECK(major, minor, micro) ((major) == PURPLE_MAJOR_VERSION && \
+ ((minor) < PURPLE_MINOR_VERSION || \
+ ((minor) == PURPLE_MINOR_VERSION && (micro) <= PURPLE_MICRO_VERSION)))
G_BEGIN_DECLS
--- a/meson.build Mon Nov 18 20:37:58 2019 -0600
+++ b/meson.build Tue Nov 19 04:05:30 2019 +0000
@@ -1,7 +1,7 @@
# UPDATING VERSION NUMBERS FOR RELEASES
#
# The version number is:
-# <major>.<minor>.<micro><suffix>
+# <major>.<minor>.<micro><extra>
#
# micro += 1
#
@@ -15,7 +15,7 @@
# major += 1
# purple_soversion += 1
#
-# suffix should be similar to one of the following:
+# extra should be similar to one of the following:
# For beta releases: '-beta2'
# For code under development: '-devel'
# For production releases: ''
@@ -27,9 +27,9 @@
parts = meson.project_version().split('-')
if parts.length() > 1
- purple_version_suffix = parts[1]
+ purple_extra_version = parts[1]
else
- purple_version_suffix = ''
+ purple_extra_version = ''
endif
parts = parts[0].split('.')
@@ -46,10 +46,12 @@
conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('VERSION', meson.project_version())
+conf.set_quoted('DISPLAY_VERSION', meson.project_version())
version_conf.set('PURPLE_MAJOR_VERSION', purple_major_version)
version_conf.set('PURPLE_MINOR_VERSION', purple_minor_version)
version_conf.set('PURPLE_MICRO_VERSION', purple_micro_version)
+version_conf.set('PURPLE_EXTRA_VERSION', purple_extra_version)
version_conf.set('PURPLE_VERSION', meson.project_version())
version_conf.set('PURPLE_API_VERSION', purple_soversion)
@@ -280,14 +282,6 @@
gthread = dependency('gthread-2.0')
gnome = import('gnome')
-if get_option('extraversion') != ''
- DISPLAY_VERSION = '@0@-@1@'.format(meson.project_version(),
- get_option('extraversion'))
-else
- DISPLAY_VERSION = meson.project_version()
-endif
-conf.set_quoted('DISPLAY_VERSION', DISPLAY_VERSION)
-
#######################################################################
# Check for GObject Introspection
#######################################################################