[gimp/meson: 33/805] Fix meson of app/*



commit 522d7d5a1b6364ca4a45c53cf69e78e876b75d4a
Author: Félix Piédallu <felix piedallu me>
Date:   Thu Nov 9 10:05:54 2017 +0100

    Fix meson of app/*

 app/actions/meson.build |    2 -
 app/config/meson.build  |   53 +++++++++++++++++++++++++++++++++++++++-------
 app/gui/meson.build     |   21 +++++++++++++-----
 app/tests/meson.build   |    9 +++++++-
 4 files changed, 68 insertions(+), 17 deletions(-)
---
diff --git a/app/actions/meson.build b/app/actions/meson.build
index bcf230c..d9322fe 100644
--- a/app/actions/meson.build
+++ b/app/actions/meson.build
@@ -103,5 +103,3 @@ libappactions = static_library('appactions',
     gegl, gdk_pixbuf, gtk2,
   ],
 )
-
-
diff --git a/app/config/meson.build b/app/config/meson.build
index 8fb4f31..b5487d2 100644
--- a/app/config/meson.build
+++ b/app/config/meson.build
@@ -1,3 +1,45 @@
+
+appconfigenums = custom_target('config-enums.c',
+  input : [ 'config-enums.h', ],
+  output: [ 'config-enums.c', ],
+  command: [
+    gimp_mkenums,
+    '--fhead','#include "config.h"\n'+
+              '#include <gio/gio.h>\n'+
+              '#include "libgimpbase/gimpbase.h"\n'+
+              '#include "config-enums.h"\n'+
+              '#include"gimp-intl.h"\n',
+    '--fprod','/* enumerations from "@basename@" */\n',
+    '--vhead','GType\n'+
+              '@enum_name@_get_type (void)\n'+
+              '{\n'+
+              '  static const G@Type@Value values[] =\n'+
+              '  {',
+    '--vprod','    { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
+    '--vtail','    { 0, NULL, NULL }\n'+
+              '  };\n',
+    '--dhead','  static const Gimp@Type@Desc descs[] =\n'+
+              '  {',
+    '--dprod','    { @VALUENAME@, @valuedesc@, @valuehelp@ },',
+    '--dtail','    { 0, NULL, NULL }\n'+
+              '  };\n'+
+              '\n'+
+              '  static GType type = 0;\n'+
+              '\n'+
+              '  if (G_UNLIKELY (! type))\n'+
+              '    {\n'+
+              '      type = g_@type@_register_static ("@EnumName@", values);\n'+
+              '      gimp_type_set_translation_context (type, "@enumnick@");\n'+
+              '      gimp_@type@_set_value_descriptions (type, descs);\n'+
+              '    }\n'+
+              '\n'+
+              '  return type;\n'+
+              '}\n',
+    '@INPUT@',
+  ],
+  capture: true,
+)
+
 libappconfig_sources = [
   'gimpconfig-dump.c',
   'gimpconfig-file.c',
@@ -15,14 +57,9 @@ libappconfig_sources = [
   'gimprc-unknown.c',
   'gimprc.c',
   'gimpxmlparser.c',
+  appconfigenums,
 ]
 
-# TODO mkenums
-libappconfig_sources += [
-  'config-enums.c',
-]
-
-
 libappconfig = static_library('appconfig',
   libappconfig_sources,
   include_directories: [ rootInclude, rootAppInclude, ],
@@ -38,7 +75,7 @@ libappconfig = static_library('appconfig',
 
 
 executable('test-config',
-  'test-config.c',
+  [ 'test-config.c', app_debug_files, ],
   include_directories: [ rootInclude, rootAppInclude, ],
 
   dependencies: [
@@ -67,5 +104,5 @@ executable('test-config',
     libappvectors,
     libappxcf,
   ],
+  install: false,
 )
-
diff --git a/app/gui/meson.build b/app/gui/meson.build
index 0f4abfa..13c7b1a 100644
--- a/app/gui/meson.build
+++ b/app/gui/meson.build
@@ -1,20 +1,28 @@
+
+gimpdbusservice_gen = gnome.gdbus_codegen(
+  'gimpdbusservice-generated',
+  'dbus-service.xml',
+  interface_prefix: 'org.gimp.GIMP.',
+  namespace: 'GimpDBusService',
+)
+
 libappgui_sources = [
-  # 'gimpdbusservice.c',
+  'gimpdbusservice.c',
   'gimpuiconfigurer.c',
   'gui-message.c',
-  # 'gui-unique.c',
+  'gui-unique.c',
   'gui-vtable.c',
   'gui.c',
   'icon-themes.c',
   'session.c',
   'splash.c',
   'themes.c',
+  gimpdbusservice_gen,
 ]
 
-# TODO dbus-codegen
-libappgui_sources += [
-  # 'gimpdbusservice-generated.c',
-]
+# Workaround for generated header included in other directories.
+configInclude = include_directories('.')
+
 
 libappgui = static_library('appgui',
   libappgui_sources,
@@ -26,4 +34,5 @@ libappgui = static_library('appgui',
   dependencies: [
     cairo, dbus_glib, gegl, gdk_pixbuf, gio_specific, gtk2
   ],
+  install: false,
 )
diff --git a/app/tests/meson.build b/app/tests/meson.build
index 8be3769..5eaa4fd 100644
--- a/app/tests/meson.build
+++ b/app/tests/meson.build
@@ -6,7 +6,7 @@ apptests_deps = [
   pangocairo, gtk2, dbus_glib, gegl,
 ]
 apptests_links = [
-  # libapp,
+  libapp,
   libappactions,
   libappconfig,
   libappcore,
@@ -30,6 +30,13 @@ apptests_links = [
   libappvectors,
   libappwidgets,
   libappxcf,
+  libgimpbase,
+  libgimpcolor,
+  libgimpconfig,
+  libgimpmath,
+  libgimpmodule,
+  libgimpthumb,
+  libgimpwidgets,
 ]
 
 


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