[at-spi2-core/wip/meson] Add Meson build system



commit 937d852b99a8047b859ffc181a9b32106255806f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon May 22 15:54:24 2017 +0100

    Add Meson build system
    
    Meson is a meta-build system which provides us with various advantages
    over Autotools:
    
     - it's portable to various platforms
     - it's easy to understand
     - it's fast
     - it's well maintained
    
    Various libraries in the GNOME stack have been ported to it, including
    GTK+ itself.

 atspi/meson.build     |   78 ++++++++++++++++++++++++++++++++++
 bus/meson.build       |   55 ++++++++++++++++++++++++
 dbind/meson.build     |   16 +++++++
 meson.build           |  111 +++++++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt     |   12 +++++
 registryd/meson.build |   42 ++++++++++++++++++
 test/meson.build      |    4 ++
 7 files changed, 318 insertions(+), 0 deletions(-)
---
diff --git a/atspi/meson.build b/atspi/meson.build
new file mode 100644
index 0000000..b831044
--- /dev/null
+++ b/atspi/meson.build
@@ -0,0 +1,78 @@
+atspi_sources = [
+  'atspi-accessible.c',
+  'atspi-action.c',
+  'atspi-application.c',
+  'atspi-collection.c',
+  'atspi-component.c',
+  'atspi-device-listener.c',
+  'atspi-document.c',
+  'atspi-editabletext.c',
+  'atspi-event-listener.c',
+  'atspi-gmain.c',
+  'atspi-hyperlink.c',
+  'atspi-hypertext.c',
+  'atspi-image.c',
+  'atspi-matchrule.c',
+  'atspi-misc.c',
+  'atspi-object.c',
+  'atspi-registry.c',
+  'atspi-relation.c',
+  'atspi-selection.c',
+  'atspi-stateset.c',
+  'atspi-table.c',
+  'atspi-table-cell.c',
+  'atspi-text.c',
+  'atspi-value.c',
+]
+
+atspi_headers = [
+  'atspi.h',
+  'atspi-accessible.h',
+  'atspi-action.h',
+  'atspi-application.h',
+  'atspi-collection.h',
+  'atspi-component.h',
+  'atspi-constants.h',
+  'atspi-device-listener.h',
+  'atspi-document.h',
+  'atspi-editabletext.h',
+  'atspi-enum-types.h',
+  'atspi-event-listener.h',
+  'atspi-gmain.h',
+  'atspi-hyperlink.h',
+  'atspi-hypertext.h',
+  'atspi-image.h',
+  'atspi-matchrule.h',
+  'atspi-misc.h',
+  'atspi-object.h',
+  'atspi-private.h',
+  'atspi-registry.h',
+  'atspi-relation.h',
+  'atspi-selection.h',
+  'atspi-stateset.h',
+  'atspi-table.h',
+  'atspi-table-cell.h',
+  'atspi-text.h',
+  'atspi-types.h',
+  'atspi-value.h',
+]
+
+atspi_includedir = join_paths(get_option('includedir'), 'at-spi-2.0', 'atspi')
+
+atspi_enums = gnome.mkenums('atspi-enum-types',
+                            sources: [ 'atspi-constants.h', 'atspi-types.h' ],
+                            c_template: 'atspi-enum-types.c.template',
+                            h_template: 'atspi-enum-types.h.template',
+                            install_dir: atspi_includedir,
+                            install_header: true)
+atspi_enum_h = atspi_enums[1]
+
+atspi = shared_library('atspi', atspi_sources + atspi_enums,
+                       include_directories: [ root_inc, registryd_inc ],
+                       dependencies: [ libdbus_dep, gobject_dep, dbind_dep ],
+                       install: true)
+
+atspi_dep = declare_dependency(link_with: atspi,
+                               sources: atspi_enum_h,
+                               include_directories: root_inc,
+                               dependencies: [ libdbus_dep, gobject_dep, dbind_dep ])
diff --git a/bus/meson.build b/bus/meson.build
new file mode 100644
index 0000000..8e4673f
--- /dev/null
+++ b/bus/meson.build
@@ -0,0 +1,55 @@
+libexec_conf = configuration_data()
+libexec_conf.set('libexecdir', atspi_libexecdir)
+
+accessibility_conf = configuration_data()
+accessibility_conf.set('DATADIR', atspi_datadir)
+
+busconfig_dir = join_paths(atspi_datadir, 'defaults/at-spi2')
+session_dir = join_paths(atspi_sysconfdir, 'xdg/autostart')
+
+configure_file(input: 'accessibility.conf.in',
+               output: 'accessibility.conf',
+               configuration: accessibility_conf,
+               install: true,
+               install_dir: busconfig_dir)
+
+configure_file(input: 'at-spi-dbus-bus.desktop.in',
+               output: 'at-spi-dbus-bus.desktop',
+               configuration: libexec_conf,
+               install: true,
+               install_dir: session_dir)
+
+configure_file(input: 'org.a11y.Bus.service.in',
+               output: 'org.a11y.Bus.service',
+               configuration: libexec_conf,
+               install: true,
+               install_dir: dbus_services_dir)
+
+configure_file(input: 'at-spi-dbus-bus.service.in',
+               output: 'at-spi-dbus-bus.service',
+               configuration: libexec_conf,
+               install: true,
+               install_dir: systemd_user_dir)
+
+if get_option('dbus_daemon') != 'default'
+  dbus_daemon = get_option('dbus_daemon')
+else
+  dbus_daemon = find_program('dbus-daemon',
+                             '/sbin/dbus-daemon',
+                             '/usr/sbin/dbus-daemon',
+                             '/libexec/dbus-daemon',
+                             '/usr/libexec/dbus-daemon',
+                             '/usr/pkg/bin/dbus-daemon',
+                             required: true).path()
+endif
+
+executable('at-spi-bus-launcher', 'at-spi-bus-launcher.c',
+           include_directories: [ root_inc, include_directories('.') ],
+           dependencies: [ gio_dep ],
+           c_args: [
+             '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir),
+             '-DDATADIR="@0@"'.format(atspi_datadir),
+             '-DDBUS_DAEMON="@0@"'.format(dbus_daemon),
+           ],
+           install: true,
+           install_dir: atspi_libexecdir)
diff --git a/dbind/meson.build b/dbind/meson.build
new file mode 100644
index 0000000..e122645
--- /dev/null
+++ b/dbind/meson.build
@@ -0,0 +1,16 @@
+dbind_sources = [
+  'dbind.c',
+  'dbind-any.c',
+]
+
+dbind = static_library('dbind', dbind_sources,
+                       include_directories: root_inc,
+                       dependencies: [ libdbus_dep, glib_dep ],
+                       c_args: [ '-DG_LOG_DOMAIN="dbind"' ])
+
+dbind_dep = declare_dependency(link_with: dbind)
+
+test('dbind-test',
+     executable('dbind-test', [ 'dbtest.c', '../atspi/atspi-gmain.c' ],
+                include_directories: root_inc,
+                dependencies: [ libdbus_dep, glib_dep, dbind_dep ]))
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..b3bb2ec
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,111 @@
+project('at-spi2-core', 'c',
+        version: '2.25.1',
+        license: 'LGPLv2.1+',
+        default_options: [
+          'buildtype=debugoptimized',
+          'warning_level=1',
+          'c_std=c99',
+        ],
+        meson_version: '>= 0.40.1')
+
+add_project_arguments([ '-D_POSIX_C_SOURCE', '-D_DEFAULT_SOURCE' ], language: 'c')
+
+cc = meson.get_compiler('c')
+host_system = host_machine.system()
+
+soversion = '0.0.1'
+
+at_spi_conf = configuration_data()
+at_spi_conf.set('GETTEXT_PACKAGE', meson.project_name())
+
+root_inc = include_directories('.')
+registryd_inc = include_directories('registryd')
+
+atspi_datadir = join_paths(get_option('prefix'), get_option('datadir'))
+atspi_libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
+atspi_sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
+
+if get_option('dbus_services_dir') != 'default'
+  dbus_services_dir = get_option('dbus_services_dir')
+else
+  dbus_services_dir = join_paths(get_option('datadir'), 'dbus-1/services')
+endif
+
+if get_option('systemd_user_dir') != 'default'
+  systemd_user_dir = get_option('systemd_user_dir')
+else
+  systemd_user_dir = join_paths(get_option('prefix'), 'lib/systemd/user')
+endif
+
+# Dependencies
+libdbus_req_version = '>= 1.5'
+glib_req_version = '>= 2.32.0'
+gobject_req_version = '>= 2.0.0'
+gio_req_version = '>= 2.28.0'
+
+libdbus_dep = dependency('dbus-1', version: libdbus_req_version)
+glib_dep = dependency('glib-2.0', version: glib_req_version)
+gobject_dep = dependency('gobject-2.0', version: gobject_req_version)
+gio_dep = dependency('gio-2.0', version: gio_req_version)
+dl_dep = cc.find_library('dl', required: false)
+x11_dep = dependency('x11', required: false)
+
+x11_deps = []
+if x11_dep.found()
+  x11_deps += x11_dep
+
+  xtest_dep = dependency('xtst')
+  x11_deps += xtest_dep
+
+  xkb_dep = dependency('xkbcommon-x11', required: false)
+  if xkb_dep.found()
+    x11_deps += xkb_dep
+    at_spi_conf.set('HAVE_XKB', 1)
+  endif
+
+  xinput_dep = dependency('xi')
+  x11_deps += xinput_dep
+endif
+
+# Alignments
+at_spi_conf.set('ALIGNOF_CHAR', cc.alignment('char'))
+at_spi_conf.set('ALIGNOF_DOUBLE', cc.alignment('double'))
+
+dbus_alignments = [
+  'dbus_bool_t',
+  'dbus_int16_t',
+  'dbus_int32_t',
+  'dbus_int64_t',
+]
+
+foreach a: dbus_alignments
+  at_spi_conf.set('ALIGNOF_' + a.underscorify().to_upper(),
+                  cc.alignment(a, prefix: '#include <dbus/dbus.h>', dependencies: libdbus_dep))
+endforeach
+
+at_spi_conf.set('ALIGNOF_DBIND_POINTER', cc.alignment('dbind_pointer', prefix: 'typedef void 
*dbind_pointer;'))
+at_spi_conf.set('ALIGNOF_DBIND_STRUCT', cc.alignment('dbind_struct', prefix: 'typedef struct { char s1; } 
dbind_struct;'))
+
+configure_file(output: 'config.h', configuration: at_spi_conf)
+
+# Compat variables for pkgconfig
+pkgconf = configuration_data()
+pkgconf.set('prefix', get_option('prefix'))
+pkgconf.set('exec_prefix', get_option('prefix'))
+pkgconf.set('libdir', get_option('libdir'))
+pkgconf.set('includedir', get_option('includedir'))
+pkgconf.set('VERSION', meson.project_version())
+
+configure_file(input: 'atspi-2.pc.in',
+               output: 'atspi-2.pc',
+               configuration: pkgconf,
+               install: true,
+               install_dir: join_paths(get_option('libdir'), 'pkgconfig'))
+
+gnome = import('gnome')
+
+subdir('dbind')
+subdir('atspi')
+subdir('bus')
+subdir('registryd')
+subdir('test')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..740bd28
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,12 @@
+option('dbus_services_dir',
+       description: 'Location of the DBus services',
+       type: 'string',
+       value: 'default')
+option('dbus_daemon',
+       description: 'The path of the DBus daemon',
+       type: 'string',
+       value: 'default')
+option('systemd_user_dir',
+       description: 'Location of the systemd user services',
+       type: 'string',
+       value: 'default')
diff --git a/registryd/meson.build b/registryd/meson.build
new file mode 100644
index 0000000..5de6902
--- /dev/null
+++ b/registryd/meson.build
@@ -0,0 +1,42 @@
+atspi_introspection_path = ''
+
+registryd_sources = [
+  'de-marshaller.c',
+  'registry-main.c',
+  'registry.c',
+  'introspection.c',
+  'deviceeventcontroller.c',
+  'reentrant-list.c',
+]
+
+registryd_deps = [
+  gio_dep,
+  libdbus_dep,
+  atspi_dep,
+  dl_dep,
+]
+
+if x11_dep.found()
+  registryd_sources += [
+    'deviceeventcontroller-x11.c',
+    'display.c',
+    'event-source.c',
+    'ucs2keysym.c',
+  ]
+
+  registryd_deps += x11_deps 
+endif
+
+executable('at-spi2-registryd', registryd_sources,
+           dependencies: registryd_deps,
+           install: true,
+           install_dir: atspi_libexecdir)
+
+libexec_conf = configuration_data()
+libexec_conf.set('libexecdir', atspi_libexecdir)
+
+configure_file(input: 'org.a11y.atspi.Registry.service.in',
+               output: 'org.a11y.atspi.Registry.service',
+               configuration: libexec_conf,
+               install: true,
+               install_dir: join_paths(atspi_datadir, 'dbus-1/accessibility-services'))
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..1fb35a8
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,4 @@
+test('memory',
+     executable('memory', 'memory.c',
+                include_directories: root_inc,
+                dependencies: [ atspi_dep ]))


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