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



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

    WIP: Implement Meson build support

 .gitignore      |    2 +
 lib/meson.build |   75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build     |   52 ++++++++++++++++++++++++++++++++++++++
 src/meson.build |   22 ++++++++++++++++
 4 files changed, 151 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/lib/meson.build b/lib/meson.build
new file mode 100644
index 0000000..7fffd0d
--- /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,
+       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(),
+       header: maps_h,
+       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..5f501dc
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,52 @@
+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('src')
+subdir('lib')
+#subdir('data')
+#subdir('po')
+#subdir('scripts')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..2314bed
--- /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: name,
+       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]