[gedit-plugins] build: do not store meson.project_name() in another variable
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins] build: do not store meson.project_name() in another variable
- Date: Mon, 11 Nov 2019 15:39:46 +0000 (UTC)
commit e449069c0bd8cc1a8702318aa7246f222bd34a6c
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon Nov 11 16:26:08 2019 +0100
build: do not store meson.project_name() in another variable
Especially because package_name was a global variable, and we must avoid
if possible to have global variables.
meson.build | 7 +++----
plugins/findinfiles/meson.build | 2 +-
plugins/meson.build | 4 ++--
po/meson.build | 2 +-
4 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/meson.build b/meson.build
index 886d5c4..9c60fbc 100644
--- a/meson.build
+++ b/meson.build
@@ -11,8 +11,7 @@ python = import('python')
api_version = '3.14'
-package_name = meson.project_name()
-package_string = '@0@-@1@'.format(package_name, api_version)
+package_string = '@0@-@1@'.format(meson.project_name(), api_version)
# Paths
rootdir = include_directories('.')
@@ -49,10 +48,10 @@ appstream_util = find_program('appstream-util', required: false)
# Configurations
config_h = configuration_data()
-config_h.set_quoted('PACKAGE_NAME', package_name)
+config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('PACKAGE_STRING', package_string)
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
-config_h.set_quoted('GETTEXT_PACKAGE', package_name)
+config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
config_h.set_quoted('LOCALEDIR', localedir)
config_h.set_quoted('LIBDIR', libdir)
config_h.set_quoted('DATADIR', datadir)
diff --git a/plugins/findinfiles/meson.build b/plugins/findinfiles/meson.build
index c356dd2..23eaf66 100644
--- a/plugins/findinfiles/meson.build
+++ b/plugins/findinfiles/meson.build
@@ -14,7 +14,7 @@ libfindinfiles_deps = [
]
libfindinfiles_c_args = [
- '-DGETTEXT_PACKAGE="@0@"'.format(package_name),
+ '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
'-DGP_LOCALEDIR="@0@"'.format(localedir),
]
diff --git a/plugins/meson.build b/plugins/meson.build
index 1838b04..3d4df4c 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -12,9 +12,9 @@ plugin_in = configuration_data()
plugin_in.set('VERSION', meson.project_version())
gpdefs_py = configuration_data()
-gpdefs_py.set('PACKAGE', package_name)
+gpdefs_py.set('PACKAGE', meson.project_name())
gpdefs_py.set('PACKAGE_STRING', package_string)
-gpdefs_py.set('GETTEXT_PACKAGE', package_name)
+gpdefs_py.set('GETTEXT_PACKAGE', meson.project_name())
gpdefs_py.set('VERSION', meson.project_version())
gpdefs_py.set('prefix', prefix)
diff --git a/po/meson.build b/po/meson.build
index 0e5cd0b..75c9c97 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1,5 +1,5 @@
i18n.gettext(
- package_name,
+ meson.project_name(),
preset: 'glib',
args: [
'--keyword=Description',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]