[evince] build: Port to Meson build system



commit d69158ecf0e2a2f1562b06c265fc86f87fe7dd6f
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Tue Sep 4 23:29:58 2018 +0200

    build: Port to Meson build system
    
    Meson is a build system focused on speed and ease of use, which
    helps speed up software development. This patch adds Meson support
    alongside Autotools.

 backend/backend-symbol.map                     |   6 +
 backend/comics/meson.build                     |  37 ++
 backend/djvu/meson.build                       |  17 +
 backend/dvi/mdvi-lib/meson.build               |  37 ++
 backend/dvi/meson.build                        |  27 ++
 backend/meson.build                            |  63 +++
 backend/pdf/meson.build                        |  18 +
 backend/ps/meson.build                         |  11 +
 backend/tiff/meson.build                       |  16 +
 backend/xps/meson.build                        |  11 +
 browser-plugin/meson.build                     |  55 +++
 browser-plugin/plugin-symbol.map               |   9 +
 cut-n-paste/gimpcellrenderertoggle/meson.build |  12 +
 cut-n-paste/libgd/meson.build                  |  22 +
 cut-n-paste/meson.build                        |   9 +
 cut-n-paste/synctex/meson.build                |  16 +
 cut-n-paste/unarr/meson.build                  |  27 ++
 data/icons/meson.build                         |  95 +++++
 data/meson.build                               |  77 ++++
 generate-changelog.sh                          |  13 +
 help/LINGUAS                                   |  34 ++
 help/meson.build                               | 109 +++++
 help/reference/libdocument/meson.build         |  38 ++
 help/reference/libview/meson.build             |  46 +++
 help/reference/shell/meson.build               |  34 ++
 lib-symbol.map                                 |   6 +
 libdocument/meson.build                        | 197 +++++++++
 libmisc/meson.build                            |  19 +
 libview/meson.build                            | 139 +++++++
 meson.build                                    | 544 +++++++++++++++++++++++++
 meson_options.txt                              |  29 ++
 meson_post_install.py                          |  15 +
 po/meson.build                                 |   1 +
 previewer/meson.build                          |  36 ++
 properties/meson.build                         |  29 ++
 shell/meson.build                              | 176 ++++++++
 thumbnailer/meson.build                        |  20 +
 37 files changed, 2050 insertions(+)
