[gnome-contacts] meson: Cleanup the meson.build files



commit a255a78d7658ab5ffb439abc8685e806d17dd1ea
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Jan 5 14:14:42 2020 +0100

    meson: Cleanup the meson.build files
    
    * Replace `join_paths` with the `/` operator
    * Remove some unused config variables
    * Use `@BASENAME@` when it makes sense

 data/meson.build | 22 +++++++++++-----------
 docs/meson.build |  2 +-
 man/meson.build  |  2 +-
 meson.build      | 16 ++++------------
 src/meson.build  |  4 ++--
 vapi/config.vapi |  2 --
 6 files changed, 19 insertions(+), 29 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 2bfa750..54d6171 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -5,7 +5,7 @@ resources = gnome.compile_resources('org.gnome.Contacts', resource_files,
 )
 
 # The icons
-iconsdir = join_paths(datadir, 'icons', 'hicolor')
+iconsdir = get_option('datadir') / 'icons' / 'hicolor'
 foreach size: ['scalable', 'symbolic']
   install_subdir('icons/hicolor/' + size, install_dir: iconsdir)
 endforeach
@@ -13,11 +13,11 @@ endforeach
 # The desktop file
 desktop_file = i18n.merge_file(
   input: 'org.gnome.Contacts.desktop.in',
-  output: 'org.gnome.Contacts.desktop',
+  output: '@BASENAME',
   type: 'desktop',
   po_dir: po_dir,
   install: true,
-  install_dir: join_paths(datadir, 'applications')
+  install_dir: get_option('datadir') / 'applications'
 )
 # Validate the desktop file 
 desktop_file_validate = find_program ('desktop-file-validate', required: false)
@@ -38,7 +38,7 @@ appdata_file = i18n.merge_file(
   type: 'xml',
   po_dir: po_dir,
   install: true,
-  install_dir: join_paths(datadir, 'metainfo')
+  install_dir: get_option('datadir') / 'metainfo',
 )
 # Validate the appdata file 
 appstream_util = find_program('appstream-util', required: false)
@@ -53,28 +53,28 @@ endif
 
 # DBus service files
 service_config = configuration_data()
-service_config.set('bindir', join_paths(bindir))
-service_config.set('libexecdir', join_paths(libexecdir))
+service_config.set('bindir', contacts_prefix / get_option('bindir'))
+service_config.set('libexecdir', contacts_prefix / get_option('libexecdir'))
 
 # The DBUS service file of the app
 configure_file(
   input: 'org.gnome.Contacts.service.in',
-  output: 'org.gnome.Contacts.service',
+  output: '@BASENAME@',
   configuration: service_config,
   install: true,
-  install_dir: join_paths(datadir, 'dbus-1', 'services'),
+  install_dir: get_option('datadir') / 'dbus-1' / 'services',
 )
 
 # The DBUS service file of the search provider
 configure_file(
   input: 'org.gnome.Contacts.SearchProvider.service.in',
-  output: 'org.gnome.Contacts.SearchProvider.service',
+  output: '@BASENAME@',
   configuration: service_config,
   install: true,
-  install_dir: join_paths(datadir, 'dbus-1', 'services'),
+  install_dir: get_option('datadir') / 'dbus-1' / 'services',
 )
 
 # The search provider file
 install_data('org.gnome.Contacts.search-provider.ini',
-  install_dir: join_paths(datadir, 'gnome-shell', 'search-providers'),
+  install_dir: get_option('datadir') / 'gnome-shell' / 'search-providers',
 )
diff --git a/docs/meson.build b/docs/meson.build
index b2c82d2..4fe7383 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,5 +1,5 @@
 docs_vapidirs = [
-  '--vapidir=@0@'.format(join_paths(meson.source_root(), 'vapi')),
+  '--vapidir=@0@'.format(meson.source_root() / 'vapi'),
 ]
 
 if libhandy_vapidir != ''
