[folks/wip/nielsdg/meson-followup-fixes: 1/3] meson: Fix omitted Gir annotations in the VAPIs



commit 4664aa29bce06a3229a18a7b8cd3aeefbb02ca3d
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Wed Apr 17 23:51:03 2019 +0200

    meson: Fix omitted Gir annotations in the VAPIs
    
    Because some backend libraries have a different VAPI/GIR namespace, we
    need to make sure this doesn't get omitted in the generated VAPI files.
    See the comments in the code for more info.
    
    Spotted by @ricotz at https://gitlab.gnome.org/GNOME/folks/merge_requests/9#note_491440

 backends/eds/lib/meson.build          | 10 ++++++++++
 backends/libsocialweb/lib/meson.build | 10 ++++++++++
 backends/meson.build                  |  8 ++++++++
 backends/namespace.vala.in            |  6 ++++++
 backends/telepathy/lib/meson.build    | 10 ++++++++++
 backends/tracker/lib/meson.build      | 10 ++++++++++
 6 files changed, 54 insertions(+)
---
diff --git a/backends/eds/lib/meson.build b/backends/eds/lib/meson.build
index 3c43d0df..297cc158 100644
--- a/backends/eds/lib/meson.build
+++ b/backends/eds/lib/meson.build
@@ -5,6 +5,16 @@ eds_backendlib_sources = files(
   'edsf-persona.vala',
 )
 
+eds_backendlib_sources += configure_file(
+  input: namespace_vala_in,
+  output: 'namespace.vala',
+  configuration: {
+    'BACKENDLIB_GIR_NAME': eds_backendlib_gir_name.split('-')[0],
+    'BACKENDLIB_GIR_VERSION': folks_api_version,
+    'BACKENDLIB_NAMESPACE': 'Edsf',
+  },
+)
+
 eds_backendlib_deps = [
   backend_deps,
   libebook_dep,
diff --git a/backends/libsocialweb/lib/meson.build b/backends/libsocialweb/lib/meson.build
index a1884cb8..6861f054 100644
--- a/backends/libsocialweb/lib/meson.build
+++ b/backends/libsocialweb/lib/meson.build
@@ -5,6 +5,16 @@ libsocialweb_backendlib_sources = files(
   'swf-persona.vala',
 )
 
+libsocialweb_backendlib_sources += configure_file(
+  input: namespace_vala_in,
+  output: 'namespace.vala',
+  configuration: {
+    'BACKENDLIB_GIR_NAME': libsocialweb_backendlib_gir_name.split('-')[0],
+    'BACKENDLIB_GIR_VERSION': folks_api_version,
+    'BACKENDLIB_NAMESPACE': 'Swf',
+  },
+)
+
 libsocialweb_backendlib_deps = [
   backend_deps,
   libsocialweb_dep,
diff --git a/backends/meson.build b/backends/meson.build
index 7e7d953f..7e918d40 100644
--- a/backends/meson.build
+++ b/backends/meson.build
@@ -11,6 +11,14 @@ common_backendlib_vala_flags = [
   '--includedir', meson.project_name(),
 ]
 
+# Namespace Vala file
+#
+# FIXME: This can be removed once the backend namespaces have been sanitised.
+# https://gitlab.gnome.org/GNOME/folks/issues/73
+#
+# This file sets namespace and version attributes for GIR.
+namespace_vala_in = files('namespace.vala.in')
+
 # A subdirectory for each type of backend
 subdir('dummy')
 subdir('key-file')
diff --git a/backends/namespace.vala.in b/backends/namespace.vala.in
new file mode 100644
index 00000000..9681a74c
--- /dev/null
+++ b/backends/namespace.vala.in
@@ -0,0 +1,6 @@
+// FIXME: This can be removed once the backend namespaces have been sanitised.
+// https://gitlab.gnome.org/GNOME/folks/issues/73
+//
+// This file sets namespace and version attributes for GIR.
+[CCode (gir_namespace = "@BACKENDLIB_GIR_NAME@", gir_version = "@BACKENDLIB_GIR_VERSION@")]
+namespace @BACKENDLIB_NAMESPACE@ { }
diff --git a/backends/telepathy/lib/meson.build b/backends/telepathy/lib/meson.build
index 138e77e0..b5850395 100644
--- a/backends/telepathy/lib/meson.build
+++ b/backends/telepathy/lib/meson.build
@@ -74,6 +74,16 @@ telepathy_backendlib_sources = files(
   'tpf-persona.vala',
 )
 
+telepathy_backendlib_sources += configure_file(
+  input: namespace_vala_in,
+  output: 'namespace.vala',
+  configuration: {
+    'BACKENDLIB_GIR_NAME': telepathy_backendlib_gir_name.split('-')[0],
+    'BACKENDLIB_GIR_VERSION': folks_api_version,
+    'BACKENDLIB_NAMESPACE': 'Tpf',
+  },
+)
+
 telepathy_backendlib_deps = [
   backend_deps,
   telepathy_glib_dep,
diff --git a/backends/tracker/lib/meson.build b/backends/tracker/lib/meson.build
index 4fa35de8..95a8d48d 100644
--- a/backends/tracker/lib/meson.build
+++ b/backends/tracker/lib/meson.build
@@ -6,6 +6,16 @@ tracker_backendlib_sources = files(
   'trf-util.vala',
 )
 
+tracker_backendlib_sources += configure_file(
+  input: namespace_vala_in,
+  output: 'namespace.vala',
+  configuration: {
+    'BACKENDLIB_GIR_NAME': tracker_backendlib_gir_name.split('-')[0],
+    'BACKENDLIB_GIR_VERSION': folks_api_version,
+    'BACKENDLIB_NAMESPACE': 'Trf',
+  },
+)
+
 tracker_backendlib_deps = [
   backend_deps,
   tracker_sparql_dep,


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