[gnome-settings-daemon/wip/inigomartinez/meson: 3/5] build: Port to meson build system



commit 0b7d8ceb58a5f810a9a9a177b7376236bb140a50
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Thu Feb 1 08:35:23 2018 +0100

    build: Port to meson build system
    
    meson is a build system focused on speed an ease of use, which
    helps speeding up the software development. This patch adds meson
    support along autotools.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793087

 data/meson.build                        |   67 ++++++++
 gnome-settings-daemon/meson.build       |   48 ++++++
 meson.build                             |  250 +++++++++++++++++++++++++++++++
 meson_options.txt                       |   12 ++
 meson_post_install.py                   |   11 ++
 plugins/a11y-settings/meson.build       |   29 ++++
 plugins/clipboard/meson.build           |   31 ++++
 plugins/color/meson.build               |   63 ++++++++
 plugins/common/meson.build              |   91 +++++++++++
 plugins/datetime/meson.build            |   49 ++++++
 plugins/dummy/meson.build               |   50 ++++++
 plugins/housekeeping/meson.build        |   52 +++++++
 plugins/keyboard/meson.build            |   35 +++++
 plugins/media-keys/meson.build          |   74 +++++++++
 plugins/meson.build                     |   48 ++++++
 plugins/mouse/meson.build               |   53 +++++++
 plugins/power/meson.build               |  164 ++++++++++++++++++++
 plugins/print-notifications/meson.build |   44 ++++++
 plugins/rfkill/meson.build              |   32 ++++
 plugins/screensaver-proxy/meson.build   |   28 ++++
 plugins/sharing/meson.build             |   33 ++++
 plugins/smartcard/meson.build           |   62 ++++++++
 plugins/sound/meson.build               |   30 ++++
 plugins/wacom/meson.build               |   79 ++++++++++
 plugins/xsettings/meson.build           |   57 +++++++
 po/meson.build                          |    1 +
 subprojects/gvc                         |    2 +-
 tests/meson.build                       |   19 +++
 28 files changed, 1513 insertions(+), 1 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..0385b93
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,67 @@
+data_inc = include_directories('.')
+
+schemas = [
+  'org.gnome.settings-daemon.peripherals.gschema.xml',
+  'org.gnome.settings-daemon.peripherals.wacom.gschema.xml',
+  'org.gnome.settings-daemon.plugins.gschema.xml',
+  'org.gnome.settings-daemon.plugins.color.gschema.xml',
+  'org.gnome.settings-daemon.plugins.housekeeping.gschema.xml',
+  'org.gnome.settings-daemon.plugins.media-keys.gschema.xml',
+  'org.gnome.settings-daemon.plugins.power.gschema.xml',
+  'org.gnome.settings-daemon.plugins.sharing.gschema.xml',
+  'org.gnome.settings-daemon.plugins.xsettings.gschema.xml'
+]
+
+schema_conf = configuration_data()
+schema_conf.set('GETTEXT_PACKAGE', meson.project_name())
+
+foreach schema: schemas
+  schema_in = configure_file(
+    input: schema + '.in.in',
+    output: schema + '.in',
+    configuration: schema_conf
+  )
+
+  custom_target(
+    schema,
+    input: schema_in,
+    output: schema,
+    command: [intltool_merge, '-x', '-u', '--no-translations', '@INPUT@', '@OUTPUT@'],
+    install: true,
+    install_dir: gsd_schemadir
+  )
+endforeach
+
+enums_header = files('gsd-enums.h')
+
+gnome.mkenums(
+  'org.gnome.settings-daemon.enums.xml',
+  sources: enums_header,
+  comments: '<!-- @comment@ -->',
+  fhead: '<schemalist>',
+  vhead: '  <@type@ id="org.gnome.settings-daemon.@EnumName@">',
+  vprod: '    <value nick="@valuenick@" value="@valuenum@"/>',
+  vtail: '  </@type@>',
+  ftail: '</schemalist>',
+  install_header: true,
+  install_dir: gsd_schemadir
+)
+
+install_data(
+  enums_header,
+  install_dir: join_paths(gsd_pkgincludedir, meson.project_name())
+)
+
+install_data(
+  'gnome-settings-daemon.convert',
+  install_dir: join_paths(gsd_datadir, 'GConf', 'gsettings')
+)
+
+pkg.generate(
+  version: gsd_version,
+  name: meson.project_name(),
+  description: meson.project_name() + ' specific enumerations',
+  filebase: meson.project_name(),
+  subdirs: gsd_api_name,
+  requires: 'glib-2.0'
+)
diff --git a/gnome-settings-daemon/meson.build b/gnome-settings-daemon/meson.build
new file mode 100644
index 0000000..a4e47e3
--- /dev/null
+++ b/gnome-settings-daemon/meson.build
@@ -0,0 +1,48 @@
+sources = files(
+  'gnome-settings-bus.c',
+  'gnome-settings-profile.c'
+)
+
+dbus_ifaces = [
+  ['SessionManager', 'gsd-session-manager-glue'],
+  ['ScreenSaver', 'gsd-screen-saver-glue'],
+  ['Shell', 'gsd-shell-glue']
+]
+
+foreach iface: dbus_ifaces
+  name = 'org.gnome.' + iface[0]
+  sources += gnome.gdbus_codegen(
+    iface[1],
+    name + '.xml',
+    interface_prefix: name + '.',
+    namespace: 'Gsd',
+    annotations: [name, 'org.gtk.GDBus.C.Name', iface[0]]
+  )
+endforeach
+
+deps = [gio_unix_dep]
+
+cflags = [
+  '-DDATADIR="@0@"'.format(gsd_datadir),
+  '-DGNOME_SETTINGS_LOCALEDIR="@0@"'.format(gsd_localedir),
+  '-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)
+]
+
+if enable_wayland
+  deps += wayland_client_dep
+endif
+
+libgsd = shared_library(
+  'gsd',
+  sources: sources,
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_pkglibdir
+)
+
+libgsd_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  link_with: libgsd
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..8a162e9
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,250 @@
+project(
+  'gnome-settings-daemon', 'c',
+  version: '3.26.2',
+  license: 'GPL2+',
+  meson_version: '>= 0.43.0'
+)
+
+gsd_version = meson.project_version()
+version_array = gsd_version.split('.')
+gsd_major_version = version_array[0].to_int()
+
+gsd_api_version_minor = 0
+gsd_api_version = '@0@.@1@'.format(gsd_major_version, gsd_api_version_minor)
+gsd_api_name = '@0@-@1@'.format(meson.project_name(), gsd_api_version)
+
+gsd_prefix = get_option('prefix')
+gsd_bindir = join_paths(gsd_prefix, get_option('bindir'))
+gsd_datadir = join_paths(gsd_prefix, get_option('datadir'))
+gsd_includedir = join_paths(gsd_prefix, get_option('includedir'))
+gsd_libdir = join_paths(gsd_prefix, get_option('libdir'))
+gsd_libexecdir = join_paths(gsd_prefix, get_option('libexecdir'))
+gsd_localedir = join_paths(gsd_prefix, get_option('localedir'))
+gsd_sysconfdir = join_paths(gsd_prefix, get_option('sysconfdir'))
+
+gsd_pkgdatadir = join_paths(gsd_datadir, meson.project_name())
+gsd_pkgincludedir = join_paths(gsd_includedir, gsd_api_name)
+gsd_pkglibdir = join_paths(gsd_libdir, gsd_api_name)
+
+gsd_schemadir = join_paths(gsd_datadir, 'glib-2.0', 'schemas')
+
+gsd_xdg_autostart = join_paths(gsd_sysconfdir, 'xdg', 'autostart')
+
+host_is_darwin = host_machine.system().contains('darwin')
+host_is_linux = host_machine.system().contains('linux')
+host_is_linux_not_s390 = host_is_linux and not host_machine.cpu().contains('s390')
+
+cc = meson.get_compiler('c')
+
+config_h = configuration_data()
+
+# defines
+set_defines = [
+  ['PACKAGE_NAME', meson.project_name()],
+  ['PACKAGE_VERSION', gsd_version],
+  # i18n
+  ['GETTEXT_PACKAGE', meson.project_name()]
+]
+
+foreach define: set_defines
+  config_h.set_quoted(define[0], define[1])
+endforeach
+
+# compiler flags
+common_flags = ['-DHAVE_CONFIG_H']
+
+if get_option('buildtype').contains('debug')
+  common_flags += ['-DG_ENABLE_DEBUG']
+
+  test_cflags = [
+    '-Wcast-align',
+    '-Wmissing-declarations',
+    '-Wmissing-prototypes',
+    '-Wnested-externs',
+    '-Wno-strict-aliasing',
+    '-Wno-sign-compare',
+    '-Wpointer-arith'
+  ]
+
+  compiler_flags = cc.get_supported_arguments(test_cflags)
+else
+  common_flags += ['-DG_DISABLE_CHECKS']
+endif
+
+# Workaround for meson's bug
+# https://github.com/mesonbuild/meson/pull/1896
+if get_option('b_ndebug') == false
+  common_flags += ['-DG_DISABLE_ASSERT']
+endif
+
+add_project_arguments(common_flags + compiler_flags, language: 'c')
+
+glib_req_version = '>= 2.53.0'
+pulse_req_version = '>= 2.0'
+
+colord_dep = dependency('colord', version: '>= 1.0.2')
+geocode_glib_dep = dependency('geocode-glib-1.0', version: '>= 3.10.0')
+gio_dep = dependency('gio-2.0', version: glib_req_version)
+gio_unix_dep = dependency('gio-unix-2.0')
+glib_dep = dependency('glib-2.0', version: glib_req_version)
+gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 3.11.1')
+gsettings_desktop_dep = dependency('gsettings-desktop-schemas', version: '>= 3.23.3')
+gtk_dep = dependency('gtk+-3.0', version: '>= 3.15.3')
+gtk_x11_dep = dependency('gtk+-x11-3.0')
+gweather_dep = dependency('gweather-3.0', version: '>= 3.9.5')
+lcms_dep = dependency('lcms2', version: '>= 2.2')
+libcanberra_gtk_dep = dependency('libcanberra-gtk3')
+libgeoclue_dep = dependency('libgeoclue-2.0', version: '>= 2.3.1')
+libnotify_dep = dependency('libnotify', version: '>= 0.7.3')
+libpulse_dep = dependency('libpulse', version: pulse_req_version)
+libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', version: pulse_req_version)
+pango_dep = dependency('pango', version: '>= 1.20.0')
+polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.103')
+upower_glib_dep = dependency('upower-glib', version: '>= 0.99.0')
+x11_dep = dependency('x11')
+xtst_dep = dependency('xtst')
+
+m_dep = cc.find_library('m')
+
+# ALSA integration (default enabled)
+enable_alsa = get_option('alsa')
+if host_is_linux
+  assert(enable_alsa, 'ALSA is not optional on Linux platforms')
+endif
+
+libgvc = subproject(
+  'gvc',
+  default_options: [
+    'static=true',
+    'alsa=' + enable_alsa.to_string()
+  ]
+)
+libgvc_dep = libgvc.get_variable('libgvc_dep')
+
+# GUdev integration (default enabled)
+enable_gudev = get_option('gudev')
+if enable_gudev
+  assert(enable_gudev, 'GUdev is not optional on Linux platforms')
+  gudev_dep = dependency('gudev-1.0')
+endif
+config_h.set('HAVE_GUDEV', enable_gudev)
+
+# Check for libwayland-client
+enable_wayland = get_option('wayland')
+if enable_wayland
+  wayland_client_dep = dependency('wayland-client')
+endif
+config_h.set10('HAVE_WAYLAND', enable_wayland)
+
+# wacom (disabled for s390/s390x and non Linux platforms)
+enable_wacom = not host_is_linux or host_is_linux_not_s390
+if enable_wacom
+  assert(enable_gudev, 'GUDev support is required for wacom support.')
+  libwacom_dep = dependency('libwacom', version: '>= 0.7')
+endif
+config_h.set10('HAVE_WACOM', enable_wacom)
+
+# smartcard section
+enable_smartcard = get_option('smartcard')
+if enable_smartcard
+  nss_dep = dependency('nss', version: '>= 3.11.2')
+
+  system_nssdb_dir = get_option('nssdb_dir')
+  if system_nssdb_dir == ''
+    system_nssdb_dir = join_paths(gsd_sysconfdir, 'pki', 'nssdb')
+  endif
+endif
+
+# CUPS
+enable_cups = get_option('cups')
+if enable_cups
+  cups_dep = dependency('cups', version : '>= 1.4', required: false)
+  assert(cups_dep.found(), 'CUPS 1.4 or newer not found')
+
+  # FIXME: 1.6 cflags generate a lot of errors
+  '''
+  cups_cflags = []
+  if cups_dep.version().version_compare('>= 1.6')
+    cups_cflags += '-D_PPD_DEPRECATED=""'
+  endif
+
+  cups_dep = declare_dependency(
+    dependencies: cups_dep,
+    compile_args: cups_cflags
+  )
+  '''
+endif
+
+# Rfkill
+enable_rfkill = get_option('rfkill')
+if enable_rfkill
+  assert(cc.has_header('linux/rfkill.h'), 'rfkill support requested but RFKill headers not found')
+
+  udev_dir = get_option('udev_dir')
+  if udev_dir == ''
+    udev_dir = dependency('udev').get_pkgconfig_variable('udevdir')
+  endif
+endif
+
+# Sharing plugin
+enable_network_manager = get_option('network_manager')
+if enable_network_manager
+  # network manager
+  libnm_dep = dependency('libnm', version: '>= 1.0')
+endif
+config_h.set('HAVE_NETWORK_MANAGER', enable_network_manager)
+
+enable_profiling = get_option('profiling')
+config_h.set('ENABLE_PROFILING', enable_profiling)
+
+gnome = import('gnome')
+i18n = import('i18n')
+pkg = import('pkgconfig')
+
+po_dir = join_paths(meson.source_root(), 'po')
+
+intltool_merge = find_program('intltool-merge')
+intltool_cache = join_paths(po_dir, '.intltool-merge-cache')
+intltool_desktop_cmd = [intltool_merge, '-d', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
+intltool_xml_cmd = [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
+
+top_inc = include_directories('.')
+
+subdir('gnome-settings-daemon')
+subdir('data')
+subdir('plugins')
+subdir('po')
+subdir('tests')
+
+configure_file(
+  output: 'config.h',
+  configuration: config_h
+)
+
+meson.add_install_script(
+  'meson_post_install.py',
+  gsd_datadir
+)
+
+output = '\n        ' + meson.project_name() + ' ' + meson.project_version() +'\n'
+output += '        =============================\n'
+output += '\n        prefix:                   ' + gsd_prefix + '\n'
+output += '        exec_prefix:              ' + gsd_prefix + '\n'
+output += '        libdir:                   ' + gsd_libdir + '\n'
+output += '        libexecdir:               ' + gsd_libexecdir + '\n'
+output += '        bindir:                   ' + gsd_bindir + '\n'
+output += '        sysconfdir:               ' + gsd_sysconfdir + '\n'
+output += '        datadir:                  ' + gsd_datadir + '\n'
+output += '\n        source code location:     ' + meson.source_root() + '\n'
+output += '        compiler:                 ' + cc.get_id() + '\n'
+output += '        cflags:                   ' + ' '.join(compiler_flags) + '\n'
+output += '\n        ALSA support:             ' + enable_alsa.to_string() + '\n'
+output += '        NetworkManager support:   ' + enable_network_manager.to_string() + '\n'
+output += '        Smartcard support:        ' + enable_smartcard.to_string() + '\n'
+output += '        Cups support:             ' + enable_cups.to_string() + '\n'
+output += '        Wayland support:          ' + enable_wayland.to_string() + '\n'
+output += '        Wacom support:            ' + enable_wacom.to_string() + '\n'
+output += '        RFKill support:           ' + enable_rfkill.to_string() + '\n'
+output += '\n        System nssdb:             ' + system_nssdb_dir + '\n'
+output += '        udev dir:                 ' + udev_dir
+message(output)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..989c967
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,12 @@
+option('nssdb_dir', type: 'string', value: '', description: 'Absolute path to the system NSS database 
directory')
+option('udev_dir', type: 'string', value: '', description: 'Absolute path to the udev base directory.')
+
+option('alsa', type: 'boolean', value: true, description: 'build with ALSA support (not optional on Linux 
platforms)')
+option('gudev', type: 'boolean', value: true, description: 'build with gudev device support (not optional on 
Linux platforms)')
+option('cups', type: 'boolean', value: true, description: 'build with CUPS support')
+option('network_manager', type: 'boolean', value: true, description: 'build with NetworkManager support')
+option('rfkill', type: 'boolean', value: true, description: 'build with rfkill support')
+option('smartcard', type: 'boolean', value: true, description: 'build with smartcard support')
+option('wayland', type: 'boolean', value: true, description: 'build with Wayland support')
+
+option('profiling', type: 'boolean', value: false, description: 'turn on profiling')
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..6058e73
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+import sys
+
+if not os.environ.get('DESTDIR'):
+  schemadir = os.path.join(sys.argv[1], 'glib-2.0', 'schemas')
+
+  print('Compiling gsettings schemas...')
+  subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/plugins/a11y-settings/meson.build b/plugins/a11y-settings/meson.build
new file mode 100644
index 0000000..f088466
--- /dev/null
+++ b/plugins/a11y-settings/meson.build
@@ -0,0 +1,29 @@
+desktop = 'org.gnome.SettingsDaemon.A11ySettings.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-a11y-settings-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gio_dep,
+  gsettings_desktop_dep
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/clipboard/meson.build b/plugins/clipboard/meson.build
new file mode 100644
index 0000000..df25cc7
--- /dev/null
+++ b/plugins/clipboard/meson.build
@@ -0,0 +1,31 @@
+desktop = 'org.gnome.SettingsDaemon.Clipboard.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-clipboard-manager.c',
+  'list.c',
+  'main.c',
+  'xutils.c'
+)
+
+deps = plugins_deps + [
+  gtk_x11_dep,
+  x11_dep
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/color/meson.build b/plugins/color/meson.build
new file mode 100644
index 0000000..f026c0a
--- /dev/null
+++ b/plugins/color/meson.build
@@ -0,0 +1,63 @@
+desktop = 'org.gnome.SettingsDaemon.Color.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gcm-edid.c',
+  'gnome-datetime-source.c',
+  'gsd-color-calibrate.c',
+  'gsd-color-manager.c',
+  'gsd-color-profiles.c',
+  'gsd-color-state.c',
+  'gsd-night-light.c',
+  'gsd-night-light-common.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  colord_dep,
+  gnome_desktop_dep,
+  lcms_dep,
+  libcanberra_gtk_dep,
+  libgeoclue_dep,
+  libnotify_dep,
+  m_dep,
+]
+
+cflags += ['-DBINDIR="@0@"'.format(gsd_bindir)]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+sources = files(
+  'gcm-edid.c',
+  'gcm-self-test.c',
+  'gnome-datetime-source.c',
+  'gsd-night-light.c',
+  'gsd-night-light-common.c'
+)
+
+test_unit = 'gcm-self-test'
+
+exe = executable(
+  test_unit,
+  sources,
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: '-DTESTDATADIR="@0@"'.format(join_paths(meson.current_source_dir(), 'test-data'))
+)
+
+test(test_unit, exe)
diff --git a/plugins/common/meson.build b/plugins/common/meson.build
new file mode 100644
index 0000000..c5fe7b2
--- /dev/null
+++ b/plugins/common/meson.build
@@ -0,0 +1,91 @@
+common_inc = include_directories('.')
+
+sources = files(
+  'gsd-device-manager.c',
+  'gsd-device-manager-x11.c',
+  'gsd-device-mapper.c',
+  'gsd-input-helper.c',
+  'gsd-settings-migrate.c',
+  'gsd-shell-helper.c'
+)
+
+enums_header = 'gsd-device-manager.h'
+
+enums = 'gsd-common-enums'
+
+sources += gnome.mkenums(
+  enums + '.h',
+  sources: enums_header,
+  fhead: '#ifndef GSD_COMMON_ENUMS_H\n#define GSD_COMMON_ENUMS_H\n\n#include 
<glib-object.h>\n\nG_BEGIN_DECLS\n',
+  fprod: '/* enumerations from "@filename@" */\n',
+  vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GSD_TYPE_@ENUMSHORT@ 
(@enum_name@_get_type())\n',
+  ftail: 'G_END_DECLS\n\n#endif /* !GSD_COMMON_ENUMS_H */'
+)
+
+sources += gnome.mkenums(
+  enums + '.c',
+  sources: enums_header,
+  fhead: '#include "gsd-device-manager.h"\n#include "gsd-common-enums.h"\n',
+  fprod: '\n/* enumerations from "@filename@" */',
+  vhead: 'GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static 
const G@Type@Value values[] = {',
+  vprod: '      { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
+  vtail: '      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static ("@EnumName@", values);\n  
}\n  return etype;\n}\n'
+)
+
+resource_data = files('gtk.css')
+
+sources += gnome.compile_resources(
+  'gsd-resources',
+  'gsd.gresources.xml',
+  c_name: 'gsd',
+  dependencies: resource_data
+)
+
+deps = plugins_deps + [
+  gnome_desktop_dep,
+  gtk_x11_dep,
+  x11_dep,
+  dependency('kbproto'),
+  dependency('xi')
+]
+
+ldflags = []
+if host_is_darwin
+  ldflags += ['-Wl,-bundle_loader,@0@'.format(join_paths(), meson.build_root(), meson.project_name(), 
meson.project_name())]
+endif
+
+if enable_gudev
+  deps += gudev_dep
+endif
+
+if enable_wacom
+  deps += libwacom_dep
+endif
+
+if enable_wayland
+  sources += files('gsd-device-manager-udev.c')
+endif
+
+libcommon = shared_module(
+  plugin_name,
+  sources: sources,
+  include_directories: [top_inc, data_inc],
+  dependencies: deps,
+  c_args: cflags,
+  link_args: ldflags
+)
+
+libcommon_dep = declare_dependency(
+  include_directories: common_inc,
+  link_with: libcommon
+)
+
+executable(
+  'gsd-test-input-helper',
+  'test-input-helper.c',
+  include_directories: top_inc,
+  dependencies: gtk_dep,
+  link_with: libcommon,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/datetime/meson.build b/plugins/datetime/meson.build
new file mode 100644
index 0000000..a21d48f
--- /dev/null
+++ b/plugins/datetime/meson.build
@@ -0,0 +1,49 @@
+desktop = 'org.gnome.SettingsDaemon.Datetime.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+install_data(
+  'backward',
+  install_dir: join_paths(gsd_pkgdatadir, 'datetime')
+)
+
+sources = files(
+  'gsd-datetime-manager.c',
+  'gsd-timezone-monitor.c',
+  'main.c',
+  'tz.c',
+  'weather-tz.c'
+)
+
+sources += gnome.gdbus_codegen(
+  'timedated',
+  'timedated1-interface.xml',
+  interface_prefix: 'org.freedesktop.'
+)
+
+deps = plugins_deps + [
+  geocode_glib_dep,
+  gweather_dep,
+  libgeoclue_dep,
+  libnotify_dep,
+  m_dep,
+  polkit_gobject_dep
+]
+
+cflags += ['-DGNOMECC_DATA_DIR="@0@"'.format(gsd_pkgdatadir)]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/dummy/meson.build b/plugins/dummy/meson.build
new file mode 100644
index 0000000..4dcffd1
--- /dev/null
+++ b/plugins/dummy/meson.build
@@ -0,0 +1,50 @@
+desktops = []
+if not enable_smartcard
+  desktops += ['org.gnome.SettingsDaemon.Smartcard']
+endif
+
+if not enable_cups
+  desktops += ['org.gnome.SettingsDaemon.PrintNotifications']
+endif
+
+if not enable_rfkill
+  desktops += ['org.gnome.SettingsDaemon.Rfkill']
+endif
+
+if not enable_wacom
+  desktops += ['org.gnome.SettingsDaemon.Wacom']
+endif
+
+foreach desktop: desktops
+  dummy_conf = configuration_data()
+  dummy_conf.set('libexecdir', gsd_libexecdir)
+  dummy_conf.set('pluginname', desktop)
+
+  configure_file(
+    input: 'org.gnome.SettingsDaemon.Dummy.desktop.in',
+    output: desktop + '.desktop',
+    configuration: dummy_conf,
+    install: true,
+    install_dir: gsd_xdg_autostart
+  )
+endforeach
+
+sources = files(
+  'gsd-dummy-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gio_dep,
+  glib_dep
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/housekeeping/meson.build b/plugins/housekeeping/meson.build
new file mode 100644
index 0000000..5477911
--- /dev/null
+++ b/plugins/housekeeping/meson.build
@@ -0,0 +1,52 @@
+desktop = 'org.gnome.SettingsDaemon.Housekeeping.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+common_files = files(
+  'gsd-disk-space.c',
+  'gsd-disk-space-helper.c'
+)
+
+sources = common_files + files(
+  'gsd-housekeeping-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gio_unix_dep,
+  gtk_dep,
+  libnotify_dep
+]
+
+cflags += ['-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+programs = [
+  'gsd-disk-space-test',
+  'gsd-empty-trash-test',
+  'gsd-purge-temp-test'
+]
+
+foreach program: programs
+  executable(
+    program,
+    common_files + [program + '.c'],
+    include_directories: top_inc,
+    dependencies: deps
+  )
+endforeach
diff --git a/plugins/keyboard/meson.build b/plugins/keyboard/meson.build
new file mode 100644
index 0000000..a28b8b7
--- /dev/null
+++ b/plugins/keyboard/meson.build
@@ -0,0 +1,35 @@
+desktop = 'org.gnome.SettingsDaemon.Keyboard.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-keyboard-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gtk_dep,
+  libcommon_dep,
+  x11_dep
+]
+
+cflags += [
+  '-DDATADIR="@0@"'.format(gsd_pkgdatadir),
+  '-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, data_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/media-keys/meson.build b/plugins/media-keys/meson.build
new file mode 100644
index 0000000..904bca9
--- /dev/null
+++ b/plugins/media-keys/meson.build
@@ -0,0 +1,74 @@
+desktop = 'org.gnome.SettingsDaemon.MediaKeys.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'bus-watch-namespace.c',
+  'gsd-media-keys-manager.c',
+  'gsd-screenshot-utils.c',
+  'main.c',
+  'mpris-controller.c'
+)
+
+marshal = 'gsd-marshal'
+
+sources += gnome.genmarshal(
+  marshal,
+  sources: marshal + '.list',
+  prefix: marshal.underscorify(),
+  internal: true
+)
+
+sources += gnome.gdbus_codegen(
+  'shell-key-grabber',
+  'org.gnome.ShellKeyGrabber.xml',
+  interface_prefix: 'org.gnome.',
+  namespace: 'Shell'
+)
+
+deps = plugins_deps + [
+  gio_unix_dep,
+  gsettings_desktop_dep,
+  libcanberra_gtk_dep,
+  libcommon_dep,
+  libgvc_dep,
+  libpulse_dep,
+  libpulse_mainloop_glib_dep,
+  m_dep,
+  upower_glib_dep
+]
+
+if enable_gudev
+  deps += gudev_dep
+endif
+
+cflags += [
+  '-DBINDIR="@0@"'.format(gsd_bindir),
+  '-DGTKBUILDERDIR="@0@"'.format(gsd_pkgdatadir),
+  '-DPIXMAPDIR="@0@"'.format(gsd_pkgdatadir)
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, data_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+program = 'audio-selection-test'
+
+executable(
+  program,
+  program + '.c',
+  include_directories: top_inc,
+  dependencies: deps
+)
diff --git a/plugins/meson.build b/plugins/meson.build
new file mode 100644
index 0000000..6babd8e
--- /dev/null
+++ b/plugins/meson.build
@@ -0,0 +1,48 @@
+enabled_plugins = [
+  'a11y-settings',
+  'clipboard',
+  'color',
+  'datetime',
+  'dummy',
+  'power',
+  'housekeeping',
+  'keyboard',
+  'media-keys',
+  'mouse',
+  'screensaver-proxy',
+  'sharing',
+  'sound',
+  'xsettings'
+]
+
+if enable_smartcard
+  enabled_plugins += ['smartcard']
+endif
+
+if enable_wacom
+  enabled_plugins += ['wacom']
+endif
+
+if enable_cups
+  enabled_plugins += ['print-notifications']
+endif
+
+if enable_rfkill
+  enabled_plugins += ['rfkill']
+endif
+
+plugins_conf = configuration_data()
+plugins_conf.set('libexecdir', gsd_libexecdir)
+
+plugins_deps = [libgsd_dep]
+
+plugins_cflags = ['-DGNOME_SETTINGS_LOCALEDIR="@0@"'.format(gsd_localedir)]
+
+foreach plugin_name: ['common'] + enabled_plugins
+  cflags = [
+    '-DG_LOG_DOMAIN="@0@-plugin"'.format(plugin_name),
+    '-DPLUGIN_NAME="@0@"'.format(plugin_name),
+  ] + plugins_cflags
+
+  subdir(plugin_name)
+endforeach
diff --git a/plugins/mouse/meson.build b/plugins/mouse/meson.build
new file mode 100644
index 0000000..a01d275
--- /dev/null
+++ b/plugins/mouse/meson.build
@@ -0,0 +1,53 @@
+desktop = 'org.gnome.SettingsDaemon.Mouse.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-mouse-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gio_dep,
+  gsettings_desktop_dep,
+  libcommon_dep,
+  m_dep
+]
+
+cflags += ['-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, data_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+sources = files(
+  'gsd-locate-pointer.c',
+  'gsd-timeline.c'
+)
+
+deps = [
+  gtk_dep,
+  m_dep,
+  x11_dep
+]
+
+executable(
+  'gsd-locate-pointer',
+  sources,
+  include_directories: top_inc,
+  dependencies: deps,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/power/meson.build b/plugins/power/meson.build
new file mode 100644
index 0000000..3e688fe
--- /dev/null
+++ b/plugins/power/meson.build
@@ -0,0 +1,164 @@
+desktop = 'org.gnome.SettingsDaemon.Power.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gpm-common.c',
+  'gsd-backlight-linux.c',
+  'gsd-power-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  libcanberra_gtk_dep,
+  libcommon_dep,
+  libnotify_dep,
+  gnome_desktop_dep,
+  m_dep,
+  upower_glib_dep,
+  x11_dep,
+  xtst_dep,
+  dependency('xext')
+]
+
+if enable_gudev
+  deps += gudev_dep
+endif
+
+cflags += [
+  '-DBINDIR="@0@"'.format(gsd_bindir),
+  '-DGTKBUILDERDIR="@0@"'.format(gsd_pkgdatadir),
+  '-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)
+]
+
+gsd_power = executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, data_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+sources = files('gsd-power-enums-update.c')
+
+enums_headers = files(
+  'gsm-inhibitor-flag.h',
+  'gsm-presence-flag.h'
+)
+
+enums = 'gsd-power-enums'
+
+sources += gnome.mkenums(
+  enums + '.h',
+  sources: enums_headers,
+  fhead: '#ifndef GSD_POWER_ENUMS_H\n#define GSD_POWER_ENUMS_H\n\n#include 
<glib-object.h>\n\nG_BEGIN_DECLS\n',
+  fprod: '/* enumerations from "@filename@" */\n',
+  vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GSD_POWER_TYPE_@ENUMSHORT@ 
(@enum_name@_get_type())\n',
+  ftail: 'G_END_DECLS\n\n#endif /* !GSD_POWER_ENUMS_H */'
+)
+
+sources += gnome.mkenums(
+  enums + '.c',
+  sources: enums_headers,
+  fhead: '#include "gsm-inhibitor-flag.h"\n#include "gsm-presence-flag.h"\n#include "gsd-power-enums.h"',
+  fprod: '\n/* enumerations from "@filename@" */',
+  vhead: 'GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static 
const G@Type@Value values[] = {',
+  vprod: '      { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
+  vtail: '      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static ("@EnumName@", values);\n  
}\n  return etype;\n}\n'
+)
+
+gsd_power_enums_update = executable(
+  'gsd-power-enums-update',
+  sources,
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: cflags
+)
+
+if enable_gudev
+  policy = 'org.gnome.settings-daemon.plugins.power.policy'
+
+  policy_in = configure_file(
+    input: policy + '.in.in',
+    output: policy + '.in',
+    configuration: plugins_conf
+  )
+
+  custom_target(
+    policy,
+    input: policy_in,
+    output: policy,
+    command: intltool_xml_cmd,
+    install: true,
+    install_dir: join_paths(gsd_datadir, 'polkit-1', 'actions')
+  )
+
+  sources = files(
+    'gsd-backlight-helper.c',
+    'gsd-backlight-linux.c'
+  )
+
+  deps = [
+    glib_dep,
+    gudev_dep,
+    m_dep
+  ]
+
+  executable(
+    'gsd-backlight-helper',
+    sources,
+    include_directories: top_inc,
+    dependencies: deps,
+    install: true,
+    install_dir: gsd_libexecdir
+  )
+endif
+
+output = 'gsdpowerconstants.py'
+
+gsdpowerconstants_py = custom_target(
+  output,
+  input: 'gsd-power-constants.h',
+  output: output,
+  command: [join_paths(meson.current_source_dir(), 'gsd-power-constants-update.pl'), '@INPUT@', '@OUTPUT@']
+)
+
+output = 'gsdpowerenums.py'
+
+gsdpowerenums_py = custom_target(
+  output,
+  output: output,
+  capture: true,
+  command: [gsd_power_enums_update]
+)
+
+test_py = find_program('test.py')
+
+# FIXME: the test doesn't work due to issues in the python code
+#        AttributeError: 'NoneType' object has no attribute 'rfind'
+'''
+# This is how you run a single test
+#      BUILDDIR=$(builddir) TOP_BUILDDIR=$(top_builddir) ${PYTHON} $(srcdir)/test.py 
PowerPluginTest.test_sleep_inactive_blank
+       BUILDDIR=$(builddir) TOP_BUILDDIR=$(top_builddir) ${PYTHON} $(srcdir)/test.py
+
+envs = [
+  'BUILDDIR=' + meson.current_build_dir(),
+  'TOP_BUILDDIR=' + meson.build_root()
+]
+
+# FIXME: dependency over gsdpowerenums.py is necessary
+test(
+  'test-power',
+  test_py,
+  args: 'PowerPluginTest.test_sleep_inactive_blank',
+  env: envs
+)
+'''
diff --git a/plugins/print-notifications/meson.build b/plugins/print-notifications/meson.build
new file mode 100644
index 0000000..241f305
--- /dev/null
+++ b/plugins/print-notifications/meson.build
@@ -0,0 +1,44 @@
+desktop = 'org.gnome.SettingsDaemon.PrintNotifications.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-print-notifications-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  cups_dep,
+  gtk_dep,
+  libnotify_dep
+]
+
+cflags += ['-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+program = 'gsd-printer'
+
+executable(
+  program,
+  program + '.c',
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: '-DGNOME_SETTINGS_LOCALEDIR="@0@"'.format(gsd_localedir),
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/rfkill/meson.build b/plugins/rfkill/meson.build
new file mode 100644
index 0000000..8a4d094
--- /dev/null
+++ b/plugins/rfkill/meson.build
@@ -0,0 +1,32 @@
+desktop = 'org.gnome.SettingsDaemon.Rfkill.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+install_data(
+  '61-gnome-settings-daemon-rfkill.rules',
+  install_dir: join_paths(udev_dir, 'rules.d')
+)
+
+sources = files(
+  'gsd-rfkill-manager.c',
+  'rfkill-glib.c',
+  'main.c'
+)
+
+deps = plugins_deps + [gio_unix_dep]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/screensaver-proxy/meson.build b/plugins/screensaver-proxy/meson.build
new file mode 100644
index 0000000..2348b55
--- /dev/null
+++ b/plugins/screensaver-proxy/meson.build
@@ -0,0 +1,28 @@
+desktop = 'org.gnome.SettingsDaemon.ScreensaverProxy.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-screensaver-proxy-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [gio_dep,]
+
+cflags += ['-DLIBEXECDIR="@0@"'.format(gsd_libexecdir)]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/sharing/meson.build b/plugins/sharing/meson.build
new file mode 100644
index 0000000..5ab8265
--- /dev/null
+++ b/plugins/sharing/meson.build
@@ -0,0 +1,33 @@
+desktop = 'org.gnome.SettingsDaemon.Sharing.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-sharing-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gio_unix_dep,
+  libnotify_dep
+]
+
+if enable_network_manager
+  deps += libnm_dep
+endif
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/smartcard/meson.build b/plugins/smartcard/meson.build
new file mode 100644
index 0000000..aaec9c3
--- /dev/null
+++ b/plugins/smartcard/meson.build
@@ -0,0 +1,62 @@
+desktop = 'org.gnome.SettingsDaemon.Smartcard.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-smartcard-manager.c',
+  'gsd-smartcard-service.c',
+  'gsd-smartcard-utils.c',
+  'main.c'
+)
+
+enum_headers = files(
+  'gsd-smartcard-manager.h',
+  'gsd-smartcard-utils.h'
+)
+
+enum_types = 'gsd-smartcard-enum-types'
+
+sources += gnome.mkenums(
+  enum_types,
+  sources: enum_headers,
+  c_template: enum_types + '.c.in',
+  h_template: enum_types + '.h.in'
+)
+
+gdbus = 'org.gnome.SettingsDaemon.Smartcard'
+
+sources += gnome.gdbus_codegen(
+  gdbus,
+  gdbus + '.xml',
+  interface_prefix: gdbus + '.',
+  namespace: 'GsdSmartcardService',
+  object_manager: true
+)
+
+deps = plugins_deps + [
+  gio_unix_dep,
+  libnotify_dep,
+  nss_dep
+]
+
+cflags += [
+  '-DGSD_SMARTCARD_MANAGER_NSS_DB="@0@"'.format(system_nssdb_dir),
+  '-DLIBDIR="@0@"'.format(gsd_libdir),
+  '-DSYSCONFDIR="@0@"'.format(gsd_sysconfdir)
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/sound/meson.build b/plugins/sound/meson.build
new file mode 100644
index 0000000..b73c1c9
--- /dev/null
+++ b/plugins/sound/meson.build
@@ -0,0 +1,30 @@
+desktop = 'org.gnome.SettingsDaemon.Sound.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+sources = files(
+  'gsd-sound-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gio_dep,
+  libpulse_dep,
+  libpulse_mainloop_glib_dep
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
diff --git a/plugins/wacom/meson.build b/plugins/wacom/meson.build
new file mode 100644
index 0000000..1d5a3a7
--- /dev/null
+++ b/plugins/wacom/meson.build
@@ -0,0 +1,79 @@
+desktop = 'org.gnome.SettingsDaemon.Wacom.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+policy = 'org.gnome.settings-daemon.plugins.wacom.policy'
+
+policy_in = configure_file(
+  input: policy + '.in.in',
+  output: policy + '.in',
+  configuration: plugins_conf
+)
+
+custom_target(
+  policy,
+  input: policy_in,
+  output: policy,
+  command: intltool_xml_cmd,
+  install: true,
+  install_dir: join_paths(gsd_datadir, 'polkit-1', 'actions')
+)
+
+sources = files(
+  'gsd-wacom-manager.c',
+  'gsd-wacom-oled.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gtk_dep,
+  libcommon_dep,
+  m_dep,
+  pango_dep
+]
+
+cflags += [
+  '-DBINDIR="@0@"'.format(gsd_bindir),
+  '-DGTKBUILDERDIR="@0@"'.format(gsd_pkgdatadir),
+  '-DLIBEXECDIR="@0@"'.format(gsd_libexecdir),
+  '-DPIXMAPDIR="@0@"'.format(gsd_pkgdatadir)
+]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, data_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+if enable_gudev
+  deps = [
+    gudev_dep,
+    m_dep
+  ]
+
+  programs = [
+    ['gsd-wacom-led-helper', [glib_dep]],
+    ['gsd-wacom-oled-helper', []]
+  ]
+
+  foreach program: programs
+    executable(
+      program[0],
+      program[0] + '.c',
+      include_directories: top_inc,
+      dependencies: deps + program[1],
+      install: true,
+      install_dir: gsd_libexecdir
+    )
+  endforeach
+endif
diff --git a/plugins/xsettings/meson.build b/plugins/xsettings/meson.build
new file mode 100644
index 0000000..6cfb8f7
--- /dev/null
+++ b/plugins/xsettings/meson.build
@@ -0,0 +1,57 @@
+desktop = 'org.gnome.SettingsDaemon.XSettings.desktop'
+
+configure_file(
+  input: desktop + '.in',
+  output: desktop,
+  configuration: plugins_conf,
+  install: true,
+  install_dir: gsd_xdg_autostart
+)
+
+gsd_xsettings_gtk = files('gsd-xsettings-gtk.c')
+
+fc_monitor = files('fc-monitor.c')
+
+wm_button_layout_translation = files('wm-button-layout-translation.c')
+
+sources = gsd_xsettings_gtk + fc_monitor + wm_button_layout_translation + files(
+  'gsd-remote-display-manager.c',
+  'gsd-xsettings-manager.c',
+  'xsettings-common.c',
+  'xsettings-manager.c',
+  'main.c'
+)
+
+deps = plugins_deps + [
+  gtk_dep,
+  x11_dep,
+  dependency('fontconfig')
+]
+
+cflags += ['-DGTK_MODULES_DIRECTORY="@0@"'.format(join_paths(gsd_pkglibdir, 'gtk-modules'))]
+
+executable(
+  'gsd-' + plugin_name,
+  sources,
+  include_directories: [top_inc, common_inc, data_inc],
+  dependencies: deps,
+  c_args: cflags,
+  install: true,
+  install_dir: gsd_libexecdir
+)
+
+programs = [
+  ['test-gtk-modules', gsd_xsettings_gtk + ['test-gtk-modules.c'], cflags],
+  ['test-fontconfig-monitor', fc_monitor, cflags + ['-DFONTCONFIG_MONITOR_TEST']],
+  ['test-wm-button-layout-translations', wm_button_layout_translation + 
['test-wm-button-layout-translations.c'], []]
+]
+
+foreach program: programs
+  executable(
+    program[0],
+    program[1],
+    include_directories: top_inc,
+    dependencies: deps,
+    c_args: program[2]
+  )
+endforeach
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..e9b77d7
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(meson.project_name(), preset: 'glib')
diff --git a/subprojects/gvc b/subprojects/gvc
index ce8e488..67533bf 160000
--- a/subprojects/gvc
+++ b/subprojects/gvc
@@ -1 +1 @@
-Subproject commit ce8e4880ce31e275c40825c4ed756c791107f810
+Subproject commit 67533bffdcd22893b28baa411b2e75bd75dce323
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..75b46a7
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,19 @@
+test_unit = 'shiftkey'
+
+deps = [
+  x11_dep,
+  xtst_dep
+]
+
+exe = executable(
+  test_unit,
+  test_unit + '.c',
+  include_directories: top_inc,
+  dependencies: deps
+)
+
+test(
+  test_unit,
+  exe,
+  args: [gsd_power, test_py.path(), gsdpowerconstants_py, gsdpowerenums_py]
+)



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