[gedit/zbrown/deteplification-src: 62/633] build: use meson.project_version() instead of having a global variable




commit fe8ead4a6f56d223185ad55d3ef543f64fa9a7ab
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Dec 4 11:21:16 2019 +0100

    build: use meson.project_version() instead of having a global variable
    
    The global variable "version" was harder to grep, it gives lots of false
    positives. And when possible it's of course better to avoid a global
    variable.

 data/meson.build  | 2 +-
 gedit/meson.build | 2 +-
 meson.build       | 9 +++------
 3 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index bef694c4f..cd00137de 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -36,7 +36,7 @@ endif
 
 
 desktop_in = configuration_data()
-desktop_in.set('VERSION', version)
+desktop_in.set('VERSION', meson.project_version())
 desktop_in.set('FULL_LIBEXECDIR', libexecdir)
 
 desktop_file_configured = configure_file(
diff --git a/gedit/meson.build b/gedit/meson.build
index 6e7edfd55..ae41a96c3 100644
--- a/gedit/meson.build
+++ b/gedit/meson.build
@@ -268,7 +268,7 @@ libgedit_pc = pkg.generate(
   name: package_name,
   description: 'GNOME text editor',
   requires: ['gtksourceview-4', 'libpeas-1.0', 'libpeas-gtk-1.0'],
-  version: version,
+  version: meson.project_version(),
   subdirs: package_string,
   libraries: libgedit_sha,
   install_dir: pkgconfigdir,
diff --git a/meson.build b/meson.build
index 09feaa426..5f4f7333d 100644
--- a/meson.build
+++ b/meson.build
@@ -9,9 +9,6 @@ i18n = import('i18n')
 pkg = import('pkgconfig')
 python = import('python')
 
-# Versioning
-version = meson.project_version()
-
 api_version = '3.36'
 
 package_name = meson.project_name()
@@ -107,12 +104,12 @@ endif
 config_h = configuration_data()
 config_h.set_quoted('PACKAGE_NAME', package_name)
 config_h.set_quoted('PACKAGE_STRING', package_string)
-config_h.set_quoted('PACKAGE_VERSION', version)
+config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
 config_h.set_quoted('GETTEXT_PACKAGE', package_name)
 config_h.set_quoted('LOCALEDIR', localdir)
 config_h.set_quoted('LIBDIR', libdir)
 config_h.set_quoted('DATADIR', datadir)
-config_h.set_quoted('VERSION', version)
+config_h.set_quoted('VERSION', meson.project_version())
 
 enable_gvfs_metadata = get_option('enable-gvfs-metadata')
 if enable_gvfs_metadata == 'yes' or (enable_gvfs_metadata == 'auto' and host_machine.system() == 'linux')
@@ -190,7 +187,7 @@ endif
 summary = [
   '',
   '------',
-  'gedit @0@ (@1@)'.format(version, api_version),
+  'gedit @0@ (@1@)'.format(meson.project_version(), api_version),
   '',
   '       API docs: @0@'.format(build_gtk_doc),
   '      User docs: @0@'.format(get_option('user_documentation')),


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