summaryrefslogtreecommitdiffstats
path: root/mysql-workbench-5.2.28-cppconn.patch
blob: 65d177f6c54ef582e7aaef57f85cd1d21727053f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
diff -up mysql-workbench-gpl-5.2.28-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp.cppconn mysql-workbench-gpl-5.2.28-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp
--- mysql-workbench-gpl-5.2.28-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp.cppconn	2010-09-20 19:11:07.100715204 +0200
+++ mysql-workbench-gpl-5.2.28-src/backend/wbprivate/sqlide/wb_sql_editor_form.cpp	2010-09-20 19:11:12.633514446 +0200
@@ -47,7 +47,7 @@
 // this doesn't belong here, but there's no other workaround for having access to mysql_info
 // because of that we also need to link wbprivate directly to the connector, making their
 // dynamic loading pretty much useless
-#include <cppconn/../driver/mysql_connection.h>
+#include <mysql_connection.h>
 
 #include "boost_smart_ptr_helpers.h"
 
diff -up mysql-workbench-gpl-5.2.26/configure.in.cppconn mysql-workbench-gpl-5.2.26/configure.in
--- mysql-workbench-gpl-5.2.26/configure.in.cppconn	2010-08-05 15:33:27.000000000 +0200
+++ mysql-workbench-gpl-5.2.26/configure.in	2010-08-07 08:11:56.906643649 +0200
@@ -462,8 +462,6 @@ res/mysql.profiles/Makefile
 res/sqlidedata/Makefile
 ext/Makefile
 ext/scintilla/gtk/Makefile
-ext/cppconn/Makefile
-ext/cppconn/driver/Makefile
 backend/Makefile
 backend/wbpublic/Makefile
 backend/wbprivate/Makefile
diff -up mysql-workbench-gpl-5.2.26/ext/Makefile.am.cppconn mysql-workbench-gpl-5.2.26/ext/Makefile.am
--- mysql-workbench-gpl-5.2.26/ext/Makefile.am.cppconn	2010-08-05 15:33:23.000000000 +0200
+++ mysql-workbench-gpl-5.2.26/ext/Makefile.am	2010-08-07 08:11:56.907643461 +0200
@@ -4,4 +4,4 @@ else
 ctemplate_dirs=ctemplate 
 endif
 
-SUBDIRS=scintilla/gtk cppconn $(ctemplate_dirs)
+SUBDIRS=scintilla/gtk $(ctemplate_dirs)
diff -up mysql-workbench-gpl-5.2.26/ext/Makefile.in.cppconn mysql-workbench-gpl-5.2.26/ext/Makefile.in
--- mysql-workbench-gpl-5.2.26/ext/Makefile.in.cppconn	2010-08-05 15:33:32.000000000 +0200
+++ mysql-workbench-gpl-5.2.26/ext/Makefile.in	2010-08-07 08:11:56.907643461 +0200
@@ -53,7 +53,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re
   distclean-recursive maintainer-clean-recursive
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = scintilla/gtk cppconn ctemplate
+DIST_SUBDIRS = scintilla/gtk ctemplate
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -214,7 +214,7 @@ target_alias = @target_alias@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @BUILD_CTEMPLATE_FALSE@ctemplate_dirs = ctemplate 
-SUBDIRS = scintilla/gtk cppconn $(ctemplate_dirs)
+SUBDIRS = scintilla/gtk $(ctemplate_dirs)
 all: all-recursive
 
 .SUFFIXES:
