[rygel/wip/meson: 83/85] fixup! meson: Fix dependency issues for GIR generation



commit 62bc96cf8df956897ade7eee82e1f731160309d4
Author: Jens Georg <mail jensge org>
Date:   Sun Sep 9 15:06:54 2018 +0200

    fixup! meson: Fix dependency issues for GIR generation

 src/librygel-core/meson.build         | 14 ++++++++++++--
 src/librygel-renderer-gst/meson.build |  2 ++
 src/librygel-renderer/meson.build     |  2 ++
 src/librygel-server/meson.build       |  3 +++
 4 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/librygel-core/meson.build b/src/librygel-core/meson.build
index e586dbff..6f471932 100644
--- a/src/librygel-core/meson.build
+++ b/src/librygel-core/meson.build
@@ -35,6 +35,9 @@ build_config = declare_dependency(include_directories : config_include,
                                   sources : 'rygel-build-config.vapi')
 
 
+# Rygel GIR generation is a tad special. We need to hammer in custom namespaces
+# since the libraries used to be in one binary. So
+# Step one: Build the library, generate the GIR from vala but do not install it
 core_lib = library('rygel-core-2.6', core_sources,
         dependencies : core_deps,
         include_directories: [config_include, include_directories('.')],
@@ -46,8 +49,12 @@ core_lib = library('rygel-core-2.6', core_sources,
         install_dir : [true, rygel_includedir, true, false])
 install_data('rygel-core-2.6.deps', install_dir : rygel_vapidir)
 
-foo_01 = declare_dependency(link_with : core_lib)
-
+# Step two: Do the namespace magic with sed
+# We cannot use input: here since the generated ninja build file does not seem
+# to know that Rygel-2.6.gir is a result of building rygel-core-2.6 target
+# The custom_target call depends on the core_lib to make sure it is build before
+# and the name of the generated GIR is passed directly to sed as part of the
+# commandline
 core_gir = custom_target('RygelCore-2.6.gir',
               command: [sed, '-e', 's,Rygel[.],RygelCore.,g',
                         '-e', 's,namespace name="Rygel",namespace name="RygelCore",g',
@@ -58,6 +65,9 @@ core_gir = custom_target('RygelCore-2.6.gir',
               install: true,
               install_dir: gir_dir)
 
+# Step three: Compile the typelib. The dependency issue is similar to step two,
+# so we depend on the custom_target from that step and pass the input through
+# commandline.
 custom_target('RygelCore-2.6.typelib',
                command: [g_ir_compiler, '--output', '@OUTPUT@', join_paths(meson.current_build_dir(), 
'RygelCore-2.6.gir')],
                output: 'RygelCore-2.6.typelib',
diff --git a/src/librygel-renderer-gst/meson.build b/src/librygel-renderer-gst/meson.build
index fddef8ef..bdcf8187 100644
--- a/src/librygel-renderer-gst/meson.build
+++ b/src/librygel-renderer-gst/meson.build
@@ -13,6 +13,8 @@ renderer_gst_lib = library('rygel-renderer-gst-2.6', renderer_gst_sources,
         install_dir : [true, rygel_includedir, true, false])
 install_data('rygel-renderer-gst-2.6.deps', install_dir : rygel_vapidir)
 
+# For details on the GIR/typelib generating process, see
+# librygel-core/meson.build
 renderer_gst_gir = custom_target('RygelRendererGst-2.6.gir',
               command: [sed, '-e', 's,Rygel[.],RygelRendererGst.,g',
                              '-e', 's,RygelRendererGst[.]MediaRenderer,RygelRenderer.MediaRenderer,g',
diff --git a/src/librygel-renderer/meson.build b/src/librygel-renderer/meson.build
index 68c8c0d8..94948977 100644
--- a/src/librygel-renderer/meson.build
+++ b/src/librygel-renderer/meson.build
@@ -21,6 +21,8 @@ renderer_lib = library('rygel-renderer-2.6', renderer_sources,
         install_dir : [true, rygel_includedir, true, false])
 install_data('rygel-renderer-2.6.deps', install_dir : rygel_vapidir)
 
+# For details on the GIR / typelib generation process, see
+# librygel-core/meson.build
 renderer_gir = custom_target('RygelRenderer-2.6.gir',
               command: [sed, '-e', 's,Rygel[.],RygelRenderer.,g',
                                           '-e', 's,namespace name="Rygel",namespace name="RygelRenderer",g',
diff --git a/src/librygel-server/meson.build b/src/librygel-server/meson.build
index aa1237bc..a57ac7c3 100644
--- a/src/librygel-server/meson.build
+++ b/src/librygel-server/meson.build
@@ -99,6 +99,9 @@ server_lib = library('rygel-server-2.6', server_sources,
         install_dir : [true, rygel_includedir, true, false])
 install_data('rygel-server-2.6.deps', install_dir : rygel_vapidir)
 
+
+# For details on the GIR/typelib generation process, see
+# librygel-core/meson.build
 server_gir = custom_target('RygelServer-2.6.gir',
               command: [sed, '-e', 's,Rygel[.],RygelServer.,g',
                                           '-e', 's,namespace name="Rygel",namespace name="RygelServer",g',


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