about summary refs log tree commit diff
path: root/libnm/fake-typelib
diff options
context:
space:
mode:
Diffstat (limited to 'libnm/fake-typelib')
-rw-r--r--libnm/fake-typelib/NMClient.gir9
-rw-r--r--libnm/fake-typelib/NetworkManager.gir10
-rw-r--r--libnm/fake-typelib/meson.build30
-rw-r--r--libnm/fake-typelib/typelibs.gresource.xml7
4 files changed, 56 insertions, 0 deletions
diff --git a/libnm/fake-typelib/NMClient.gir b/libnm/fake-typelib/NMClient.gir
new file mode 100644
index 00000000..3002f8d6
--- /dev/null
+++ b/libnm/fake-typelib/NMClient.gir
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!-- A lame duck typelib which prevents GIR from loading the
+     real one (which would crash due to conflict with libnm) -->
+<repository version="1.2"
+            xmlns="http://www.gtk.org/introspection/core/1.0"
+            xmlns:c="http://www.gtk.org/introspection/c/1.0"
+            xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+	<namespace name="NMClient" version="0.0" />
+</repository>
diff --git a/libnm/fake-typelib/NetworkManager.gir b/libnm/fake-typelib/NetworkManager.gir
new file mode 100644
index 00000000..d15d29af
--- /dev/null
+++ b/libnm/fake-typelib/NetworkManager.gir
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!-- A lame duck typelib which prevents GIR from loading the
+     real one (which would crash due to conflict with libnm) -->
+<repository version="1.2"
+            xmlns="http://www.gtk.org/introspection/core/1.0"
+            xmlns:c="http://www.gtk.org/introspection/c/1.0"
+            xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+	<namespace name="NetworkManager" version="0.0">
+	</namespace>
+</repository>
diff --git a/libnm/fake-typelib/meson.build b/libnm/fake-typelib/meson.build
new file mode 100644
index 00000000..c0a779a2
--- /dev/null
+++ b/libnm/fake-typelib/meson.build
@@ -0,0 +1,30 @@
+g_ir_compiler = find_program('g-ir-compiler')
+
+girs = [
+  'NetworkManager',
+  'NMClient'
+]
+
+resource_data = []
+
+foreach gir: girs
+  gir_typelib = gir + '.typelib'
+
+  resource_data += custom_target(
+    gir_typelib,
+    input: gir + '.gir',
+    output: gir_typelib,
+    command: [g_ir_compiler, '@INPUT@', '-o', '@OUTPUT@']
+  )
+endforeach
+
+resource = 'typelibs'
+
+sources += gnome.compile_resources(
+  resource,
+  resource + '.gresource.xml',
+  source_dir: '.',
+  dependencies: resource_data,
+  extra_args: '--manual-register',
+  export: true
+)
diff --git a/libnm/fake-typelib/typelibs.gresource.xml b/libnm/fake-typelib/typelibs.gresource.xml
new file mode 100644
index 00000000..9a71d975
--- /dev/null
+++ b/libnm/fake-typelib/typelibs.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+	<gresource prefix="/org/freedesktop/libnm/fake-typelib">
+		<file>NetworkManager.typelib</file>
+		<file>NMClient.typelib</file>
+	</gresource>
+</gresources>