[libvirt-designer v3] Add Vala API

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

 



From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>

This is mostly (modified) copy&paste from libvirt-glib.
---

v3: Added .metadata file to correct init functions vapi.

 Makefile.am                       |  2 +-
 configure.ac                      | 37 +++++++++++++++++++++++++++++++++++++
 vapi/LibvirtDesigner-1.0.metadata |  2 ++
 vapi/Makefile.am                  | 28 ++++++++++++++++++++++++++++
 vapi/libvirt-designer-1.0.deps    |  2 ++
 5 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 vapi/LibvirtDesigner-1.0.metadata
 create mode 100644 vapi/Makefile.am
 create mode 100644 vapi/libvirt-designer-1.0.deps

diff --git a/Makefile.am b/Makefile.am
index 7801b63..b928f83 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 
-SUBDIRS = libvirt-designer examples docs
+SUBDIRS = libvirt-designer vapi examples docs
 
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/configure.ac b/configure.ac
index a9c5c34..c999826 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,10 +71,46 @@ if test "x$enable_examples" != "xno" ; then
 fi
 AM_CONDITIONAL(WITH_EXAMPLES, [test "x$enable_examples" = "xyes"])
 
+AC_ARG_ENABLE([vala],
+              AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
+              [], [enable_vala=check])
+if test "x$enable_introspection" = "xyes" ; then
+        if test "x$enable_vala" != "xno" ; then
+                AC_PATH_PROG(VAPIGEN, vapigen, no)
+                if test "x$VAPIGEN" == "xno"; then
+                        if test "x$enable_vala" == "xcheck" ; then
+                                enable_vala=no
+                        else
+                                AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
+                        fi
+                fi
+                AC_SUBST(VAPIGEN)
+        fi
+        if test "x$enable_vala" != "xno" ; then
+                AC_MSG_CHECKING([$VAPIGEN support for --metadatadir])
+                $VAPIGEN --help | grep metadatadir 1>/dev/null 2>&1
+                if test $? != 0 ; then
+                        if test "x$enable_vala" == "xcheck" ; then
+                                enable_vala=no
+                                AC_MSG_RESULT([no])
+                        else
+                                AC_MSG_ERROR(["vapigen" binary in your PATH is too old (< 0.13)])
+                        fi
+                else
+                        AC_MSG_RESULT([no])
+                fi
+        fi
+        if test "x$enable_vala" = "xcheck" ; then
+                enable_vala=yes
+        fi
+fi
+AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"])
+
 AC_OUTPUT(Makefile
           libvirt-designer/Makefile
           libvirt-designer.spec
           libvirt-designer-1.0.pc
+          vapi/Makefile
           docs/Makefile
           examples/Makefile)
 
@@ -83,6 +119,7 @@ AC_MSG_NOTICE([Configuration summary])
 AC_MSG_NOTICE([=====================])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([])
+AC_MSG_NOTICE([        Vala API: $enable_vala])
 AC_MSG_NOTICE([        examples: $enable_examples])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([])
diff --git a/vapi/LibvirtDesigner-1.0.metadata b/vapi/LibvirtDesigner-1.0.metadata
new file mode 100644
index 0000000..44f6726
--- /dev/null
+++ b/vapi/LibvirtDesigner-1.0.metadata
@@ -0,0 +1,2 @@
+init.argv unowned
+init_check.argv unowned
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
new file mode 100644
index 0000000..6136216
--- /dev/null
+++ b/vapi/Makefile.am
@@ -0,0 +1,28 @@
+NULL =
+
+if WITH_VALA
+vapidir = $(datadir)/vala/vapi
+vapi_DATA =					\
+	libvirt-designer-1.0.deps		\
+	libvirt-designer-1.0.vapi		\
+	$(NULL)
+
+libvirt-designer-1.0.vapi: $(top_builddir)/libvirt-designer/LibvirtDesigner-1.0.gir
+	$(AM_V_GEN)$(VAPIGEN)							 \
+		--vapidir=$(builddir)						 \
+		--pkg gio-2.0							 \
+		--pkg libosinfo-1.0						 \
+		--pkg libvirt-gconfig-1.0					 \
+		--library libvirt-designer-1.0					 \
+		--metadatadir=$(srcdir)						 \
+		$<
+endif
+
+CLEANFILES =					\
+	libvirt-designer-1.0.vapi		\
+	$(NULL)
+
+EXTRA_DIST =					\
+	LibvirtDesigner-1.0.metadata		\
+	libvirt-designer-1.0.deps		\
+	$(NULL)
diff --git a/vapi/libvirt-designer-1.0.deps b/vapi/libvirt-designer-1.0.deps
new file mode 100644
index 0000000..ba30bfd
--- /dev/null
+++ b/vapi/libvirt-designer-1.0.deps
@@ -0,0 +1,2 @@
+libosinfo-1.0
+libvirt-gconfig-1.0
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]