[recipes/meson2: 1/19] meson build support



commit fe586db2018ceecfc790b719b73ad59e9fb7d95d
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 2 17:04:32 2016 -0500

    meson build support

 meson.build      |   33 ++++++++++++++++++++++++
 po/meson.build   |    3 ++
 src/meson.build  |   73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 types.c.template |   37 +++++++++++++++++++++++++++
 types.h.template |   26 +++++++++++++++++++
 5 files changed, 172 insertions(+), 0 deletions(-)
---
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..fb22c6d
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,33 @@
+project('recipes', 'c', version: '0.1.0',
+        meson_version : '>=0.36.0')
+
+i18n = import('i18n')
+
+conf = configuration_data()
+
+conf.set_quoted('G_LOG_DOMAIN', 'org.gnome.Recipes')
+conf.set_quoted('PACKAGE_NAME', 'recipes')
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+conf.set_quoted('GETTEXT_PACKAGE', 'recipes')
+conf.set_quoted('PKGDATADIR', join_paths([ get_option('prefix'),
+                                           get_option('datadir'),
+                                           'recipes' ]))
+conf.set_quoted('LOCALEDIR', join_paths([ get_option('prefix'),
+                                          get_option('datadir'),
+                                          'locale' ]))
+
+configure_file(output : 'config.h', configuration : conf)
+
+# Needed to find config.h
+top_inc = include_directories('.')
+
+libgd_tagged_entry = true
+libgd_static = true
+subdir('po')
+subdir('libgd')
+
+deps = [ dependency('gtk+-3.0'),
+         dependency('gnome-autoar-0'),
+         libgd_dep ]
+
+subdir('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..14cfabd
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+langs = ['de', 'es', 'nl', 'pl', 'sr']
+
+i18n.gettext('recipes', languages: langs)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..27d977f
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,73 @@
+gnome = import('gnome')
+
+resources_ui = gnome.compile_resources('resources_ui',
+                                       'recipes-ui.gresource.xml',
+                                       c_name: '_recipes',
+                                       source_dir: 'src')
+
+resources_images = gnome.compile_resources('resources_images',
+                                       'recipes-images.gresource.xml',
+                                       c_name: '_recipes',
+                                       source_dir: 'src')
+
+enums = gnome.mkenums('types',
+                      sources: 'gr-recipe.h',
+                      c_template: 'types.c.template',
+                      h_template: 'types.h.template')
+
+search_provider = gnome.gdbus_codegen('search-provider',
+                                      'shell-search-provider-dbus-interfaces.xml',
+                                      interface_prefix: 'org.gnome.',
+                                      namespace: 'Gr')
+
+
+src =  ['main.c',
+       'gr-app.c',
+       'gr-category-tile.c',
+       'gr-chef.c',
+       'gr-chef-tile.c',
+       'gr-cuisine.c',
+       'gr-cuisine-tile.c',
+       'gr-cuisine-page.c',
+       'gr-cuisines-page.c',
+       'gr-details-page.c',
+       'gr-diet.c',
+       'gr-diet-row.c',
+       'gr-edit-page.c',
+       'gr-images.c',
+       'gr-image-viewer.c',
+       'gr-ingredient.c',
+       'gr-ingredient-row.c',
+       'gr-ingredient-tile.c',
+       'gr-ingredients-list.c',
+       'gr-ingredients-page.c',
+       'gr-list-page.c',
+       'gr-meal.c',
+       'gr-meal-row.c',
+       'gr-preferences.c',
+       'gr-query-editor.c',
+       'gr-recipe.c',
+       'gr-recipe-exporter.c',
+       'gr-recipe-importer.c',
+       'gr-recipe-printer.c',
+       'gr-recipe-store.c',
+       'gr-recipe-tile.c',
+       'gr-recipes-page.c',
+       'gr-search-page.c',
+       'gr-season.c',
+       'gr-timer.c',
+       'gr-timer-widget.c',
+       'gr-toggle-button.c',
+       'gr-utils.c',
+       'gr-window.c',
+       'gr-shell-search-provider.c',
+  enums,
+  resources_ui,
+  resources_images]
+
+executable('recipe',
+           src,
+           install : true,
+           include_directories : top_inc,
+           dependencies: deps)
+
diff --git a/types.c.template b/types.c.template
new file mode 100644
index 0000000..22b2994
--- /dev/null
+++ b/types.c.template
@@ -0,0 +1,37 @@
+/*** BEGIN file-header ***/
+#include "config.h"
+#include "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/types.h.template b/types.h.template
new file mode 100644
index 0000000..51f953d
--- /dev/null
+++ b/types.h.template
@@ -0,0 +1,26 @@
+/*** BEGIN file-header ***/
+#pragma once
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+
+#include "@filename@"
+
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+/*** END file-tail ***/
+~                                         


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