[Libguestfs] [PATCH] gobject: Add Vala binding support

Richard W.M. Jones rjones at redhat.com
Tue Jan 22 13:09:52 UTC 2019


On Tue, Jan 22, 2019 at 01:05:41PM +0000, Richard W.M. Jones wrote:
> From 610c8206ecd991be372650c2914bbffd9af057fb Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Corentin=20No=C3=ABl?= <corentin.noel at collabora.com>
> Date: Tue, 22 Jan 2019 13:12:57 +0100
> Subject: [PATCH] gobject: Add Vala binding support
> 
> ---
>  .gitignore                          |   1 +
>  configure.ac                        |   4 ++
>  gobject/Makefile.am                 |  17 +++++
>  gobject/libguestfs-gobject-1.0.deps |   2 +
>  m4/vapigen.m4                       | 101 ++++++++++++++++++++++++++++

So generally speaking the patch is good.  I have a few comments inlne ...

>  5 files changed, 125 insertions(+)
>  create mode 100644 gobject/libguestfs-gobject-1.0.deps
>  create mode 100644 m4/vapigen.m4
> 
> diff --git a/.gitignore b/.gitignore
> index 637bf7765..afe1c0654 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -340,6 +340,7 @@ Makefile.in
>  /gobject/Guestfs-1.0.typelib
>  /gobject/guestfs-gobject.3
>  /gobject/stamp-guestfs-gobject.pod
> +/gobject/libguestfs-gobject-1.0.vapi

If you could keep the entries in .gitignore sorted.

>  /golang/bindtests.go
>  /golang/examples/guestfs-golang.3
>  /golang/examples/stamp-guestfs-golang.pod
> diff --git a/configure.ac b/configure.ac
> index e18e099b9..dfc7a1af3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -161,6 +161,8 @@ HEADING([Checking for Go])
>  m4_include([m4/guestfs-golang.m4])
>  HEADING([Checking for GObject Introspection])
>  m4_include([m4/guestfs-gobject.m4])
> +HEADING([Checking for Vala])
> +VAPIGEN_CHECK
>  
>  dnl virt-v2v, virt-p2v.
>  HEADING([Checking the virt-v2v and virt-p2v dependencies])
> @@ -421,6 +423,8 @@ AS_ECHO_N(["gobject bindings .................... "])
>  if test "x$HAVE_GOBJECT_TRUE" = "x"; then echo "yes"; else echo "no"; fi
>  AS_ECHO_N(["gobject introspection ............... "])
>  if test "x$HAVE_INTROSPECTION_TRUE" = "x"; then echo "yes"; else echo "no"; fi
> +AS_ECHO_N(["Vala bindings ....................... "])
> +if test "x$ENABLE_VAPIGEN" = "x"; then echo "yes"; else echo "no"; fi
>  AS_ECHO_N(["bash completion ..................... "])
>  if test "x$HAVE_BASH_COMPLETION_TRUE" = "x"; then echo "yes"; else echo "no"; fi
>  echo
> diff --git a/gobject/Makefile.am b/gobject/Makefile.am
> index ddedd5b51..302d54354 100644
> --- a/gobject/Makefile.am
> +++ b/gobject/Makefile.am
> @@ -105,6 +105,23 @@ $(TESTS): $(typelib_DATA)
>  
>  CLEANFILES += $(gir_DATA) $(typelib_DATA)
>  
> +if ENABLE_VAPIGEN
> +-include $(VAPIGEN_MAKEFILE)
> +
> +libguestfs-gobject-1.0.vapi: Guestfs-1.0.gir libguestfs-gobject-1.0.deps
> +
> +VAPIGEN_VAPIS = libguestfs-gobject-1.0.vapi
> +
> +libguestfs_gobject_1_0_vapi_DEPS = gobject-2.0 gio-2.0
> +libguestfs_gobject_1_0_vapi_METADATADIRS = $(srcdir)
> +libguestfs_gobject_1_0_vapi_FILES = Guestfs-1.0.gir
> +
> +vapidir = $(datadir)/vala/vapi
> +vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
> +
> +EXTRA_DIST += foo-1.0.deps

Is 'foo' right here?

Also should EXTRA_DIST be outside the 'if ENABLE_VAPIGEN' condition?

You can try doing:

  make dist && make maintainer-check-extra-dist

to see if you're included all the right EXTRA_DIST files.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list