← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/libindicate/introspection-update into lp:libindicate

 

Ted Gould has proposed merging lp:~ted/libindicate/introspection-update into lp:libindicate.

    Requested reviews:
    Indicator Applet Developers (indicator-applet-developers)


Updates for newer introspection techniques.
-- 
https://code.launchpad.net/~ted/libindicate/introspection-update/+merge/13185
Your team ayatana-commits is subscribed to branch lp:libindicate.
=== modified file '.bzrignore'
--- .bzrignore	2009-09-03 21:57:34 +0000
+++ .bzrignore	2009-10-11 16:15:20 +0000
@@ -147,3 +147,10 @@
 tests/test-indicator-display-server
 tests/test-indicator-display-half-server
 tests/test-indicator-display-half-client
+m4/gtk-doc.m4
+libindicate/Indicate-0.2.gir
+libindicate/Indicate-0.2.typelib
+libindicate-gtk/Indicate-Gtk-0.2.gir
+libindicate-gtk/Indicate-Gtk-0.2.typelib
+libindicate-[0-9].[0-9].[0-9].tar.gz
+libindicate-[0-9].[0-9].[0-9].tar.gz.asc

=== modified file 'configure.ac'
--- configure.ac	2009-10-01 20:05:46 +0000
+++ configure.ac	2009-10-11 16:15:20 +0000
@@ -75,29 +75,7 @@
 # GObject Introspection
 ###########################
 
-AC_ARG_ENABLE(gobject-introspection, AC_HELP_STRING([--enable-gobject-introspection], [enable building the gobject-introspection files]), [enable_gir=$enableval], [enable_gir=yes])
-
-if test "x$enable_gir" = "xyes"; then
-	PKG_CHECK_MODULES(GOBJECT_INTROSPECTION, [gobject-introspection-1.0 >= 0.6], gir_ok=yes, gir_ok=no)
-
-	if test "x$gir_ok" = "xyes"; then
-		G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-		AC_SUBST(G_IR_SCANNER)
-		G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-		AC_SUBST(G_IR_COMPILER)
-		G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
-		AC_SUBST(G_IR_GENERATE)
-
-		GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
-		AC_SUBST(GIRDIR)
-		TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
-		AC_SUBST(TYPELIBDIR) 
-	fi
-else
-	gir_ok=no
-fi
-
-AM_CONDITIONAL(USE_GIR, test "x$gir_ok" = "xyes")
+GOBJECT_INTROSPECTION_CHECK([0.6.3])
 
 ###########################
 # GTK Doc 
@@ -178,5 +156,5 @@
 Libindicate Configuration:
 
 	Prefix:                 $prefix
-	GObject Introspection:  $gir_ok
+	GObject Introspection:  $enable_introspection
 ])

=== modified file 'libindicate-gtk/Makefile.am'
--- libindicate-gtk/Makefile.am	2009-09-03 22:32:17 +0000
+++ libindicate-gtk/Makefile.am	2009-10-11 16:15:20 +0000
@@ -38,35 +38,43 @@
 pkgconfig_DATA = indicate-gtk.pc
 pkgconfigdir = $(libdir)/pkgconfig
 
-if USE_GIR
-
-gobjectintrospection_gir_DATA = \
-	Indicate-gtk-0.1.gir
-gobjectintrospection_girdir = $(datadir)/gir
-
-gobjectintrospection_type_DATA = \
-	Indicate-gtk-0.1.typelib
-gobjectintrospection_typedir = $(libdir)/girepository
-
-irscanner_headers = $(patsubst %,$(srcdir)/%,$(indicate_headers))
-Indicate-gtk-0.1.gir: $(irscanner_headers)
-	$(G_IR_SCANNER) \
-		-v --namespace IndicateGtk \
-		--nsversion=0.1 \
+CLEANFILES = 
+
+if HAVE_INTROSPECTION
+
+BUILT_GIRSOURCES = 
+
+irscanner_headers = $(patsubst %,$(srcdir)/%,$(indicate_gtk_headers))
+
+Indicate-Gtk-0.2.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
+	$(INTROSPECTION_SCANNER) \
+		-v --namespace Indicate \
+		--nsversion=0.2 \
 		--add-include-path=$(srcdir) \
 		--include=GObject-2.0 \
 		--include=GLib-2.0 \
 		--include=GdkPixbuf-2.0 \
+		--include=Indicate-0.2 \
+		--add-include-path=$(top_builddir)/libindicate \
 		--library=indicate --pkg indicate \
