[gnome-maps/wip/mlundblad/meson: 3/3] Switch to build with Meson



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

    Switch to build with Meson
    
    Implement Meson build support.
    Re-arrange icons into directory trees
    corresponding to the final install directories
    under public datadir and package-internal datadir
    to avoid parsing icon file names to produce a
    directory hierarchy. For this reason, drop
    autotools support now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790151

 .gitignore                                         |    2 +
 Makefile.am                                        |    3 -
 autogen.sh                                         |   24 ----
 configure.ac                                       |   81 ------------
 data/Makefile.am                                   |   73 -----------
 data/icons/Makefile.am                             |  130 --------------------
 data/icons/meson.build                             |    9 ++
 .../16x16/apps/layer-not-visible-symbolic.svg}     |    0
 .../hicolor/16x16/apps/layer-visible-symbolic.svg} |    0
 .../hicolor/16x16/apps/layers-button-symbolic.svg} |    0
 .../16x16/apps/maps-point-end-symbolic.svg}        |    0
 .../hicolor/16x16/apps/maps-point-end.svg}         |    0
 .../16x16/apps/maps-point-start-symbolic.svg}      |    0
 .../hicolor/16x16/apps/maps-point-start.svg}       |    0
 .../hicolor/16x16/apps/route-bike-symbolic.svg}    |    0
 .../hicolor/16x16/apps/route-button-symbolic.svg}  |    0
 .../hicolor/16x16/apps/route-car-symbolic.svg}     |    0
 .../16x16/apps/route-pedestrian-symbolic.svg}      |    0
 .../hicolor/16x16/apps/route-reverse-symbolic.svg} |    0
 .../16x16/apps/route-transit-bus-symbolic.svg}     |    0
 .../apps/route-transit-cablecar-symbolic.svg}      |    0
 .../16x16/apps/route-transit-ferry-symbolic.svg}   |    0
 .../apps/route-transit-funicular-symbolic.svg}     |    0
 .../apps/route-transit-gondolalift-symbolic.svg}   |    0
 .../16x16/apps/route-transit-subway-symbolic.svg}  |    0
 .../hicolor/16x16/apps/route-transit-symbolic.svg} |    0
 .../16x16/apps/route-transit-train-symbolic.svg}   |    0
 .../16x16/apps/route-transit-tram-symbolic.svg}    |    0
 .../hicolor/24x24/apps/user-location-compass.png}  |  Bin 1298 -> 1298 bytes
 .../hicolor/24x24/apps/user-location.png}          |  Bin 1028 -> 1028 bytes
 .../apps/maps-direction-continue-symbolic.svg}     |    0
 .../32x32/apps/maps-direction-left-symbolic.svg}   |    0
 .../32x32/apps/maps-direction-right-symbolic.svg}  |    0
 .../apps/maps-direction-roundabout-0-symbolic.svg} |    0
 .../maps-direction-roundabout-135-symbolic.svg}    |    0
 .../maps-direction-roundabout-180-symbolic.svg}    |    0
 .../maps-direction-roundabout-225-symbolic.svg}    |    0
 .../maps-direction-roundabout-270-symbolic.svg}    |    0
 .../maps-direction-roundabout-315-symbolic.svg}    |    0
 .../maps-direction-roundabout-45-symbolic.svg}     |    0
 .../maps-direction-roundabout-90-symbolic.svg}     |    0
 .../apps/maps-direction-roundabout-symbolic.svg}   |    0
 .../apps/maps-direction-sharpleft-symbolic.svg}    |    0
 .../apps/maps-direction-sharpright-symbolic.svg}   |    0
 .../apps/maps-direction-slightleft-symbolic.svg}   |    0
 .../apps/maps-direction-slightright-symbolic.svg}  |    0
 .../hicolor/16x16/apps/org.gnome.Maps.png}         |  Bin 975 -> 975 bytes
 .../hicolor/22x22/apps/org.gnome.Maps.png}         |  Bin 1508 -> 1508 bytes
 .../hicolor/24x24/apps/org.gnome.Maps.png}         |  Bin 1590 -> 1590 bytes
 .../hicolor/256x256/apps/org.gnome.Maps.png}       |  Bin 43685 -> 43685 bytes
 .../hicolor/32x32/apps/org.gnome.Maps.png}         |  Bin 2381 -> 2381 bytes
 .../hicolor/48x48/apps/org.gnome.Maps.png}         |  Bin 3689 -> 3689 bytes
 .../symbolic/apps/org.gnome.Maps-symbolic.svg}     |    0
 data/meson.build                                   |   54 ++++++++
 lib/Makefile.am                                    |   88 -------------
 lib/meson.build                                    |   75 +++++++++++
 meson.build                                        |   59 +++++++++
 meson_post_install.py                              |   42 +++++++
 org.gnome.Maps.json                                |    2 +
 po/meson.build                                     |    1 +
 scripts/Makefile.am                                |    9 --
 src/Makefile.am                                    |   55 --------
 src/meson.build                                    |   22 ++++
 63 files changed, 266 insertions(+), 463 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/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..f741a0b
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,9 @@
+install_subdir(
+       join_paths('public', 'hicolor'),
+       install_dir: join_paths(datadir, 'icons')
+)
+
+install_subdir(
+       join_paths('private', 'hicolor'),
+       install_dir: join_paths(pkgdatadir, 'icons')
+)
diff --git a/data/icons/hicolor_apps_16x16_layer-not-visible-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/layer-not-visible-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_layer-not-visible-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/layer-not-visible-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_layer-visible-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/layer-visible-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_layer-visible-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/layer-visible-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_layers-button-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/layers-button-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_layers-button-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/layers-button-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_maps-point-end-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/maps-point-end-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_maps-point-end-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/maps-point-end-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_maps-point-end.svg 
b/data/icons/private/hicolor/16x16/apps/maps-point-end.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_maps-point-end.svg
rename to data/icons/private/hicolor/16x16/apps/maps-point-end.svg
diff --git a/data/icons/hicolor_apps_16x16_maps-point-start-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/maps-point-start-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_maps-point-start-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/maps-point-start-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_maps-point-start.svg 
b/data/icons/private/hicolor/16x16/apps/maps-point-start.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_maps-point-start.svg
rename to data/icons/private/hicolor/16x16/apps/maps-point-start.svg
diff --git a/data/icons/hicolor_apps_16x16_route-bike-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-bike-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-bike-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-bike-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-button-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-button-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-button-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-button-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-car-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-car-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-car-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-car-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-pedestrian-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-pedestrian-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-pedestrian-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-pedestrian-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-reverse-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-reverse-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-reverse-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-reverse-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-bus-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-bus-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-bus-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-bus-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-cablecar-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-cablecar-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-cablecar-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-cablecar-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-ferry-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-ferry-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-ferry-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-ferry-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-funicular-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-funicular-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-funicular-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-funicular-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-gondolalift-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-gondolalift-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-gondolalift-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-gondolalift-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-subway-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-subway-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-subway-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-subway-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-train-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-train-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-train-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-train-symbolic.svg
diff --git a/data/icons/hicolor_apps_16x16_route-transit-tram-symbolic.svg 
b/data/icons/private/hicolor/16x16/apps/route-transit-tram-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_16x16_route-transit-tram-symbolic.svg
rename to data/icons/private/hicolor/16x16/apps/route-transit-tram-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-continue-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-continue-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-continue-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-continue-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-left-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-left-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-left-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-left-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-right-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-right-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-right-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-right-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-0-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-0-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-0-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-0-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-135-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-135-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-135-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-135-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-180-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-180-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-180-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-180-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-225-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-225-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-225-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-225-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-270-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-270-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-270-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-270-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-315-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-315-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-315-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-315-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-45-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-45-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-45-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-45-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-90-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-90-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-90-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-90-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-roundabout-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-roundabout-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-roundabout-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-sharpleft-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-sharpleft-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-sharpleft-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-sharpleft-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-sharpright-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-sharpright-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-sharpright-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-sharpright-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-slightleft-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-slightleft-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-slightleft-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-slightleft-symbolic.svg
diff --git a/data/icons/hicolor_apps_32x32_maps-direction-slightright-symbolic.svg 
b/data/icons/private/hicolor/32x32/apps/maps-direction-slightright-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_32x32_maps-direction-slightright-symbolic.svg
rename to data/icons/private/hicolor/32x32/apps/maps-direction-slightright-symbolic.svg
diff --git a/data/icons/hicolor_apps_symbolic_org.gnome.Maps-symbolic.svg 
b/data/icons/public/hicolor/symbolic/apps/org.gnome.Maps-symbolic.svg
similarity index 100%
rename from data/icons/hicolor_apps_symbolic_org.gnome.Maps-symbolic.svg
rename to data/icons/public/hicolor/symbolic/apps/org.gnome.Maps-symbolic.svg
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..153bcbc
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,54 @@
+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')
+)
+
+subdir('icons')
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 0000000..c11fec2
--- /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: pkglibdir
+)
+
+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(pkglibdir, 'girepository-' + maps_gir_version)
+)
+
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..abfb8ba
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,59 @@
+project('gnome-maps', 'c',
+       version: '3.28.0',
+       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)
+pkglibdir = join_paths(libdir, 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')
+
+meson.add_install_script(
+  'meson_post_install.py',
+  datadir,
+  bindir
+)
+
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..bb6b67c
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+
+import glob
+import os
+import re
+import subprocess
+import sys
+
+datadir = sys.argv[1]
+
+destdir = os.environ.get('DESTDIR', '')
+bindir = os.path.normpath(destdir + os.sep + sys.argv[2])
+
+# FIXME: meson will not track the creation of these files
+#        https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
+if not os.path.exists(bindir):
+  os.makedirs(bindir)
+
+src = os.path.join(datadir, 'gnome-maps', 'org.gnome.Maps')
+dest = os.path.join(bindir, 'gnome-maps')
+subprocess.call(['ln', '-s', '-f', src, dest])
+
+if not os.environ.get('DESTDIR'):
+  icondir = os.path.join(datadir, 'icons', 'hicolor')
+
+  print('Update icon cache...')
+  subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
+
+  schemadir = os.path.join(datadir, 'glib-2.0', 'schemas')
+  print('Compiling gsettings schemas...')
+  subprocess.call(['glib-compile-schemas', schemadir])
+
+  # FIXME
+  '''
+  search_pattern = '/*.desktop'
+
+  desktopdir = os.path.join(datadir, 'applications')
+  print('Validate desktop files...')
+  [subprocess.call(['desktop-file-validate', file])
+   for file in glob.glob(desktopdir + search_pattern, recursive=False)]
+  '''
+
diff --git a/org.gnome.Maps.json b/org.gnome.Maps.json
index 738ce2e..b9fd0ec 100644
--- a/org.gnome.Maps.json
+++ b/org.gnome.Maps.json
@@ -170,6 +170,8 @@
         },
         {
             "name": "gnome-maps",
+            "buildsystem": "meson",
+            "builddir": true,
             "sources": [
                 {
                     "type": "git",
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..a2f6b5d
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(name, preset: 'glib')
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]