---
diff --git a/backend/backend-symbol.map b/backend/backend-symbol.map
new file mode 100644
index 00000000..011d5a5e
--- /dev/null
+++ b/backend/backend-symbol.map
@@ -0,0 +1,6 @@
+{
+    global:
+        register_evince_backend;
+    local:
+        *;
+};
diff --git a/backend/comics/meson.build b/backend/comics/meson.build
new file mode 100644
index 00000000..66b73a9a
--- /dev/null
+++ b/backend/comics/meson.build
@@ -0,0 +1,37 @@
+sources = files(
+  'comics-document.c',
+  'ev-archive.c',
+)
+
+incs = backends_incs + [cut_n_paste_inc]
+
+deps = backends_deps + [
+  libarchive_dep,
+  libunarr_dep,
+]
+
+shared_module(
+  backend_name,
+  sources: sources,
+  include_directories: incs,
+  dependencies: deps,
+  c_args: backends_cflags,
+  link_args: backends_ldflags,
+  link_depends: backends_symbol_map,
+  install: true,
+  install_dir: ev_backendsdir,
+)
+
+test_name = 'test-ev-archive'
+
+sources = files(
+  'ev-archive.c',
+  'test-ev-archive.c',
+)
+
+executable(
+  test_name,
+  sources,
+  include_directories: incs,
+  dependencies: deps,
+)
diff --git a/backend/djvu/meson.build b/backend/djvu/meson.build
new file mode 100644
index 00000000..604450c0
--- /dev/null
+++ b/backend/djvu/meson.build
@@ -0,0 +1,17 @@
+sources = files(
+  'djvu-document.c',
+  'djvu-links.c',
+  'djvu-text-page.c',
+)
+
+shared_module(
+  backend_name,
+  sources: sources,
+  include_directories: backends_incs,
+  dependencies: backends_deps + [ddjvuapi_dep],
+  c_args: backends_cflags + ['-DGNOMEICONDIR="@0@"'.format(join_paths(ev_datadir, 'pixmaps'))],
+  link_args: backends_ldflags,
+  link_depends: backends_symbol_map,
+  install: true,
+  install_dir: ev_backendsdir,
+)
diff --git a/backend/dvi/mdvi-lib/meson.build b/backend/dvi/mdvi-lib/meson.build
new file mode 100644
index 00000000..2f4fb57a
--- /dev/null
+++ b/backend/dvi/mdvi-lib/meson.build
@@ -0,0 +1,37 @@
+sources = files(
+  'afmparse.c',
+  'bitmap.c',
+  'color.c',
+  'common.c',
+  'dviread.c',
+  'files.c',
+  'font.c',
+  'fontmap.c',
+  'fontsrch.c',
+  'gf.c',
+  'hash.c',
+  'list.c',
+  'pagesel.c',
+  'paper.c',
+  'pk.c',
+  'setup.c',
+  'special.c',
+  'sp-epsf.c',
+  't1.c',
+  'tfm.c',
+  'tfmfile.c',
+  'tt.c',
+  'util.c',
+  'vf.c',
+)
+
+libmdvi = static_library(
+  'mdvi',
+  sources: sources,
+  include_directories: top_inc,
+)
+
+libmdvi_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  link_with: libmdvi,
+)
diff --git a/backend/dvi/meson.build b/backend/dvi/meson.build
new file mode 100644
index 00000000..9f659369
--- /dev/null
+++ b/backend/dvi/meson.build
@@ -0,0 +1,27 @@
+subdir('mdvi-lib')
+
+sources = files(
+  'cairo-device.c',
+  'dvi-document.c',
+  'fonts.c',
+  'texmfcnf.c',
+)
+
+deps = backends_deps + [
+  libmdvi_dep,
+  libspectre_dep,
+  kpathsea_dep,
+  t1_dep,
+]
+
+shared_module(
+  backend_name,
+  sources: sources,
+  include_directories: backends_incs,
+  dependencies: deps,
+  c_args: backends_cflags,
+  link_args: backends_ldflags,
+  link_depends: backends_symbol_map,
+  install: true,
+  install_dir: ev_backendsdir,
+)
diff --git a/backend/meson.build b/backend/meson.build
new file mode 100644
index 00000000..716d9468
--- /dev/null
+++ b/backend/meson.build
@@ -0,0 +1,63 @@
+backends_incs = [top_inc]
+
+backends_deps = [libevdocument_dep]
+
+backends_cflags = [
+  '-DGNOMELOCALEDIR="@0@"'.format(ev_localedir),
+  '-DEVINCE_COMPILATION',
+  '-DGDK_MULTIHEAD_SAFE',
+  '-DGTK_MULTIHEAD_SAFE',
+]
+
+backends_symbol_map = join_paths(meson.current_source_dir(), 'backend-symbol.map')
+backends_ldflags = cpp.get_supported_link_arguments('-Wl,--version-script,' + backends_symbol_map)
+
+foreach backend, backend_mime_types: backends
+  backend_name = backend + 'document'
+
+  backend_mime_types_conf = configuration_data()
+  backend_mime_types_conf.set(backend.to_upper() + '_MIME_TYPES', ';'.join(backend_mime_types))
+
+  appdata_mime_types = ''
+  foreach type: backend_mime_types
+    appdata_mime_types += '\t<mimetype>@0@</mimetype>\n'.format(type)
+  endforeach
+
+  backend_mime_types_conf.set('APPDATA_@0@_MIME_TYPES'.format(backend.to_upper()), appdata_mime_types)
+
+  backend_desc = backend_name + '.evince-backend'
+
+  backend_desc_in = configure_file(
+    input: '@0@/@1  in in'.format(backend, backend_desc),
+    output: backend_desc + '.in',
+    configuration: backend_mime_types_conf,
+  )
+
+  custom_target(
+    backend_desc,
+    input: backend_desc_in,
+    output: backend_desc,
+    command: intltool_desktop_cmd,
+    install: true,
+    install_dir: ev_backendsdir,
+  )
+
+  appstream = 'evince-@0  metainfo xml'.format(backend_name)
+
+  appstream_in = configure_file(
+    input: '@0@/@1  in in'.format(backend, appstream),
+    output: appstream + '.in',
+    configuration: backend_mime_types_conf,
+  )
+
+  custom_target(
+    appstream,
+    input: appstream_in,
+    output: appstream,
+    command: intltool_xml_cmd,
+    install: true,
+    install_dir: ev_appstreamdir,
+  )
+
+  subdir(backend)
+endforeach
diff --git a/backend/pdf/meson.build b/backend/pdf/meson.build
new file mode 100644
index 00000000..b1f3be45
--- /dev/null
+++ b/backend/pdf/meson.build
@@ -0,0 +1,18 @@
+deps = backends_deps + [
+  cairo_pdf_dep,
+  cairo_ps_dep,
+  libxml_dep,
+  poppler_glib_dep,
+]
+
+shared_module(
+  backend_name,
+  sources: 'ev-poppler.cc',
+  include_directories: backends_incs,
+  dependencies: deps,
+  cpp_args: backends_cflags,
+  link_args: backends_ldflags,
+  link_depends: backends_symbol_map,
+  install: true,
+  install_dir: ev_backendsdir,
+)
diff --git a/backend/ps/meson.build b/backend/ps/meson.build
new file mode 100644
index 00000000..3569bd18
--- /dev/null
+++ b/backend/ps/meson.build
@@ -0,0 +1,11 @@
+shared_module(
+  backend_name,
+  sources: 'ev-spectre.c',
+  include_directories: backends_incs,
+  dependencies: backends_deps + [libspectre_dep],
+  c_args: backends_cflags,
+  link_args: backends_ldflags,
+  link_depends: backends_symbol_map,
+  install: true,
+  install_dir: ev_backendsdir,
+)
diff --git a/backend/tiff/meson.build b/backend/tiff/meson.build
new file mode 100644
index 00000000..b33cc1de
--- /dev/null
+++ b/backend/tiff/meson.build
@@ -0,0 +1,16 @@
+sources = files(
+  'tiff-document.c',
+  'tiff2ps.c',
+)
+
+shared_module(
+  backend_name,
+  sources: sources,
+  include_directories: backends_incs,
+  dependencies: backends_deps + [libtiff_dep],
+  c_args: backends_cflags,
+  link_args: backends_ldflags,
+  link_depends: backends_symbol_map,
+  install: true,
+  install_dir: ev_backendsdir,
+)
diff --git a/backend/xps/meson.build b/backend/xps/meson.build
new file mode 100644
index 00000000..6306599f
--- /dev/null
+++ b/backend/xps/meson.build
@@ -0,0 +1,11 @@
+shared_module(
+  backend_name,
+  sources: 'xps-document.c',
+  include_directories: backends_incs,
+  dependencies: backends_deps + [libgxps_dep],
+  c_args: backends_cflags,
+  link_args: backends_ldflags,
+  link_depends: backends_symbol_map,
+  install: true,
+  install_dir: ev_backendsdir,
+)
diff --git a/browser-plugin/meson.build b/browser-plugin/meson.build
new file mode 100644
index 00000000..af1dc699
--- /dev/null
+++ b/browser-plugin/meson.build
@@ -0,0 +1,55 @@
+sources = files(
+  'EvBrowserPlugin.cpp',
+  'EvBrowserPluginMain.cpp',
+  'EvBrowserPluginToolbar.cpp',
+)
+
+resource_data = files(
+  '../data/thumbnail-frame.png',
+  'evince-browser.css',
+)
+
+resource = 'EvBrowserPlugin'
+
+sources += gnome.compile_resources(
+  resource + 'Resources',
+  resource + '.gresource.xml',
+  source_dir: data_dir,
+  dependencies: resource_data,
+  export: true,
+)
+
+incs = [
+  top_inc,
+  include_directories('npapi'),
+]
+
+cflags = [
+  '-DGNOMELOCALEDIR="@0@"'.format(ev_localedir),
+  '-DEVINCE_COMPILATION',
+  '-DMOZ_X11',
+  '-DXP_UNIX',
+]
+
+cppflags = cflags + cc.get_supported_arguments([
+  '-std=c++11',
+  '-fno-exceptions',
+  '-fno-strict-aliasing',
+  '-fno-rtti',
+])
+
+symbol_map = join_paths(meson.current_source_dir(), 'plugin-symbol.map')
+ldflag = cpp.get_supported_link_arguments([
+  '-Wl,--version-script,' + symbol_map,
+  '-Wl,-z,nodelete',
+])
+
+shared_module(
+  'evbrowserplugin',
+  sources: sources,
+  include_directories: incs,
+  dependencies: libevmisc_dep,
+  cpp_args: cppflags,
+  install: true,
+  install_dir: browser_plugin_dir,
+)
diff --git a/browser-plugin/plugin-symbol.map b/browser-plugin/plugin-symbol.map
new file mode 100644
index 00000000..59fe08f9
--- /dev/null
+++ b/browser-plugin/plugin-symbol.map
@@ -0,0 +1,9 @@
+{
+    global:
+        NP_GetMIMEDescription;
+        NP_GetValue;
+        NP_Initialize;
+        NP_Shutdown;
+    local:
+        *;
+};
diff --git a/cut-n-paste/gimpcellrenderertoggle/meson.build b/cut-n-paste/gimpcellrenderertoggle/meson.build
new file mode 100644
index 00000000..b08e8b66
--- /dev/null
+++ b/cut-n-paste/gimpcellrenderertoggle/meson.build
@@ -0,0 +1,12 @@
+libgimpcellrenderertoggle = static_library(
+  'gimpcellrenderertoggle',
+  sources: 'gimpcellrenderertoggle.c',
+  include_directories: top_inc,
+  dependencies: gtk_dep,
+)
+
+libgimpcellrenderertoggle_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  dependencies: gtk_dep,
+  link_with: libgimpcellrenderertoggle,
+)
diff --git a/cut-n-paste/libgd/meson.build b/cut-n-paste/libgd/meson.build
new file mode 100644
index 00000000..efa50f6a
--- /dev/null
+++ b/cut-n-paste/libgd/meson.build
@@ -0,0 +1,22 @@
+sources = files(
+  'gd-icon-utils.c',
+  'gd-two-lines-renderer.c',
+)
+
+deps = [
+  cairo_dep,
+  gtk_dep,
+]
+
+libgd = static_library(
+  'gd',
+  sources: sources,
+  include_directories: top_inc,
+  dependencies: deps,
+)
+
+libgd_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  dependencies: deps,
+  link_with: libgd,
+)
diff --git a/cut-n-paste/meson.build b/cut-n-paste/meson.build
new file mode 100644
index 00000000..2a12d40e
--- /dev/null
+++ b/cut-n-paste/meson.build
@@ -0,0 +1,9 @@
+cut_n_paste_inc = include_directories('.')
+
+subdir('gimpcellrenderertoggle')
+subdir('libgd')
+subdir('unarr')
+
+if not external_synctex
+  subdir('synctex')
+endif
diff --git a/cut-n-paste/synctex/meson.build b/cut-n-paste/synctex/meson.build
new file mode 100644
index 00000000..ed5a235d
--- /dev/null
+++ b/cut-n-paste/synctex/meson.build
@@ -0,0 +1,16 @@
+sources = files(
+  'synctex_parser.c',
+  'synctex_parser_utils.c',
+)
+
+libsynctex = static_library(
+  'synctex',
+  sources: sources,
+  include_directories: top_inc,
+  c_args: '-DSYNCTEX_VERBOSE=0',
+)
+
+synctex_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  link_with: libsynctex,
+)
diff --git a/cut-n-paste/unarr/meson.build b/cut-n-paste/unarr/meson.build
new file mode 100644
index 00000000..c0850cc9
--- /dev/null
+++ b/cut-n-paste/unarr/meson.build
@@ -0,0 +1,27 @@
+sources = files(
+  'common/conv.c',
+  'common/crc32.c',
+  'common/stream.c',
+  'common/unarr.c',
+  'lzmasdk/CpuArch.c',
+  'lzmasdk/Ppmd7.c',
+  'lzmasdk/Ppmd7Dec.c',
+  'rar/filter-rar.c',
+  'rar/huffman-rar.c',
+  'rar/parse-rar.c',
+  'rar/rar.c',
+  'rar/rarvm.c',
+  'rar/uncompress-rar.c',
+)
+
+libunarr = static_library(
+  'unarr',
+  sources: sources,
+  dependencies: zlib_dep,
+  c_args: '-DHAVE_ZLIB',
+)
+
+libunarr_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  link_with: libunarr,
+)
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 00000000..0fad69d1
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,95 @@
+# array: [size, actions, mimetypes, apps]
+icons = []
+
+actions = [
+  'object-rotate-left.png',
+  'object-rotate-right.png',
+  'view-page-continuous.png',
+  'view-page-facing.png',
+  'zoom-fit-height.png',
+  'zoom-fit-width.png',
+  'zoom.png',
+]
+
+icons += [['16x16', actions, ['x-office-presentation.png'], [ev_namespace + '.png']]]
+
+actions = [
+  'eye.png',
+  'object-rotate-left.png',
+  'object-rotate-right.png',
+  'view-page-continuous.png',
+  'view-page-facing.png',
+  'zoom-fit-page.png',
+  'zoom-fit-width.png',
+  'zoom.png',
+]
+
+icons += [['22x22', actions, ['x-office-presentation.png'], [ev_namespace + '.png']]]
+
+actions = [
+  'object-rotate-left.png',
+  'object-rotate-right.png',
+  'stock_filters-invert.png',
+  'view-page-continuous.png',
+  'view-page-facing.png',
+  'zoom-fit-height.png',
+  'zoom-fit-width.png',
+  'zoom.png',
+]
+
+icons += [['24x24', actions, ['x-office-presentation.png'], [ev_namespace + '.png']]]
+
+actions = [
+  'object-rotate-left.png',
+  'object-rotate-right.png',
+  'view-page-continuous.png',
+  'view-page-facing.png',
+]
+
+icons += [['32x32', actions, ['x-office-presentation.png'], []]]
+
+actions = [
+  'close.png',
+  'resize-se.png',
+  'resize-sw.png',
+  'view-page-continuous.png',
+  'view-page-facing.png',
+]
+
+icons += [['48x48', actions, [], [ev_namespace + '.png']]]
+
+icons += [['256x256', [], [], [ev_namespace + '.png']]]
+
+actions = [
+  'object-rotate-left.svg',
+  'object-rotate-right.svg',
+  'outline-symbolic.svg',
+  'view-sidebar-symbolic.svg',
+]
+
+icons += [['scalable', actions, ['x-office-presentation.svg'], []]]
+
+icons += [['symbolic', [], [], [ev_namespace + '-symbolic.svg']]]
+
+foreach icon: icons
+  foreach action: icon[1]
+    install_data(
+      join_paths(icon[0], 'actions', action),
+      install_dir: join_paths(ev_pkgdatadir, 'icons', 'hicolor', icon[0], 'actions'),
+    )
+  endforeach
+
+  foreach mimetype: icon[2]
+    install_data(
+      join_paths(icon[0], 'mimetypes', mimetype),
+      install_dir: join_paths(ev_pkgdatadir, 'icons', 'hicolor', icon[0], 'mimetypes'),
+    )
+  endforeach
+
+  foreach app: icon[3]
+    install_data(
+      join_paths(icon[0], 'apps', app),
+      install_dir: join_paths(ev_datadir, 'icons', 'hicolor', icon[0], 'apps'),
+    )
+  endforeach
+endforeach
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 00000000..be6ed210
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,77 @@
+subdir('icons')
+
+# Desktop file
+desktops = [ev_namespace + '.desktop']
+
+if enable_previewer
+  desktops += [ev_namespace + '-previewer.desktop']
+endif
+
+foreach desktop: desktops
+  desktop_in = configure_file(
+    input: desktop + '.in.in',
+    output: desktop + '.in',
+    configuration: mime_types_conf,
+  )
+
+  custom_target(
+    desktop,
+    input: desktop_in,
+    output: desktop,
+    command: intltool_desktop_cmd,
+    install: true,
+    install_dir: join_paths(ev_datadir, 'applications'),
+  )
+endforeach
+
+# DBus service file
+if enable_dbus
+  service_conf = configuration_data()
+  service_conf.set('libexecdir', join_paths(ev_prefix, ev_libexecdir))
+  service_conf.set('if_systemd_service', '')
+
+  services = [[ev_namespace + '.Daemon.service', dbus_service_dir]]
+
+  if install_systemd_user_unit_dir
+    services += [[ev_namespace + '.service', systemd_user_unit_dir]]
+  endif
+
+  foreach service: services
+    configure_file(
+      input: service[0] + '.in',
+      output: service[0],
+      configuration: service_conf,
+      install: true,
+      install_dir: service[1],
+    )
+  endforeach
+endif
+
+# GSettings schema
+gschema = ev_namespace + '.gschema.xml'
+
+custom_target(
+  gschema,
+  input: gschema + '.in',
+  output: gschema,
+  command: [intltool_merge, '-x', '-u', '--no-translations', '@INPUT@', '@OUTPUT@'],
+  install: true,
+  install_dir: join_paths(ev_datadir, 'glib-2.0', 'schemas'),
+)
+
+install_data(
+  'evince.convert',
+  install_dir: join_paths(ev_datadir, 'GConf', 'gsettings'),
+)
+
+# man file
+install_data(
+  'evince.1',
+  install_dir: join_paths(ev_mandir, 'man1'),
+)
+
+# UI descriptions
+install_data(
+  'hand-open.png',
+  install_dir: ev_pkgdatadir,
+)
diff --git a/generate-changelog.sh b/generate-changelog.sh
new file mode 100755
index 00000000..399b9cfb
--- /dev/null
+++ b/generate-changelog.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ -d "$1/.git" ]; then
+       git log -M -C --name-status --date=short --no-color | fmt --split-only > $2.tmp &&
+       mv -f $2.tmp $2 ||
+       {
+               rm -f $2.tmp &&
+               echo "Failed to generate ChangeLog, your ChangeLog may be outdated" >&2;
+       }
+else
+       echo "Git repository not found" >&2
+       exit 1
+fi
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 00000000..0d973dbf
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1,34 @@
+# please keep this list sorted alphabetically
+bg
+ca
+cs
+da
+de
+el
+en_GB
+es
+eu
+fi
+fr
+gl
+hu
+id
+it
+ja
+ko
+lv
+nl
+oc
+pl
+pt_BR
+ro
+ru
+sl
+sr
+sv
+te
+uk
+vi
+zh_CN
+zh_HK
+zh_TW
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 00000000..71216288
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,109 @@
+enable_gtk_doc = get_option('gtk_doc')
+if enable_gtk_doc
+  glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
+  gtk_prefix = gtk_dep.get_pkgconfig_variable('prefix')
+
+  common_fixxref_args = [
+    '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('glib')),
+    '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('gio')),
+    '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gdk')),
+    '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gdk-pixbuf')),
+    '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gtk')),
+  ]
+
+  subdir('reference/libdocument')
+  subdir('reference/libview')
+  subdir('reference/shell')
+endif
+
+sources = [
+  'annotation-properties.page',
+  'annotations-delete.page',
+  'annotations-disabled.page',
+  'annotations-navigate.page',
+  'annotations.page',
+  'annotations-save.page',
+  'bookmarks.page',
+  'bug-filing.page',
+  'commandline.page',
+  'convertpdf.page',
+  'convertPostScript.page',
+  'convertSVG.page',
+  'default-settings.page',
+  'develop.page',
+  'documentation.page',
+  'duplex-10pages.page',
+  'duplex-11pages.page',
+  'duplex-12pages.page',
+  'duplex-13pages.page',
+  'duplex-14pages.page',
+  'duplex-15pages.page',
+  'duplex-16pages.page',
+  'duplex-3pages.page',
+  'duplex-4pages.page',
+  'duplex-5pages.page',
+  'duplex-6pages.page',
+  'duplex-7pages.page',
+  'duplex-8pages.page',
+  'duplex-9pages.page',
+  'duplex-npages.page',
+  'editing.page',
+  'finding.page',
+  'formats.page',
+  'forms.page',
+  'forms-saving.page',
+  'index.page',
+  'introduction.page',
+  'invert-colors.page',
+  'license.page',
+  'legal.xml',
+  'legal-unported.xml',
+  'movingaround.page',
+  'noprint.page',
+  'openerror.page',
+  'opening.page',
+  'password.page',
+  'presentations.page',
+  'print-2sided.page',
+  'print-booklet.page',
+  'print-differentsize.page',
+  'printing.page',
+  'print-order.page',
+  'print-pagescaling.page',
+  'print-select.page',
+  'reload.page',
+  'shortcuts.page',
+  'singlesided-13-16pages.page',
+  'singlesided-17-20pages.page',
+  'singlesided-3-4pages.page',
+  'singlesided-5-8pages.page',
+  'singlesided-9-12pages.page',
+  'singlesided-npages.page',
+  'synctex-beamer.page',
+  'synctex-compile.page',
+  'synctex-editors.page',
+  'synctex.page',
+  'synctex-search.page',
+  'synctex-support.page',
+  'textselection.page',
+  'titlebar.page',
+  'translate.page',
+]
+
+media = [
+  'figures/add-text-annotation.png',
+  'figures/annotations-nav-to-page.png',
+  'figures/evincelogo.png',
+  'figures/evince-trail.png',
+  'figures/list-add-tabs.png',
+  'figures/print-select.png',
+  'figures/reverse-collate.png',
+  'figures/zoom.png',
+]
+
+gnome.yelp(
+  ev_name,
+  sources: sources,
+  media: media,
+  symlink_media: true,
+)
diff --git a/help/reference/libdocument/meson.build b/help/reference/libdocument/meson.build
new file mode 100644
index 00000000..bea95ff6
--- /dev/null
+++ b/help/reference/libdocument/meson.build
@@ -0,0 +1,38 @@
+doc_module = 'libevdocument'
+doc_module_dir = '@0@-@1@'.format(doc_module, ev_api_version)
+
+private_headers = [
+  'ev-backend-info.h',
+  'ev-debug.h',
+  'ev-macros.h',
+  'ev-module.h',
+]
+
+libevdocument_doc_path = join_paths(ev_prefix, gnome.gtkdoc_html_dir(doc_module_dir))
+
+fixxref_args = common_fixxref_args + ['--html-dir=' + libevdocument_doc_path]
+
+version_conf = configuration_data()
+version_conf.set('VERSION', ev_version)
+
+version_xml = 'version.xml'
+
+version = configure_file(
+  input: version_xml + '.in',
+  output: version_xml,
+  configuration: version_conf,
+)
+
+gnome.gtkdoc(
+  doc_module,
+  main_xml: doc_module + '-docs.xml',
+  src_dir: libdocument_inc,
+  dependencies: libevdocument_dep,
+  ignore_headers: private_headers,
+  namespace: ev_code_prefix.to_lower(),
+  fixxref_args: fixxref_args,
+  gobject_typesfile: files(doc_module + '.types'),
+  content_files: version,
+  install: true,
+  install_dir: doc_module_dir,
+)
diff --git a/help/reference/libview/meson.build b/help/reference/libview/meson.build
new file mode 100644
index 00000000..7a2d6479
--- /dev/null
+++ b/help/reference/libview/meson.build
@@ -0,0 +1,46 @@
+doc_module = 'libevview'
+doc_module_dir = '@0@-@1@'.format(doc_module, ev_api_version)
+
+private_headers = [
+  'ev-link-accessible.h',
+  'ev-pixbuf-cache.h',
+  'ev-timeline.h',
+  'ev-transition-animation.h',
+  'ev-view-accessible.h',
+  'ev-view-marshal.h',
+  'ev-view-private.h',
+]
+
+libevview_doc_path = join_paths(ev_prefix, gnome.gtkdoc_html_dir(doc_module_dir))
+
+fixxref_args = [
+  '--html-dir=' + libevview_doc_path,
+  '--extra-dir=' + libevdocument_doc_path,
+] + common_fixxref_args
+
+version_conf = configuration_data()
+version_conf.set('VERSION', ev_version)
+
+version_xml = 'version.xml'
+
+version = configure_file(
+  input: version_xml + '.in',
+  output: version_xml,
+  configuration: version_conf,
+)
+
+gnome.gtkdoc(
+  doc_module,
+  main_xml: doc_module + '-docs.xml',
+  src_dir: libview_inc,
+  ignore_headers: private_headers,
+  include_directories: top_inc,
+  dependencies: libevview_dep,
+  c_args: '-DEVINCE_COMPILATION',
+  namespace: ev_code_prefix.to_lower(),
+  fixxref_args: fixxref_args,
+  gobject_typesfile: doc_module + '.types',
+  content_files: version,
+  install: true,
+  install_dir: doc_module_dir,
+)
diff --git a/help/reference/shell/meson.build b/help/reference/shell/meson.build
new file mode 100644
index 00000000..8987bba7
--- /dev/null
+++ b/help/reference/shell/meson.build
@@ -0,0 +1,34 @@
+doc_module = ev_name
+
+fixxref_args = [
+  '--html-dir=' + join_paths(ev_prefix, gnome.gtkdoc_html_dir(doc_module)),
+  '--extra-dir=' + libevdocument_doc_path,
+  '--extra-dir=' + libevview_doc_path,
+] + common_fixxref_args
+
+
+version_conf = configuration_data()
+version_conf.set('VERSION', ev_version)
+
+version_xml = 'version.xml'
+
+version = configure_file(
+  input: version_xml + '.in',
+  output: version_xml,
+  configuration: version_conf,
+)
+
+gnome.gtkdoc(
+  doc_module,
+  main_xml: doc_module + '-docs.xml',
+  src_dir: shell_inc,
+  ignore_headers: 'ev-marshal.h',
+  include_directories: top_inc,
+  dependencies: libshell_dep,
+  namespace: ev_code_prefix.to_lower(),
+  fixxref_args: fixxref_args,
+  gobject_typesfile: files(doc_module + '.types'),
+  content_files: version,
+  install: true,
+  install_dir: doc_module,
+)
diff --git a/lib-symbol.map b/lib-symbol.map
new file mode 100644
index 00000000..b14a9ddd
--- /dev/null
+++ b/lib-symbol.map
@@ -0,0 +1,6 @@
+{
+    global:
+        ev_*;
+    local:
+        *;
+};
diff --git a/libdocument/meson.build b/libdocument/meson.build
new file mode 100644
index 00000000..914815df
--- /dev/null
+++ b/libdocument/meson.build
@@ -0,0 +1,197 @@
+libdocument_inc = include_directories('.')
+
+include_subdir = join_paths(ev_include_subdir, 'libdocument')
+
+headers = files(
+  'ev-annotation.h',
+  'ev-async-renderer.h',
+  'ev-attachment.h',
+  'ev-backends-manager.h',
+  'ev-document-factory.h',
+  'ev-document-annotations.h',
+  'ev-document-attachments.h',
+  'ev-document-find.h',
+  'ev-document-fonts.h',
+  'ev-document-forms.h',
+  'ev-document.h',
+  'ev-document-images.h',
+  'ev-document-info.h',
+  'ev-document-layers.h',
+  'ev-document-links.h',
+  'ev-document-media.h',
+  'ev-document-misc.h',
+  'ev-document-print.h',
+  'ev-document-security.h',
+  'ev-document-transition.h',
+  'ev-document-text.h',
+  'ev-file-exporter.h',
+  'ev-file-helpers.h',
+  'ev-form-field.h',
+  'ev-image.h',
+  'ev-init.h',
+  'ev-layer.h',
+  'ev-link-action.h',
+  'ev-link-dest.h',
+  'ev-link.h',
+  'ev-macros.h',
+  'ev-mapping-list.h',
+  'ev-media.h',
+  'ev-page.h',
+  'ev-render-context.h',
+  'ev-selection.h',
+  'ev-transition-effect.h',
+)
+
+install_headers(
+  headers,
+  subdir: include_subdir,
+)
+
+sources = files(
+  'ev-annotation.c',
+  'ev-async-renderer.c',
+  'ev-attachment.c',
+  'ev-backend-info.c',
+  'ev-debug.c',
+  'ev-document.c',
+  'ev-document-annotations.c',
+  'ev-document-attachments.c',
+  'ev-document-factory.c',
+  'ev-document-find.c',
+  'ev-document-fonts.c',
+  'ev-document-forms.c',
+  'ev-document-images.c',
+  'ev-document-layers.c',
+  'ev-document-links.c',
+  'ev-document-media.c',
+  'ev-document-misc.c',
+  'ev-document-print.c',
+  'ev-document-security.c',
+  'ev-document-text.c',
+  'ev-document-transition.c',
+  'ev-file-exporter.c',
+  'ev-file-helpers.c',
+  'ev-form-field.c',
+  'ev-image.c',
+  'ev-init.c',
+  'ev-layer.c',
+  'ev-link-action.c',
+  'ev-link.c',
+  'ev-link-dest.c',
+  'ev-mapping-list.c',
+  'ev-media.c',
+  'ev-module.c',
+  'ev-page.c',
+  'ev-render-context.c',
+  'ev-selection.c',
+  'ev-transition-effect.c',
+)
+
+version_conf = configuration_data()
+version_conf.set('EV_MAJOR_VERSION', ev_major_version)
+version_conf.set('EV_MINOR_VERSION', ev_minor_version)
+version_conf.set('EV_MICRO_VERSION', ev_micro_version)
+
+version = 'ev-version.h'
+
+version_header = configure_file(
+  input: version + '.in',
+  output: version,
+  configuration: version_conf,
+  install: true,
+  install_dir: join_paths(ev_includedir, include_subdir),
+)
+
+enum_types = 'ev-document-type-builtins'
+
+enum_sources = gnome.mkenums(
+  enum_types,
+  sources: headers,
+  h_template: enum_types + '.h.template',
+  c_template: enum_types + '.c.template',
+  install_header: true,
+  install_dir: join_paths(ev_includedir, include_subdir),
+)
+
+common_deps = [
+  cairo_dep,
+  gdk_pixbuf_dep,
+  gio_dep,
+  glib_dep,
+  gtk_dep,
+]
+
+deps = common_deps + [
+  gmodule_dep,
+  gmodule_no_export_dep,
+  m_dep,
+  synctex_dep,
+  zlib_dep,
+]
+
+cflags = [
+  '-DG_LOG_DOMAIN="EvinceDocument"',
+  '-DGNOMELOCALEDIR="@0@"'.format(ev_localedir),
+  '-DEV_BACKENDSDIR="@0@"'.format(ev_backendsdir),
+  '-DEV_BACKENDSBINARYVERSION="@0@"'.format(ev_backends_binary_version),
+  '-DEVINCE_COMPILATION',
+]
+
+libevdocument = shared_library(
+  'evdocument' + ev_major_version.to_string(),
+  version: ev_document_version,
+  sources: sources + enum_sources + [version_header],
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: cflags,
+  link_args: lib_ldflags,
+  link_depends: lib_symbol_map,
+  install: true,
+)
+
+libevdocument_dep = declare_dependency(
+  sources: [enum_sources[1], version_header],
+  include_directories: libdocument_inc,
+  dependencies: common_deps,
+  link_with: libevdocument,
+)
+
+pkg.generate(
+  libevdocument,
+  filebase: 'evince-document-' + ev_api_version,
+  name: 'Evince Document',
+  description: 'GNOME document viewer backend library',
+  subdirs: ev_include_subdir,
+  requires: [
+    gio_dep,
+    gtk_dep,
+  ],
+  variables: [
+    'exec_prefix=${prefix}',
+    'backenddir=' + join_paths('${libdir}', ev_backends_subdir),
+  ],
+)
+
+# GObject Introspection
+if enable_introspection
+  incs = [
+    'Gdk-3.0',
+    'GdkPixbuf-2.0',
+    'Gio-2.0',
+    'GLib-2.0',
+    'Gtk-3.0',
+  ]
+
+  libevdocument_gir = gnome.generate_gir(
+    libevdocument,
+    sources: sources + headers + [enum_sources[1], version_header],
+    includes: incs,
+    nsversion: ev_api_version,
+    namespace: 'EvinceDocument',
+    identifier_prefix: ev_code_prefix,
+    symbol_prefix: ev_code_prefix.to_lower(),
+    export_packages: 'evince-document-' + ev_api_version,
+    extra_args: '-DEVINCE_COMPILATION',
+    install: true,
+  )
+endif
diff --git a/libmisc/meson.build b/libmisc/meson.build
new file mode 100644
index 00000000..0ca909e8
--- /dev/null
+++ b/libmisc/meson.build
@@ -0,0 +1,19 @@
+sources = files(
+  'ev-page-action.c',
+  'ev-page-action-widget.c',
+  'ev-search-box.c',
+)
+
+libevmisc = static_library(
+  'evmisc',
+  sources: sources,
+  include_directories: top_inc,
+  dependencies: libevview_dep,
+  c_args: '-DEVINCEDATADIR="@0@"'.format(ev_pkgdatadir),
+)
+
+libevmisc_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  dependencies: libevview_dep,
+  link_whole: libevmisc,
+)
diff --git a/libview/meson.build b/libview/meson.build
new file mode 100644
index 00000000..01b1a27c
--- /dev/null
+++ b/libview/meson.build
@@ -0,0 +1,139 @@
+libview_inc = include_directories('.')
+
+include_subdir = join_paths(ev_include_subdir, 'libview')
+
+headers = files(
+  'ev-document-model.h',
+  'ev-jobs.h',
+  'ev-job-scheduler.h',
+  'ev-print-operation.h',
+  'ev-stock-icons.h',
+  'ev-view.h',
+  'ev-view-presentation.h'
+)
+
+install_headers(
+  headers,
+  subdir: include_subdir,
+)
+
+sources = files(
+  'ev-annotation-window.c',
+  'ev-document-model.c',
+  'ev-form-field-accessible.c',
+  'ev-image-accessible.c',
+  'ev-jobs.c',
+  'ev-job-scheduler.c',
+  'ev-link-accessible.c',
+  'ev-page-accessible.c',
+  'ev-page-cache.c',
+  'ev-pixbuf-cache.c',
+  'ev-print-operation.c',
+  'ev-stock-icons.c',
+  'ev-timeline.c',
+  'ev-transition-animation.c',
+  'ev-view.c',
+  'ev-view-accessible.c',
+  'ev-view-cursor.c',
+  'ev-view-presentation.c',
+)
+
+marshal = 'ev-view-marshal'
+
+marshal_sources = gnome.genmarshal(
+  marshal,
+  sources: marshal + '.list',
+  prefix: 'ev_view_marshal',
+  internal: true,
+  extra_args: '--prototypes',
+)
+
+enum_types = 'ev-view-type-builtins'
+
+enum_sources = gnome.mkenums(
+  enum_types,
+  sources: headers,
+  h_template: enum_types + '.h.template',
+  c_template: enum_types + '.c.template',
+  install_header: true,
+  install_dir: join_paths(ev_includedir, include_subdir),
+)
+
+deps = [
+  gspell_dep,
+  gstreamer_base_dep,
+  gstreamer_dep,
+  gstreamer_video_dep,
+  gtk_unix_print_dep,
+  gthread_dep,
+  libevdocument_dep,
+  m_dep,
+]
+
+cflags = [
+  '-DG_LOG_DOMAIN="EvinceView"',
+  '-DEVINCEDATADIR="@0@"'.format(ev_pkgdatadir),
+  '-DEVINCE_COMPILATION'
+]
+
+if enable_multimedia
+  sources += files('ev-media-player.c')
+endif
+
+libevview = shared_library(
+  'evview' + ev_major_version.to_string(),
+  version: ev_view_version,
+  sources: sources + marshal_sources + enum_sources,
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: cflags,
+  link_args: lib_ldflags,
+  link_depends: lib_symbol_map,
+  install: true,
+)
+
+libevview_dep = declare_dependency(
+  sources: enum_sources[1],
+  include_directories: libview_inc,
+  dependencies: libevdocument_dep,
+  link_with: libevview,
+)
+
+pkg.generate(
+  libevview,
+  filebase: 'evince-view-' + ev_api_version,
+  name: 'Evince View',
+  description: 'GNOME document viewer view library',
+  subdirs: ev_include_subdir,
+  requires: [
+    'evince-document-@0@ = @1@'.format(ev_api_version, ev_version),
+    gthread_dep,
+  ],
+  variables: 'exec_prefix=${prefix}',
+)
+
+# GObject Introspection
+if enable_introspection
+  incs = [
+    'Gdk-3.0',
+    'GdkPixbuf-2.0',
+    'Gio-2.0',
+    'GLib-2.0',
+    'GObject-2.0',
+    'Gtk-3.0',
+    libevdocument_gir[0],
+  ]
+
+  gnome.generate_gir(
+    [libevview, libevdocument],
+    sources: sources + headers + [enum_sources[1]],
+    includes: incs,
+    nsversion: ev_api_version,
+    namespace: 'EvinceView',
+    identifier_prefix: ev_code_prefix,
+    symbol_prefix: ev_code_prefix.to_lower(),
+    export_packages: 'evince-view-' + ev_api_version,
+    extra_args: '-DEVINCE_COMPILATION',
+    install: true,
+  )
+endif
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..ed02dbdd
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,544 @@
+project(
+  'Evince', ['c', 'cpp'],
+  version: '3.30.0',
+  license: 'GPL2',
+  default_options: 'buildtype=debugoptimized',
+  meson_version: '>= 0.48.0',
+)
+
+ev_name = meson.project_name().to_lower()
+
+ev_version = meson.project_version()
+version_array = ev_version.split('.')
+ev_major_version = version_array[0].to_int()
+ev_minor_version = version_array[1].to_int()
+ev_micro_version = version_array[2].to_int()
+
+ev_prefix = get_option('prefix')
+ev_bindir = get_option('bindir')
+ev_datadir = get_option('datadir')
+ev_includedir = get_option('includedir')
+ev_libdir = get_option('libdir')
+ev_libexecdir = get_option('libexecdir')
+ev_localedir = get_option('localedir')
+ev_mandir = get_option('mandir')
+
+ev_pkgdatadir = join_paths(ev_datadir, ev_name)
+
+ev_appstreamdir = join_paths(ev_datadir, 'metainfo')
+
+# Libtool versioning. The backend and view libraries have separate versions.
+# Before making a release, the libtool version should be modified.
+# The string is of the form C:R:A.
+# - If interfaces have been changed or added, but binary compatibility has
+#   been preserved, change to C+1:0:A+1
+# - If binary compatibility has been broken (eg removed or changed interfaces)
+#   change to C+1:0:0
+# - If the interface is the same as the previous version, change to C:R+1:A
+
+# Libtool version of the backend library
+ev_document_current = 4
+ev_document_revision = 0
+ev_document_age = 0
+ev_document_version = '@0@.@1@.@2@'.format(ev_document_current, ev_document_revision, ev_document_age)
+ev_document_current_minus_age = ev_document_current - ev_document_age
+
+# Libtool version of the view library
+ev_view_current = ev_major_version
+ev_view_revision = 0
+ev_view_age = 0
+ev_view_version = '@0@.@1@.@2@'.format(ev_view_current, ev_view_revision, ev_view_age)
+ev_view_current_minus_age = ev_view_current - ev_view_age
+
+ev_api_version = '@0@.0'.format(ev_major_version)
+
+ev_include_subdir = join_paths(ev_name, ev_api_version)
+
+# Backends directory
+ev_binary_version = ev_document_current
+ev_backends_binary_version = ev_binary_version
+ev_backends_subdir = join_paths(ev_name, ev_backends_binary_version.to_string(), 'backends')
+ev_backendsdir = join_paths(ev_libdir, ev_backends_subdir)
+
+ev_namespace = 'org.gnome.' + meson.project_name()
+
+ev_code_prefix = 'Ev'
+
+ev_debug = get_option('buildtype').contains('debug')
+
+cc = meson.get_compiler('c')
+cpp = meson.get_compiler('cpp')
+
+config_h = configuration_data()
+# package
+config_h.set_quoted('PACKAGE_VERSION', ev_version)
+config_h.set_quoted('VERSION', ev_version)
+
+# i18n
+config_h.set_quoted('GETTEXT_PACKAGE', ev_name)
+config_h.set('ENABLE_NLS', true)
+
+config_h.set('HAVE_LOCALTIME_R', cc.has_function('localtime_r'))
+
+# portability checks
+# FIXME: there is no use of backtrace in the code
+# for backtrace()
+cc.has_header('execinfo.h')
+
+# Support for nl_langinfo (_NL_MEASUREMENT_MEASUREMENT) (optional)
+langinfo_measurement_src = '''
+  #include <langinfo.h>
+  int main() {
+    char c;
+    c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
+  };
+'''
+config_h.set('HAVE__NL_MEASUREMENT_MEASUREMENT', cc.compiles(langinfo_measurement_src, name: 'Support for 
nl_langinfo'),
+             description: 'Define if _NL_MEASUREMENT_MEASUREMENT is available')
+
+# compiler flags
+common_flags = ['-DHAVE_CONFIG_H']
+
+common_ldflags = []
+
+if build_machine.system() == 'windows'
+  common_flags += '-D_WIN32_WINNT=0x0500'
+
+  common_ldflags = cc.get_supported_link_arguments('-mwindows')
+endif
+
+if ev_debug
+  common_flags += ['-DEV_ENABLE_DEBUG'] + cc.get_supported_arguments([
+    '-Wnested-externs',
+    '-Wstrict-prototypes',
+    '-Werror=format=2',
+    '-Werror=implicit-function-declaration',
+    '-Werror=init-self',
+    '-Werror=missing-include-dirs',
+    '-Werror=missing-prototypes',
+    '-Werror=pointer-arith',
+    '-Werror=return-type',
+  ])
+endif
+
+add_project_arguments(common_flags, language: 'c')
+
+lib_symbol_map = join_paths(meson.current_source_dir(), 'lib-symbol.map')
+lib_ldflags = cc.get_supported_link_arguments('-Wl,--version-script,' + lib_symbol_map)
+
+gnome = import('gnome')
+i18n = import('i18n')
+pkg = import('pkgconfig')
+
+source_root = meson.current_source_dir()
+
+data_dir = join_paths(source_root, 'data')
+po_dir = join_paths(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('.')
+
+glib_req_version = '>= 2.36.0'
+gtk_req_version = '>= 3.16.0'
+
+gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.36.5')
+gio_dep = dependency('gio-2.0', version: glib_req_version)
+glib_dep = dependency('glib-2.0', version: glib_req_version)
+gmodule_dep = dependency('gmodule-2.0')
+gmodule_no_export_dep = dependency('gmodule-no-export-2.0', version: glib_req_version)
+gtk_dep = dependency('gtk+-3.0', version: gtk_req_version)
+gthread_dep = dependency('gthread-2.0', version: glib_req_version)
+
+m_dep = cc.find_library('m')
+
+# Although GTK+ 3.10 includes hi-dpi functionality, it does not require a cairo with
+# cairo_surface_set_device_scale(), which we also need if we're to support hi-dpi,
+# so we need check for that explicity.
+cairo_dep = dependency('cairo', version: '>= 1.10.0')
+config_h.set('HAVE_HIDPI_SUPPORT', cc.has_function('cairo_surface_set_device_scale', dependencies: 
cairo_dep))
+
+# ZLIB support (required)
+zlib_dep = cc.find_library('z', required: false)
+assert(zlib_dep.found() and cc.has_function('inflate', dependencies: zlib_dep) and cc.has_function('crc32', 
dependencies: zlib_dep),
+      'No sufficient zlib library found on your system')
+
+ev_platform = get_option('platform')
+if ev_platform == 'gnome'
+  # Evince has a rather soft run-time dependency on hicolor-icon-theme.
+  # If the hicolor theme is not available, Evince fails to display some
+  # icons. Because we cannot check for it at run-time, we instead
+  # would like to require the icon theme at compile-time. But, because
+  # the hicolor-icon-theme does not have a pkgconfig file, on gnome we
+  # require the gnome icon theme instead.
+  adwaita_icon_theme_dep = dependency('adwaita-icon-theme', version: '>= 2.17.1')
+
+  # *** Nautilus property page build ***
+  enable_nautilus = get_option('nautilus')
+  if enable_nautilus
+    libnautilus_extension_dep = dependency('libnautilus-extension', version: '>= 2.91.4')
+    nautilus_extension_dir = libnautilus_extension_dep.get_pkgconfig_variable('extensiondir', 
define_variable: ['libdir', ev_libdir])
+  endif
+
+  # *** DBUS ***
+  enable_dbus = get_option('dbus')
+  if enable_dbus
+    # Check for dbus service dir
+    dbus_service_dir = dependency('dbus-1').get_pkgconfig_variable('session_bus_services_dir', 
define_variable: ['datadir', ev_datadir])
+    gio_unix_dep = dependency('gio-unix-2.0', version: glib_req_version)
+  endif
+  config_h.set('ENABLE_DBUS', enable_dbus)
+
+  # *** GNOME Keyring support ***
+  libsecret_dep = dependency('libsecret-1', version: '>= 0.5', required: get_option('keyring'))
+  enable_keyring = libsecret_dep.found()
+  config_h.set('WITH_KEYRING', enable_keyring)
+
+  # GKT+ Unix Printing
+  gtk_unix_print_dep = dependency('gtk+-unix-print-3.0', version: gtk_req_version, required: 
get_option('gtk_unix_print'))
+  enable_gtk_unix_print = gtk_unix_print_dep.found()
+  config_h.set10('GTKUNIXPRINT_ENABLED', enable_gtk_unix_print)
+else
+  message('Evince has a soft run-time dependency on hicolor-icon-theme. You are advised to have this theme 
installed when running Evince.')
+  enable_nautilus = false
+  enable_dbus = false
+  enable_keyring = false
+  enable_gtk_unix_print = false
+endif
+
+# *** GObject Introspection ***
+enable_introspection = get_option('introspection')
+if enable_introspection
+  dependency('gobject-introspection-1.0', version: '>= 1.0')
+endif
+
+# *** GNOME Desktop (Thumbnail cache) ***
+gnome_desktop_dep = dependency('gnome-desktop-3.0', required: get_option('thumbnail_cache'))
+enable_thumbnail_cache = gdk_pixbuf_dep.found() and gnome_desktop_dep.found()
+config_h.set('HAVE_LIBGNOME_DESKTOP', enable_thumbnail_cache)
+
+# *** GStreamer (Multimedia) ***
+gstreamer_base_dep = dependency('gstreamer-base-1.0', required: get_option('multimedia'))
+gstreamer_dep = dependency('gstreamer-1.0', required: get_option('multimedia'))
+gstreamer_video_dep = dependency('gstreamer-video-1.0', required: get_option('multimedia'))
+
+enable_multimedia = gstreamer_dep.found() and gstreamer_base_dep.found() and gstreamer_video_dep.found()
+config_h.set('ENABLE_MULTIMEDIA', enable_multimedia)
+
+# *** Gspell ***
+gspell_dep = dependency('gspell-1', version: '>= 1.6.0', required: get_option('gspell'))
+enable_gspell = gspell_dep.found()
+config_h.set10('WITH_GSPELL', enable_gspell)
+
+# *** systemd user unit dir ***
+systemd_user_unit_dir = get_option('systemduserunitdir')
+install_systemd_user_unit_dir = (systemd_user_unit_dir != 'no')
+
+if install_systemd_user_unit_dir and systemd_user_unit_dir == ''
+  systemd_dep = dependency('systemd', required: false)
+
+  assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir 
or disable it')
+  systemd_user_unit_dir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
+endif
+
+# *** Check for Desktop Schemas ***
+gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas', required: false)
+config_h.set('HAVE_DESKTOP_SCHEMAS', gsettings_desktop_schemas_dep.found())
+
+# *** libsynctex ***
+synctex_dep = dependency('synctex', version: '>= 1.19', required: false)
+external_synctex = synctex_dep.found()
+
+# *** Mime types list ***
+mime_types_list = {
+  'comics': [
+    'application/vnd.comicbook-rar',
+    'application/vnd.comicbook+zip',
+    'application/x-cb7',
+    'application/x-cbr',
+    'application/x-cbt',
+    'application/x-cbz',
+    'application/x-ext-cb7',
+    'application/x-ext-cbr',
+    'application/x-ext-cbt',
+    'application/x-ext-cbz',
+  ],
+  'djvu': [
+    'application/x-ext-djv',
+    'application/x-ext-djvu',
+    'image/vnd.djvu+multipage',
+  ],
+  'dvi': [
+    'application/x-bzdvi',
+    'application/x-dvi',
+    'application/x-ext-dvi',
+    'application/x-gzdvi',
+  ],
+  'illustrator': [
+    'application/illustrator'
+  ],
+  'pdf': [
+    'application/pdf',
+    'application/x-bzpdf',
+    'application/x-ext-pdf',
+    'application/x-gzpdf',
+    'application/x-xzpdf',
+  ],
+  'ps': [
+    'application/postscript',
+    'application/x-bzpostscript',
+    'application/x-gzpostscript',
+    'application/x-ext-eps',
+    'application/x-ext-ps',
+    'image/x-bzeps',
+    'image/x-eps',
+    'image/x-gzeps',
+  ],
+  'tiff': [
+    'image/tiff'
+  ],
+  'xps': [
+    'application/oxps',
+    'application/vnd.ms-xpsdocument',
+  ],
+}
+
+backends = {}
+evince_mime_types = []
+
+# *** Spectre ***
+if not get_option('ps').disabled() or not get_option('dvi').disabled()
+  # libspectre (used by ps and dvi backends)
+  libspectre_req_version = '>= 0.2.0'
+  libspectre_dep = dependency('libspectre', version: libspectre_req_version, required: false)
+  config_h.set('HAVE_SPECTRE', libspectre_dep.found())
+endif
+
+# *** Comic Book ***
+libarchive_req_version = '>= 3.2.0'
+libarchive_dep = dependency('libarchive', version: libarchive_req_version, required: get_option('comics'))
+enable_comics = libarchive_dep.found()
+if enable_comics
+  backends += {'comics': mime_types_list.get('comics')}
+  evince_mime_types += mime_types_list.get('comics')
+elif get_option('comics').auto()
+  warning('** Comics support is disabled since libarchive (version ' + libarchive_req_version + ') is 
needed')
+endif
+
+# *** DJVU ***
+ddjvuapi_req_version = '>= 3.5.22'
+ddjvuapi_dep = dependency('ddjvuapi', version: ddjvuapi_req_version, required: get_option('djvu'))
+enable_djvu = ddjvuapi_dep.found()
+if enable_djvu
+  backends += {'djvu': mime_types_list.get('djvu')}
+  evince_mime_types += mime_types_list.get('djvu')
+elif get_option('djvu').auto()
+  warning('Djvu support is disabled since a recent version of the djvulibre library was not found. You need 
at least djvulibre ' + ddjvuapi_req_version + ' which can be found on http://djvulibre.djvuzone.org')
+endif
+
+# *** DVI ***
+kpathsea_dep = cc.find_library('kpathsea', required: get_option('dvi'))
+enable_dvi = libspectre_dep.found() and kpathsea_dep.found() and cc.has_function('kpse_init_prog', 
dependencies: kpathsea_dep)
+if enable_dvi
+  config_h.set10('STDC_HEADERS', true)
+
+  if not cc.has_type('size_t', prefix: '#include<sys/types.h>')
+    config_h.set('size_t', 'unsigned int')
+  endif
+
+  types = [
+    ['short', 'SHORT'],
+    ['int', 'INT'],
+    ['long', 'LONG'],
+    ['long long', 'LONG_LONG'],
+    ['void  *', 'VOID_P'],
+  ]
+
+  foreach type: types
+    config_h.set('SIZEOF_' + type[1], cc.sizeof(type[0]))
+  endforeach
+
+  t1_dep = cc.find_library('t1', required: get_option('t1lib'))
+  enable_t1lib = t1_dep.found() and cc.has_function('T1_initLib', dependencies: t1_dep)
+  config_h.set('WITH_TYPE1_FONTS', enable_t1lib)
+
+  backends += {'dvi': mime_types_list.get('dvi')}
+  evince_mime_types += mime_types_list.get('dvi')
+elif get_option('dvi').auto()
+  warning('Dvi support is disabled since kpathsea library or libspectre are not found. Check your 
installation.')
+endif
+
+# *** PDF ***
+poppler_req_version = '>= 0.33.0'
+poppler_glib_dep = dependency('poppler-glib', version: poppler_req_version, required: get_option('pdf'))
+
+libxml_req_version = '>= 2.5.0'
+libxml_dep = dependency('libxml-2.0', version: libxml_req_version, required: get_option('pdf'))
+
+enable_pdf = poppler_glib_dep.found() and libxml_dep.found()
+if enable_pdf
+  cairo_pdf_dep = dependency('cairo-pdf', required: false)
+  cairo_ps_dep = dependency('cairo-ps', required: false)
+
+  backends += {'pdf': mime_types_list.get('pdf')}
+  evince_mime_types += mime_types_list.get('pdf')
+elif get_option('pdf').auto()
+  warning('PDF support is disabled since poppler-glib version ' + poppler_req_version + ' or libxml-2.0 
version ' + libxml_req_version + ' not found')
+endif
+
+# *** PostScript ***
+enable_ps = not get_option('ps').disabled() and libspectre_dep.found()
+if enable_ps
+  backends += {'ps': mime_types_list.get('ps')}
+  evince_mime_types += mime_types_list.get('ps')
+elif not get_option('ps').disabled()
+  str = 'PS support is disabled since libspectre (version ' + libspectre_req_version + ') is needed'
+  if get_option('ps').auto()
+    error(str)
+  endif
+  warning(str)
+endif
+
+# *** TIFF ***
+# FIXME: libtiff-4 supports required features by default, so probably there is no need for header and 
function checks
+libtiff_dep = dependency('libtiff-4', required: get_option('tiff'))
+enable_tiff = libtiff_dep.found() and cc.has_header('tiff.h', dependencies: libtiff_dep) and 
cc.has_function('TIFFOpen', dependencies: libtiff_dep) and cc.has_function('TIFFReadRGBAImageOriented', 
dependencies: libtiff_dep)
+if enable_tiff
+  backends += {'tiff': mime_types_list.get('tiff')}
+  evince_mime_types += mime_types_list.get('tiff')
+elif get_option('tiff').auto()
+  warning('Tiff support is disabled since tiff library version 3.6 or newer not found')
+endif
+
+# *** XPS ***
+libgxps_req_version = '>= 0.2.1'
+libgxps_dep = dependency('libgxps', version: libgxps_req_version, required: get_option('xps'))
+enable_xps = libgxps_dep.found()
+if enable_xps
+  backends += {'xps': mime_types_list.get('xps')}
+  evince_mime_types += mime_types_list.get('xps')
+elif get_option('xps').auto()
+  warning('** XPS support is disabled since libgxps (version ' + libgxps_req_version + ') is needed')
+endif
+
+if enable_pdf and enable_ps
+  backends += {
+    'pdf': mime_types_list.get('pdf') + mime_types_list.get('illustrator'),
+    'ps': mime_types_list.get('ps') + mime_types_list.get('illustrator'),
+  }
+  evince_mime_types += mime_types_list.get('illustrator')
+endif
+
+mime_types_conf = configuration_data()
+mime_types_conf.set('EVINCE_MIME_TYPES', ';'.join(evince_mime_types))
+
+subdir('cut-n-paste')
+subdir('libdocument')
+subdir('backend')
+subdir('libview')
+subdir('libmisc')
+subdir('properties')
+
+# *** Document Viewer ***
+enable_viewer = get_option('viewer')
+if enable_viewer
+  subdir('shell')
+endif
+
+subdir('po')
+subdir('help')
+
+# *** Thumbnailer ***
+enable_thumbnailer = get_option('thumbnailer')
+if enable_thumbnailer
+  subdir('thumbnailer')
+endif
+
+# Print Previewer
+enable_previewer = get_option('previewer')
+if enable_previewer
+  subdir('previewer')
+endif
+
+# *** Browser Plugin ***
+enable_browser_plugin = get_option('browser_plugin')
+if enable_browser_plugin
+  browser_plugin_dir = get_option('browser_plugin_dir')
+  if not browser_plugin_dir.startswith('/')
+    browser_plugin_dir = join_paths(ev_libdir, browser_plugin_dir)
+  endif
+
+  subdir('browser-plugin')
+endif
+
+subdir('data')
+
+headers = files(
+  'evince-document.h',
+  'evince-view.h',
+)
+
+install_headers(
+  headers,
+  subdir: ev_include_subdir,
+)
+
+# Appdata files
+appdata = ev_namespace + '.appdata.xml'
+
+custom_target(
+  appdata,
+  input: appdata + '.in',
+  output: appdata,
+  command: intltool_xml_cmd,
+  install: true,
+  install_dir: ev_appstreamdir,
+)
+
+run_target(
+  'ChangeLog',
+  command: [find_program('generate-changelog.sh'), source_root, 'ChangeLog'],
+)
+
+configure_file(
+  output: 'config.h',
+  configuration: config_h,
+)
+
+meson.add_install_script(
+  'meson_post_install.py',
+  join_paths(ev_prefix, ev_datadir),
+)
+
+output = '\n' + meson.project_name() + ' configure summary\n'
+output += '========================\n\n'
+output += 'Platform .................:  ' + ev_platform + '\n'
+output += 'Debug mode ...............:  ' + ev_debug.to_string() + '\n\n\n'
+output += 'FRONTENDS\n\n'
+output += 'Viewer ...................:  ' + enable_viewer.to_string() + '\n'
+output += 'Previewer ................:  ' + enable_previewer.to_string() + '\n'
+output += 'Thumbnailer ..............:  ' + enable_thumbnailer.to_string() + '\n'
+output += 'Nautilus Extensions ......:  ' + enable_nautilus.to_string() + '\n'
+output += 'Browser Plugin ...........:  ' + enable_browser_plugin.to_string() + '\n\n\n'
+output += 'BACKENDS\n\n'
+output += 'Comics ...................:  ' + enable_comics.to_string() + '\n'
+output += 'DJVU .....................:  ' + enable_djvu.to_string() + '\n'
+output += 'DVI ......................:  ' + enable_dvi.to_string() + '\n'
+output += 'PDF ......................:  ' + enable_pdf.to_string() + '\n'
+output += 'PostScript ...............:  ' + enable_ps.to_string() + '\n'
+output += 'TIFF .....................:  ' + enable_tiff.to_string() + '\n'
+output += 'XPS ......................:  ' + enable_xps.to_string() + '\n\n\n'
+output += 'FEATURES\n\n'
+output += 'GTK Doc reference ........:  ' + enable_gtk_doc.to_string() + '\n'
+output += 'GObject Introspection ....:  ' + enable_introspection.to_string() + '\n'
+output += 'DBUS communication .......:  ' + enable_dbus.to_string() + '\n'
+output += 'Keyring integration ......:  ' + enable_keyring.to_string() + '\n'
+output += 'GTK+ Unix Print ..........:  ' + enable_gtk_unix_print.to_string() + '\n'
+output += 'Thumbnail cache ..........:  ' + enable_thumbnail_cache.to_string() + '\n'
+output += 'Multimedia ...............:  ' + enable_multimedia.to_string() + '\n'
+output += 'Spell Checker ............:  ' + enable_gspell.to_string() + '\n'
+output += 'SyncTex ..................:  ' + external_synctex.to_string('external', 'internal')
+message(output)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..7d4740fa
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,29 @@
+option('platform', type: 'combo', choices: ['gnome', 'win32'], value: 'gnome', description: 'for which 
platform to build')
+
+option('viewer', type: 'boolean', value: true, description: 'whether Viewer support is requested')
+option('previewer', type: 'boolean', value: true, description: 'whether Previewer support is requested')
+option('thumbnailer', type: 'boolean', value: true, description: 'whether Thumbnailer support is requested')
+option('browser_plugin', type: 'boolean', value: false, description: 'whether Browser Plugin support is 
requested')
+option('nautilus', type: 'boolean', value: true, description: 'whether Nautilus support is requested')
+
+option('comics', type: 'feature', value: 'auto', description: 'whether Comics support is requested')
+option('djvu', type: 'feature', value: 'auto', description: 'whether DJVU support is requested')
+option('dvi', type: 'feature', value: 'auto', description: 'whether DVI support is requested')
+option('pdf', type: 'feature', value: 'auto', description: 'whether PDF support is requested')
+option('ps', type: 'feature', value: 'disabled', description: 'whether PS support is requested')
+option('tiff', type: 'feature', value: 'auto', description: 'whether TIFF support is requested')
+option('xps', type: 'feature', value: 'auto', description: 'whether XPS support is requested')
+
+option('gtk_doc', type: 'boolean', value: true, description: 'whether GTK Doc reference is requested')
+option('introspection', type: 'boolean', value: true, description: 'whether introspection support is 
requested')
+option('dbus', type: 'boolean', value: true, description: 'whether DBUS support is requested')
+option('keyring', type: 'feature', value: 'auto', description: 'whether keyring support is requested')
+option('gtk_unix_print', type: 'feature', value: 'auto', description: 'whether gtk+-unix-print support is 
requested')
+option('thumbnail_cache', type: 'feature', value: 'auto', description: 'whether GNOME Desktop (Thumbnail 
cache) is requested')
+option('multimedia', type: 'feature', value: 'auto', description: 'whether multimedia support is requested')
+option('gspell', type: 'feature', value: 'auto', description: 'whether gpsell support is requested')
+
+option('t1lib', type: 'feature', value: 'auto', description: 'whether support of t1lib for type1 fonts in 
dvi is requested')
+
+option('browser_plugin_dir', type: 'string', value: 'mozilla/plugins', description: 'custom directory for 
browser plugin')
+option('systemduserunitdir', type: 'string', value: '', description: 'custom directory for systemd user 
units, or \'no\' to disable')
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 00000000..8295580b
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+import sys
+
+if not os.environ.get('DESTDIR'):
+    icondir = os.path.join(sys.argv[1], 'icons', 'hicolor')
+
+    print('Update icon cache...')
+    subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
+
+    schemadir = os.path.join(sys.argv[1], 'glib-2.0', 'schemas')
+    print('Compiling gsettings schemas...')
+    subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..f4f1c436
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(ev_name, preset: 'glib')
diff --git a/previewer/meson.build b/previewer/meson.build
new file mode 100644
index 00000000..c2f87fbc
--- /dev/null
+++ b/previewer/meson.build
@@ -0,0 +1,36 @@
+sources = files(
+  'ev-previewer.c',
+  'ev-previewer-window.c',
+)
+
+resource_data = files(
+  '../data/thumbnail-frame.png',
+  'evince-previewer.css',
+  'previewer-ui.xml',
+)
+
+sources += gnome.compile_resources(
+  'ev-previewer-resources',
+  'previewer.gresource.xml',
+  source_dir: data_dir,
+  c_name: 'ev_previewer',
+  dependencies: resource_data,
+  export: true,
+)
+
+deps = [libevmisc_dep]
+
+if enable_gtk_unix_print
+  deps += gtk_unix_print_dep
+endif
+
+program = 'evince-previewer'
+
+executable(
+  program,
+  sources,
+  include_directories: top_inc,
+  dependencies: deps,
+  link_args: common_ldflags,
+  install: true,
+)
diff --git a/properties/meson.build b/properties/meson.build
new file mode 100644
index 00000000..cd64dde5
--- /dev/null
+++ b/properties/meson.build
@@ -0,0 +1,29 @@
+libevproperties = static_library(
+  'evproperties',
+  sources: 'ev-properties-view.c',
+  include_directories: top_inc,
+  dependencies: libevdocument_dep,
+)
+
+libevproperties_dep = declare_dependency(
+  include_directories: include_directories('.'),
+  dependencies: libevdocument_dep,
+  link_with: libevproperties,
+)
+
+if enable_nautilus
+  deps = [
+    libevdocument_dep,
+    libnautilus_extension_dep,
+  ]
+
+  shared_module(
+    'evince-properties-page',
+    sources: 'ev-properties-main.c',
+    include_directories: top_inc,
+    dependencies: deps,
+    link_with: libevproperties,
+    install: true,
+    install_dir: nautilus_extension_dir,
+  )
+endif
diff --git a/shell/meson.build b/shell/meson.build
new file mode 100644
index 00000000..d2069df5
--- /dev/null
+++ b/shell/meson.build
@@ -0,0 +1,176 @@
+shell_inc = include_directories('.')
+
+sources = files(
+  'ev-annotation-properties-dialog.c',
+  'ev-annotations-toolbar.c',
+  'ev-application.c',
+  'ev-bookmark-action.c',
+  'ev-bookmarks.c',
+  'ev-file-monitor.c',
+  'ev-find-sidebar.c',
+  'ev-history.c',
+  'ev-keyring.c',
+  'ev-loading-message.c',
+  'ev-message-area.c',
+  'ev-metadata.c',
+  'ev-password-view.c',
+  'ev-progress-message-area.c',
+  'ev-properties-dialog.c',
+  'ev-properties-fonts.c',
+  'ev-properties-license.c',
+  'ev-recent-view.c',
+  'ev-toolbar.c',
+  'ev-utils.c',
+  'ev-window.c',
+  'ev-window-title.c',
+  'ev-sidebar-annotations.c',
+  'ev-sidebar-attachments.c',
+  'ev-sidebar-bookmarks.c',
+  'ev-sidebar.c',
+  'ev-sidebar-layers.c',
+  'ev-sidebar-links.c',
+  'ev-sidebar-page.c',
+  'ev-sidebar-thumbnails.c',
+  'ev-zoom-action.c',
+)
+
+evince_css = (gtk_dep.version().version_compare('>= 3.20.0') ? 'evince.css' : 'evince-3.18.css')
+
+resource_data = files(
+  evince_css,
+  '../data/thumbnail-frame.png',
+  'evince-menus.ui',
+  'help-overlay.ui',
+)
+
+resource_conf = configuration_data()
+resource_conf.set('EVINCE_CSS',  evince_css)
+
+resource = 'evince.gresource.xml'
+
+resource_xml = configure_file(
+  input: resource + '.in',
+  output: resource,
+  configuration: resource_conf,
+)
+
+sources += gnome.compile_resources(
+  'ev-resources',
+  resource_xml,
+  source_dir: data_dir,
+  c_name: ev_code_prefix.to_lower(),
+  dependencies: resource_data,
+  export: true,
+)
+
+deps = [
+  gdk_pixbuf_dep,
+  gnome_desktop_dep,
+  libevmisc_dep,
+  libevproperties_dep,
+  libgd_dep,
+  libgimpcellrenderertoggle_dep,
+  m_dep,
+]
+
+cflags = [
+  '-DBINDIR="@0@"'.format(join_paths(ev_prefix, ev_bindir)),
+  '-DGNOMEDATADIR="@0@"'.format(join_paths(ev_prefix, ev_datadir)),
+  '-DEVINCE_COMPILATION',
+  '-DGDK_MULTIHEAD_SAFE',
+  '-DGTK_MULTIHEAD_SAFE',
+]
+
+ldflags = common_ldflags
+
+if ev_platform == 'win32'
+  resource = 'evince-icon.o'
+
+  ldflag += custom_target(
+    resource,
+    input: 'evince-icon.rc',
+    output: resource,
+    command: [find_program('windres'), '@INPUT@', '-I', data_dir, '@OUTPUT@'],
+  )
+else
+  deps += adwaita_icon_theme_dep
+endif
+
+if enable_dbus
+  sources += files('ev-media-player-keys.c')
+
+  gdbus = 'ev-gdbus'
+
+  sources += gnome.gdbus_codegen(
+    gdbus + '-generated',
+    gdbus + '.xml',
+    interface_prefix: ev_namespace,
+    namespace: ev_code_prefix,
+    object_manager: true,
+    autocleanup: 'objects',
+  )
+endif
+
+if enable_keyring
+  deps += libsecret_dep
+endif
+
+libshell = shared_library(
+  'shell' + ev_major_version.to_string(),
+  version: ev_view_version,
+  sources: sources,
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: cflags,
+)
+
+libshell_dep = declare_dependency(
+  include_directories: shell_inc,
+  link_with: libshell,
+)
+
+executable(
+  'evince',
+  'main.c',
+  include_directories: top_inc,
+  dependencies: deps,
+  c_args: cflags,
+  objects: libshell.extract_all_objects(),
+  link_args: ldflags,
+  install: true,
+)
+
+if enable_dbus
+  sources = files('ev-daemon.c')
+
+  gdbus = 'ev-daemon-gdbus'
+
+  sources += gnome.gdbus_codegen(
+    gdbus + '-generated',
+    gdbus + '.xml',
+    interface_prefix: ev_namespace,
+    namespace: ev_code_prefix,
+    object_manager: true,
+    autocleanup: 'objects',
+  )
+
+  deps = [
+    gio_dep,
+    gio_unix_dep,
+  ]
+
+  cflags = [
+    '-DBINDIR="@0@"'.format(join_paths(ev_prefix, ev_bindir)),
+    '-DEVINCE_COMPILATION',
+  ]
+
+  executable(
+    'evinced',
+    sources,
+    include_directories: top_inc,
+    dependencies: deps,
+    c_args: cflags,
+    install: true,
+    install_dir: ev_libexecdir,
+  )
+endif
diff --git a/thumbnailer/meson.build b/thumbnailer/meson.build
new file mode 100644
index 00000000..12d8ecd8
--- /dev/null
+++ b/thumbnailer/meson.build
@@ -0,0 +1,20 @@
+input = 'evince.thumbnailer'
+
+configure_file(
+  input: input + '.in',
+  output: input,
+  configuration: mime_types_conf,
+  install: true,
+  install_dir: join_paths(ev_datadir, 'thumbnailers'),
+)
+
+program = 'evince-thumbnailer'
+
+executable(
+  program,
+  program + '.c',
+  include_directories: top_inc,
+  dependencies: libevdocument_dep,
+  link_args: common_ldflags,
+  install: true,
+)


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