[gnome-control-center] build: Import egg-list-box as a git submodule



commit 2dee0fd591c0897db779c0541f1153ce5854a455
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Oct 31 15:43:59 2012 -0400

    build: Import egg-list-box as a git submodule
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687490

 .gitmodules            |    3 +
 Makefile.am            |    2 +-
 autogen.sh             |   12 +++++
 configure.ac           |   13 +++++-
 egg-list-box           |    1 +
 m4/ax_config_dir.m4    |  109 ++++++++++++++++++++++++++++++++++++++++++++++++
 shell/control-center.c |    3 +
 7 files changed, 141 insertions(+), 2 deletions(-)
---
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..992c00b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "egg-list-box"]
+	path = egg-list-box
+	url = git://git.gnome.org/egg-list-box
diff --git a/Makefile.am b/Makefile.am
index c77c562..a57c5f2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
-SUBDIRS = po shell panels
+SUBDIRS = po egg-list-box shell panels
 if BUILD_DOCUMENTATION
 SUBDIRS += man
 endif
diff --git a/autogen.sh b/autogen.sh
index 1661cd6..735fcee 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -18,6 +18,18 @@ DIE=0
 
 rm -f .using-gnome-libs-package
 
+# Fetch submodules if needed
+if test ! -f egg-list-box/COPYING;
+then
+  echo "+ Setting up submodules"
+  git submodule init
+fi
+git submodule update
+
+cd egg-list-box
+sh autogen.sh --no-configure
+cd ..
+
 if ! which gnome-autogen.sh ; then
   echo "You need to install the gnome-common module and make"
   echo "sure the gnome-autogen.sh script is in your \$PATH."
diff --git a/configure.ac b/configure.ac
index 675f48b..954e73f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,15 @@ else
         IBUS_MODULE=
 fi
 
+# EggListBox submodule
+prev_top_build_prefix=$ac_top_build_prefix
+prev_ac_configure_args=$ac_configure_args
+AX_CONFIG_DIR([egg-list-box])
+ac_top_build_prefix=$prev_top_build_prefix
+ac_configure_args=$prev_ac_configure_args
+
+export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"egg-list-box
+
 dnl ==============================================
 dnl Check that we meet the  dependencies
 dnl ==============================================
@@ -109,7 +118,9 @@ COMMON_MODULES="gtk+-3.0 >= $GTK_REQUIRED_VERSION
 
 PKG_CHECK_MODULES(LIBLANGUAGE, $COMMON_MODULES gnome-desktop-3.0 fontconfig)
 PKG_CHECK_MODULES(LIBSHORTCUTS, $COMMON_MODULES x11)
