[gnome-documents/wip/inigomartinez/meson: 2/3] build: Port to meson build system



commit ecb9c068df9824091a00ded5d0ed5d9d55f489eb
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Wed Aug 30 13:24:29 2017 +0200

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

 Makefile.am                 |    6 +-
 data/Makefile.am            |    3 +-
 data/icons/Makefile.am      |    1 +
 data/icons/meson.build      |   30 +++++++
 data/meson.build            |  105 ++++++++++++++++++++++++
 getting-started/Makefile.am |    2 +
 getting-started/meson.build |   36 ++++++++
 help/Makefile.am            |    2 +
 help/meson.build            |   63 +++++++++++++++
 man/Makefile.am             |    4 +-
 man/meson.build             |   33 ++++++++
 meson.build                 |  184 ++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt           |    2 +
 meson_post_install.py       |   45 ++++++++++
 po/meson.build              |    1 +
 src/Makefile.am             |    3 +-
 src/meson.build             |  186 +++++++++++++++++++++++++++++++++++++++++++
 17 files changed, 702 insertions(+), 4 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 4c1a97c..645029c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,11 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-getting-started
 EXTRA_DIST = \
     autogen.sh \
     COPYING \
-    NEWS
+    NEWS \
+    meson.build \
+    meson_options.txt \
+    meson_post_install.py \
+    po/meson.build
 
 stale-files-clean-local:
        -$(RM) $(abs_top_builddir)/*.la $(abs_top_builddir)/*.gir $(abs_top_builddir)/*.typelib
diff --git a/data/Makefile.am b/data/Makefile.am
index f4ef544..35f4b8c 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -67,7 +67,8 @@ EXTRA_DIST= \
     $(searchprovider_DATA) \
     $(gsettings_SCHEMAS) \
     org.gnome.Documents.data.gresource.xml \
-    org.gnome.Books.data.gresource.xml
+    org.gnome.Books.data.gresource.xml \
+    meson.build
 
 CLEANFILES = \
     org.gnome.Documents.data.gresource \
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index c65f001..f19990f 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -32,6 +32,7 @@ noinst_DATA = \
 EXTRA_DIST = \
        $(public_icons)         \
        $(noinst_DATA)          \
+       meson.build             \
        $(NULL)
 
 ###############################################################################
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..be0003f
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,30 @@
+names = [
+  'org.gnome.Books',
+  'org.gnome.Documents'
+]
+
+icon_sizes = [
+  '16x16',
+  '22x22',
+  '24x24',
+  '32x32',
+  '48x48',
+  '256x256',
+  '512x512'
+]
+
+foreach icon_size: icon_sizes
+  foreach name: names
+    install_data(
+      '_'.join(['hicolor', 'apps', icon_size, name + '.png']),
+      install_dir: join_paths(documents_icondir, 'hicolor', icon_size, 'apps')
+    )
+  endforeach
+endforeach
+
+foreach name: names
+  install_data(
+    '_'.join(['hicolor', 'apps', 'scalable', name + '-symbolic.svg']),
+    install_dir: join_paths(documents_icondir, 'hicolor', 'scalable', 'apps')
+  )
+endforeach
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..25cfc8c
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,105 @@
+subdir('icons')
+
+# FIXME: this is a workaround for libgd source location
+libgd_src_path = join_paths(meson.source_root(), 'subprojects', 'libgd', 'libgd')
+
+enum_headers = files(
+  join_paths(libgd_src_path, 'gd-main-view.h'),
+  join_paths(libgd_src_path, 'gd-main-view-generic.h')
+)
+
+gnome.mkenums(
+  'org.gnome.Documents.enums.xml',
+  sources: enum_headers,
+  comments: '<!-- @comment@ -->',
+  fhead: '<schemalist>',
+  vhead: '  <@type@ id="org.gnome.Documents.@EnumName@">',
+  vprod: '    <value nick="@valuenick@" value="@valuenum@"/>',
+  vtail: '  </@type@>',
+  ftail: '</schemalist>',
+  install_header: true,
+  install_dir: documents_schemadir
+)
+
+resource_data = files(
+  'application.css',
+  'media/dnd-counter.svg',
+  'media/thumbnail-frame.png',
+  'ui/app-menu.ui',
+  'ui/app-menu.ui',
+  'ui/help-overlay.ui',
+  'ui/help-overlay.ui',
+  'ui/organize-collection-dialog.ui',
+  'ui/preview-context-menu.ui',
+  'ui/preview-menu.ui',
+  'ui/selection-menu.ui',
+  'ui/selection-toolbar.ui',
+  'ui/view-menu.ui'
+)
+
+resources = [
+  'org.gnome.Books.data',
+  'org.gnome.Documents.data'
+]
+
+foreach resource: resources
+  sources += gnome.compile_resources(
+    resource,
+    resource + '.gresource.xml',
+    source_dir: '.',
+    dependencies: resource_data,
+    gresource_bundle: true,
+    install: true,
+    install_dir: documents_pkgdatadir
+  )
+endforeach
+
+info_names = [
+  ['org.gnome.Books.appdata.xml.in', 'org.gnome.Books.metainfo.xml'],
+  ['org.gnome.Documents.appdata.xml.in', 'org.gnome.Documents.metainfo.xml']
+]
+
+foreach info_name: info_names
+  i18n.merge_file(
+    info_name[1],
+    input: info_name[0],
+    output: info_name[1],
+    po_dir: po_dir,
+    install: true,
+    install_dir: join_paths(documents_datadir, 'metainfo')
+  )
+endforeach
+
+desktop_file_validate = find_program('desktop-file-validate')
+
+desktops = [
+  'org.gnome.Books.desktop',
+  'org.gnome.Documents.desktop'
+]
+
+foreach desktop: desktops
+  desktop_file = i18n.merge_file(
+    desktop,
+    type: 'desktop',
+    input: desktop + '.in',
+    output: desktop,
+    po_dir: po_dir,
+    install: true,
+    install_dir: documents_desktopdir
+  )
+endforeach
+
+install_data(
+  'org.gnome.Documents.search-provider.ini',
+  install_dir: join_paths(documents_datadir, 'gnome-shell', 'search-providers')
+)
+
+schemas = files(
+  'org.gnome.books.gschema.xml',
+  'org.gnome.documents.gschema.xml'
+)
+
+install_data(
+  schemas,
+  install_dir: documents_schemadir
+)
diff --git a/getting-started/Makefile.am b/getting-started/Makefile.am
index 5d401ad..ee29935 100644
--- a/getting-started/Makefile.am
+++ b/getting-started/Makefile.am
@@ -11,4 +11,6 @@ HELP_FILES = \
        learn-more.svg \
        $(NULL)
 
+EXTRA_DIST = meson.build
+
 -include $(top_srcdir)/git.mk
diff --git a/getting-started/meson.build b/getting-started/meson.build
new file mode 100644
index 0000000..4cb4fe7
--- /dev/null
+++ b/getting-started/meson.build
@@ -0,0 +1,36 @@
+pdfunite = find_program('pdfunite')
+inkscape = find_program('inkscape')
+
+sources = [
+  'landing',
+  'goa',
+  'bookmarking',
+  'scrubbing',
+  'editing',
+  'learn-more'
+]
+
+linguas = ['C']
+
+output = 'gnome-documents-getting-started.pdf'
+
+foreach lingua: linguas
+  files = []
+  foreach source: sources
+    files += custom_target(
+      source,
+      input: join_paths(lingua, source + '.svg'),
+      output: source + '.pdf',
+      command: [inkscape, '-z', '-A', '@OUTPUT@', '@INPUT@']
+    )
+  endforeach
+
+  custom_target(
+    output,
+    input: files,
+    output: output,
+    command: [pdfunite, '@INPUT@', '@OUTPUT@'],
+    install: true,
+    install_dir: join_paths(documents_pkgdatadir, 'getting-started', lingua)
+  )
+endforeach
diff --git a/help/Makefile.am b/help/Makefile.am
index eb63948..a2a1ed1 100644
--- a/help/Makefile.am
+++ b/help/Makefile.am
@@ -23,4 +23,6 @@ HELP_MEDIA = \
 
 HELP_LINGUAS = as ca cs de el fi fr es gl gu hi hu id it ja kn ko lv mr nl pa pl pt_BR ru sl sr sr@latin sv 
te vi ta zh_CN
 
+EXTRA_DIST = meson.build
+
 -include $(top_srcdir)/git.mk
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..f508ed9
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,63 @@
+sources = [
+  'legal.xml',
+  'collections.page',
+  'filter.page',
+  'formats.page',
+  'index.page',
+  'info.page',
+  'print.page',
+  'prob-no-show.page',
+  'prob-previews.page',
+  'search.page',
+  'viewgrid.page',
+  'view.page',
+  'view-add.page'
+]
+
+media = [
+  'media/go-down.png',
+  'media/icon_gnome-documents.png'
+]
+
+linguas = [
+  'as',
+  'ca',
+  'cs',
+  'de',
+  'el',
+  'fi',
+  'fr',
+  'es',
+  'gl',
+  'gu',
+  'hi',
+  'hu',
+  'id',
+  'it',
+  'ja',
+  'kn',
+  'ko',
+  'lv',
+  'mr',
+  'nl',
+  'pa',
+  'pl',
+  'pt_BR',
+  'ru',
+  'sl',
+  'sr',
+  'sr@latin',
+  'sv',
+  'te',
+  'vi',
+  'ta',
+  'zh_CN'
+]
+
+gnome.yelp(
+  meson.project_name(),
+  sources: sources,
+  media: media,
+  symlink_media: true,
+  languages: linguas
+)
diff --git a/man/Makefile.am b/man/Makefile.am
index 3a63e63..fc7ecb3 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -15,7 +15,9 @@ man_MANS = \
 
 xml_files = $(man_MANS:.1=.xml)
 
-EXTRA_DIST = $(xml_files)
+EXTRA_DIST = \
+       $(xml_files) \
+       meson.build
 
 DISTCLEANFILES = $(man_MANS)
 
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 0000000..5ff5224
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,33 @@
+xsltproc = find_program('xsltproc', required: false)
+assert(xsltproc.found(), 'xsltproc is required to build documentation')
+
+xsltproc_cmd = [
+  xsltproc,
+  '--output', '@OUTPUT@',
+  '--nonet',
+  '--stringparam', 'man.output.quietly', '1',
+  '--stringparam', 'funcsynopsis.style', 'ansi',
+  '--stringparam', 'man.th.extra1.suppress', '1',
+  '--stringparam', 'man.authors.section.enabled', '0',
+  '--stringparam', 'man.copyright.section.enabled', '0',
+  'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
+  '@INPUT@'
+]
+
+mans = [
+  'gnome-documents',
+  'gnome-books'
+]
+
+foreach man: mans
+  output = man + '.1'
+
+  custom_target(
+    output,
+    input: man + '.xml',
+    output: output,
+    command: xsltproc_cmd,
+    install: true,
+    install_dir: join_paths(documents_mandir, 'man1')
+  )
+endforeach
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..60cbe7d
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,184 @@
+project(
+  'gnome-documents', 'c',
+  version: '3.26.0',
+  license: 'GPL2+',
+  default_options: [
+    'buildtype=debugoptimized',
+    'warning_level=1'
+  ],
+  meson_version: '>= 0.42.0'
+)
+
+documents_version = meson.project_version()
+
+documents_api_version = '1.0'
+documents_gir_version = '1.0'
+
+documents_prefix = get_option('prefix')
+documents_bindir = join_paths(documents_prefix, get_option('bindir'))
+documents_datadir = join_paths(documents_prefix, get_option('datadir'))
+documents_libdir = join_paths(documents_prefix, get_option('libdir'))
+documents_mandir = join_paths(documents_prefix, get_option('mandir'))
+
+documents_pkgdatadir = join_paths(documents_datadir, meson.project_name())
+documents_pkglibdir = join_paths(documents_libdir, meson.project_name())
+
+documents_desktopdir = join_paths(documents_datadir, 'applications')
+documents_icondir = join_paths(documents_datadir, 'icons')
+documents_schemadir = join_paths(documents_datadir, 'glib-2.0', 'schemas')
+
+documents_debug = get_option('buildtype').contains('debug')
+
+cc = meson.get_compiler('c')
+
+config_h = configuration_data()
+
+# defines
+set_defines = [
+  # package
+  ['PACKAGE', meson.project_name()],
+  ['PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=' + meson.project_name()],
+  ['PACKAGE_NAME', meson.project_name()],
+  ['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), documents_version)],
+  ['PACKAGE_TARNAME', meson.project_name()],
+  ['PACKAGE_URL', 'https://wiki.gnome.org/Apps/Documents'],
+  ['PACKAGE_VERSION', documents_version],
+  ['VERSION', documents_version],
+  # i18n
+  ['GETTEXT_PACKAGE', meson.project_name()]
+]
+
+foreach define: set_defines
+  config_h.set_quoted(define[0], define[1])
+endforeach
+
+# debug options
+config_h.set('NDEBUG', not documents_debug)
+
+# headers
+check_headers = [
+  ['HAVE_DLFCN_H', 'dlfcn.h'],
+  ['HAVE_INTTYPES_H', 'inttypes.h'],
+  ['HAVE_MEMORY_H', 'memory.h'],
+  ['HAVE_STDINT_H', 'stdint.h'],
+  ['HAVE_STDLIB_H', 'stdlib.h'],
+  ['HAVE_STRINGS_H', 'strings.h'],
+  ['HAVE_STRING_H', 'string.h'],
+  ['HAVE_SYS_STAT_H', 'sys/stat.h'],
+  ['HAVE_SYS_TYPES_H', 'sys/types.h'],
+  ['HAVE_UNISTD_H', 'unistd.h']
+]
+
+foreach header: check_headers
+  config_h.set(header[0], cc.has_header(header[1]))
+endforeach
+
+# functions
+check_functions = [
+  # i18n
+  ['HAVE_DCGETTEXT', 'dcgettext'],
+  ['HAVE_GETTEXT', 'gettext'],
+  ['HAVE_ICONV', 'iconv']
+]
+
+if host_machine.system().contains('darwin')
+  check_functions += [
+    ['HAVE_CFLOCALECOPYCURRENT', 'CFLocaleCopyCurrent'],
+    ['HAVE_CFPREFERENCESCOPYAPPVALUE', 'CFPreferencesCopyAppValue']
+  ]
+endif
+
+foreach func: check_functions
+  config_h.set(func[0], cc.has_function(func[1]))
+endforeach
+
+# compiler flags
+add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
+
+evince_req_version = '>= 3.13.3'
+tracker_req_version = '>= 0.17.3'
+
+gjs_dep = dependency('gjs-1.0', version: '>= 1.48.0')
+gjs_console = gjs_dep.get_pkgconfig_variable('gjs_console')
+
+documents_deps = [
+  gjs_dep,
+  dependency('evince-document-3.0', version: evince_req_version),
+  dependency('evince-view-3.0', version: evince_req_version),
+  dependency('glib-2.0', version: '>= 2.39.3'),
+  dependency('gnome-desktop-3.0'),
+  dependency('gobject-introspection-1.0', version: '>= 1.31.6'),
+  dependency('gtk+-3.0', version: '>= 3.22.15'),
+  dependency('libsoup-2.4', version: '>= 2.41.3'),
+  dependency('tracker-control-2.0', version: tracker_req_version),
+  dependency('tracker-sparql-2.0', version: tracker_req_version),
+  dependency('webkit2gtk-4.0', version: '>= 2.6.0'),
+  cc.find_library('m')
+]
+
+# we just check their existence for gir
+dependency('libgdata')
+dependency('goa-1.0')
+dependency('zapojit-0.0')
+
+# 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.
+config_h.set(
+  'HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE',
+  cc.has_function('cairo_surface_set_device_scale', dependencies: documents_deps)
+)
+
+libgd = subproject(
+  'libgd',
+  default_options: [
+    'pkgdatadir=' + documents_pkgdatadir,
+    'pkglibdir=' + documents_pkglibdir,
+    'static=false',
+    'with-gtk-hacks=true',
+    'with-introspection=true',
+    'with-main-view=true',
+    'with-notification=true',
+    'with-tagged-entry=true',
+    'with-view-common=true'
+  ]
+)
+documents_deps += libgd.get_variable('libgd_dep')
+
+configure_file(
+  output: 'config.h',
+  configuration: config_h
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+pkg = import('pkgconfig')
+
+po_dir = join_paths(meson.source_root(), 'po')
+
+top_inc = include_directories('.')
+
+subdir('help')
+subdir('src')
+subdir('data')
+subdir('po')
+
+if get_option('enable-documentation')
+  subdir('man')
+endif
+
+if get_option('enable-getting-started')
+  subdir('getting-started')
+endif
+
+meson.add_install_script(
+  'meson_post_install.py',
+  documents_datadir,
+  documents_bindir
+)
+
+output = '\n        ' + meson.project_name() + ' ' + documents_version + '\n'
+output += '        ==================\n\n'
+output += '        prefix:    ' + documents_prefix + '\n'
+output += '        compiler:  ' + cc.get_id() + '\n'
+message(output)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..00dd571
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,2 @@
+option('enable-documentation', type: 'boolean', value: false, description: 'build documentation')
+option('enable-getting-started', type: 'boolean', value: false, description: 'build getting started PDFs')
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..264ebf0
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+
+import glob
+import os
+import re
+import subprocess
+import sys
+
+if not os.environ.get('DESTDIR'):
+  # FIXME: meson will not track the creation of these files
+  apps = [
+    ['org.gnome.Books', 'gnome-books'],
+    ['org.gnome.Documents', 'gnome-documents']
+  ]
+
+  bindir = sys.argv[2]
+  if not os.path.exists(bindir):
+    os.makedirs(bindir)
+
+  for app in apps:
+    src = os.path.join(sys.argv[1], 'gnome-documents', app[0])
+    dest = os.path.join(bindir, app[1])
+    subprocess.call(['ln', '-s', '-f', src, dest])
+
+  icondir = os.path.join(sys.argv[1], 'icons', 'hicolor')
+
+  name_pattern = re.compile('hicolor_(?:apps)_(?:\d+x\d+|scalable)_(.*)')
+  search_pattern = '/**/hicolor_*'
+
+  [os.rename(file, os.path.join(os.path.dirname(file), name_pattern.search(file).group(1)))
+   for file in glob.glob(icondir + search_pattern, recursive=True)]
+
+  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])
+
+  search_pattern = '/*.desktop'
+
+  desktopdir = os.path.join(sys.argv[1], 'applications')
+  print('Validate desktop files...')
+  [subprocess.call(['desktop-file-validate', file])
+   for file in glob.glob(desktopdir + search_pattern, recursive=False)]
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..e9b77d7
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(meson.project_name(), preset: 'glib')
diff --git a/src/Makefile.am b/src/Makefile.am
index 974ac9b..6ff460e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -75,7 +75,8 @@ EXTRA_DIST += \
     $(documents_app_resource_files) \
     $(books_app_resource_files) \
     org.gnome.Documents.src.gresource.xml \
