[gnumeric] [win32] fix libglade, start libgnomedb removal



commit 72baff89bcbf170a987da8ed9b3f27afeb92643a
Author: Jody Goldberg <jody gnome org>
Date:   Wed Nov 4 17:59:45 2009 -0500

    [win32] fix libglade, start libgnomedb removal

 plugins/gda/Makefile.am                      |    2 +-
 plugins/gda/plugin-gda.c                     |   52 ++++++----
 plugins/gda/plugin.xml.in                    |    7 ++
 plugins/{gnome-db => gda}/ui.xml.in          |    0
 tools/win32/build                            |   12 ++-
 tools/win32/jhbuildrc-release                |  134 --------------------------
 tools/win32/{jhbuildrc => jhbuildrc.py}      |   10 ++-
 tools/win32/moduleset.in                     |   10 ++-
 tools/win32/patches/libglade-no-python.patch |   53 ++++++++++
 9 files changed, 116 insertions(+), 164 deletions(-)
---
diff --git a/plugins/gda/Makefile.am b/plugins/gda/Makefile.am
index 8e3f749..f5eeb21 100644
--- a/plugins/gda/Makefile.am
+++ b/plugins/gda/Makefile.am
@@ -12,7 +12,7 @@ gdaif_la_LDFLAGS = -module $(GNUMERIC_PLUGIN_LDFLAGS)
 gdaif_la_SOURCES = plugin-gda.c
 gdaif_la_LIBADD = $(GDA_LIBS) $(GNOMEDB_LIBS)
 
-xml_in_files = plugin.xml.in
+xml_in_files = plugin.xml.in ui.xml.in
 xml_DATA = $(xml_in_files:.xml.in=.xml)
 
 @INTLTOOL_XML_RULE@
diff --git a/plugins/gda/plugin-gda.c b/plugins/gda/plugin-gda.c
index 2ec40f4..c65683c 100644
--- a/plugins/gda/plugin-gda.c
+++ b/plugins/gda/plugin-gda.c
@@ -22,12 +22,9 @@
 #include <gnumeric-config.h>
 #include <gnumeric.h>
 #include <libgda/libgda.h>
+#include <libgda/control-center/gdaui-login-dialog.h>
 #include <sql-parser/gda-sql-parser.h>
 #include <string.h>
-#ifdef HAVE_LIBGNOMEDB
-#include <libgnomedb/gnome-db-login-dialog.h>
-#include <libgnomedb/gnome-db-login.h>
-#endif
 
 #include "func.h"
 #include "expr.h"
@@ -258,32 +255,20 @@ open_connection (const gchar *dsn, const gchar *user, const gchar *password, Gda
 		CncKey *key;
 		gchar *auth, *tmp1, *tmp2;
 
-#ifdef HAVE_LIBGNOMEDB
-		GtkWidget    *dialog =
-			gnome_db_login_dialog_new (_("Database Connection"), NULL); /* FIXME: pass a pointer to parent window */
-		GnomeDbLogin *login =
-			gnome_db_login_dialog_get_login_widget (GNOME_DB_LOGIN_DIALOG (dialog));
-
+		GtkWidget    *dialog = gdaui_login_dialog_new (_("Database Connection"), NULL); /* FIXME: pass a pointer to parent window */
+		GnomeDbLogin *login  = gdaui_login_dialog_get_login_widget (GDAUI_LOGIN_DIALOG (dialog));
 		gnome_db_login_set_dsn (login, dsn);
 		gnome_db_login_set_username (login, user);
 		gnome_db_login_set_password (login, password);
-
-		if (gnome_db_login_dialog_run (GNOME_DB_LOGIN_DIALOG (dialog))) {
-			real_dsn = g_strdup (gnome_db_login_get_dsn (login));
-			real_user = g_strdup (gnome_db_login_get_username (login));
-			real_password = g_strdup (gnome_db_login_get_password (login));
-
+		if (gdaui_login_dialog_run (GDAUI_LOGIN_DIALOG (dialog))) {
+			real_dsn = g_strdup (gdauilogin_get_dsn (login));
+			real_user = g_strdup (gdauilogin_get_username (login));
+			real_password = g_strdup (gdauilogin_get_password (login));
 			gtk_widget_destroy (dialog);
 		} else {
 			gtk_widget_destroy (dialog);
 			return NULL;
 		}
-#else
-		real_dsn = g_strdup (dsn);
-		real_user = g_strdup (user);
-		real_password = g_strdup (password);
-#endif
-
 		tmp1 = gda_rfc1738_encode (real_user);
 		tmp2 = gda_rfc1738_encode (real_password);
 		auth = g_strdup_printf ("USERNAME=%s;PASSWORD=%s", tmp1, tmp2);
@@ -472,6 +457,24 @@ gnumeric_readDBTable (GnmFuncEvalInfo *ei, GnmValue const * const *args)
 	return ret;
 }
 
+static void
+view_data_sources (GnmAction const *action, WorkbookControl *wbc)
+{
+	char *argv[2];
+
+	argv[0] = gda_get_application_exec_path ("gda-control-center");
+	argv[1] = NULL;
+	if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL)) {
+		char *msg = g_strdup_printf (
+			_("Could not run GNOME database configuration tool ('%s')"),
+			argv[0]);
+		go_gtk_notice_dialog (wbcg_toplevel (WBC_GTK (wbc)),
+			GTK_MESSAGE_INFO,  msg);
+		g_free (msg);
+	}
+	g_free (argv[0]);
+}
+
 G_MODULE_EXPORT void
 go_plugin_shutdown (GOPlugin *plugin, GOCmdContext *cc)
 {
@@ -480,6 +483,11 @@ go_plugin_shutdown (GOPlugin *plugin, GOCmdContext *cc)
 	cnc_hash = NULL;
 }
 
