[Goodies-commits] r7714 - in thunar-vcs-plugin/trunk: . thunar-vcs-plugin
Peter de Ridder
peter at xfce.org
Fri Jul 10 14:36:47 CEST 2009
Author: peter
Date: 2009-07-10 12:36:46 +0000 (Fri, 10 Jul 2009)
New Revision: 7714
Modified:
thunar-vcs-plugin/trunk/Makefile.am
thunar-vcs-plugin/trunk/configure.ac.in
thunar-vcs-plugin/trunk/thunar-vcs-plugin/Makefile.am
thunar-vcs-plugin/trunk/thunar-vcs-plugin/thunar-vcs-plugin.c
thunar-vcs-plugin/trunk/thunar-vcs-plugin/tvp-provider.c
Log:
Added flags to configure.ac.in to disable subversion or git support.
Modified: thunar-vcs-plugin/trunk/Makefile.am
===================================================================
--- thunar-vcs-plugin/trunk/Makefile.am 2009-07-09 22:36:54 UTC (rev 7713)
+++ thunar-vcs-plugin/trunk/Makefile.am 2009-07-10 12:36:46 UTC (rev 7714)
@@ -2,9 +2,13 @@
SUBDIRS = \
icons \
po \
- thunar-vcs-plugin \
- tvp-svn-helper \
- tvp-git-helper
+ thunar-vcs-plugin
+if HAVE_SUBVERSION
+SUBDIRS += tvp-svn-helper
+endif
+if HAVE_GIT
+SUBDIRS += tvp-git-helper
+endif
distclean-local:
rm -rf *.spec *.cache *~
Modified: thunar-vcs-plugin/trunk/configure.ac.in
===================================================================
--- thunar-vcs-plugin/trunk/configure.ac.in 2009-07-09 22:36:54 UTC (rev 7713)
+++ thunar-vcs-plugin/trunk/configure.ac.in 2009-07-10 12:36:46 UTC (rev 7714)
@@ -69,36 +69,44 @@
dnl ***********************************
XDT_CHECK_PACKAGE([THUNARX], [thunarx-1], [0.4.0])
XDT_CHECK_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.4.0])
-XDT_CHECK_PACKAGE([APR], [apr-1], [0.9.7])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.6.0])
XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [2.6.0])
-AC_CHECK_LIB([svn_subr-1], [main], ,
-[
- echo "*** The required library 'svn_subr-1' was not found on your system."
- echo "*** Please install libsvn (atleast version 1.5)."
- exit 1
-])
-AC_CHECK_LIB([svn_fs-1], [main], ,
-[
- echo "*** The required library 'svn_fs-1' was not found on your system."
- echo "*** Please install libsvn (atleast version 1.5)."
- exit 1
-])
-AC_CHECK_LIB([svn_wc-1], [main], ,
-[
- echo "*** The required library 'svn_wc-1' was not found on your system."
- echo "*** Please install libsvn (atleast version 1.5)."
- exit 1
-])
-AC_CHECK_LIB([svn_client-1], [main], ,
-[
- echo "*** The required library 'svn_wc-1' was not found on your system."
- echo "*** Please install libsvn (atleast version 1.5)."
- exit 1
-])
dnl ***********************************
+dnl *** Check for optional packages ***
+dnl ***********************************
+XDT_CHECK_OPTIONAL_PACKAGE([APR], [apr-1], [0.9.7], [subversion], [libsvn])
+if test x"$APR_FOUND" = x"yes"; then
+ found_subversion=yes
+ AC_CHECK_LIB([svn_subr-1], [main], , [found_subversion=no])
+ AC_CHECK_LIB([svn_fs-1], [main], , [found_subversion=no])
+ AC_CHECK_LIB([svn_wc-1], [main], , [found_subversion=no])
+ AC_CHECK_LIB([svn_client-1], [main], , [found_subversion=no])
+ if test x"$found_subversion" = x"yes"; then
+ AC_DEFINE([HAVE_SUBVERSION], [1], [Define if libsvn is present])
+ fi
+else
+ AC_MSG_CHECKING([for optional package subversion])
+ AC_MSG_RESULT([disabled])
+fi
+AM_CONDITIONAL([HAVE_SUBVERSION], [test x"$found_subversion" = x"yes"])
+
+AC_ARG_ENABLE([git],
+ AC_HELP_STRING([--enable-git], [Enable git (default)])
+AC_HELP_STRING([--disable-git], [Disable git]),
+ [check_for_git=$enableval], [check_for_git=yes])
+AC_MSG_CHECKING([for optional package git])
+if test x"$check_for_git" = x"yes"; then
+ found_git=yes
+ AC_MSG_RESULT([enabled])
+ AC_DEFINE([HAVE_GIT], [1], [Define if git is endabled])
+else
+ AC_MSG_RESULT([disabled])
+fi
+AM_CONDITIONAL([HAVE_GIT], [test x"$found_git" = x"yes"])
+
+dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
AC_ARG_ENABLE([debug],
Modified: thunar-vcs-plugin/trunk/thunar-vcs-plugin/Makefile.am
===================================================================
--- thunar-vcs-plugin/trunk/thunar-vcs-plugin/Makefile.am 2009-07-09 22:36:54 UTC (rev 7713)
+++ thunar-vcs-plugin/trunk/thunar-vcs-plugin/Makefile.am 2009-07-10 12:36:46 UTC (rev 7714)
@@ -13,25 +13,37 @@
thunar-vcs-plugin.la
thunar_vcs_plugin_la_SOURCES = \
+ tvp-provider.c \
+ tvp-provider.h \
+ thunar-vcs-plugin.c
+if HAVE_SUBVERSION
+thunar_vcs_plugin_la_SOURCES += \
tvp-svn-backend.c \
tvp-svn-backend.h \
tvp-svn-action.c \
tvp-svn-action.h \
tvp-svn-property-page.c \
- tvp-svn-property-page.h \
+ tvp-svn-property-page.h
+endif
+if HAVE_GIT
+thunar_vcs_plugin_la_SOURCES += \
tvp-git-action.c \
- tvp-git-action.h \
- tvp-provider.c \
- tvp-provider.h \
- thunar-vcs-plugin.c
+ tvp-git-action.h
+endif
thunar_vcs_plugin_la_CFLAGS = \
$(PLATFORM_CFLAGS) \
$(THUNARX_CFLAGS) \
- $(THUNAR_VFS_CFLAGS) \
+ $(THUNAR_VFS_CFLAGS)
+if HAVE_SUBVERSION
+thunar_vcs_plugin_la_CFLAGS += \
$(APR_CFLAGS) \
- -DTVP_SVN_HELPER=\"$(libexecdir)/tvp-svn-helper\" \
+ -DTVP_SVN_HELPER=\"$(libexecdir)/tvp-svn-helper\"
+endif
+if HAVE_GIT
+thunar_vcs_plugin_la_CFLAGS += \
-DTVP_GIT_HELPER=\"$(libexecdir)/tvp-git-helper\"
+endif
thunar_vcs_plugin_la_LDFLAGS = \
-avoid-version \
@@ -39,7 +51,10 @@
-module \
$(PLATFORM_LDFLAGS) \
$(THUNARX_LDFLAGS) \
- $(THUNAR_VFS_LDFLAGS) \
+ $(THUNAR_VFS_LDFLAGS)
+if HAVE_SUBVERSION
+thunar_vcs_plugin_la_LDFLAGS += \
$(APR_LDFLAGS)
+endif
# vi:set ts=8 sw=8 noet ai nocindent:
Modified: thunar-vcs-plugin/trunk/thunar-vcs-plugin/thunar-vcs-plugin.c
===================================================================
--- thunar-vcs-plugin/trunk/thunar-vcs-plugin/thunar-vcs-plugin.c 2009-07-09 22:36:54 UTC (rev 7713)
+++ thunar-vcs-plugin/trunk/thunar-vcs-plugin/thunar-vcs-plugin.c 2009-07-10 12:36:46 UTC (rev 7714)
@@ -24,9 +24,15 @@
#include <exo/exo.h>
#include <thunar-vcs-plugin/tvp-provider.h>
+
+#ifdef HAVE_SUBVERSION
#include <thunar-vcs-plugin/tvp-svn-action.h>
#include <thunar-vcs-plugin/tvp-svn-property-page.h>
+#endif
+
+#ifdef HAVE_GIT
#include <thunar-vcs-plugin/tvp-git-action.h>
+#endif
@@ -59,9 +65,13 @@
/* register the types provided by this plugin */
tvp_provider_register_type (plugin);
+#ifdef HAVE_SUBVERSION
tvp_svn_action_register_type (plugin);
tvp_svn_property_page_register_type (plugin);
+#endif
+#ifdef HAVE_GIT
tvp_git_action_register_type (plugin);
+#endif
/* setup the plugin provider type list */
type_list[0] = TVP_TYPE_PROVIDER;
Modified: thunar-vcs-plugin/trunk/thunar-vcs-plugin/tvp-provider.c
===================================================================
--- thunar-vcs-plugin/trunk/thunar-vcs-plugin/tvp-provider.c 2009-07-09 22:36:54 UTC (rev 7713)
+++ thunar-vcs-plugin/trunk/thunar-vcs-plugin/tvp-provider.c 2009-07-10 12:36:46 UTC (rev 7714)
@@ -31,12 +31,17 @@
#include <thunar-vfs/thunar-vfs.h>
+#ifdef HAVE_SUBVERSION
#include <subversion-1/svn_types.h>
-
#include <thunar-vcs-plugin/tvp-svn-backend.h>
#include <thunar-vcs-plugin/tvp-svn-action.h>
#include <thunar-vcs-plugin/tvp-svn-property-page.h>
+#endif
+
+#ifdef HAVE_GIT
#include <thunar-vcs-plugin/tvp-git-action.h>
+#endif
+
#include <thunar-vcs-plugin/tvp-provider.h>
/* use g_access() on win32 */
@@ -64,7 +69,7 @@
ThunarxFileInfo *folder);
static GList *tvp_provider_get_pages (ThunarxPropertyPageProvider *menu_provider,
GList *files);
-static void tvp_new_process (TvpSvnAction *action,
+static void tvp_new_process (GtkAction *action,
const GPid *pid,
const gchar *path,
TvpProvider *tvp_provider);
@@ -167,7 +172,9 @@
gtk_icon_set_unref (icon_set);
#endif /* !GTK_CHECK_VERSION(2,9,0) */
+#ifdef HAVE_SUBVERSION
tvp_svn_backend_init();
+#endif
}
@@ -189,13 +196,17 @@
g_object_unref (G_OBJECT (tvp_provider->icon_factory));
#endif
+#ifdef HAVE_SUBVERSION
tvp_svn_backend_free();
+#endif
+
(*G_OBJECT_CLASS (tvp_provider_parent_class)->finalize) (object);
}
+#ifdef HAVE_SUBVERSION
static gboolean
tvp_is_working_copy (ThunarxFileInfo *file_info)
{
@@ -224,9 +235,11 @@
return result;
}
+#endif
+#ifdef HAVE_SUBVERSION
static gboolean
tvp_is_parent_working_copy (ThunarxFileInfo *file_info)
{
@@ -255,9 +268,11 @@
return result;
}
+#endif
+#ifdef HAVE_SUBVERSION
static GSList *
tvp_get_parent_status (ThunarxFileInfo *file_info)
{
@@ -286,6 +301,7 @@
return result;
}
+#endif
@@ -329,6 +345,7 @@
+#ifdef HAVE_SUBVERSION
static gint
tvp_compare_path (TvpSvnFileStatus *file_status, ThunarxFileInfo *file_info)
{
@@ -357,6 +374,7 @@
return result;
}
+#endif
@@ -365,6 +383,9 @@
GtkWidget *window,
GList *files)
{
+ GList *actions = NULL;
+ GtkAction *action;
+#ifdef HAVE_SUBVERSION
ThunarVfsPathScheme scheme;
ThunarVfsInfo *info;
gboolean parent_wc = FALSE;
@@ -372,8 +393,6 @@
gboolean directory_is_not_wc = FALSE;
gboolean file_is_vc = FALSE;
gboolean file_is_not_vc = FALSE;
- GtkAction *action;
- GList *actions = NULL;
GList *lp;
gint n_files = 0;
GSList *file_status;
@@ -436,11 +455,14 @@
action = tvp_svn_action_new ("Tvp::svn", _("SVN"), files, window, FALSE, parent_wc, directory_is_wc, directory_is_not_wc, file_is_vc, file_is_not_vc);
g_signal_connect(action, "new-process", G_CALLBACK(tvp_new_process), menu_provider);
actions = g_list_append (actions, action);
+#endif
+#ifdef HAVE_GIT
/* append the git submenu action */
action = tvp_git_action_new ("Tvp::git", _("GIT"), files, window, FALSE);
g_signal_connect(action, "new-process", G_CALLBACK(tvp_new_process), menu_provider);
actions = g_list_append (actions, action);
+#endif
return actions;
}
@@ -469,16 +491,20 @@
files = g_list_append (NULL, folder);
+#ifdef HAVE_SUBVERSION
/* Lets see if we are dealing with a working copy */
action = tvp_svn_action_new ("Tvp::svn", _("SVN"), files, window, TRUE, tvp_is_working_copy (folder), FALSE, FALSE, FALSE, FALSE);
g_signal_connect(action, "new-process", G_CALLBACK(tvp_new_process), menu_provider);
/* append the svn submenu action */
actions = g_list_append (actions, action);
+#endif
+#ifdef HAVE_GIT
action = tvp_git_action_new ("Tvp::git", _("GIT"), files, window, TRUE);
g_signal_connect(action, "new-process", G_CALLBACK(tvp_new_process), menu_provider);
/* append the git submenu action */
actions = g_list_append (actions, action);
+#endif
g_list_free (files);
@@ -491,6 +517,7 @@
tvp_provider_get_pages (ThunarxPropertyPageProvider *page_provider, GList *files)
{
GList *pages = NULL;
+#ifdef HAVE_SUBVERSION
if (g_list_length (files) == 1)
{
gboolean is_vc = FALSE;
@@ -538,6 +565,7 @@
pages = g_list_prepend (pages, tvp_svn_property_page_new (files->data));
}
}
+#endif
return pages;
}
@@ -585,7 +613,7 @@
static void
-tvp_new_process (TvpSvnAction *action, const GPid *pid, const gchar *path, TvpProvider *tvp_provider)
+tvp_new_process (GtkAction *action, const GPid *pid, const gchar *path, TvpProvider *tvp_provider)
{
TvpChildWatch *watch;
if (tvp_provider->child_watch)
More information about the Goodies-commits
mailing list