-		--output Indicate-gtk-0.1.gir $(irscanner_headers)
-
-Indicate-gtk-0.1.typelib: Indicate-gtk-0.1.gir
-	$(G_IR_COMPILER) \
-		--includedir=$(srcdir) Indicate-gtk-0.1.gir \
-		-o Indicate-gtk-0.1.typelib
-
-DISTCLEANFILES = \
-	Indicate-gtk-0.1.gir \
-	Indicate-gtk-0.1.typelib
+		--output Indicate-Gtk-0.2.gir $(irscanner_headers)
+
+BUILT_GIRSOURCES += Indicate-Gtk-0.2.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+%.typelib: %.gir $(INTROSPECTION_COMPILER)
+	$(INTROSPECTION_COMPILER) \
+		--includedir=$(srcdir) \
+		--includedir=. \
+		--includedir=$(top_builddir)/libindicate \
+		$(INTROSPECTION_COMPILER_OPTS) \
+		$< -o $(@F)
+
+CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
 
 endif

=== modified file 'libindicate/Makefile.am'
--- libindicate/Makefile.am	2009-09-04 17:44:23 +0000
+++ libindicate/Makefile.am	2009-10-11 16:15:20 +0000
@@ -152,19 +152,14 @@
 	s-enum-types-c \
 	s-enum-types-h
 
-if USE_GIR
-
-gobjectintrospection_gir_DATA = \
-	Indicate-0.2.gir
-gobjectintrospection_girdir = $(datadir)/gir
-
-gobjectintrospection_type_DATA = \
-	Indicate-0.2.typelib
-gobjectintrospection_typedir = $(libdir)/girepository
+if HAVE_INTROSPECTION
+
+BUILT_GIRSOURCES = 
 
 irscanner_headers = $(patsubst %,$(srcdir)/%,$(indicate_headers))
-Indicate-0.2.gir: $(irscanner_headers) Makefile
-	$(G_IR_SCANNER) \
+
+Indicate-0.2.gir: $(INTROSPECTION_SCANNER) $(irscanner_headers) Makefile.am
+	$(INTROSPECTION_SCANNER) \
 		-v --namespace Indicate \
 		--nsversion=0.2 \
 		--add-include-path=$(srcdir) \
@@ -174,13 +169,21 @@
 		--library=indicate --pkg indicate \
 		--output Indicate-0.2.gir $(irscanner_headers)
 
-Indicate-0.2.typelib: Indicate-0.2.gir
-	$(G_IR_COMPILER) \
-		--includedir=$(srcdir) Indicate-0.2.gir \
-		-o Indicate-0.2.typelib
-
-DISTCLEANFILES = \
-	Indicate-0.2.gir \
-	Indicate-0.2.typelib
+BUILT_GIRSOURCES += Indicate-0.2.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+%.typelib: %.gir $(INTROSPECTION_COMPILER)
+	$(INTROSPECTION_COMPILER) \
+		--includedir=$(srcdir) \
+		--includedir=. \
+		$(INTROSPECTION_COMPILER_OPTS) \
+		$< -o $(@F)
+
+CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
 
 endif

=== added directory 'm4'
=== added file 'm4/introspection.m4'
--- m4/introspection.m4	1970-01-01 00:00:00 +0000
+++ m4/introspection.m4	2009-10-11 16:15:20 +0000
@@ -0,0 +1,88 @@
+dnl -*- mode: autoconf -*-
+dnl Copyright 2009 Johan Dahlin
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+# serial 1
+
+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+[
+    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+    dnl enable/disable introspection
+    m4_if([$2], [require],
+    [dnl
+        enable_introspection=yes
+    ],[dnl
+        AC_ARG_ENABLE(introspection,
+                  AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+                                 [Enable introspection for this build]),, 
+                                 [enable_introspection=auto])
+    ])dnl
+
+    AC_MSG_CHECKING([for gobject-introspection])
+
+    dnl presence/version checking
+    AS_CASE([$enable_introspection],
+    [no], [dnl
+        found_introspection="no (disabled, use --enable-introspection to enable)"
+    ],dnl
+    [yes],[dnl
+        PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+                         AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+                         found_introspection=yes,
+                         AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+    ],dnl
+    [auto],[dnl
+        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+    ],dnl
+    [dnl	
+        AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+    ])dnl
+
+    AC_MSG_RESULT([$found_introspection])
+
+    INTROSPECTION_SCANNER=
+    INTROSPECTION_COMPILER=
+    INTROSPECTION_GENERATE=
+    INTROSPECTION_GIRDIR=
+    INTROSPECTION_TYPELIBDIR=
+    if test "x$found_introspection" = "xyes"; then
+       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+    fi
+    AC_SUBST(INTROSPECTION_SCANNER)
+    AC_SUBST(INTROSPECTION_COMPILER)
+    AC_SUBST(INTROSPECTION_GENERATE)
+    AC_SUBST(INTROSPECTION_GIRDIR)
+    AC_SUBST(INTROSPECTION_TYPELIBDIR)
+
+    AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+])
+
+
+dnl Usage:
+dnl   GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+
+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+[
+  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+])
+
+dnl Usage:
+dnl   GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+
+
+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+[
+  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+])


Follow ups