+ModulePluginUIActions const gdaif_ui_actions[] = {
+	{"ViewDataSources", view_data_sources},
+	{NULL}
+};
+
 GnmFuncDescriptor gdaif_functions[] = {
 	{
 		"execSQL",	"ssss", "dsn,username,password,sql",
diff --git a/plugins/gda/plugin.xml.in b/plugins/gda/plugin.xml.in
index 5d93f62..e20cecb 100644
--- a/plugins/gda/plugin.xml.in
+++ b/plugins/gda/plugin.xml.in
@@ -15,5 +15,12 @@
 				<function name="readDBTable"/>
 			</functions>
 		</service>
+		<service type="ui" id="gdaif" file="ui.xml">
+			<actions>
+				<action name="ViewDataSources">
+					<_label>Data Bases...</_label>
+				</action>
+			</actions>
+		</service>
 	</services>
 </plugin>
diff --git a/plugins/gnome-db/ui.xml.in b/plugins/gda/ui.xml.in
similarity index 100%
rename from plugins/gnome-db/ui.xml.in
rename to plugins/gda/ui.xml.in
diff --git a/tools/win32/build b/tools/win32/build
index 779d1d1..86ce25e 100755
--- a/tools/win32/build
+++ b/tools/win32/build
@@ -9,11 +9,17 @@ builddir="$1"
 srcdir="$2"
 target="$3"
 
+if [ -z "${builddir}" -o -z "${srcdir}" -o -z "${target}" ]; then
+    echo "usage  : $0 <builddir> <srcdir> <target>"
+    exit 1
+fi
+
 export WINEPREFIX="${builddir}/wine"
 WINEDIR="${WINEPREFIX}/drive_c"
 archive_dir="${builddir}/archive"
 export JH_PREFIX="${builddir}/${target}"
 export JH_MODULE_SET="${srcdir}/moduleset"
+export JH_TARGET="${target}"
 
 build_mkdir() {
      if [ ! -d "$1" ]; then
@@ -33,7 +39,7 @@ build_ls_s() {
     build_mkdir "bin"
     build_mkdir "lib"
     build_mkdir "etc/gtk-2.0"
-    install -C "${srcdir}/gtkrc" "etc/gtk-2.0"
+    install "${srcdir}/gtkrc" "etc/gtk-2.0"
 
 # Setup Python
     py_pkg="${archive_dir}/python-${py_pkg_ver}.msi"
@@ -41,7 +47,7 @@ build_ls_s() {
 
     if [ ! -f "$py_pkg" ]; then
 	echo wget "http://www.python.org/ftp/python/${py_pkg_ver}/python-${py_pkg_ver}.msi";
-	( cd ${archive_dir} && wget "http://www.python.org/ftp/python/${py_pkg_ver}/python-${py_pkg_ver}.msi"; )
+	( cd "${archive_dir}" ; wget "http://www.python.org/ftp/python/${py_pkg_ver}/python-${py_pkg_ver}.msi"; )
     fi
     if [ ! -d "${WINEDIR}/Python${py_ver}" ]; then
 	echo wine msiexec /i ${py_pkg}
@@ -52,7 +58,7 @@ build_ls_s() {
     build_ls_s "${WINEDIR}/Python${py_ver}/libs/python${py_ver}.lib"	"lib/libpython${py_ver}.dll.a"
 
 # prep jhbuild files
-    ${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc"
+    ${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py" # "-${target}"
 
 ################################################################
 # TODO
diff --git a/tools/win32/jhbuildrc b/tools/win32/jhbuildrc.py
similarity index 96%
rename from tools/win32/jhbuildrc
rename to tools/win32/jhbuildrc.py
index f2ae893..3197282 100644
--- a/tools/win32/jhbuildrc
+++ b/tools/win32/jhbuildrc.py
@@ -46,6 +46,14 @@ for tool in mingw_tools.keys():
 	fullpath_tool = mingw_tool_prefix + mingw_tools[tool]
 	os.environ[tool] = fullpath_tool
 
+if os.getenv('JH_TARGET') == "debug":
+    optim = ' -O0 -gstabs'
+elif os.getenv('JH_TARGET') == "release":
+    optim = ' -O2'
+else:
+    print "Best to invoke this via make"
+    sys.exit (0)
+
 #Exporting tool flags enviroment variables
 os.environ['LDFLAGS']	 = ' -mno-cygwin -L'+prefix+'/lib  -no-undefined'
 os.environ['CFLAGS']	 = ' -O0 -gstabs -I'+prefix+'/include -mno-cygwin -mms-bitfields -march=i686 ' 
@@ -123,7 +131,7 @@ module_autogenargs['libxml2']	= autogenargs + """ --disable-scrollkeeper --witho
 autogenargs += """ --disable-scrollkeeper --disable-gtk-doc"""
 
 module_autogenargs['atk']	= autogenargs + """ --disable-glibtest"""
-module_autogenargs['gtk+']	= autogenargs + """ --disable-glibtest --enable-gdiplus --without-libjasper  --without-libtiff --without-libjpeg"""
+module_autogenargs['gtk+']	= autogenargs + """ --disable-glibtest --enable-gdiplus --without-libjasper  --without-libtiff --without-libjpeg --enable-cups=no"""
 
 module_autogenargs['libgda']	= autogenargs + """ --without-odbc --without-lda --without-java"""
 module_autogenargs['pxlib']	= autogenargs + """ --with-gsf=""" + prefix
diff --git a/tools/win32/moduleset.in b/tools/win32/moduleset.in
index 7aa5e73..7f92336 100644
--- a/tools/win32/moduleset.in
+++ b/tools/win32/moduleset.in
@@ -214,13 +214,17 @@
 	    <dep package="zlib"/>
 	</dependencies>
     </tarball>
-    <tarball id="libglade" version="2.6.4">
-	<source href="http://ftp.gnome.org/pub/gnome/sources/libglade/2.6/libglade-2.6.4.tar.bz2"/>
+    <autotools id="libglade"
+	autogen-sh="autoreconf" skip-autogen="never">
+	<branch repo="gnome.org" module="sources/libglade/2.6/libglade-2.6.4.tar.bz2"
+		version="2.6.4">
+	    <patch file="&patch_dir;libglade-no-python.patch"/>
+	</branch>
 	<dependencies>
 	    <dep package="gtk+"/>
 	    <dep package="libxml2"/>
 	</dependencies>
-    </tarball>
+    </autotools>
 
 <!-- python stack -->
     <autotools id="pygobject" 
diff --git a/tools/win32/patches/libglade-no-python.patch b/tools/win32/patches/libglade-no-python.patch
new file mode 100644
index 0000000..4a56a35
--- /dev/null
+++ b/tools/win32/patches/libglade-no-python.patch
@@ -0,0 +1,53 @@
+*** configure.in	Tue Mar 17 10:19:01 2009
+--- configure.in	Wed Nov  4 17:08:14 2009
+***************
+*** 123,146 ****
+  AH_BOTTOM(
+  [#endif /* GLADE_CONFIG_H */])
+  
+! # check for a copy of python >= 2.0 with the xml.parsers.expat module.
+! AM_PATH_PYTHON(2.0, [have_python=true], [have_python=false])
+! if $have_python; then
+!   jh_python_check='
+! import sys
+! try:
+!     import xml.parsers.expat
+! except ImportError:
+!     sys.exit(1)
+! '
+!   AC_MSG_CHECKING([for the Python module xml.parsers.expat])
+!   if AC_RUN_LOG([$PYTHON -c "$jh_python_check"]); then
+!     AC_MSG_RESULT([yes])
+!   else
+!     AC_MSG_RESULT([no])
+!     have_python=false
+!   fi
+! fi
+  AM_CONDITIONAL(HAVE_PYTHON, $have_python)
+  
+  # check for XML catalog
+--- 123,129 ----
+  AH_BOTTOM(
+  [#endif /* GLADE_CONFIG_H */])
+  
+! have_python=false
+  AM_CONDITIONAL(HAVE_PYTHON, $have_python)
+  
+  # check for XML catalog
+--- gtk-doc.make	2009-03-17 10:25:30.000000000 -0400
++++ gtk-doc.make	2009-11-04 17:46:23.000000000 -0500
+@@ -156,7 +156,6 @@
+ 	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
+ 	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
+ 	  fi; \
+-	  $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
+ 	fi
+ 
+ uninstall-local:
+@@ -188,6 +187,5 @@
+ 	-cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
+ 	-cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
+ 	cd $(distdir) && rm -f $(DISTCLEANFILES)
+-	$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+ 
+ .PHONY : dist-hook-local docs



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