[gnome-clocks/wip/meson: 2/2] build: add meson build system



commit 8387f9e8a41f77dbec388d9e4f0fce9ea4a83500
Author: Paolo Borelli <pborelli gnome org>
Date:   Tue Dec 27 10:34:02 2016 +0100

    build: add meson build system
    
    WIP. Current TODO list:
     - icons and other data files are still not handled
     - translator stuff
     - docs (yelp etc)
     - the config.h workaround is pretty ugly (drop subdir?)
     - fix detection of first weekday support
     - learn more about meson to check if there are cleaner ways
     - distcheck etc?

 data/meson.build |    6 +++++
 meson.build      |   32 ++++++++++++++++++++++++++++++
 src/meson.build  |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+), 0 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..a336232
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,6 @@
+gnome_module = import('gnome')
+
+resources = gnome_module.compile_resources('org.gnome.clocks',
+                                           'gnome-clocks.gresource.xml',
+                                           source_dir: '.',
+                                           c_name: 'resources')
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..17c23b2
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,32 @@
+project('gnome-clocks',
+        ['vala', 'c'],
+        version: '3.23.0',
+        license: 'GPL')
+
+glib = dependency('glib-2.0', version: '>=2.44')
+gio = dependency('gio-2.0', version: '>=2.44')
+gobject = dependency('gobject-2.0', version: '>=2.44')
+gtk = dependency('gtk+-3.0', version: '>=3.20')
+gsound = dependency('gsound', version: '>=0.98')
+gweather = dependency('gweather-3.0', version: '>=3.14')
+gnomedesktop = dependency('gnome-desktop-3.0', version: '>=3.8')
+geocodeglib = dependency('geocode-glib-1.0', version: '>=1.0')
+libgeoclue = dependency('libgeoclue-2.0', version: '>=2.4')
+
+cc = meson.get_compiler('c')
+m_dep = cc.find_library('m', required: true)
+
+conf = configuration_data()
+conf.set('G_LOG_DOMAIN', '"org.gnome.Clocks"')
+conf.set('PACKAGE_NAME', '"gnome-clocks"')
+conf.set('PACKAGE_VERSION', '"' + meson.project_version() + '"')
+conf.set('VERSION', '"' + meson.project_version() + '"')
+conf.set('GETTEXT_PACKAGE', '"gnome-clocks"')
+conf.set('DATADIR', '"' + get_option('prefix') + '/' + get_option('datadir') + '"')
+conf.set('GNOMELOCALEDIR', '"' + get_option('prefix') + '/' + get_option('datadir') + '/locale"')
+conf.set('HAVE__NL_TIME_FIRST_WEEKDAY', '1') # FIXME detect
+configure_file(output : 'config.h', configuration : conf)
+config_file = files('config.h') # FIXME unused
+
+subdir('data')
+subdir('src')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..4cd2290
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,56 @@
+vala_sources = [
+    'alarm.vala',
+    'application.vala',
+    'clock.vala',
+    'config.vapi',
+    'geocoding.vala',
+    'main.vala',
+    'search-provider.vala',
+    'stopwatch.vala',
+    'timer.vala',
+    'utils.vala',
+    'widgets.vala',
+    'window.vala',
+    'world.vala'
+]
+
+c_sources = [
+    'cutils.c'
+]
+
+vala_args = [
+    '--target-glib=2.44',
+    '--vapidir=' + meson.current_source_dir(),
+    '--gresources=' + meson.current_source_dir() + '/../data/gnome-clocks.gresource.xml',
+]
+
+c_args = [
+    '-include', '../config.h',
+    '-DGWEATHER_I_KNOW_THIS_IS_UNSTABLE',
+    '-DGNOME_DESKTOP_USE_UNSTABLE_API'
+]
+
+include_dirs = include_directories(meson.current_build_dir() + '/../')
+
+dependencies = [
+    glib,
+    gio,
+    gobject,
+    gtk,
+    gsound,
+    gweather,
+    gnomedesktop,
+    geocodeglib,
+    libgeoclue,
+    m_dep
+]
+
+executable('gnome-clocks',
+           vala_sources + c_sources,
+           resources,
+           include_directories: include_dirs,
+           vala_args: vala_args,
+           c_args: c_args,
+           install: true,
+           dependencies: dependencies)
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]