[tracker/sam/meson-options-cleanup] Clean up Meson options



commit d318ebeb5d4f984c61373b492d86ca50fbfd71dc
Author: Sam Thursfield <sam afuera me uk>
Date:   Tue Feb 25 14:46:20 2020 +0100

    Clean up Meson options
    
    Fixes https://gitlab.gnome.org/GNOME/tracker-miners/issues/49

 meson.build                               | 62 ++++++-------------------------
 meson_options.txt                         | 16 +++-----
 src/libtracker-sparql-backend/meson.build |  1 -
 src/tracker/meson.build                   |  2 +-
 4 files changed, 18 insertions(+), 63 deletions(-)
---
diff --git a/meson.build b/meson.build
index 23d3c61b2..a8e1c4cfd 100644
--- a/meson.build
+++ b/meson.build
@@ -174,61 +174,22 @@ if unicode_library_name == ''
   endif
 endif
 
-####################################################################
-# D-Bus service files
-####################################################################
-
-if get_option('dbus_services') == ''
-  dbus_services_dir = dbus.get_pkgconfig_variable('session_bus_services_dir',
-                                                  define_variable: [ 'datadir', datadir ])
-else
-  dbus_services_dir = get_option('dbus_services')
-endif
-
-####################################################################
-# systemd user services
-####################################################################
-
-install_systemd_user_services = false
-if get_option('systemd_user_services') == 'yes' or get_option('systemd_user_services') == 'auto'
-  systemd = dependency('systemd', required: false)
-  if systemd.found()
-    # FIXME: this would ideally use the systemduserunitdir pkgconfig variable, but
-    # it does not depend on variables we can override to install within prefix.
-    install_systemd_user_services = true
-    systemd_user_services_dir = join_paths(libdir, 'systemd', 'user')
-  else
-    install_systemd_user_services = false
-    systemd_user_services_dir = '(not found)'
-  endif
-elif get_option('systemd_user_services') == 'no' or get_option('systemd_user_services') == ''
-  install_systemd_user_services = false
-  systemd_user_services_dir = '(disabled)'
-else
-  install_systemd_user_services = true
-  systemd_user_services_dir = get_option('systemd_user_services')
-endif
-
 ####################################################################
 # bash-completion
 ####################################################################
 
-install_bash_completion = false
-if get_option('bash_completion') == 'yes' or get_option('bash_completion') == 'auto'
-  bash_completion_package = dependency('bash-completion', required: false)
-  if bash_completion_package.found()
-    bash_completion_dir = bash_completion_package.get_pkgconfig_variable('completionsdir',
-                                                                         define_variable:  [ 'prefix', 
get_option('prefix') ])
-  else
-    bash_completion_dir = join_paths(datadir, 'bash-completion', 'completions')
+if get_option('bash_completion')
+  bash_completion_dir = get_option('bash_completion_dir')
+
+  if bash_completion_dir == ''
+    bash_completion_package = dependency('bash-completion', required: false)
+    if bash_completion_package.found()
+      bash_completion_dir = bash_completion_package.get_pkgconfig_variable('completionsdir',
+                                                                           define_variable: [ 'prefix', 
get_option('prefix') ])
+    else
+      bash_completion_dir = join_paths(datadir, 'bash-completion', 'completions')
+    endif
   endif
-  install_bash_completion = true
-elif get_option('bash_completion') == 'no' or get_option('bash_completion') == ''
-  install_bash_completion = false
-  bash_completion_dir = '(disabled)'
-else
-  install_bash_completion = true
-  bash_completion_dir = get_option('bash_completion')
 endif
 
 conf = configuration_data()
@@ -354,7 +315,6 @@ summary = [
   '\nFeature Support:',
   '    Support for network status detection:   ' + have_network_manager.to_string(),
   '    Unicode support library:                ' + unicode_library_name,
-  '    Build with Journal support:             ' + get_option('journal').to_string(),
   '    Build with SQLite FTS support:          @0@ (built-in FTS: @1@)'.format(
      get_option('fts'), sqlite3_has_builtin_fts5),
   '    Build with Stemming support:            ' + have_libstemmer.to_string(),
diff --git a/meson_options.txt b/meson_options.txt
index 3d01836ab..e29aaaa84 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,10 +1,8 @@
-option('docs', type: 'boolean', value: false,
+option('docs', type: 'boolean', value: false, yield: true,
        description: 'Generate API documentation with gtk-doc')
 option('fts', type: 'boolean', value: true,
        description: 'Enable the Tracker full-text search feature')
-option('journal', type: 'boolean', value: true,
-       description: 'Enable database journal backup mechanism')
-option('man', type: 'boolean', value: true,
+option('man', type: 'boolean', value: true, yield: true,
        description: 'Install man pages')
 option('override_sqlite_version_check', type: 'boolean', value: false,
        description: 'Override checks for broken sqlite versions')
@@ -16,12 +14,10 @@ option('stemmer', type: 'feature', value: 'auto',
 option('unicode_support', type: 'combo', choices: ['icu', 'unistring', 'auto'], value: 'auto',
        description: 'Unicode support library to use')
 
-option('bash_completion', type: 'string', value: 'yes',
-       description: 'Directory to install Bash completion files (or "yes" for default directory, "no" to 
disable installation')
-option('dbus_services', type: 'string', value: '',
-       description: 'Directory to install D-Bus .service files (leave blank to use the value from 
dbus-1.pc)')
-option('systemd_user_services', type: 'string', value: 'yes',
-       description: 'Directory to install systemd user .service files (or "yes" for default directory, "no" 
to disable installation)')
+option('bash_completion', type: 'boolean', value: true,
+       description: 'Whether to install Bash completion files')
+option('bash_completion_dir', type: 'string',
+       description: 'Directory to install Bash completion files')
 option('test_utils', type: 'boolean', value: true,
        description: 'Whether to install the trackertestutils Python package')
 option('test_utils_dir', type: 'string', value: '',
diff --git a/src/libtracker-sparql-backend/meson.build b/src/libtracker-sparql-backend/meson.build
index 504f77fa8..59384d42c 100644
--- a/src/libtracker-sparql-backend/meson.build
+++ b/src/libtracker-sparql-backend/meson.build
@@ -41,7 +41,6 @@ pkg.generate(libtracker_sparql,
         'tracker_datadir=${datadir}' / 'tracker',
         'ontologies_dir=' + tracker_ontologies_dir,
         'domain_ontologies_dir=${tracker_datadir}' / 'domain-ontologies',
-        'dbus_services_dir=' + dbus_services_dir,
     ],
 )
 
diff --git a/src/tracker/meson.build b/src/tracker/meson.build
index 7b7161c05..650d5155d 100644
--- a/src/tracker/meson.build
+++ b/src/tracker/meson.build
@@ -30,7 +30,7 @@ executable('tracker', sources,
 
 meson.add_install_script('make-subcommand-links.sh', modules)
 
-if install_bash_completion
+if get_option('bash_completion')
     install_data(
         sources: 'bash-completion/tracker',
         install_dir: bash_completion_dir)


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