[gnome-contacts] Ported the build system to Meson.



commit 0993447834343e21f9285be2fa1d6a6ca96fcf53
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Fri Jun 30 13:04:06 2017 +0200

    Ported the build system to Meson.
    
    For this cycle, we will still support autotools. This is not guaranteed
    however for 3.27 and later.

 Makefile.am                        |    2 +
 data/meson.build                   |   54 +++++++++++++++++
 data/org.gnome.Contacts.service.in |    3 +
 man/meson.build                    |   21 +++++++
 meson.build                        |   66 +++++++++++++++++++++
 meson_options.txt                  |    2 +
 po/meson.build                     |    3 +
 src/meson.build                    |  111 ++++++++++++++++++++++++++++++++++++
 8 files changed, 262 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 2ce26b7..5161e83 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,6 +8,8 @@ DIST_SUBDIRS = vapi src data po man
 
 EXTRA_DIST = \
        autogen.sh \
+       **/meson.build \
+       meson_options.txt \
        $(NULL)
 
 ChangeLog:
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..a117a02
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,54 @@
+# The resources (NOTE: needed by e.g. src/)
+resource_files = files('contacts.gresource.xml')
+resources = gnome.compile_resources('org.gnome.Contacts', resource_files,
+  c_name: 'resources'
+)
+
+# The icons
+iconsdir = join_paths(get_option('datadir'), 'icons', 'hicolor')
+foreach size: ['16x16', '22x22', '32x32', '48x48', '512x512', 'symbolic']
+  install_subdir('icons/hicolor/' + size, install_dir: iconsdir)
+endforeach
+
+# The desktop file
+i18n.merge_file(
+  input: 'org.gnome.Contacts.desktop.in',
+  output: 'org.gnome.Contacts.desktop',
+  type: 'desktop',
+  po_dir: po_dir,
+  install: true,
+  install_dir: join_paths(get_option('datadir'), 'applications')
+)
+
+# The appdata file
+i18n.merge_file(
+  input: 'org.gnome.Contacts.appdata.xml.in',
+  output: 'org.gnome.Contacts.appdata.xml',
+  type: 'xml',
+  po_dir: po_dir,
+  install: true,
+  install_dir: join_paths(get_option('datadir'), 'metainfo')
+)
+
+# DBus service files
+service_config = configuration_data()
+service_config.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
+service_config.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
+
+# The DBUS service file of the app
+configure_file(
+  input: 'org.gnome.Contacts.service.in',
+  output: 'org.gnome.Contacts.service',
+  configuration: service_config,
+  install: true,
+  install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services'),
+)
+
+# The DBUS service file of the search provider
+configure_file(
+  input: 'org.gnome.Contacts.SearchProvider.service.in',
+  output: 'org.gnome.Contacts.SearchProvider.service',
+  configuration: service_config,
+  install: true,
+  install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services'),
+)
diff --git a/data/org.gnome.Contacts.service.in b/data/org.gnome.Contacts.service.in
new file mode 100644
index 0000000..1effe62
--- /dev/null
+++ b/data/org.gnome.Contacts.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Contacts
+Exec=@bindir@/gnome-contacts --gapplication-service
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 0000000..2912cca
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,21 @@
+if get_option('with-manpage')
+  xsltproc = find_program('xsltproc')
+  custom_target('manfile-gnome-contacts',
+    input: 'gnome-contacts.xml',
+    output: 'gnome-contacts.1',
+    install: true,
+    install_dir: join_paths(get_option('mandir'), 'man1'),
+    command: [
+      xsltproc,
+      '--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',
+      '-o', '@OUTPUT@',
+      'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
+      '@INPUT@'
+    ]
+  )
+endif
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..ae31d19
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,66 @@
+project('gnome-contacts', [ 'vala', 'c' ],
+  version: '3.22.1',
+  license: 'GPL2+',
+  meson_version: '>= 0.37',
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+
+# Add our custom VAPI dir
+add_project_arguments(
+  ['--vapidir', join_paths(meson.source_root(), 'vapi')],
+  language: 'vala'
+)
+
+# Some variables
+config_h_dir = include_directories('.')
+locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
+pkgdatadir = join_paths(get_option('datadir'), meson.project_name())
+pkglibdir = join_paths(get_option('libdir'), meson.project_name())
+po_dir = join_paths(meson.source_root(), 'po')
+
+# Dependencies
+champlain = dependency('champlain-0.12')
+clutter_gtk = dependency('clutter-gtk-1.0')
+folks = dependency('folks', version: '>= 0.9.5')
+folks_eds = dependency('folks-eds')
+folks_telepathy = dependency('folks-telepathy')
+gee = dependency('gee-0.8')
+geocode_glib = dependency('geocode-glib-1.0', version: '>= 3.15.3')
+gio_unix = dependency('gio-unix-2.0')
+glib = dependency('glib-2.0', version: '>= 2.44.0')
+gmodule_export = dependency('gmodule-export-2.0')
+gnome_desktop = dependency('gnome-desktop-3.0')
+goa = dependency('goa-1.0')
+gtk = dependency('gtk+-3.0', version: '>= 3.22.0')
+libebook = dependency('libebook-1.2', version: '>= 3.13.90')
+libedataserver = dependency('libedataserver-1.2', version: '>= 3.13.90')
+telepathy_glib = dependency('telepathy-glib', version: '>= 0.22.0')
+
+if get_option('with-cheese')
+  cheese = dependency('cheese')
+  cheese_gtk = dependency('cheese-gtk', version: '>= 3.3.91')
+endif
+
+# Libraries
+cc = meson.get_compiler('c')
+libedataserverui = cc.find_library('libedataserverui-1.2', version: '>= 3.13.90')
+math = cc.find_library('m')
+
+# Configuration
+conf = configuration_data()
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+conf.set_quoted('LOCALEDIR', locale_dir)
+conf.set_quoted('PACKAGE_NAME', meson.project_name())
+conf.set_quoted('PACKAGE_STRING', meson.project_name())
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+conf.set_quoted('PKGDATADIR', pkgdatadir)
+conf.set_quoted('PKGLIBDIR', pkglibdir)
+conf.set_quoted('VERSION', meson.project_version())
+configure_file(output: 'config.h', configuration: conf)
+
+subdir('data')
+subdir('po')
+subdir('src')
+subdir('man')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..d8d3bf2
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,2 @@
+option('with-cheese', type: 'boolean', value: true, description: 'enable cheese webcam support')
+option('with-manpage', type: 'boolean', value: true, description: 'enable building man pages')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..f904cde
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext(meson.project_name(),
+  preset: 'glib'
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..98d0756
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,111 @@
+compiled = gnome.compile_schemas()
+install_data('org.gnome.Contacts.gschema.xml',
+  install_dir: 'share/glib-2.0/schemas'
+)
+
+contacts_vala_sources = [
+  'contacts-accounts-list.vala',
+  'contacts-address-map.vala',
+  'contacts-app.vala',
+  'contacts-avatar-dialog.vala',
+  'contacts-contact-editor.vala',
+  'contacts-contact-frame.vala',
+  'contacts-contact-pane.vala',
+  'contacts-contact-sheet.vala',
+  'contacts-contact.vala',
+  'contacts-in-app-notification.vala',
+  'contacts-linked-accounts-dialog.vala',
+  'contacts-linking.vala',
+  'contacts-list-pane.vala',
+  'contacts-settings.vala',
+  'contacts-store.vala',
+  'contacts-types.vala',
+  'contacts-utils.vala',
+  'contacts-view.vala',
+  'contacts-window.vala',
+  'main.vala',
+]
+
+contacts_vala_args = [
+  '--target-glib=2.38',
+  '--pkg', 'config',
+  '--pkg', 'custom',
+]
+
+contacts_c_sources = [
+  'cc-crop-area.c',
+  'contacts-esd-setup.c',
+]
+
+contacts_c_args = [
+  '-include', 'config.h',
+  '-DGNOME_DESKTOP_USE_UNSTABLE_API',
+  '-DLOCALEDIR="@0@"'.format(locale_dir),
+]
+
+contacts_sources = [
+  contacts_c_sources,
+  contacts_vala_sources,
+  resources,
+]
+
+contacts_deps = [
+  champlain,
+  clutter_gtk,
+  folks,
+  folks_eds,
+  folks_telepathy,
+  gee,
+  geocode_glib,
+  gio_unix,
+  glib,
+  gnome_desktop,
+  goa,
+  gtk,
+  libebook,
+  libedataserver,
+  libedataserverui,
+  math,
+  telepathy_glib,
+]
+
+# Add extra stuff if cheese is enabled
+if get_option('with-cheese')
+  contacts_deps += [ cheese, cheese_gtk ]
+  contacts_vala_args += [ '-D', 'HAVE_CHEESE' ]
+  contacts_c_sources += 'cheese-flash.c'
+endif
+
+executable('gnome-contacts', contacts_sources,
+  include_directories: config_h_dir,
+  vala_args: contacts_vala_args,
+  c_args: contacts_c_args,
+  dependencies: contacts_deps,
+  install: true,
+)
+
+# The search provider
+contact_search_provider_vala_sources = [
+  'contacts-contact.vala',
+  'contacts-shell-search-provider.vala',
+  'contacts-store.vala',
+  'contacts-types.vala',
+  'contacts-utils.vala',
+]
+
+contact_search_provider_c_sources = [
+  'contacts-esd-setup.c',
+]
+
+contact_search_provider_sources = [
+  contact_search_provider_vala_sources,
+  contact_search_provider_c_sources,
+]
+
+executable('gnome-contacts-search-provider', contact_search_provider_sources,
+  include_directories: config_h_dir,
+  vala_args: contacts_vala_args,
+  c_args: contacts_c_args,
+  dependencies: contacts_deps,
+  install: true,
+)


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