-PKG_CHECK_MODULES(SHELL, $COMMON_MODULES libgnome-menu-3.0 x11)
+# egg-list-box is a static library, so it must be shared among all panels
+# or it breaks GType registration
+PKG_CHECK_MODULES(SHELL, $COMMON_MODULES libgnome-menu-3.0 x11 egg-list-box)
 PKG_CHECK_MODULES(BACKGROUND_PANEL, $COMMON_MODULES libxml-2.0 gnome-desktop-3.0
                   gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION)
 PKG_CHECK_MODULES(DATETIME_PANEL, $COMMON_MODULES
diff --git a/egg-list-box b/egg-list-box
new file mode 160000
index 0000000..b32d127
--- /dev/null
+++ b/egg-list-box
@@ -0,0 +1 @@
+Subproject commit b32d1270655f7c6c83550ae1adc0934105c0cc00
diff --git a/m4/ax_config_dir.m4 b/m4/ax_config_dir.m4
new file mode 100644
index 0000000..0ba313f
--- /dev/null
+++ b/m4/ax_config_dir.m4
@@ -0,0 +1,109 @@
+dnl Copied from Audacity 1.3.10 which itself is licensed under the GPL v2 or
+dnl any later version
+
+dnl Function to configure a sub-library now, because we need to know the result
+dnl of the configuration now in order to take decisions.
+dnl We don't worry about whether the configuration worked or not - it is
+dnl assumed that the next thing after this will be a package-specific check to
+dnl see if the package is actually available. (Hint: use pkg-config and
+dnl -uninstalled.pc files if available).
+dnl code based on a simplification of _AC_OUTPUT_SUBDIRS in 
+dnl /usr/share/autoconf/autoconf/status.m4 which implements part of 
+dnl AC_CONFIG_SUBDIRS
+
+AC_DEFUN([AX_CONFIG_DIR],
+[AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])]
+[m4_append([_AC_LIST_SUBDIRS], [$1], [])]
+[
+  # Remove --cache-file and --srcdir arguments so they do not pile up.
+  ax_sub_configure_args=
+  ax_prev=
+  eval "set x $ac_configure_args"
+  shift
+  for ax_arg
+  do
+    if test -n "$ax_prev"; then
+      ax_prev=
+      continue
+    fi
+    case $ax_arg in
+    -cache-file | --cache-file | --cache-fil | --cache-fi \
+    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+      ax_prev=cache_file ;;
+    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+    | --c=*)
+      ;;
+    --config-cache | -C)
+      ;;
+    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+      ax_prev=srcdir ;;
+    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+      ;;
+    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+      ax_prev=prefix ;;
+    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+      ;;
+    *)
+      case $ax_arg in
+      *\'*) ax_arg=`echo "$ax_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      ax_sub_configure_args="$ax_sub_configure_args '$ax_arg'" ;;
+    esac
+  done
+
+  # Always prepend --prefix to ensure using the same prefix
+  # in subdir configurations.
+  ax_arg="--prefix=$prefix"
+  case $ax_arg in
+  *\'*) ax_arg=`echo "$ax_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  ax_sub_configure_args="'$ax_arg' $ax_sub_configure_args"
+
+  # Pass --silent
+  if test "$silent" = yes; then
+    ax_sub_configure_args="--silent $ax_sub_configure_args"
+  fi
+
+  ax_popdir=`pwd`
+  AC_MSG_NOTICE([Configuring sources in $1])
+  dnl for out-of-place builds srcdir and builddir will be different, and
+  dnl builddir may not exist, so we must create it
+  AS_MKDIR_P(["$1"])
+  dnl and also set the variables. As this isn't autoconf, the following may be
+  dnl risky:
+  _AC_SRCDIRS(["$1"])
+  cd "$1"
+
+  # Check for guested configure; otherwise get Cygnus style configure.
+  if test -f "configure.gnu"; then
+    ax_sub_configure=$ac_srcdir/configure.gnu
+  elif test -f "$ac_srcdir/configure"; then
+    ax_sub_configure=$ac_srcdir/configure
+  elif test -f "$ac_srcdir/configure.in"; then
+    # This should be Cygnus configure.
+	ax_sub_configure=$ac_aux_dir/configure
+  else
+    AC_MSG_WARN([no configuration information is in $1])
+    ax_sub_configure=
+  fi
+
+  # The recursion is here.
+  if test -n "$ax_sub_configure"; then
+    # Make the cache file name correct relative to the subdirectory.
+    case $cache_file in
+    [[\\/]]* | ?:[[\\/]]* ) ax_sub_cache_file=$cache_file ;;
+    *) # Relative name.
+	ax_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+    esac
+
+    AC_MSG_NOTICE([running $SHELL $ax_sub_configure $ax_sub_configure_args --cache-file=$ax_sub_cache_file --srcdir=$ac_srcdir])
+    # The eval makes quoting arguments work.
+    eval "\$SHELL \"\$ax_sub_configure\" $ax_sub_configure_args \
+	   --cache-file=\"\$ax_sub_cache_file\" --srcdir=\"\$ax_srcdir\""
+  fi
+
+  cd "$ax_popdir"
+  AC_MSG_NOTICE([Done configuring in $1])
+])
+
diff --git a/shell/control-center.c b/shell/control-center.c
index 3ea4c7b..d32d64f 100644
--- a/shell/control-center.c
+++ b/shell/control-center.c
@@ -29,6 +29,7 @@
 #include <gtk/gtk.h>
 #include <string.h>
 #include <libnotify/notify.h>
+#include <egg-list-box.h>
 
 #ifdef GDK_WINDOWING_X11
 #include <X11/Xlib.h>
@@ -242,6 +243,8 @@ main (int argc, char **argv)
   gtk_init (&argc, &argv);
   cc_shell_log_init ();
 
+  g_type_ensure (egg_list_box_get_type ());
+
   /* register a symbolic icon size for use in sidebar lists */
   gtk_icon_size_register ("cc-sidebar-list", 24, 24);
 



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