[geocode-glib/wip/meson] wip: Port to meson
- From: Zeeshan Ali <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geocode-glib/wip/meson] wip: Port to meson
- Date: Fri, 14 Jul 2017 17:58:15 +0000 (UTC)
commit 3e65ebd6d8b1a49aa82f7a6826567ebb9e7b4f60
Author: Zeeshan Ali <zeenix gmail com>
Date: Mon Oct 31 12:28:29 2016 +0100
wip: Port to meson
geocode-glib/geocode-enum-types.c.in | 40 ++++++++++++++++++++++++
geocode-glib/geocode-enum-types.h.in | 24 +++++++++++++++
geocode-glib/geocode-glib.c | 1 +
geocode-glib/meson.build | 55 ++++++++++++++++++++++++++++++++++
geocode-glib/tests/meson.build | 47 +++++++++++++++++++++++++++++
meson.build | 47 +++++++++++++++++++++++++++++
6 files changed, 214 insertions(+), 0 deletions(-)
---
diff --git a/geocode-glib/geocode-enum-types.c.in b/geocode-glib/geocode-enum-types.c.in
new file mode 100644
index 0000000..50b09f7
--- /dev/null
+++ b/geocode-glib/geocode-enum-types.c.in
@@ -0,0 +1,40 @@
+/*** BEGIN file-header ***/
+
+#include "config.h"
+
+#include <geocode-glib/geocode-glib.h>
+#include <geocode-glib/geocode-enum-types.h>
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type (void)
+{
+ static GType etype = 0;
+ if (G_UNLIKELY(etype == 0)) {
+ static const G@Type@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+ { 0, NULL, NULL }
+ };
+ etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
+ }
+
+ return etype;
+}
+
+/*** END value-tail ***/
+
+/*** BEGIN file-tail ***/
+
+/*** END file-tail ***/
diff --git a/geocode-glib/geocode-enum-types.h.in b/geocode-glib/geocode-enum-types.h.in
new file mode 100644
index 0000000..ce603f6
--- /dev/null
+++ b/geocode-glib/geocode-enum-types.h.in
@@ -0,0 +1,24 @@
+/*** BEGIN file-header ***/
+#ifndef __GEOCODE_ENUM_TYPES_H__
+#define __GEOCODE_ENUM_TYPES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void);
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* __GEOCODE_ENUM_TYPES_H__ */
+/*** END file-tail ***/
diff --git a/geocode-glib/geocode-glib.c b/geocode-glib/geocode-glib.c
index fdd9ceb..b89439d 100644
--- a/geocode-glib/geocode-glib.c
+++ b/geocode-glib/geocode-glib.c
@@ -27,6 +27,7 @@
#include <libsoup/soup.h>
#include <langinfo.h>
#include <geocode-glib/geocode-glib-private.h>
+#include <config.h>
/**
* SECTION:geocode-glib
diff --git a/geocode-glib/meson.build b/geocode-glib/meson.build
new file mode 100644
index 0000000..74d6149
--- /dev/null
+++ b/geocode-glib/meson.build
@@ -0,0 +1,55 @@
+
+public_sources = [ 'geocode-location.c',
+ 'geocode-forward.c',
+ 'geocode-reverse.c',
+ 'geocode-glib.c',
+ 'geocode-error.c',
+ 'geocode-place.c',
+ 'geocode-bounding-box.c',
+ 'geocode-backend.c',
+ 'geocode-mock-backend.c',
+ 'geocode-nominatim.c' ]
+
+sources = public_sources + [ 'geocode-glib-private.h' ]
+
+headers = [ 'geocode-glib.h',
+ 'geocode-location.h',
+ 'geocode-forward.h',
+ 'geocode-reverse.h',
+ 'geocode-error.h',
+ 'geocode-place.h',
+ 'geocode-bounding-box.h',
+ 'geocode-backend.h',
+ 'geocode-mock-backend.h',
+ 'geocode-nominatim.h' ]
+
+header_subdir = 'geocode-glib-' + gclib_api_version + '/geocode-glib'
+header_dir = get_option('includedir') + '/' + header_subdir
+
+generated_sources = gnome.mkenums('geocode-enum-types',
+ h_template: 'geocode-enum-types.h.in',
+ c_template: 'geocode-enum-types.c.in',
+ sources: headers,
+ install_header: true,
+ install_dir: header_dir)
+
+deps = [ dependency('gio-2.0', version: '>= 2.34'),
+ dependency('json-glib-1.0', version: '>= 0.99.2'),
+ dependency('libsoup-2.4', version: '>= 2.42') ]
+libm = cc.find_library('m', required: false)
+if libm.found()
+ deps += [ libm ]
+endif
+
+include = include_directories('..')
+
+libgcglib = shared_library('geocode-glib',
+ sources,
+ generated_sources,
+ dependencies: deps,
+ include_directories: include,
+ install: true)
+
+install_headers(headers, subdir: header_subdir)
+
+subdir('tests')
diff --git a/geocode-glib/tests/meson.build b/geocode-glib/tests/meson.build
new file mode 100644
index 0000000..b1b428d
--- /dev/null
+++ b/geocode-glib/tests/meson.build
@@ -0,0 +1,47 @@
+install_dir = get_option('libexecdir') + '/installed-tests/geocode-glib-1.0'
+
+e = executable('geo-uri',
+ 'geo-uri.c',
+ dependencies: deps,
+ include_directories: include,
+ link_with: libgcglib,
+ install: true,
+ install_dir: install_dir)
+test('Geo URI', e)
+
+e = executable('geocode-glib',
+ 'geocode-nominatim-test.h',
+ 'geocode-nominatim-test.c',
+ 'geocode-glib.c',
+ dependencies: deps,
+ include_directories: include,
+ link_with: libgcglib,
+ install: true,
+ install_dir: install_dir)
+env = ['G_TEST_SRCDIR=' + meson.current_source_dir()]
+test('API test', e, env: env)
+
+e = executable('mock-backend',
+ 'mock-backend.c',
+ dependencies: deps,
+ include_directories: include,
+ link_with: libgcglib,
+ install: true,
+ install_dir: install_dir)
+test('Test mock backend', e)
+
+install_data('locale_format.json',
+ 'locale_name.json',
+ 'nominatim-area.json',
+ 'nominatim-no-results.json',
+ 'nominatim-rio.json',
+ 'osm_type0.json',
+ 'osm_type1.json',
+ 'osm_type2.json',
+ 'pub.json',
+ 'rev.json',
+ 'rev_fail.json',
+ 'search.json',
+ 'search_lat_long.json',
+ 'xep.json',
+ install_dir: install_dir)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..c7eac62
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,47 @@
+project('geocode-glib', 'c', version: '3.20.1')
+
+gclib_version = meson.project_version() # set in project() below
+ver_arr = gclib_version.split('.')
+
+gclib_major_version = ver_arr[0]
+gclib_minor_version = ver_arr[1]
+gclib_micro_version = ver_arr[2]
+
+gclib_api_version='1.0'
+
+conf = configuration_data()
+conf.set_quoted('VERSION', gclib_version)
+conf.set_quoted('PACKAGE_VERSION', gclib_version)
+conf.set_quoted('PACKAGE_NAME', 'geocode-glib')
+conf.set_quoted('GETTEXT_PACKAGE', 'geocode-glib')
+conf.set_quoted('PACKAGE_TARNAME', 'geocode-glib')
+conf.set_quoted('PACKAGE_STRING', 'geocode-glib ' + gclib_version)
+conf.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Boxes')
+conf.set_quoted('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=geocode-glib')
+conf.set_quoted('TEST_SRCDIR', meson.source_root() + '/data/')
+datadir = get_option('prefix') + '/' + get_option('datadir')
+conf.set_quoted('GEOCODE_LOCALEDIR', datadir + '/locale')
+
+configure_file(output: 'config.h', configuration : conf)
+
+gnome = import('gnome')
+
+add_global_arguments('-Wall', language: 'c')
+cc = meson.get_compiler('c')
+if cc.get_id() == 'gcc'
+ add_global_arguments('-Wchar-subscripts',
+ '-Wmissing-declarations',
+ '-Wmissing-prototypes',
+ '-Wnested-externs',
+ '-Wpointer-arith',
+ '-Wcast-align',
+ '-Wsign-compare',
+ '-Wredundant-decls',
+ '-fno-strict-aliasing',
+ language: 'c')
+endif
+
+subdir('geocode-glib')
+#subdir('po')
+#subdir('icons')
+#subdir('docs')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]