[tracker/g-i-2: 1/2] libtracker-sparql: Adding introspection using vala --gir options



commit 6ac2b480d35bcd866d7848cc7727b688bc45f3dd
Author: Ivan Frade <ivan frade nokia com>
Date:   Wed Mar 2 14:41:33 2011 +0200

    libtracker-sparql: Adding introspection using vala --gir options
    
    va_list is preventing the generation of the typelib

 Makefile.am                       |    1 +
 configure.ac                      |    3 ++
 src/libtracker-sparql/Makefile.am |   49 +++++++++++++++++++++++++++++++-----
 3 files changed, 46 insertions(+), 7 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e1e6012..56c0aad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -93,6 +93,7 @@ DISTCHECK_CONFIGURE_FLAGS =                            \
 	--enable-libgsf                                \
 	--enable-playlist                              \
 	--enable-tracker-preferences                   \
+	--enable-instrospection			       \
 	--with-enca
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
diff --git a/configure.ac b/configure.ac
index acb6277..6eaf293 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,6 +207,9 @@ NETWORK_MANAGER_REQUIRED=0.8
 # 3.7.0 for WAL
 SQLITE_REQUIRED=3.7.0
 
+# GObject-introspection
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+
 # NOTE: dbus and dbus-glib-1 are only used now for libtracker-client
 # which is deprecated and tracker-writeback which will be refactored
 # shortly to use gdbus. The other place which requires dbus-glib-1 is
diff --git a/src/libtracker-sparql/Makefile.am b/src/libtracker-sparql/Makefile.am
index 38f9512..e74f112 100644
--- a/src/libtracker-sparql/Makefile.am
+++ b/src/libtracker-sparql/Makefile.am
@@ -9,6 +9,8 @@ AM_VALAFLAGS =                                         \
 	--header tracker-sparql.h                      \
 	--vapi tracker-sparql-$(TRACKER_API_VERSION).vapi \
 	--pkg gio-2.0 --pkg gmodule-2.0 --pkg posix    \
+	--gir TrackerSparql-1.0.gir 		       \
+	--library TrackerSparql-1.0		       \
 	$(BUILD_VALAFLAGS)                             \
 	config.vapi                                    \
 	$(top_srcdir)/src/vapi/glib-2.0-fixes.vapi
@@ -22,13 +24,16 @@ AM_CPPFLAGS =                                          \
 
 libtracker_sparqlincludedir = $(includedir)/tracker-$(TRACKER_API_VERSION)/libtracker-sparql
 
-libtracker_sparql_ TRACKER_API_VERSION@_la_SOURCES =   \
-	tracker-builder.vala                           \
-	tracker-connection.vala                        \
-	tracker-cursor.vala                            \
-	tracker-backend.vala                           \
-	tracker-utils.vala                             \
-	tracker-uri.c                                  \
+libtracker_sparql_VALASOURCES =   			\
+	tracker-builder.vala                           	\
+	tracker-connection.vala                        	\
+	tracker-cursor.vala                            	\
+	tracker-backend.vala                           	\
+	tracker-utils.vala
+
+libtracker_sparql_ TRACKER_API_VERSION@_la_SOURCES =   	\
+	$(libtracker_sparql_VALASOURCES) 		\
+	tracker-uri.c                                   \
 	tracker-init.c
 
 libtracker_sparql_ TRACKER_API_VERSION@_la_LIBADD =    \
@@ -45,6 +50,14 @@ libtracker_sparqlinclude_HEADERS =                     \
 tracker-sparql-$(TRACKER_API_VERSION).deps: tracker-sparql.deps
 	$(AM_V_GEN)cp $^ $@
 
+# Gir for Gobject introspection
+TrackerSparql-1.0.gir: $(libtracker_sparql_VALASOURCES)
+	$(VALAC) -C $(AM_VALAFLAGS) $^
+	touch $@
+
+TrackerSparql_1_0_gir_NAMESPACE = "TrackerSparql"
+TrackerSparql_1_0_gir_VERSION = "1.0"
+
 # Vala bindings
 vapidir = $(datadir)/vala/vapi
 vapi_DATA =                                            \
@@ -64,3 +77,25 @@ EXTRA_DIST =                                           \
 	tracker-sparql-$(TRACKER_API_VERSION).vapi     \
 	tracker-sparql-$(TRACKER_API_VERSION).deps     \
 	tracker-sparql.deps
+
+if HAVE_INTROSPECTION
+girdir = @INTROSPECTION_GIRDIR@
+
+gir_DATA = \
+	TrackerSparql-1.0.gir
+
+typelibdir = @INTROSPECTOIN_TYPELIBDIR@
+typelib_DATA = \
+	TrackerSparql-1.0.typelib
+
+TrackerSparql-1.0.typelib: TrackerSparql-1.0.gir
+	@INTROSPECTION_COMPILER@ --shared-library=libtracker-sparql- TRACKER_API_VERSION@ -o $@ $^
+
+EXTRA_DIST += TrackerSparql-1.0.gir
+
+MAINTAINERCLEANFILES += TrackerSparql-1.0.gir
+
+CLEANFILES = TrackerSparql-1.0.typelib
+
+endif
+



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