[retro-gtk/build-doc: 1/2] Make the D-Bus API clearly private



commit 9d3b599caf55d305d01babbb67a121b7cdcc6e1d
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Sun Apr 12 20:01:33 2020 +0200

    Make the D-Bus API clearly private
    
    This adds the generated D-Bus header end by -private.h like other
    private headers, and makes the generated D-Bus documentation private.
    
    This makes it extra clear that the API is private, and it will help when
    building the documentation.

 retro-gtk/retro-runner-process-private.h |  2 +-
 retro-runner/ipc-runner-impl-private.h   |  2 +-
 shared/make-ipc-runner-private.sh        | 13 +++++++++++++
 shared/meson.build                       | 15 +++++++++++++--
 4 files changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/retro-gtk/retro-runner-process-private.h b/retro-gtk/retro-runner-process-private.h
index 0a570f8..56a4a9e 100644
--- a/retro-gtk/retro-runner-process-private.h
+++ b/retro-gtk/retro-runner-process-private.h
@@ -4,7 +4,7 @@
 
 #include <glib-object.h>
 
-#include "ipc-runner.h"
+#include "ipc-runner-private.h"
 
 G_BEGIN_DECLS
 
diff --git a/retro-runner/ipc-runner-impl-private.h b/retro-runner/ipc-runner-impl-private.h
index dc40bb6..dbdad46 100644
--- a/retro-runner/ipc-runner-impl-private.h
+++ b/retro-runner/ipc-runner-impl-private.h
@@ -2,7 +2,7 @@
 
 #pragma once
 
-#include "ipc-runner.h"
+#include "ipc-runner-private.h"
 #include "retro-core.h"
 #include "retro-variable-private.h"
 #include "retro-pixel-format-private.h"
diff --git a/shared/make-ipc-runner-private.sh b/shared/make-ipc-runner-private.sh
new file mode 100755
index 0000000..5d8f70e
--- /dev/null
+++ b/shared/make-ipc-runner-private.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ "$1" != "shared/ipc-runner-public.c" ]; then
+  exit 1
+fi
+
+if [ "$2" != "shared/ipc-runner-public.h" ]; then
+  exit 1
+fi
+
+sed -i -e s/ipc-runner-public.h/ipc-runner-private.h/ -e s/SECTION:IpcRunner/PRIVATE:IpcRunner/ $1
+mv $1 shared/ipc-runner.c
+mv $2 shared/ipc-runner-private.h
diff --git a/shared/meson.build b/shared/meson.build
index 0aec622..d33654b 100644
--- a/shared/meson.build
+++ b/shared/meson.build
@@ -1,10 +1,21 @@
-ipc_runner_src = gnome.gdbus_codegen(
-  'ipc-runner',
+ipc_runner_public_src = gnome.gdbus_codegen(
+  'ipc-runner-public',
   sources: 'org.gnome.Retro.Runner.xml',
   interface_prefix: 'org.gnome.Retro.',
   namespace: 'Ipc'
 )
 
+# Make the generated D-Bus API documentation private.
+
+make_ipc_runner_private = find_program('make-ipc-runner-private.sh')
+
+ipc_runner_src = custom_target('make-ipc-runner-private',
+  output : ['ipc-runner.c', 'ipc-runner-private.h'],
+  input : ipc_runner_public_src,
+  command : [make_ipc_runner_private, '@INPUT@'],
+  install : true,
+  install_dir : 'subdir')
+
 shared_sources = files([
   'retro-controller-codes.c',
   'retro-controller-state.c',


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