[totem/introspection: 6/17] Bug 551290 — Add gobject-introspection support



commit 92ae2c5426274ac39fc93748b81c38e03c8e8674
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Jun 26 22:54:59 2010 +0100

    Bug 551290 â?? Add gobject-introspection support
    
    Add gobject-introspection support to libtotem.la. For the time being,
    we're introspecting only the files which exposed API which was previously
    used by the Python bindings.
    
    This adds a hard dependency on gobject-introspection 0.6.7, as the
    introspection will be necessary for Python and Vala plugin support.
    
    Closes: bgo#551290

 Makefile.am     |    3 +--
 configure.in    |    1 +
 src/Makefile.am |   51 ++++++++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 46 insertions(+), 9 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 43e32de..fa4a054 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,6 @@ if ENABLE_BROWSER_PLUGINS
 SUBDIRS += browser-plugin
 endif
 
-
 EXTRA_DIST =			\
 	license_change		\
 	autogen.sh		\
@@ -25,7 +24,7 @@ DISTCLEANFILES = intltool-extract intltool-merge intltool-update \
 		 gnome-doc-utils.make
 
 DIST_SUBDIRS = $(NORMAL_SUBDIRS) browser-plugin
-DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc --with-nautilusdir='$${libdir}/nautilus/extensions-2.0-distcheck' --enable-vala=yes
+DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc --with-nautilusdir='$${libdir}/nautilus/extensions-2.0-distcheck' --enable-vala=yes --enable-introspection
 
 # Build ChangeLog from GIT history
 ChangeLog:
diff --git a/configure.in b/configure.in
index 99ee9db..c3bdd6d 100644
--- a/configure.in
+++ b/configure.in
@@ -25,6 +25,7 @@ AM_GLIB_GNU_GETTEXT
 IT_PROG_INTLTOOL([0.40.0])
 
 GNOME_DOC_INIT
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
 
 AC_PROG_CXX
 AM_PROG_CC_C_O
diff --git a/src/Makefile.am b/src/Makefile.am
index 002879e..467f972 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,13 +19,23 @@ common_defines = \
 
 modules_flags = -export_dynamic -avoid-version -module -no-undefined
 
+# Header files installed for use by plugins (and consequently introspected using gobject-introspection; see the bottom of the Makefile)
+
+INST_H_FILES = \
+	totem.h				\
+	totem-video-list.h		\
+	totem-cell-renderer-video.h	\
+	totem-interface.h		\
+	plugins/totem-plugin.h		\
+	plugins/totem-dirs.h
+
 # Totem UI ltlibrary (used by browser plugins)
 
 libtotem_player_la_SOURCES = \
+	$(INST_H_FILES)		\
 	totem-statusbar.c	\
 	totem-statusbar.h	\
 	totem-interface.c	\
-	totem-interface.h	\
 	totem-fullscreen.c	\
 	totem-fullscreen.h	\
 	gsd-media-keys-window.c	\
@@ -52,13 +62,11 @@ libtotem_player_la_LDFLAGS = \
 
 libtotem_la_SOURCES = \
 	$(TOTEMMARSHALFILES)		\
+	$(INST_H_FILES)			\
 	totem-object.c			\
-	totem.h				\
 	totem-private.h			\
 	totem-cell-renderer-video.c	\
-	totem-cell-renderer-video.h	\
 	totem-video-list.c		\
-	totem-video-list.h		\
 	totem-preferences.c		\
 	totem-preferences.h		\
 	totem-dnd-menu.c		\
@@ -85,11 +93,9 @@ libtotem_la_SOURCES = \
 	totem-subtitle-encoding.c	\
 	totem-subtitle-encoding.h	\
 	totem-profile.h			\
-	plugins/totem-plugin.h		\
 	plugins/totem-plugins-engine.c	\
 	plugins/totem-plugins-engine.h	\
-	plugins/totem-dirs.c		\
-	plugins/totem-dirs.h
+	plugins/totem-dirs.c
 
 libtotem_la_CPPFLAGS = \
 	-I$(top_srcdir)/		\
@@ -377,3 +383,34 @@ EXTRA_DIST = 				\
 	totemvideolist-marshal.list	\
 	totemplaylist-marshal.list
 
+# Introspection
+-include $(INTROSPECTION_MAKEFILE)
+
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
+if HAVE_INTROSPECTION
+
+introspection_sources = $(INST_H_FILES) $(filter %.c,$(libtotem_player_la_SOURCES) $(libtotem_la_SOURCES))
+
+Totem-1.0.gir: libtotem.la
+Totem_1_0_gir_INCLUDES = GLib-2.0 GObject-2.0 Gtk-3.0 TotemPlParser-1.0
+Totem_1_0_gir_CFLAGS = $(DEPENDENCY_CFLAGS)		\
+	$(DBUS_CFLAGS)			\
+	$(MISSING_PLUGINS_CFLAGS)	\
+	$(PEASUI_CFLAGS)		\
+	$(AM_CFLAGS)	$(libtotem_la_CPPFLAGS)
+Totem_1_0_gir_LIBS = libtotem.la
+Totem_1_0_gir_FILES = $(introspection_sources)
+INTROSPECTION_GIRS += Totem-1.0.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+
+endif



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