diff --git a/man/meson.build b/man/meson.build
index ea94abf..7eb8257 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -4,7 +4,7 @@ custom_target('manfile-gnome-contacts',
   input: 'gnome-contacts.xml',
   output: 'gnome-contacts.1',
   install: true,
-  install_dir: join_paths(get_option('mandir'), 'man1'),
+  install_dir: get_option('mandir') / 'man1',
   command: [
     xsltproc,
     '--nonet',
diff --git a/meson.build b/meson.build
index d8c04ce..db23d4e 100644
--- a/meson.build
+++ b/meson.build
@@ -9,7 +9,7 @@ i18n = import('i18n')
 
 # Add our custom VAPI dir
 add_project_arguments(
-  ['--vapidir', join_paths(meson.source_root(), 'vapi')],
+  ['--vapidir', meson.source_root() / 'vapi'],
   language: 'vala'
 )
 
@@ -18,14 +18,8 @@ contacts_app_id = 'org.gnome.Contacts'
 
 config_h_dir = include_directories('.')
 contacts_prefix = get_option('prefix')
-datadir = join_paths(contacts_prefix, get_option('datadir'))
-bindir = join_paths(contacts_prefix, get_option('bindir'))
-libdir = join_paths(contacts_prefix, get_option('libdir'))
-libexecdir = join_paths(contacts_prefix, get_option('libexecdir'))
-locale_dir = join_paths(contacts_prefix, get_option('localedir'))
-pkgdatadir = join_paths(datadir, meson.project_name())
-pkglibdir = join_paths(libdir, meson.project_name())
-po_dir = join_paths(meson.source_root(), 'po')
+locale_dir = contacts_prefix / get_option('localedir')
+po_dir = meson.source_root() / 'po'
 
 # Dependencies
 min_eds_version = '3.13.90'
@@ -76,7 +70,7 @@ if not libhandy.found()
     ]
   )
 
-  libhandy_vapidir = join_paths(meson.build_root(), 'subprojects', 'libhandy', 'src')
+  libhandy_vapidir = meson.build_root() / 'subprojects' / 'libhandy' / 'src'
 else
   libhandy_vapidir = ''
 endif
@@ -93,8 +87,6 @@ conf.set_quoted('LOCALEDIR', locale_dir)
 conf.set_quoted('PACKAGE_NAME', meson.project_name())
 conf.set_quoted('PACKAGE_STRING', meson.project_name())
 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
-conf.set_quoted('PKGDATADIR', pkgdatadir)
-conf.set_quoted('PKGLIBDIR', pkglibdir)
 conf.set_quoted('VERSION', meson.project_version())
 conf.set('GOA_API_IS_SUBJECT_TO_CHANGE', true)
 configure_file(output: 'config.h', configuration: conf)
diff --git a/src/meson.build b/src/meson.build
index 95977fb..2592e74 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,7 +1,7 @@
 # GSettings
 compiled = gnome.compile_schemas()
 install_data('org.gnome.Contacts.gschema.xml',
-  install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
+  install_dir: get_option('datadir') / 'glib-2.0' / 'schemas',
 )
 
 # Common library
@@ -129,5 +129,5 @@ executable('gnome-contacts-search-provider',
   vala_args: contacts_vala_args,
   c_args: contacts_c_args,
   install: true,
-  install_dir: libexecdir,
+  install_dir: get_option('libexecdir'),
 )
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 2459e3b..6ba9bbb 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -13,7 +13,5 @@ public const string GETTEXT_PACKAGE;
 /* Configured paths - these variables are not present in config.h, they are
 * passed to underlying C code as cmd line macros. */
 public const string LOCALEDIR; /* /usr/local/share/locale */
-public const string PKGDATADIR; /* /usr/local/share/gnome-contacts */
-public const string PKGLIBDIR; /* /usr/local/lib/gnome-contacts */
 }
 


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