diff --git a/clients/meson.build b/clients/meson.build
new file mode 100644
index 0000000..eb6660c
--- /dev/null
+++ b/clients/meson.build
@@ -0,0 +1,67 @@
+executable('weston-simple-shm',
+'simple-shm.c',
+xdg_shell_c, xdg_shell_client_h,
+fullscreen_shell_c, fullscreen_shell_client_h,
+ivi_application_c, ivi_application_client_h,
+include_directories : weston_inc,
+link_with : shared_lib,
+dependencies : [wlclient_dep])
+
+executable('weston-simple-damage', 'simple-damage.c',
+scaler_c, scaler_client_h,
+xdg_shell_c, xdg_shell_client_h,
+fullscreen_shell_c, fullscreen_shell_client_h,
+include_directories : weston_inc,
+link_with : shared_lib,
+dependencies : [wlclient_dep],
+)
+
+executable('weston-simple-touch', 'simple-touch.c',
+include_directories : weston_inc,
+link_with : shared_lib,
+dependencies : [wlclient_dep],
+)
+
+executable('weston-presentation-shm', 'presentation-shm.c',
+presentation_timing_c, presentation_timing_client_h,
+include_directories : weston_inc,
+link_with : shared_lib,
+link_args : '-lm',
+dependencies : [wlclient_dep],
+)
+
+executable('weston-multi-resource', 'multi-resource.c',
+include_directories : weston_inc,
+link_with : shared_lib,
+link_args : '-lm',
+dependencies : [wlclient_dep],
+)
+
+executable('weston-simple-egl', 'simple-egl.c',
+xdg_shell_c, xdg_shell_client_h,
+ivi_application_c, ivi_application_client_h,
+include_directories : weston_inc,
+link_with : shared_lib,
+link_args : '-lm',
+dependencies : [wlcursor_dep, wlclient_dep, wlegl_dep, egl_dep, gles_dep],
+)
+
+toytoolkit = static_library('toytoolkit',
+'window.c',
+text_cursor_position_c, text_cursor_position_client_h,
+scaler_c, scaler_client_h,
+workspaces_c, workspaces_client_h,
+presentation_timing_c, presentation_timing_client_h,
+xdg_shell_c, xdg_shell_client_h,
+ivi_application_c, ivi_application_client_h,
+include_directories : weston_inc,
+dependencies : [cairo_dep],
+)
+
+executable('weston-flower', 'flower.c',
+link_with : [toytoolkit, sharedcairo_lib],
+include_directories : weston_inc,
+link_args : '-lm',
+dependencies : [cairo_dep, wlclient_dep, wlcursor_dep,  xkb_dep]
+)
+
diff --git a/clients/window.c b/clients/window.c
index c5082ba..5d23802 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -5189,10 +5189,12 @@ input_destroy(struct input *input)
 		data_offer_destroy(input->selection_offer);
 
 	if (input->data_device) {
+#if 0 /* HORRIBLE HACK, some symbol exporting failure, so disabling for now */
 		if(input->display->data_device_manager_version >= 2)
 			wl_data_device_release(input->data_device);
 		else
 			wl_data_device_destroy(input->data_device);
+#endif
 	}
 	if (input->display->seat_version >= 3) {
 		if (input->pointer)
diff --git a/config.h.meson b/config.h.meson
new file mode 100644
index 0000000..9a18986
--- /dev/null
+++ b/config.h.meson
@@ -0,0 +1,207 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Build the Wayland clients */
+#mesondefine BUILD_CLIENTS
+
+/* Build the DRM compositor */
+#mesondefine BUILD_DRM_COMPOSITOR
+
+/* Build the fbdev compositor */
+#mesondefine BUILD_FBDEV_COMPOSITOR
+
+/* Build the headless compositor */
+#mesondefine BUILD_HEADLESS_COMPOSITOR
+
+/* Build the RDP compositor */
+#mesondefine BUILD_RDP_COMPOSITOR
+
+/* Build the compositor for Raspberry Pi */
+#mesondefine BUILD_RPI_COMPOSITOR
+
+/* Build the vaapi recorder */
+#mesondefine BUILD_VAAPI_RECORDER
+
+/* Build the Wayland (nested) compositor */
+#mesondefine BUILD_WAYLAND_COMPOSITOR
+
+/* Build the wcap tools */
+#mesondefine BUILD_WCAP_TOOLS
+
+/* Build the X11 compositor */
+#mesondefine BUILD_X11_COMPOSITOR
+
+/* Build the X server launcher */
+#mesondefine BUILD_XWAYLAND
+
+/* Build Weston with EGL support */
+#mesondefine ENABLE_EGL
+
+/* Build Weston with libxkbcommon support */
+#mesondefine ENABLE_XKBCOMMON
+
+/* have Raspberry Pi BCM headers */
+#mesondefine HAVE_BCM_HOST
+
+/* Have cairo-egl */
+#mesondefine HAVE_CAIRO_EGL
+
+/* Build with dbus support */
+#mesondefine HAVE_DBUS
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#mesondefine HAVE_DLFCN_H
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#mesondefine HAVE_EXECINFO_H
+
+/* Define to 1 if you have the <freerdp/version.h> header file. */
+#mesondefine HAVE_FREERDP_VERSION_H
+
+/* Define to 1 if you have the `initgroups' function. */
+#mesondefine HAVE_INITGROUPS
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#mesondefine HAVE_INTTYPES_H
+
+/* Have lcms support */
+#mesondefine HAVE_LCMS
+
+/* Define if libdrm is available */
+#mesondefine HAVE_LIBDRM
+
+/* Have libunwind support */
+#mesondefine HAVE_LIBUNWIND
+
+/* Define to 1 if you have the <memory.h> header file. */
+#mesondefine HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mkostemp' function. */
+#mesondefine HAVE_MKOSTEMP
+
+/* Define to 1 if you have the `posix_fallocate' function. */
+#mesondefine HAVE_POSIX_FALLOCATE
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#mesondefine HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#mesondefine HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchrnul' function. */
+#mesondefine HAVE_STRCHRNUL
+
+/* Define to 1 if you have the <strings.h> header file. */
+#mesondefine HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#mesondefine HAVE_STRING_H
+
+/* Have systemd-login */
+#mesondefine HAVE_SYSTEMD_LOGIN
+
+/* Have systemd-login >= 209 */
+#mesondefine HAVE_SYSTEMD_LOGIN_209
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#mesondefine HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#mesondefine HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#mesondefine HAVE_UNISTD_H
+
+/* Have webp */
+#mesondefine HAVE_WEBP
+
+/* Define to 1 if you have the `xcb_poll_for_queued_event' function. */
+#mesondefine HAVE_XCB_POLL_FOR_QUEUED_EVENT
+
+/* libxcb supports XKB protocol */
+#mesondefine HAVE_XCB_XKB
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#mesondefine LT_OBJDIR
+
+/* Name of package */
+#mesondefine PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#mesondefine PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "@PACKAGE_NAME@"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "@PACKAGE_STRING@"
+
+/* Define to the one symbol short name of this package. */
+#mesondefine PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#mesondefine PACKAGE_URL
+
+/* Define to the version of this package. */
+#mesondefine PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#mesondefine STDC_HEADERS
+
+/* Use the GLESv2 GL cairo backend */
+#mesondefine USE_CAIRO_GLESV2
+
+/* Use resize memory pool as a performance optimization */
+#mesondefine USE_RESIZE_POOL
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Version number of package */
+#define VERSION "@VERSION@"
+
+/* The default backend to load, if not wayland nor x11. */
+#define WESTON_NATIVE_BACKEND "@WESTON_NATIVE_BACKEND@"
+
+/* The default desktop shell client to load. */
+#mesondefine WESTON_SHELL_CLIENT
+
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#mesondefine _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#mesondefine _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#mesondefine _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#mesondefine _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#mesondefine _POSIX_SOURCE
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..03b11f3
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,23 @@
+install_data(
+'wayland.svg',
+'wayland.png',
+'pattern.png',
+'terminal.png',
+'border.png',
+'icon_window.png',
+'sign_close.png',
+'sign_maximize.png',
+'sign_minimize.png',
+'background.png',
+'tiling.png',
+'fullscreen.png',
+'panel.png',
+'random.png',
+'sidebyside.png',
+'home.png',
+'icon_ivi_clickdot.png',
+'icon_ivi_flower.png',
+'icon_ivi_simple-egl.png',
+'icon_ivi_simple-shm.png',
+'icon_ivi_smoke.png',
+install_dir : 'share/weston')
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..f9d6bb1
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,78 @@
+project('weston', 'c')
+
+version_major = 1
+version_minor = 7
+version_micro = 90
+version_str = '@0@.@1@.@2@'.format(version_major, version_minor, version_micro)
+
+conf_data = configuration_data()
+conf_data.set('WESTON_VERSION_MAJOR', version_major)
+conf_data.set('WESTON_VERSION_MINOR', version_minor)
+conf_data.set('WESTON_VERSION_MICRO', version_micro)
+conf_data.set('WESTON_VERSION', version_str)
+conf_data.set('VERSION', version_str)
+conf_data.set('PACKAGE_NAME', 'weston')
+conf_data.set('PACKAGE_URL', '"http://weston"')
+conf_data.set('PACKAGE_STRING', 'weston')
+conf_data.set('PACKAGE_BUGREPORT', '"foo@bar.com"')
+conf_data.set('MODULEDIR', '"weston"')
+conf_data.set('WESTON_NATIVE_BACKEND', 'drm')
+conf_data.set('prefix', get_option('prefix'))
+conf_data.set('includedir', get_option('prefix') + '/' + get_option('includedir'))
+
+wlserver_dep = dependency('wayland-server', version : '>=1.7.0')
+wlclient_dep = dependency('wayland-client', version : '>=1.7.0')
+wlegl_dep = dependency('wayland-egl', version : '>=1.7.0')
+wlcursor_dep = dependency('wayland-cursor', version : '>=1.7.0')
+egl_dep = dependency('egl', version : '>=7.10')
+gles_dep = dependency('glesv2')
+xkb_dep = dependency('xkbcommon', version : '>=0.3.0')
+xcb_dep = dependency('xcb')
+xcb_xfixes_dep = dependency('xcb-xfixes')
+xcb_comp_dep = dependency('xcb-composite')
+xcursor_dep = dependency('xcursor')
+cairo_dep = dependency('cairo')
+cairoxcb_dep = dependency('cairo-xcb')
+drm_dep = dependency('libdrm', version : '>=2.4.30')
+udev_dep = dependency('libudev', version : '>=136')
+gbm_dep = dependency('gbm')
+mtdev_dep = dependency('mtdev', version : '>=1.1.0')
+input_dep = dependency('libinput', version : '0.8.0')
+pixman_dep = dependency('pixman-1')
+png_dep = dependency('libpng')
+webp_dep = dependency('libwebp', required : false)
+libva_dep = dependency('libva', version : '>=0.34.0', required : false)
+libvadrm_dep = dependency('libva-drm', version : '>=0.34.0', required : false)
+systemdlogin_dep = dependency('libsystemd-login', version : '>=198', required : false)
+colord_dep = dependency('colord', version : '>=0.1.27', required : false)
+dbus_dep = dependency('dbus-1', version : '>=1.6', required : false)
+unwind_dep = dependency('libunwind', required : false)
+lcms_dep = dependency('lcms2', required : false)
+pam_dep = find_library('pam', required : false)
+jpg_dep = find_library('jpeg', required : false)
+
+add_global_arguments('-D_GNU_SOURCE', language : 'c')
+
+cc = meson.get_compiler('c')
+conf_data.set('HAVE_LIBDRM', drm_dep.found())
+conf_data.set('HAVE_DBUS', dbus_dep.found())
+conf_data.set('HAVE_SYSTEMD_LOGIN', systemdlogin_dep.found())
+conf_data.set('HAVE_LIBUNWIND', unwind_dep.found())
+conf_data.set10('HAVE_POSIX_FALLOCATE', cc.has_function('posix_fallocate', prefix : '#include<fcntl.h>'))
+conf_data.set10('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
+conf_data.set10('HAVE_INTTYPES_H', cc.has_header('inttypes.h'))
+
+wayland_scanner = find_program('wayland-scanner')
+
+weston_inc = include_directories('.', 'src', 'protocol', 'shared')
+
+configure_file(input : 'config.h.meson',
+output : 'config.h',
+configuration : conf_data)
+
+subdir('protocol')
+subdir('shared')
+subdir('src')
+subdir('clients')
+subdir('data')
+subdir('tests')
diff --git a/protocol/meson.build b/protocol/meson.build
new file mode 100644
index 0000000..a6a8474
--- /dev/null
+++ b/protocol/meson.build
@@ -0,0 +1,42 @@
+files = [
+['desktop-shell', 'desktop_shell'],
+['fullscreen-shell', 'fullscreen_shell'],
+['input-method', 'input_method'],
+['ivi-application', 'ivi_application'],
+['ivi-hmi-controller', 'ivi_hmi_controller'],
+['presentation_timing', 'presentation_timing'],
+['scaler', 'scaler'],
+['screenshooter', 'screenshooter'],
+['text', 'text'],
+['text-cursor-position', 'text_cursor_position'],
+['wayland-test', 'wayland_test'],
+['workspaces', 'workspaces'],
+['xdg-shell', 'xdg_shell'],
+]
+
+foreach arr : files
+  f = arr.get(0)
+  namebase = arr.get(1)
+  xml = f + '.xml'
+  cfile = f + '-protocol.c'
+  shfile = f + '-server-protocol.h'
+  chfile = f + '-client-protocol.h'
+  ctarget = namebase + '_c'
+  shtarget = namebase + '_server_h'
+  chtarget = namebase + '_client_h'
+  ct = custom_target(ctarget,
+    input : xml,
+    output : cfile,
+    command : [wayland_scanner, 'code', '@INPUT@', '@OUTPUT@'])
+  set_variable(ctarget, ct)
+  sh = custom_target(shtarget,
+    input : xml,
+    output : shfile,
+    command : [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'])
+  set_variable(shtarget, sh)
+  ch = custom_target(chtarget,
+    input : xml,
+    output : chfile,
+    command : [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])
+  set_variable(chtarget, sh)
+endforeach
diff --git a/shared/meson.build b/shared/meson.build
new file mode 100644
index 0000000..dff89fa
--- /dev/null
+++ b/shared/meson.build
@@ -0,0 +1,18 @@
+shared_lib = shared_library('shared',
+'config-parser.c',
+'option-parser.c',
+'os-compatibility.c',
+c_args : ['-DLIBEXECDIR="@0@/libexec"'.format(get_option('prefix'))],
+include_directories : weston_inc)
+
+sharedcairo_lib = shared_library('shared-cairo',
+'config-parser.c',
+'option-parser.c',
+'os-compatibility.c',
+'image-loader.c',
+'cairo-util.c',
+'frame.c',
+c_args : ['-DLIBEXECDIR="@0@/libexec"'.format(get_option('prefix')),
+          '-DDATADIR="@0@/share/foobar"'.format(get_option('prefix'))],
+dependencies : [cairo_dep, jpg_dep],
+include_directories : weston_inc)
diff --git a/src/git-version.h.in b/src/git-version.h.in
new file mode 100644
index 0000000..d91f19c
--- /dev/null
+++ b/src/git-version.h.in
@@ -0,0 +1 @@
+#define BUILD_ID "@VCS_TAG@"
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..2e52523
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,103 @@
+version_header = vcs_tag(input : 'git-version.h.in',
+output : 'git-version.h',
+fallback : version_str,
+install_dir : 'include/weston')
+
+configure_file(input : 'version.h.in',
+output : 'version.h',
+configuration : conf_data)
+
+
+protocol_src = [screenshooter_c, screenshooter_server_h,
+text_cursor_position_c,
+text_cursor_position_server_h,
+text_c,
+text_server_h,
+input_method_c,
+input_method_server_h,
+workspaces_c,
+workspaces_server_h,
+presentation_timing_c,
+presentation_timing_server_h,
+scaler_c,
+scaler_server_h,
+]
+
+weston_lib = shared_library('weston',
+'log.c',
+'compositor.c',
+'compositor.h',
+'input.c',
+'data-device.c',
+'screenshooter.c',
+'clipboard.c',
+'zoom.c',
+'text-backend.c',
+'bindings.c',
+'animation.c',
+'noop-renderer.c',
+'pixman-renderer.c',
+'pixman-renderer.h',
+'timeline.c',
+'timeline.h',
+'timeline-object.h',
+'../shared/matrix.c',
+'weston-egl-ext.h',
+version_header,
+protocol_src,
+c_args : '-DMODULEDIR="foo"',
+include_directories : weston_inc,
+dependencies : [pixman_dep, wlserver_dep],
+)
+
+helper_src = ['launcher-util.c']
+helper_deps = [pixman_dep, wlserver_dep, drm_dep]
+if dbus_dep.found() and systemdlogin_dep.found()
+  helper_src = helper_src + ['dbus.c', 'logind-util.c']
+  helper_deps = helper_deps + [dbus_dep, systemdlogin_dep]
+endif
+
+sessionhelper_lib = shared_library('session-helper',
+helper_src,
+include_directories : weston_inc,
+dependencies : helper_deps)
+
+wlaunch = executable('weston-launch',
+'weston-launch.c',
+include_directories : weston_inc,
+dependencies : [drm_dep, pam_dep, systemdlogin_dep],
+c_args : '-DBINDIR="foobar"'
+)
+
+configure_file(input : 'weston.pc.in',
+output : 'weston.pc',
+configuration : conf_data,
+install_dir : get_option('libdir') + '/' + 'pkgconfig')
+
+install_headers('compositor.h', 'timeline-object.h',
+'../shared/matrix.h', '../shared/config-parser.h',
+'../shared/zalloc.h', subdir : 'weston')
+
+gl_renderer_lib = shared_library('gl-renderer',
+'gl-renderer.c',
+'vertex-clipping.c',
+c_args : '-DENABLE_EGL',
+include_directories : weston_inc,
+dependencies : [pixman_dep, egl_dep, wlserver_dep])
+
+inputbackend_lib = shared_library('input-backend',
+'libinput-seat.c',
+'libinput-device.c',
+include_directories : weston_inc,
+dependencies : [pixman_dep, wlserver_dep],
+)
+
+# skipped some here
+
+executable('spring-tool',
+'spring-tool.c',
+'animation.c',
+'../shared/matrix.c',
+include_directories : weston_inc,
+dependencies : [pixman_dep, wlserver_dep],
+)
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..f0dd063
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,74 @@
+sglobal_exe = executable('surface-global-test',
+'surface-global-test.c',
+include_directories : weston_inc,
+link_with : [weston_lib, shared_lib],
+link_args : '-ldl',
+dependencies : [pixman_dep, wlserver_dep]
+)
+test('surface-global', sglobal_exe)
+
+surface_exe = executable('surface-test',
+'surface-test.c',
+include_directories : weston_inc,
+link_with : [weston_lib, shared_lib],
+link_args : '-ldl',
+dependencies : [pixman_dep, wlserver_dep])
+
+weston_test_lib = static_library('weston-test',
+'weston-test.c',
+include_directories : weston_inc,
+dependencies : [pixman_dep, wlserver_dep],
+)
+
+testrunner_lib = static_library('test-runner',
+'weston-test-runner.c',
+include_directories : weston_inc)
+
+config_parser_exe = executable('config-parser',
+'config-parser-test.c',
+include_directories : weston_inc,
+link_with : [ shared_lib, testrunner_lib],
+link_args : '-ldl',
+dependencies : [pixman_dep, wlserver_dep]
+)
+test('config-parser', config_parser_exe)
+
+vertex_clip_exe = executable('vertex-clip',
+'vertex-clip-test.c', '../src/vertex-clipping.c',
+link_with : [testrunner_lib],
+include_directories : weston_inc,
+)
+test('vertex-clip', vertex_clip_exe)
+
+testclient_lib = static_library('test-client',
+'weston-test-client-helper.c',
+include_directories : weston_inc)
+
+#bad_buffer_exe = executable('bad-buffer',
+#'bad-buffer-test.c',
+#include_directories : weston_inc,
+#link_with : [testrunner_lib, testclient_lib, weston_test_lib, shared_lib],
+#dependencies : [wlclient_dep],
+#)
+#test('bad-buffer', bad_buffer_exe)
+
+#keyboard_weston_exe = executable('keyboard-weston',
+#'keyboard-test.c',
+#include_directories : weston_inc,
+#link_with : [testrunner_lib, testclient_lib, weston_test_lib, shared_lib],
+#dependencies : [wlclient_dep],
+#)
+#test('keyboard-weston', keyboard_weston_exe)
+
+# stuff skipped
+
+matrix_exe = executable('matrix-test',
+'matrix-test.c',
+'../shared/matrix.c',
+link_with : [shared_lib],
+link_args : '-lm',
+c_args : '-DUNIT_TEST',
+include_directories : weston_inc,
+dependencies : [wlserver_dep],
+)
+test('matrix', matrix_exe)
