grim/gir2glade
Clone
Summary
Browse
Changes
Graph
Add an example using meson
draft
2018-05-08, Gary Kramlich
36082cc7145e
Parents
66a42ebdec52
Children
1ceacc6b4468
Add an example using meson
1 files changed, 43 insertions(+), 0 deletions(-)
+43
-0
README.md
--- a/README.md Tue May 08 01:37:05 2018 -0500
+++ b/README.md Tue May 08 01:37:13 2018 -0500
@@ -6,6 +6,17 @@
It can be used on any gir file with any XSLT processor.
+# Purpose
+
+gir2glade was written because I didn't want to have to maintain a glade catalog
+especially when all of the data is already in the gir files being built as part
+of my projects.
+
+With it, you can add a build target to your build system that depends on your
+gir and have it create the catalog and install it into the proper place.
+
+# Command Line Usage
+
The following will create the glade catalog and output it to stdout.
```
@@ -20,3 +31,35 @@
Then add the path you wrote it to to glade's catalog search path and you're set!
+# Meson Usage
+
+Below is a quick HOWTO, to generate the catalog with meson. You may need to
+tweak the path of `gir2glade.xsl` as it's assumed to be in the root of your
+source directory.
+
+This is spread a couple of files, but it can be found in the
+[GtkIM](https://bitbucket.org/rw_grim/gtkim) source tree.
+
+```
+GLADEUI = dependency('gladeui-2.0', version: '>=3.0.0')
+
+XSLTPROC = find_program('xsltproc', required : true)
+
+gtkim_gir = gnome.generate_gir(gtkim,
+ sources : GTKIM_SOURCES + GTKIM_HEADERS +
+ GTKIM_PUBLIC_BUILT_SOURCES +
+ GTKIM_PUBLIC_BUILT_HEADERS,
+ includes : ['GModule-2.0', 'GObject-2.0', 'Gtk-3.0'],
+ namespace : 'GtkIM',
+ symbol_prefix : 'gtkim',
+ nsversion : '@0@.0'.format(GTKIM_MAJOR_VERSION),
+ install : true)
+
+gtkim_glade_catalog = custom_target('gtkim.xml',
+ output : 'gtkim.xml',
+ input : gtkim_gir[0],
+ command : [XSLTPROC.path(), '--output', '@0@/gtkim.xml'.format(meson.current_build_dir()), '@0@/gir2glade.xls'.format(meson.source_root()), gtkim_gir[0]],
+ install : true,
+ install_dir : GLADEUI.get_pkgconfig_variable('catalogdir'))
+```
+