[geocode-glib/wip/meson: 63/63] wip: Port to meson



commit 15898584ace14df44423c7c1951fa186c454af71
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             |   48 ++++++++++++++++++++++++++++++++++
 meson.build                          |   47 +++++++++++++++++++++++++++++++++
 5 files changed, 160 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..cf7ee09
--- /dev/null
+++ b/geocode-glib/meson.build
@@ -0,0 +1,48 @@
+
+public_sources = [ 'geocode-location.c',
+                   'geocode-forward.c',
+                   'geocode-reverse.c',
+                   'geocode-glib.c',
+                   'geocode-error.c',
+                   'geocode-place.c',
+                   'geocode-bounding-box.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' ]
+
+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(meson.source_root(),
+                              meson.build_root())
+
+libgcglib = shared_library('geocode-glib',
+                           sources,
+                           generated_sources,
+                           dependencies: deps,
+                           include_directories: include,
+                           install: true)
+
+install_headers(headers, subdir: header_subdir)
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]