From 74f7670af1848a814568d570d2306ed93ece1a6c Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Fri, 2 Sep 2011 09:50:03 -0500 Subject: Make building tests optional --- Makefile.am | 6 +++++- configure.ac | 16 +++++++++++++++- tools/testapp/Makefile.am | 6 +++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index c2c0980..81a2cbb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,11 +3,15 @@ EXTRA_DIST = \ COPYING-GPL3 \ m4/introspection.m4 +if WANT_TESTS +TESTS_SUBDIR = tests +endif + SUBDIRS = \ libdbusmenu-glib \ libdbusmenu-gtk \ tools \ - tests \ + $(TESTS_SUBDIR) \ docs \ po diff --git a/configure.ac b/configure.ac index fcec99a..6430cc3 100644 --- a/configure.ac +++ b/configure.ac @@ -99,8 +99,17 @@ AC_SUBST(DBUSMENUDUMPER_LIBS) JSON_GLIB_REQUIRED_VERSION=0.13.4 GIO_UNIX_REQUIRED_VERSION=2.24 +AC_ARG_ENABLE([tests], + AC_HELP_STRING([--disable-tests], [Disable tests]), + [enable_tests=$enableval], [enable_tests=auto]) +AM_CONDITIONAL([WANT_TESTS], [test "x$enable_tests" != "xno"]) + +AS_IF([test "x$enable_tests" != "xno"],[ PKG_CHECK_MODULES(DBUSMENUTESTS, json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION - gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION) + gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION, + [have_tests=yes] +) +]) AC_SUBST(DBUSMENUTESTS_CFLAGS) AC_SUBST(DBUSMENUTESTS_LIBS) @@ -199,3 +208,8 @@ libdbusmenu Configuration: GTK+ Version: $with_gtk ]) +AS_IF([test "x$have_tests" = "xyes"], + AC_MSG_NOTICE([ Tests: yes]), + AC_MSG_NOTICE([ Tests: no]) +) + diff --git a/tools/testapp/Makefile.am b/tools/testapp/Makefile.am index 39de532..ee12ec9 100644 --- a/tools/testapp/Makefile.am +++ b/tools/testapp/Makefile.am @@ -5,7 +5,11 @@ else VER= endif -libexec_PROGRAMS = dbusmenu-testapp +libexec_PROGRAMS = + +if WANT_TESTS +libexec_PROGRAMS += dbusmenu-testapp +endif dbusmenu_testapp_SOURCES = \ main.c -- cgit v1.2.3 From 89cf0dc43171c9d2b708cd8c9de27593f1338097 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Fri, 2 Sep 2011 09:54:39 -0500 Subject: Make building for GTK optional --- Makefile.am | 6 +++++- configure.ac | 29 ++++++++++++++++++++++------- tests/Makefile.am | 18 +++++++++++++----- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Makefile.am b/Makefile.am index c2c0980..2fb4c84 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,9 +3,13 @@ EXTRA_DIST = \ COPYING-GPL3 \ m4/introspection.m4 +if WANT_LIBDBUSMENUGTK +LIBDBUSMENUGTK_SUBDIR = libdbusmenu-gtk +endif + SUBDIRS = \ libdbusmenu-glib \ - libdbusmenu-gtk \ + $(LIBDBUSMENUGTK_SUBDIR) \ tools \ tests \ docs \ diff --git a/configure.ac b/configure.ac index 465d8bf..47ea915 100644 --- a/configure.ac +++ b/configure.ac @@ -58,27 +58,37 @@ AC_SUBST(DBUSMENUGLIB_LIBS) GTK_REQUIRED_VERSION=2.16 GTK3_REQUIRED_VERSION=2.91 +AC_ARG_ENABLE([gtk], + AC_HELP_STRING([--disable-gtk], [Disable libdbusmenu-gtk library]), + [enable_gtk=$enableval], [enable_gtk=auto]) +AM_CONDITIONAL([WANT_LIBDBUSMENUGTK], [test "x$enable_gtk" != "xno"]) + AC_ARG_WITH([gtk], [AS_HELP_STRING([--with-gtk], [Which version of gtk to use @<:@default=2@:>@])], [], [with_gtk=3]) +AM_CONDITIONAL([USE_GTK3], [test "x$with_gtk" = "x3"]) + +AS_IF([test "x$enable_gtk" != "xno"],[ AS_IF([test "x$with_gtk" = x3], [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-3.0 >= $GTK3_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION) - AC_SUBST(DBUSMENUGTK_CFLAGS) - AC_SUBST(DBUSMENUGTK_LIBS) + glib-2.0 >= $GLIB_REQUIRED_VERSION, + [have_gtk=yes] +) AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available]) ], [test "x$with_gtk" = x2], [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION) - AC_SUBST(DBUSMENUGTK_CFLAGS) - AC_SUBST(DBUSMENUGTK_LIBS) + glib-2.0 >= $GLIB_REQUIRED_VERSION, + [have_gtk=yes] +) ], [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] ) -AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3]) +]) +AC_SUBST(DBUSMENUGTK_CFLAGS) +AC_SUBST(DBUSMENUGTK_LIBS) ########################### # Dependencies - dumper @@ -199,3 +209,8 @@ libdbusmenu Configuration: GTK+ Version: $with_gtk ]) +AS_IF([test "x$enable_gtk" = "xyes"], + AC_MSG_NOTICE([ Gtk: yes (gtk$with_gtk)]), + AC_MSG_NOTICE([ Gtk: no]) +) + diff --git a/tests/Makefile.am b/tests/Makefile.am index a4763da..e6882af 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,13 +13,17 @@ TESTS = \ test-glib-proxy \ test-glib-simple-items \ test-glib-submenu \ - test-json \ + test-json + +if WANT_LIBDBUSMENUGTK +TESTS += \ test-gtk-objects-test \ test-gtk-label \ test-gtk-shortcut \ test-gtk-reorder \ test-gtk-submenu \ test-gtk-parser-test +endif XFAIL_TESTS = \ test-glib-proxy @@ -44,20 +48,24 @@ check_PROGRAMS = \ test-glib-proxy-client \ test-glib-proxy-server \ test-glib-proxy-proxy \ - test-gtk-objects \ test-glib-submenu-client \ test-glib-submenu-server \ + test-glib-simple-items \ + test-json-client \ + test-json-server + +if WANT_LIBDBUSMENUGTK +check_PROGRAMS += \ + test-gtk-objects \ test-gtk-label-client \ test-gtk-label-server \ test-gtk-shortcut-client \ test-gtk-shortcut-server \ - test-glib-simple-items \ test-gtk-reorder-server \ - test-json-client \ - test-json-server \ test-gtk-submenu-server \ test-gtk-submenu-client \ test-gtk-parser +endif XVFB_RUN=". $(srcdir)/run-xvfb.sh" -- cgit v1.2.3 From ce055ed4b12b875cf24856f5026fda3bb5a95ce3 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Fri, 2 Sep 2011 21:53:27 -0500 Subject: Fix detecting introspection when there is none at all --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index 3853d2a..a31f9bb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +ACLOCAL_AMFLAGS = -I m4 + EXTRA_DIST = \ COPYING.2.1 \ COPYING-GPL3 \ -- cgit v1.2.3 From 587b3cdf66d99cc4c52dd49ba04cfbbd518b6c98 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Fri, 2 Sep 2011 21:57:04 -0500 Subject: Remove unneeded dbusmenu-GTK dep in testapp --- tools/testapp/Makefile.am | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/testapp/Makefile.am b/tools/testapp/Makefile.am index 39de532..f59f839 100644 --- a/tools/testapp/Makefile.am +++ b/tools/testapp/Makefile.am @@ -1,10 +1,4 @@ -if USE_GTK3 -VER=3 -else -VER= -endif - libexec_PROGRAMS = dbusmenu-testapp dbusmenu_testapp_SOURCES = \ @@ -18,6 +12,4 @@ dbusmenu_testapp_CFLAGS = \ dbusmenu_testapp_LDADD = \ $(builddir)/../../libdbusmenu-glib/libdbusmenu-glib.la \ - $(builddir)/../../libdbusmenu-gtk/libdbusmenu-gtk$(VER).la \ - $(DBUSMENUGTK_LIBS) \ $(DBUSMENUTESTS_LIBS) -- cgit v1.2.3 From 8ff45d6b126d0cfacf3b6f96c16ab89d5bbe7861 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Fri, 2 Sep 2011 22:09:10 -0500 Subject: Fix dependencies in introspection build --- libdbusmenu-glib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index a139f7c..7d3cfb7 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -138,7 +138,7 @@ if HAVE_INTROSPECTION introspection_sources = $(libdbusmenu_glibinclude_HEADERS) -Dbusmenu_Glib-0.4.gir: libdbusmenu-glib.la +Dbusmenu-Glib-0.4.gir: libdbusmenu-glib.la Dbusmenu_Glib_0_4_gir_INCLUDES = \ GObject-2.0 Dbusmenu_Glib_0_4_gir_CFLAGS = $(DBUSMENUGLIB_CFLAGS) -I$(top_srcdir) -- cgit v1.2.3 From 0fca4c859e42bf3cafc6fa449dac3122996ed0c6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 14 Sep 2011 14:24:03 -0500 Subject: releasing version 0.4.93-0ubuntu2~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7c35d99..820d6c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libdbusmenu (0.4.93-0ubuntu2~ppa1) UNRELEASED; urgency=low +libdbusmenu (0.4.93-0ubuntu2~ppa1) oneiric; urgency=low * Upstream Merge * Build fixes to allow more optional builds - -- Ted Gould Wed, 14 Sep 2011 14:17:15 -0500 + -- Ted Gould Wed, 14 Sep 2011 14:24:00 -0500 libdbusmenu (0.4.93-0ubuntu1) oneiric; urgency=low -- cgit v1.2.3 From 232a1e5836bf9394b93b586788811f1b3d1a26ab Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 19 Sep 2011 13:07:27 -0500 Subject: Adding in warnings to protect watch_submenu --- libdbusmenu-gtk/parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 3243c81..e988c62 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -283,6 +283,9 @@ toggle_widget_visibility (GtkWidget * widget) static void watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) { + g_return_if_fail(DBUSMENU_IS_MENUITEM(mi)); + g_return_if_fail(GTK_IS_MENU_SHELL(menu)); + ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(mi), PARSER_DATA); pdata->shell = menu; -- cgit v1.2.3 From 0b5f7ed8fcaee4b32db7a1deed1b65ff77688551 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 19 Sep 2011 13:13:49 -0500 Subject: Making sure to sink the reference before parsing it. --- tests/test-gtk-parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-gtk-parser.c b/tests/test-gtk-parser.c index 87b0a7f..afd6194 100644 --- a/tests/test-gtk-parser.c +++ b/tests/test-gtk-parser.c @@ -28,6 +28,8 @@ test_parser_runs (void) { GtkWidget * gmi = gtk_menu_item_new_with_label("Test Item"); g_assert(gmi != NULL); + g_object_ref_sink(gmi); + DbusmenuMenuitem * mi = dbusmenu_gtk_parse_menu_structure(gmi); g_assert(mi != NULL); -- cgit v1.2.3 From 21afbd946557e93304bdb34199d62594f365799f Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Mon, 19 Sep 2011 23:39:39 -0500 Subject: Making it so that the Vala build is optional --- configure.ac | 15 +++++++++++++++ libdbusmenu-glib/Makefile.am | 2 ++ libdbusmenu-gtk/Makefile.am | 2 ++ 3 files changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 895f9f8..e284980 100644 --- a/configure.ac +++ b/configure.ac @@ -140,7 +140,17 @@ AM_CONDITIONAL(INTROSPECTION_TEN, [test "x$introspection_ten" = "xyes"]) # Vala API Generation ########################### +AC_ARG_ENABLE([vala], + AC_HELP_STRING([--disable-vala], [Disable vala]), + [enable_vala=$enableval], [enable_vala=auto]) + +AS_IF([test "x$enable_vala" != "xno"],[ + AM_COND_IF([HAVE_INTROSPECTION],,[ + AC_MSG_ERROR([Vala bindings require introspection support, please --enable-introspection]) + ]) AC_PATH_PROG([VALA_API_GEN], [vapigen]) +]) +AM_CONDITIONAL([HAVE_VALA], [test -n "$VALA_API_GEN"]) ########################### # XSLT Processor @@ -228,3 +238,8 @@ AS_IF([test "x$enable_gtk" = "xno"], AC_MSG_NOTICE([ Gtk: yes (gtk$with_gtk)]) ) +AM_COND_IF([HAVE_VALA], + AC_MSG_NOTICE([ Vala bindings: yes]), + AC_MSG_NOTICE([ Vala bindings no]) +) + diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index 5b04415..7d4ea5d 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -189,6 +189,7 @@ endif # VAPI Files ######################### +if HAVE_VALA if HAVE_INTROSPECTION vapidir = $(datadir)/vala/vapi @@ -200,4 +201,5 @@ Dbusmenu-0.4.vapi: Dbusmenu-0.4.gir CLEANFILES += $(vapi_DATA) endif +endif diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index 4ec464b..b4564d1 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -144,6 +144,7 @@ endif # VAPI Files ######################### +if HAVE_VALA if HAVE_INTROSPECTION vapidir = $(datadir)/vala/vapi @@ -167,4 +168,5 @@ DbusmenuGtk$(VER)-0.4.tmp.gir: DbusmenuGtk$(VER)-0.4.gir CLEANFILES += $(vapi_DATA) DbusmenuGtk$(VER)-0.4.tmp.gir endif +endif -- cgit v1.2.3 From 4177700e45a02a7f35b32dc24dd7ec6e150d6a0a Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Mon, 19 Sep 2011 23:43:26 -0500 Subject: Adding an optional build of the dumper --- configure.ac | 16 +++++++++++++++- tests/Makefile.am | 12 ++++++++++-- tools/Makefile.am | 6 +++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e284980..f347625 100644 --- a/configure.ac +++ b/configure.ac @@ -96,8 +96,17 @@ AC_SUBST(DBUSMENUGTK_LIBS) X11_REQUIRED_VERSION=1.3 +AC_ARG_ENABLE([dumper], + AC_HELP_STRING([--disable-dumper], [Disable dbusmenudumper tool]), + [enable_dumper=$enableval], [enable_dumper=auto]) +AM_CONDITIONAL([WANT_DBUSMENUDUMPER], [test "x$enable_dumper" != "xno"]) + +AS_IF([test "x$enable_dumper" != "xno"],[ PKG_CHECK_MODULES(DBUSMENUDUMPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION - x11 >= $X11_REQUIRED_VERSION) + x11 >= $X11_REQUIRED_VERSION, + [have_dumper=yes] +) +]) AC_SUBST(DBUSMENUDUMPER_CFLAGS) AC_SUBST(DBUSMENUDUMPER_LIBS) @@ -243,3 +252,8 @@ AM_COND_IF([HAVE_VALA], AC_MSG_NOTICE([ Vala bindings no]) ) +AS_IF([test "x$have_dumper" = "xyes"], + AC_MSG_NOTICE([ Dumper: yes]), + AC_MSG_NOTICE([ Dumper: no]) +) + diff --git a/tests/Makefile.am b/tests/Makefile.am index e6882af..a4e8682 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -12,8 +12,12 @@ TESTS = \ test-glib-properties \ test-glib-proxy \ test-glib-simple-items \ - test-glib-submenu \ + test-glib-submenu + +if WANT_DBUSMENUDUMPER +TESTS += \ test-json +endif if WANT_LIBDBUSMENUGTK TESTS += \ @@ -50,9 +54,13 @@ check_PROGRAMS = \ test-glib-proxy-proxy \ test-glib-submenu-client \ test-glib-submenu-server \ - test-glib-simple-items \ + test-glib-simple-items + +if WANT_DBUSMENUDUMPER +check_PROGRAMS += \ test-json-client \ test-json-server +endif if WANT_LIBDBUSMENUGTK check_PROGRAMS += \ diff --git a/tools/Makefile.am b/tools/Makefile.am index 48993f1..029b73e 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,7 +1,11 @@ SUBDIRS = testapp -libexec_PROGRAMS = dbusmenu-dumper +libexec_PROGRAMS = + +if WANT_DBUSMENUDUMPER +libexec_PROGRAMS += dbusmenu-dumper +endif libexec_SCRIPTS = dbusmenu-bench -- cgit v1.2.3 From 451acabd0340c1f0196ec0fe8a6ef62ead4e77f9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 19 Sep 2011 23:54:06 -0500 Subject: 0.4.94 --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f347625..6276327 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.4.93, ted@canonical.com) +AC_INIT(libdbusmenu, 0.4.94, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.4.93, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.4.94, [-Wno-portability]) AM_MAINTAINER_MODE @@ -172,7 +172,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc]) ########################### LIBDBUSMENU_CURRENT=4 -LIBDBUSMENU_REVISION=3 +LIBDBUSMENU_REVISION=4 LIBDBUSMENU_AGE=0 AC_SUBST(LIBDBUSMENU_CURRENT) -- cgit v1.2.3 From 70c33b0c4c7ce124ac203020f2f3b0a392727577 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Sep 2011 00:08:23 -0500 Subject: releasing version 0.4.94-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 566030a..8e51968 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -libdbusmenu (0.4.94-0ubuntu1~ppa1) UNRELEASED; urgency=low +libdbusmenu (0.4.94-0ubuntu1~ppa1) oneiric; urgency=low * New upstream release. ∘ Protect functions from NULL submenus (LP: #803667) ∘ Build fixes (LP: #552526, LP: #552530, LP: #552538, LP: #709761, LP: #713690, LP: #643871, LP: #713685) - -- Ted Gould Tue, 20 Sep 2011 00:02:23 -0500 + -- Ted Gould Tue, 20 Sep 2011 00:08:19 -0500 libdbusmenu (0.4.93-0ubuntu1) oneiric; urgency=low -- cgit v1.2.3