summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@update.uu.se>2018-02-21 21:39:24 +0100
committerMarcus Lundblad <ml@update.uu.se>2018-03-27 21:34:05 +0200
commit6c207661519cf8c4ebbfc1b912dcddf41a20679a (patch)
treebf738b477634d590a51b848ce8feb9cf64202b34 /lib
parent49c2c39e1ea404614b5a9001da7517115d4968d7 (diff)
downloadgnome-maps-6c207661519cf8c4ebbfc1b912dcddf41a20679a.tar.gz
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. Closes #104
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am88
-rw-r--r--lib/meson.build75
2 files changed, 75 insertions, 88 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
deleted file mode 100644
index d1ddf3f2..00000000
--- a/lib/Makefile.am
+++ /dev/null
@@ -1,88 +0,0 @@
-pkglib_LTLIBRARIES = libgnome-maps.la
-
-BUILT_SOURCES = \
- maps-enum-types.c \
- maps-enum-types.h
-
-EXTRA_DIST = \
- maps-enum-types.c.template \
- maps-enum-types.h.template
-
-libgnome_maps_headers_private = \
- maps-contact-store.h \
- maps-contact.h \
- mapsintl.h \
- maps.h \
- maps-file-tile-source.h \
- maps-osm.h \
- maps-osm-changeset.h \
- maps-osm-node.h \
- maps-osm-object.h \
- maps-osm-relation.h \
- maps-osm-way.h \
- maps-osm-oauth-proxy-call.h
-
-libgnome_maps_sources = \
- maps-contact-store.c \
- maps-contact.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
-
-libgnome_maps_la_SOURCES = \
- $(libgnome_maps_sources) \
- $(libgnome_maps_headers_private)
-
-nodist_libgnome_maps_la_SOURCES = \
- $(BUILT_SOURCES)
-
-libgnome_maps_la_LIBADD = $(GNOME_MAPS_LIB_LIBS)
-
-AM_CPPFLAGS = \
- $(GNOME_MAPS_LIB_CFLAGS) \
- -I$(top_srcdir)
-
-maps-enum-types.h: $(libgnome_maps_headers_private)
- $(AM_V_GEN) ($(GLIB_MKENUMS) \
- --template $(srcdir)/maps-enum-types.h.template \
- $^ > xgen-$(@F) && mv -f xgen-$(@F) $@)
-
-maps-enum-types.c: $(libgnome_maps_headers_private) maps-enum-types.h
- $(AM_V_GEN) ($(GLIB_MKENUMS) \
- --template $(srcdir)/maps-enum-types.c.template \
- $^ > xgen-$(@F) && mv -f xgen-$(@F) $@)
-
-if HAVE_INTROSPECTION
--include $(INTROSPECTION_MAKEFILE)
-INTROSPECTION_SCANNER_ARGS = --warn-all
-
-GnomeMaps-1.0.gir: libgnome-maps.la
-GnomeMaps_1_0_gir_INCLUDES = \
- GLib-2.0 \
- GObject-2.0 \
- GeocodeGlib-1.0 \
- Champlain-0.12 \
- Rest-0.7
-GnomeMaps_1_0_gir_PACKAGES = gobject-2.0 geocode-glib-1.0
-GnomeMaps_1_0_gir_FILES = $(libgnome_maps_la_SOURCES)
-GnomeMaps_1_0_gir_CFLAGS = $(MAPS_CFLAGS) -I$(top_srcdir) -I$(top_builddir) -I$(srcdir)
-GnomeMaps_1_0_gir_LIBS = libgnome-maps.la
-GnomeMaps_1_0_gir_EXPORT_PACKAGES = gnome-maps-1.0
-GnomeMaps_1_0_gir_SCANNERFLAGS = \
- --symbol-prefix=maps \
- --identifier-prefix=Maps
-INTROSPECTION_GIRS = GnomeMaps-1.0.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(INTROSPECTION_GIRS)
-
-typelibdir = $(pkglibdir)/girepository-1.0
-typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-
-CLEANFILES = $(gir_DATA) $(typelib_DATA) $(BUILT_SOURCES)
-endif
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 00000000..c11fec24
--- /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)
+)
+