[gnome-maps/wip/mlundblad/meson: 2/2] WIP: Implement Meson build support



commit 4982a6c8fb9be362ad7daa82eeaadf8ed7821587
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Feb 21 21:39:24 2018 +0100

    WIP: Implement Meson build support

 .gitignore       |    2 +
 data/meson.build |   61 +++++++++++++++++++++++++++++++++++++++++++
 lib/meson.build  |   75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build      |   53 ++++++++++++++++++++++++++++++++++++++
 src/meson.build  |   22 ++++++++++++++++
 5 files changed, 213 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 139180b..b7aecf8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,5 @@ src/org.gnome.Maps.service
 /lib/GnomeMaps-1.0.gir
 /lib/GnomeMaps-1.0.typelib
 /lib/maps-enum-types.[ch]
+
+build/
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..5f40c92
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,61 @@
+gnome.compile_resources(
+       app_id + '.data',
+       app_id + '.data.gresource.xml',
+       gresource_bundle: true,
+       install: true,
+       install_dir: pkgdatadir
+)
+
+install_data(
+       'maps-service.json',
+       install_dir: pkgdatadir
+)
+
+desktop = app_id + '.desktop'
+
+i18n.merge_file(
+       desktop,
+       type: 'desktop',
+       input: desktop + '.in',
+       output: desktop,
+       po_dir: po_dir,
+       install: true,
+       install_dir: join_paths(datadir, 'applications')
+)
+
+install_data(
+       app_id + '.gschema.xml',
+       install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
+)
+
+appdata = app_id + '.appdata.xml'
+
+i18n.merge_file(
+       appdata,
+       input: appdata + '.in',
+       output: appdata,
+       po_dir: po_dir,
+       install: true,
+       install_dir: join_paths(datadir, 'metainfo')
+)
+
+service_conf = configuration_data()
+service_conf.set('PACKAGE_NAME', meson.project_name())
+service_conf.set('pkgdatadir', pkgdatadir)
+
+configure_file(
+       input: app_id + '.service.in',
+       output: app_id + '.service',
+       configuration: service_conf,
+       install: true,
+       install_dir: join_paths(datadir, 'dbus-1', 'services')
+)
+
+install_subdir(
+       'icons',
+       exclude_files: ['org.gnome.Maps.svg',
+                       'hicolor_apps_24x24_user-location.svg',
+                       'hicolor_apps_24x24_user-location-compass.svg'],
+       install_dir: join_paths(datadir, 'icons')
+)
+
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 0000000..34c0cfc
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,75 @@
+maps_h = 'maps.h'
+
+headers_private = files(
+       'maps-contact.h',
+       'maps-contact-store.h',
+       'maps-file-tile-source.h',
+       'maps-osm.h',
+       'maps-osm-changeset.h',
+       'maps-osm-node.h',
+       'maps-osm-object.h',
+       'maps-osm-way.h',
+       'maps-osm-relation.h',
+       'maps-osm-oauth-proxy-call.h'
+)
+
+sources = files(
+       'maps-contact.c',
+       'maps-contact-store.c',
+       'maps-file-tile-source.c',
+       'maps-osm.c',
+       'maps-osm-changeset.c',
+       'maps-osm-node.c',
+       'maps-osm-object.c',
+       'maps-osm-way.c',
+       'maps-osm-relation.c',
+       'maps-osm-oauth-proxy-call.c'
+)
+
+enum_types = 'maps-enum-types'
+
+maps_enums = gnome.mkenums(
+       enum_types,
+       sources: headers_private,
+       c_template: enum_types + '.c.template',
+       h_template: enum_types + '.h.template',
+       identifier_prefix: maps_ns,
+       symbol_prefix: maps_ns.to_lower()
+)
+
+cflags = [
+       '-DG_DISABLE_DEPRECATED',
+       '-DPREFIX="@0@"'.format(prefix),
+       '-DLIBDIR="@0@"'.format(libdir)
+]
+
+libmaps = shared_library(
+       maps_libname,
+       version: '0.0.0',
+       sources: sources + maps_enums,
+       include_directories: top_inc,
+       dependencies: libmaps_deps,
+       c_args: cflags,
+       install: true,
+       install_dir: libdir
+)
+
+gnome.generate_gir(
+       libmaps,
+       sources: sources + [maps_enums[0], headers_private],
+       nsversion: maps_gir_version,
+       namespace: maps_gir_name,
+       identifier_prefix: maps_ns,
+       symbol_prefix: maps_ns.to_lower(),
+       includes: [
+               'GLib-2.0',
+               'GObject-2.0',
+               'GeocodeGlib-1.0',
+               'Champlain-0.12',
+               'Rest-0.7'
+       ],
+       install: true,
+       install_dir_gir: join_paths(pkgdatadir, 'gir-' + maps_gir_version),
+       install_dir_typelib: join_paths(libdir, 'girepository-' + maps_gir_version)
+)
+
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..838a6b1
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,53 @@
+project('gnome-maps', 'c',
+       version: '3.27.90',
+       license: 'GPL2+'
+)
+
+app_id = 'org.gnome.Maps'
+gnome = import('gnome')
+i18n = import('i18n')
+
+prefix = get_option('prefix')
+name = meson.project_name()
+version = meson.project_version()
+
+bindir = join_paths(prefix, get_option('bindir'))
+libdir = join_paths(prefix, get_option('libdir'))
+datadir = join_paths(prefix, get_option('datadir'))
+pkgdatadir = join_paths(datadir, name)
+
+maps_ns = 'Maps'
+maps_libname = 'gnome-maps'
+maps_gir_name = 'GnomeMaps'
+maps_gir_version = '1.0'
+
+desktop_file_validate = find_program('desktop-file-validate', required: false)
+appstream_util = find_program('appstream-util', required: false)
+
+gio = dependency('gio-2.0', version: '>= 2.44.0')
+gjs = dependency('gjs-1.0', version: '>= 1.40.0')
+girepository = dependency('gobject-introspection-1.0', version: '>= 0.10.1')
+gtk3 = dependency('gtk+-3.0', version: '>= 3.22.0')
+geoclue2 = dependency('geoclue-2.0', version: '>= 0.12.99')
+
+libmaps_deps = [
+       dependency('gee-0.8', version: '>= 0.16.0'),
+       dependency('folks', version: '>= 0.10.0'),
+       dependency('geocode-glib-1.0', version: '>= 3.15.2'),
+       dependency('champlain-0.12', version: '>= 0.12.14'),
+       dependency('libxml-2.0'),
+       dependency('rest-0.7', version: '>= 0.7.90')
+]
+
+po_dir = join_paths(meson.source_root(), 'po')
+
+top_inc = include_directories('.')
+
+cc = meson.get_compiler('c')
+
+subdir('po')
+subdir('src')
+subdir('lib')
+subdir('data')
+
+#subdir('scripts')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..5cc7e5e
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,22 @@
+script_conf = configuration_data()
+script_conf.set('GJS', find_program('gjs').path())
+script_conf.set('PACKAGE_VERSION', version)
+script_conf.set('libdir', libdir)
+script_conf.set('prefix', prefix)
+
+configure_file(
+       input: app_id + '.in',
+       output: app_id,
+       configuration: script_conf,
+       install: true,
+       install_dir: pkgdatadir
+)
+
+gnome.compile_resources(
+       app_id + '.src',
+       app_id + '.src.gresource.xml',
+       gresource_bundle: true,
+       install: true,
+       install_dir: pkgdatadir,
+       source_dir: 'geojson-vt'
+)


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