-    org.gnome.Books.src.gresource.xml
+    org.gnome.Books.src.gresource.xml \
+    meson.build
 
 gir_DATA += $(INTROSPECTION_GIRS)
 typelib_DATA += $(gir_DATA:.gir=.typelib)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..27380c7
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,186 @@
+# FIXME: are config.js and path.js (missing) not needed anymore?
+'''
+js_conf = configuration_data()
+js_conf.set('PACKAGE_NAME', meson.project_name())
+js_conf.set('PACKAGE_VERSION', documents_version)
+js_conf.set('GETTEXT_PACKAGE', meson.project_name())
+
+js = 'config.js'
+
+configure_file(
+  input: js + '.in',
+  output: js,
+  configuration: js_conf
+)
+'''
+
+service_conf = configuration_data()
+service_conf.set('bindir', documents_bindir)
+
+services = [
+  'org.gnome.Books.service',
+  'org.gnome.Documents.service'
+]
+
+foreach service: services
+  configure_file(
+    input: service + '.in',
+    output: service,
+    install: true,
+    install_dir: join_paths(documents_datadir, 'dbus-1', 'services'),
+    configuration: service_conf
+  )
+endforeach
+
+app_conf = configuration_data()
+app_conf.set('prefix', documents_prefix)
+app_conf.set('libdir', documents_libdir)
+app_conf.set('PACKAGE_VERSION', documents_version)
+app_conf.set('GJS', gjs_console)
+
+apps = [
+  'org.gnome.Books',
+  'org.gnome.Documents'
+]
+
+foreach app: apps
+  configure_file(
+    input: app + '.in',
+    output: app,
+    install: true,
+    install_dir: documents_pkgdatadir,
+    configuration: app_conf
+  )
+endforeach
+
+headers = files(
+  'lib/gd-bookmark.h',
+  'lib/gd-bookmarks.h',
+  'lib/gd-display-preview.h',
+  'lib/gd-metadata.h',
+  'lib/gd-nav-bar.h',
+  'lib/gd-pdf-loader.h',
+  'lib/gd-places-bookmarks.h',
+  'lib/gd-places-links.h',
+  'lib/gd-places-page.h',
+  'lib/gd-utils.h'
+)
+
+sources = files(
+  'lib/gd-bookmark.c',
+  'lib/gd-bookmarks.c',
+  'lib/gd-display-preview.c',
+  'lib/gd-metadata.c',
+  'lib/gd-nav-bar.c',
+  'lib/gd-pdf-loader.c',
+  'lib/gd-places-bookmarks.c',
+  'lib/gd-places-links.c',
+  'lib/gd-places-page.c',
+  'lib/gd-utils.c',
+)
+
+resource_data = files(
+  'application.js',
+  'changeMonitor.js',
+  'documents.js',
+  'edit.js',
+  'embed.js',
+  'epubview.js',
+  'errorBox.js',
+  'evinceview.js',
+  'fullscreenAction.js',
+  'lokview.js',
+  'main.js',
+  'mainToolbar.js',
+  'mainWindow.js',
+  'manager.js',
+  'miners.js',
+  'notifications.js',
+  'overview.js',
+  'password.js',
+  'places.js',
+  'presentation.js',
+  'preview.js',
+  'properties.js',
+  'query.js',
+  'searchbar.js',
+  'search.js',
+  'selections.js',
+  'sharing.js',
+  'shellSearchProvider.js',
+  'testentry.js',
+  'trackerController.js',
+  'trackerUtils.js',
+  'utils.js',
+  'windowMode.js'
+)
+
+resources = [
+  'org.gnome.Books.src',
+  'org.gnome.Documents.src'
+]
+
+foreach resource: resources
+  sources += gnome.compile_resources(
+    resource,
+    resource + '.gresource.xml',
+    source_dir: '.',
+    dependencies: resource_data,
+    gresource_bundle: true,
+    install: true,
+    install_dir: documents_pkgdatadir
+  )
+endforeach
+
+incs = [
+  top_inc,
+  include_directories('lib')
+]
+
+cflags = [
+  '-DPREFIX="@0@"'.format(documents_prefix),
+  '-DLIBDIR="@0@"'.format(documents_libdir),
+  '-DG_LOG_DOMAIN="Gdprivate"',
+  '-DG_DISABLE_DEPRECATED'
+]
+
+libgdprivate = shared_library(
+  'gdprivate-' + documents_api_version,
+  sources: sources,
+  include_directories: incs,
+  dependencies: documents_deps,
+  c_args: cflags,
+  install: true,
+  install_dir: documents_pkglibdir
+)
+
+gir_sources = sources + headers
+
+gir_incs = [
+  'GData-0.0',
+  'GnomeDesktop-3.0',
+  'Goa-1.0',
+  'Gtk-3.0',
+  'EvinceDocument-3.0',
+  'EvinceView-3.0',
+  'Zpj-0.0'
+]
+
+gir_extra_args = '--warn-all'
+
+gir_dir = join_paths(documents_pkgdatadir, 'gir-' + documents_gir_version)
+typelib_dir = join_paths(documents_pkglibdir, 'girepository-' + documents_gir_version)
+
+gnome.generate_gir(
+  libgdprivate,
+  sources: gir_sources,
+  nsversion: documents_api_version,
+  namespace: 'GdPrivate',
+  identifier_prefix: 'Gd',
+  symbol_prefix: 'gd',
+  includes: gir_incs,
+  install: true,
+  install_dir_gir: gir_dir,
+  install_dir_typelib: typelib_dir,
+  extra_args: gir_extra_args
+)
diff --git a/src/org.gnome.Books.in b/src/org.gnome.Books.in
old mode 100644
new mode 100755
diff --git a/src/org.gnome.Documents.in b/src/org.gnome.Documents.in
old mode 100644
new mode 100755


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