diff -up mysql-workbench-gpl-5.2.26/library/dbc/src/driver_manager.cpp.cppconn mysql-workbench-gpl-5.2.26/library/dbc/src/driver_manager.cpp
--- mysql-workbench-gpl-5.2.26/library/dbc/src/driver_manager.cpp.cppconn	2010-08-05 15:33:19.000000000 +0200
+++ mysql-workbench-gpl-5.2.26/library/dbc/src/driver_manager.cpp	2010-08-07 08:11:56.907643461 +0200
@@ -145,6 +145,8 @@ TunnelConnection *DriverManager::getTunn
 ConnectionWrapper DriverManager::getConnection(const db_mgmt_ConnectionRef &connectionProperties, ConnectionInitSlot connection_init_slot)
 {
   TunnelConnection* tunnel = NULL;
+  gchar *p = NULL;
+  GModule *gmodule = NULL;
   // 0. determine correct driver filename
   
   db_mgmt_DriverRef drv = connectionProperties->driver();
@@ -154,21 +156,21 @@ ConnectionWrapper DriverManager::getConn
     library = drv->driverLibraryName();
   else
     throw SQLException("Invalid connection settings: undefined connection driver");
-#ifdef _WIN32
-  library.append(".dll");
-#elif defined(__APPLE__)
-  library.append(".dylib");
-#else
-  library.append(".so");
-#endif
+
+  // Patch : use library in standard path
+  p = g_module_build_path (NULL, library.c_str());
 
   // 1. find driver
 
-  GModule *gmodule= g_module_open((_driver_path + "/" + library).c_str(), G_MODULE_BIND_LOCAL);
+  if (p) {
+    gmodule = g_module_open(std::string(p).append(".5").c_str(), G_MODULE_BIND_LOCAL);
+    g_free(p);
+  }
+
   if (NULL == gmodule)
   {
     fprintf(stderr, "Error: %s", g_module_error());
-    throw SQLException(std::string("Database driver: Failed to open library '").append(_driver_path + "/" + library).append("'. Check settings.").c_str());
+    throw SQLException(std::string("Database driver: Failed to open library '").append(library).append("'. Check settings.").c_str());
   }
   
   Driver *(* get_driver_instance)()= NULL;
diff -up mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.am.cppconn mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.am
--- mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.am.cppconn	2010-09-20 22:02:44.930765082 +0200
+++ mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.am	2010-09-20 22:03:42.489372852 +0200
@@ -48,13 +48,11 @@ mysql_workbench_bin_LDADD=\
 	$(top_srcdir)/library/base/src/libwbbase.la\
 	$(top_srcdir)/library/grt/src/libgrt.la\
 	$(top_srcdir)/library/dbc/libcdbc.la\
-	$(top_srcdir)/ext/cppconn/driver/mysqlcppconn.la\
 	$(top_srcdir)/library/canvas/src/libmdcanvasgtk.la\
 	$(top_srcdir)/library/canvas/src/libmdcanvas.la\
-	$(top_srcdir)/ext/cppconn/driver/mysqlcppconn.la\
 	@CTEMPLATE_LIBS@\
 	@GNOME_LIBS@ @GRT_LIBS@ @PCRE_LIBS@ @GLIB_LIBS@ @CAIRO_LIBS@ @ZIP_LIBS@ @MYSQL_LIBS@ @SQLITE3_LIBS@\
-	-lX11
+	-lmysqlcppconn -lX11
 
 #precompiled.h.gch: precompiled.h
 #	$(CXXCOMPILE) precompiled.h -o precompiled.h.gch
diff -up mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.in.cppconn mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.in
--- mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.in.cppconn	2010-09-20 22:02:34.683084613 +0200
+++ mysql-workbench-gpl-5.2.28-src/frontend/linux/workbench/Makefile.in	2010-09-20 22:03:30.266939988 +0200
@@ -71,10 +71,8 @@ mysql_workbench_bin_DEPENDENCIES =  \
 	$(top_srcdir)/library/base/src/libwbbase.la \
 	$(top_srcdir)/library/grt/src/libgrt.la \
 	$(top_srcdir)/library/dbc/libcdbc.la \
-	$(top_srcdir)/ext/cppconn/driver/mysqlcppconn.la \
 	$(top_srcdir)/library/canvas/src/libmdcanvasgtk.la \
-	$(top_srcdir)/library/canvas/src/libmdcanvas.la \
-	$(top_srcdir)/ext/cppconn/driver/mysqlcppconn.la
+	$(top_srcdir)/library/canvas/src/libmdcanvas.la
 binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(bin_SCRIPTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -305,13 +303,11 @@ mysql_workbench_bin_LDADD = \
 	$(top_srcdir)/library/base/src/libwbbase.la\
 	$(top_srcdir)/library/grt/src/libgrt.la\
 	$(top_srcdir)/library/dbc/libcdbc.la\
-	$(top_srcdir)/ext/cppconn/driver/mysqlcppconn.la\
 	$(top_srcdir)/library/canvas/src/libmdcanvasgtk.la\
 	$(top_srcdir)/library/canvas/src/libmdcanvas.la\
-	$(top_srcdir)/ext/cppconn/driver/mysqlcppconn.la\
 	@CTEMPLATE_LIBS@\
 	@GNOME_LIBS@ @GRT_LIBS@ @PCRE_LIBS@ @GLIB_LIBS@ @CAIRO_LIBS@ @ZIP_LIBS@ @MYSQL_LIBS@ @SQLITE3_LIBS@\
-	-lX11
+	-lmysqlcppconn -lX11
 
 mysql_workbench_bin_SOURCES = \
 main.cpp\