Commit d46cd37f authored by Iñigo Martínez's avatar Iñigo Martínez Committed by Debarshi Ray

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 alongside Autotools.

Known issue:
  * #FooObject style links in gtk-doc markup don't resolved into HTML
    links in the generated HTML.

https://gitlab.gnome.org/GNOME/gnome-online-accounts/merge_requests/2
https://gitlab.gnome.org/GNOME/gnome-online-accounts/merge_requests/3
parent 2fda65d9
icon_data = [
'goa-account-facebook.png',
'goa-account-flickr.png',
'goa-account-foursquare.png',
'goa-account-google.png',
'goa-account-msn.png',
'goa-account-owncloud.png',
'goa-account.png',
'goa-account-pocket.png',
'goa-account-todoist.png'
]
icon_data_256 = ['goa-account.png']
icons = [
['16x16', icon_data],
['22x22', icon_data],
['24x24', icon_data],
['32x32', icon_data],
['48x48', icon_data],
['96x96', icon_data],
['256x256', icon_data_256]
]
foreach icon: icons
icon_dir = join_paths(goa_datadir, 'icons', 'hicolor', icon[0], 'apps')
foreach data: icon[1]
install_data(
join_paths(icon[0], data),
install_dir: icon_dir
)
endforeach
endforeach
subdir('icons')
dbus_ifaces = files('dbus-interfaces.xml')
if enable_goabackend
install_data(
'org.gnome.online-accounts.gschema.xml',
install_dir: join_paths(goa_datadir, 'glib-2.0', 'schemas')
)
services = ['org.gnome.OnlineAccounts.service']
if enable_kerberos
services += 'org.gnome.Identity.service'
endif
service_conf = configuration_data()
service_conf.set('libexecdir', goa_libexecdir)
foreach service: services
configure_file(
input: service + '.in',
output: service,
configuration: service_conf,
install: true,
install_dir: dbus_service_dir
)
endforeach
endif
if enable_gtk_doc
version_conf = configuration_data()
version_conf.set('VERSION', goa_version)
version_xml = 'version.xml'
configure_file(
input: version_xml + '.in',
output: version_xml,
configuration: version_conf
)
gnome.gtkdoc(
goa_name,
main_xml: goa_name + '-docs.xml',
src_dir: [goa_inc, goabackend_inc],
dependencies: libgoa_backend_dep,
mkdb_args: '--name-space=' + goa_name,
fixxref_args: '--html-dir=' + join_paths(goa_prefix, gnome.gtkdoc_html_dir(goa_name)),
gobject_typesfile: files(goa_name + '.types'),
install: true
)
endif
if enable_man
xsltproc_cmd = [
find_program('xsltproc'),
'--output', '@OUTPUT@',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
'@INPUT@'
]
man = 'goa-daemon'
custom_target(
man + '.8',
input: man + '.xml',
output: man + '.8',
command: xsltproc_cmd,
install: true,
install_dir: join_paths(goa_mandir, 'man8')
)
endif
This diff is collapsed.
option('goabackend', type: 'boolean', value: true, description: 'Enable goabackend library')
option('inspector', type: 'boolean', value: false, description: 'Enable a WebKitWebInspector for the embedded web view')
option('exchange', type: 'boolean', value: true, description: 'Enable Microsoft Exchange provider')
option('facebook', type: 'boolean', value: true, description: 'Enable Facebook provider')
option('facebook_client_id', type: 'string', value: '297654143624603', description: 'Facebook OAuth 2.0 client id')
option('flickr', type: 'boolean', value: true, description: 'Enable Flickr provider')
option('flickr_consumer_key', type: 'string', value: 'ed00ad7e0869897506e23c0d18e34d01', description: 'Flickr OAuth 1.0 consumer key')
option('flickr_consumer_secret', type: 'string', value: 'ebd556dd187188b1', description: 'Flickr OAuth 1.0 consumer secret')
option('foursquare', type: 'boolean', value: true, description: 'Enable Foursquare provider')
option('foursquare_client_id', type: 'string', value: 'MBNU2NES5HASNDQJ25YPFGG2UGRZHPI3IYTNJGE0KIWT2HCF', description: 'Foursquare OAuth 2.0 client id')
option('google', type: 'boolean', value: true, description: 'Enable Google provider')
option('google_client_id', type: 'string', value: '44438659992-7kgjeitenc16ssihbtdjbgguch7ju55s.apps.googleusercontent.com', description: 'Google OAuth 2.0 client id')
option('google_client_secret', type: 'string', value: '-gMLuQyDiI0XrQS_vx_mhuYF', description: 'Google OAuth 2.0 client secret')
option('imap_smtp', type: 'boolean', value: true, description: 'Enable IMAP/SMTP provider')
option('kerberos', type: 'boolean', value: true, description: 'Enable kerberos provider')
option('lastfm', type: 'boolean', value: false, description: 'Enable Last.fm provider')
option('lastfm_client_id', type: 'string', value: '7a2461fe34c9c8124fb28ac750ba12fa', description: 'Last.fm client id')
option('lastfm_client_secret', type: 'string', value: '49ec391644459c417f3afe57ca246c5a', description: 'Last.fm client secret')
option('media_server', type: 'boolean', value: false, description: 'Enable Media Server provider')
option('owncloud', type: 'boolean', value: true, description: 'Enable ownCloud provider')
option('pocket', type: 'boolean', value: true, description: 'Enable Pocket provider')
option('pocket_client_id', type: 'string', value: '16630-40b25246b56e8ad5310b2883', description: 'Pocket OAuth 2.0 client id')
option('todoist', type: 'boolean', value: false, description: 'Enable Todoist provider')
option('todoist_client_id', type: 'string', value: '2e41575c1dd74f98ad7cfb178e1ba3dd', description: 'Todoist OAuth 2.0 client id')
option('todoist_client_secret', type: 'string', value: '3e59831ffdd64633918d19aa0a1efd2b', description: 'Todoist client secret')
option('windows_live', type: 'boolean', value: true, description: 'Enable Windows Live provider')
option('windows_live_client_id', type: 'string', value: '0000000044067703', description: 'Windows Live OAuth 2.0 client id')
option('gtk_doc', type: 'boolean', value: false, description: 'use gtk_doc to build documentation')
option('introspection', type: 'boolean', value: true, description: 'Enable GObject Introspection (depends on GObject)')
option('man', type: 'boolean', value: false, description: 'enable man pages')
option('template_file', type: 'string', value: '', description: 'Path to the template file')
option('vapi', type: 'boolean', value: true, description: 'build Vala binding')
#!/usr/bin/env python3
import os
import subprocess
import sys
if not os.environ.get('DESTDIR'):
datadir = sys.argv[1]
icondir = os.path.join(datadir, 'icons', 'hicolor')
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
if sys.argv[2] == 'compile-schemas':
schemadir = os.path.join(datadir, 'glib-2.0', 'schemas')
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
i18n.gettext(goa_long_name, preset: 'glib')
name = 'goa-daemon'
sources = files(
'goadaemon.c',
'main.c'
)
deps = [
libgoa_backend_dep,
rest_dep
]
cflags = [
'-DG_LOG_DOMAIN="@0@"'.format(name),
'-DGOA_API_IS_SUBJECT_TO_CHANGE',
'-DGOA_BACKEND_API_IS_SUBJECT_TO_CHANGE',
'-DGOA_BACKEND_COMPILATION',
'-DPACKAGE_LOCALE_DIR="@0@"'.format(goa_localedir),
]
executable(
name,
sources,
include_directories: common_incs,
dependencies: deps,
c_args: cflags,
install: true,
install_dir: goa_libexecdir
)
programs = [
# program name, deps
['list-accounts', libgoa_dep],
['lastfm-shout', [libgoa_dep, rest_dep]]
]
if enable_goabackend
programs += [
['introspect-providers', libgoa_backend_dep],
['list-providers', libgoa_backend_dep],
['add-pocket', [libgoa_dep, rest_dep]]
]
endif
foreach program: programs
executable(
program[0],
program[0] + '.c',
include_directories: common_incs,
dependencies: program[1]
)
endforeach
/* goaconfig.h
*
* This is a generated file. Please modify 'goaconfig.h.in'
*/
#ifndef __GOA_CONFIG_H__
#define __GOA_CONFIG_H__
G_BEGIN_DECLS
#define GOA_MAJOR_VERSION @GOA_MAJOR_VERSION@
#define GOA_MINOR_VERSION @GOA_MINOR_VERSION@
#define GOA_MICRO_VERSION @GOA_MICRO_VERSION@
G_END_DECLS
#endif /* __GOA_CONFIG_H__ */
goa_inc = include_directories('.')
enum_headers = files('goaenums.h')
headers = enum_headers + files(
'goaclient.h',
'goaerror.h',
'goa.h',
'goaversion.h'
)
install_headers(
headers,
install_dir: join_paths(goa_pkgincludedir, goa_name)
)
goaconfig_conf = configuration_data()
goaconfig_conf.set('GOA_MAJOR_VERSION', goa_major_version)
goaconfig_conf.set('GOA_MINOR_VERSION', goa_minor_version)
goaconfig_conf.set('GOA_MICRO_VERSION', goa_micro_version)
goaconfig = 'goaconfig.h'
goaconfig_h = configure_file(
input: goaconfig + '.in',
output: goaconfig,
configuration: goaconfig_conf,
install: true,
install_dir: join_paths(goa_pkglibdir, 'include')
)
dbus = 'goa-generated'
dbus_sources = gnome.gdbus_codegen(
dbus,
sources: dbus_ifaces,
interface_prefix: 'org.gnome.OnlineAccounts.',
namespace: goa_ns,
object_manager: true,
docbook: dbus + '-doc',
install_header: true,
install_dir: join_paths(goa_pkgincludedir, goa_name)
)
enum = 'goaenumtypes'
enum_sources = gnome.mkenums(
enum,
sources: enum_headers,
c_template: enum + '.c.template',
h_template: enum + '.h.template',
install_header: true,
install_dir: join_paths(goa_pkgincludedir, goa_name)
)
sources = [goaconfig_h] + dbus_sources + enum_sources + files(
'goaclient.c',
'goaerror.c',
'goaversion.c'
)
deps = [
gio_dep,
glib_dep
]
cflags = [
'-DG_LOG_DOMAIN="@0@"'.format(goa_ns),
'-DGOA_COMPILATION'
]
libgoa = shared_library(
goa_api_name,
sources: sources,
version: goa_libversion,
include_directories: common_incs,
dependencies: deps + [gio_unix_dep],
c_args: cflags,
install: true
)
libgoa_dep = declare_dependency(
sources: [goaconfig_h, dbus_sources[1], enum_sources[1]],
include_directories: goa_inc,
dependencies: deps,
link_with: libgoa
)
pkg.generate(
libraries: libgoa,
version: goa_version,
name: goa_ns,
description: 'GNOME Online Accounts Library',
filebase: goa_api_name,
subdirs: goa_api_name,
extra_cflags: ['-I${libdir}/@0@/include'.format(goa_api_name)],
requires: deps,
variables: 'exec_prefix=${prefix}'
)
if enable_introspection
libgoa_gir = gnome.generate_gir(
libgoa,
sources: sources + headers,
includes: 'Gio-2.0',
nsversion: goa_api_version,
namespace: goa_ns,
export_packages: goa_api_name,
extra_args: '-DGOA_COMPILATION',
header: join_paths(goa_name, 'goa.h'),
install: true
)
if enable_vapi
gnome.generate_vapi(
goa_api_name,
sources: libgoa_gir[0],
packages: 'gio-2.0',
install: true
)
endif
endif
goabackend_inc = include_directories('.')
enum_headers = files('goabackendenums.h')
headers = enum_headers + files(
'goabackend.h',
'goaprovider.h'
)
install_headers(
headers,
install_dir: join_paths(goa_pkgincludedir, 'goabackend')
)
enum = 'goabackendenumtypes'
enum_sources = gnome.mkenums(
enum,
sources: enum_headers,
c_template: enum + '.c.template',
h_template: enum + '.h.template',
install_header: true,
install_dir: join_paths(goa_pkgincludedir, 'goabackend')
)
sources = enum_sources + files(
'goaoauth2provider.c',
'goaoauthprovider.c',
'goabackendinit.c',
'goadlnaservermanager.c',
'goaewsclient.c',
'goaexchangeprovider.c',
'goafacebookprovider.c',
'goaflickrprovider.c',
'goafoursquareprovider.c',
'goagoogleprovider.c',
'goahttpclient.c',
'goaimapauthlogin.c',
'goaimapsmtpprovider.c',
'goalastfmprovider.c',
'goamailauth.c',
'goamailclient.c',
'goamediaserverprovider.c',
'goaobjectskeletonutils.c',
'goaowncloudprovider.c',
'goapocketprovider.c',
'goaprovider.c',
'goarestproxy.c',
'goasmtpauth.c',
'goasouplogger.c',
'goatodoistprovider.c',
'goautils.c',
'goawebview.c',
'goawindowsliveprovider.c',
'nautilus-floating-bar.c'
)
dbus = 'goadleynaservermanager'
sources += gnome.gdbus_codegen(
dbus,
dbus + '.xml',
interface_prefix: 'com.intel.dLeynaServer.',
namespace: 'DleynaServer'
)
dbus = 'goadleynaservermediadevice'
sources += gnome.gdbus_codegen(
dbus,
dbus + '.xml',
interface_prefix: 'com.intel.dLeynaServer.',
namespace: 'DleynaServer'
)
incs = common_incs
deps = [
gtk_dep,
json_glib_dep,
libgoa_dep,
libsecret_dep,
libsoup_dep,
libxml_dep,
rest_dep,
webkit_gtk_dep
]
cflags = [
'-DG_LOG_DOMAIN="GoaBackend"',
'-DGOA_API_IS_SUBJECT_TO_CHANGE',
'-DGOA_BACKEND_COMPILATION',
'-DPACKAGE_LOCALE_DIR="@0@"'.format(goa_localedir),
'-DPACKAGE_WEB_EXTENSIONS_DIR="@0@"'.format(join_paths(goa_pkglibdir, 'web-extensions'))
]
if enable_kerberos
sources += identity_dbus_sources + identity_manager_error_src + files('goakerberosprovider.c')
incs += goaidentity_inc
deps += [gcr_dep]
endif
libgoa_backend = shared_library(
goa_backend_api_name,
sources,
version: goa_backend_libversion,
include_directories: incs,
dependencies: deps,
c_args: cflags,
install: true
)
libgoa_backend_dep = declare_dependency(
sources: enum_sources[1],
include_directories: goabackend_inc,
dependencies: [gtk_dep, libgoa_dep],
link_with: libgoa_backend
)
pkg.generate(
libraries: libgoa_backend,
version: goa_version,
name: 'Goa Backends',
description: 'Backends for GNOME Online Accounts Library',
filebase: goa_backend_api_name,
subdirs: goa_api_name,
requires: [goa_api_name, 'gtk+-3.0'],
variables: 'exec_prefix=${prefix}'
)
sources = files(
'goawebextension.c',
'goawebextensionmain.c'
)
deps = [
rest_dep,
webkit_gtk_dep
]
libgoa_web_extension = shared_module(
'goawebextension',
sources + [goaconfig_h, enum_sources[1]],
include_directories: common_incs + [goa_inc],
dependencies: deps,
c_args: cflags,
link_with: libgoa_backend,
install: true,
install_dir: join_paths(goa_pkglibdir, 'web-extensions')
)
goaidentity_inc = include_directories('.')
headers = files(
'goaalarm.h',
'goaidentity.h',
'goaidentityinquiry.h',
'goaidentityinquiryprivate.h',
'goaidentityservice.h',
'goaidentitymanagerprivate.h',
'goaidentitymanager.h',
'goaidentitymanagererror.h',
'goaidentityutils.h',
'goakerberosidentity.h',
'goakerberosidentityinquiry.h',
'goakerberosidentitymanager.h'
)
dbus = 'org.gnome.Identity'
identity_dbus_sources = gnome.gdbus_codegen(
dbus,
dbus + '.xml',
interface_prefix: dbus + '.',
namespace: 'GoaIdentityService',
object_manager: true,
annotations: [dbus, 'org.gtk.GDBus.C.Name', 'Identity']
)
identity_manager_error_src = files('goaidentitymanagererror.c')
sources = identity_manager_error_src + files(
'goaalarm.c',
'goaidentity.c',
'goaidentityinquiry.c',
'goaidentityservice.c',
'goaidentitymanager.c',
'goaidentityutils.c',
'goakerberosidentity.c',
'goakerberosidentityinquiry.c',
'goakerberosidentitymanager.c',
'main.c'
)
enum = 'goaidentityenumtypes'
sources += gnome.mkenums(
enum,
sources: headers,
c_template: enum + '.c.in',
h_template: enum + '.h.in'
)
deps = [
gcr_dep,
krb5_dep,
libgoa_dep
]
cflags = [
'-DG_LOG_DOMAIN="libgoaidentity"',
'-DGOA_COMPILATION',
'-DGOA_API_IS_SUBJECT_TO_CHANGE',
'-DGOA_BACKEND_API_IS_SUBJECT_TO_CHANGE',
'-DPACKAGE_LOCALE_DIR="@0@"'.format(goa_localedir),
]
executable(
'goa-identity-service',
sources + [identity_dbus_sources],
include_directories: common_incs,
dependencies: deps,
c_args: cflags,
install: true,
install_dir: goa_libexecdir
)
src_inc = include_directories('.')
common_incs = [top_inc, src_inc]
subdir('goa')
if enable_goabackend
if enable_kerberos
subdir('goaidentity')
endif
subdir('goabackend')
subdir('daemon')
subdir('examples')
endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment