Commit debbd4c7 authored by Luca Giambonini's avatar Luca Giambonini

mysql-workbench 8.0.15 [skip-ci] Fix #11

parent bfef25ad
Pipeline #2715 skipped
From d15e588be02e44b1317bf90ff7be1714267281c8 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 23 Jul 2018 11:03:19 +0200
Subject: [PATCH 1/4] mysql-workbench-no-check-for-updates
Signed-off-by: Christian Hesse <mail@eworm.de>
---
res/wbdata/main_menu.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/res/wbdata/main_menu.xml b/res/wbdata/main_menu.xml
index a32256c..08d9a21 100644
index bfa63ef..957f809 100644
--- a/res/wbdata/main_menu.xml
+++ b/res/wbdata/main_menu.xml
@@ -2900,6 +2900,7 @@ value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.view.fkhili
<value type="string" key="itemType">action</value>
</value>
+ <!-- We build a package that should be updated via pacman, so disable this check.
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.separator.help.checkver">
<value type="string" key="itemType">separator</value>
</value>
@@ -2910,7 +2911,7 @@ value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.view.fkhili
<value type="string" key="name">checkUpdate</value>
<value type="string" key="command">plugin:wb.tools.checkForUpdates</value>
<value type="string" key="itemType">action</value>
- </value>
+ </value> //-->
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.separator.help.report_a_bug">
<value type="string" key="itemType">separator</value>
@@ -2277,6 +2277,7 @@
<value type="string" key="command">builtin:show_log_file</value>
<value type="string" key="itemType">action</value>
</value>
+ <!-- We build a package that should be updated via pacman, so disable this check.
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.separator.help.checkver">
<value type="string" key="itemType">separator</value>
</value>
@@ -2287,6 +2288,7 @@
<value type="string" key="command">plugin:wb.tools.checkForUpdates</value>
<value type="string" key="itemType">action</value>
</value>
+ </value> //-->
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.separator.help.report_a_bug">
<value type="string" key="itemType">separator</value>
<value type="string" key="platform">windows,linux</value>
From 784599e99ee97574798512f6daf987cab8fd4cdf Mon Sep 17 00:00:00 2001
From 98a9974f550dfb5c8f66213774e4ef95848127e1 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 8 Feb 2017 09:12:24 +0100
Subject: [PATCH 1/1] disable unsupported operating system warning
Date: Mon, 23 Jul 2018 11:04:55 +0200
Subject: [PATCH 2/4] disable-unsupported-operating-system-warning
Signed-off-by: Christian Hesse <mail@eworm.de>
---
......@@ -9,21 +9,18 @@ Signed-off-by: Christian Hesse <mail@eworm.de>
1 file changed, 2 insertions(+)
diff --git a/backend/wbprivate/workbench/wb_context.cpp b/backend/wbprivate/workbench/wb_context.cpp
index 82c0fa6..f06ff99 100644
index e80501a..a4047b1 100644
--- a/backend/wbprivate/workbench/wb_context.cpp
+++ b/backend/wbprivate/workbench/wb_context.cpp
@@ -1009,9 +1009,11 @@ void WBContext::init_finish_(WBOptions *options) {
@@ -1011,9 +1011,11 @@ void WBContext::init_finish_(WBOptions *options) {
_frontendCallbacks->show_status_text(_("Ready."));
+#if 0
if (options->open_at_startup_type !=
"run-script") // <--- so that our runtime tests don't lock up when a modal warning dialog is displayed
// Avoid our runtime tests to lock up when a modal warning dialog is displayed.
if (options->open_at_startup_type != "run-script")
warnIfRunningOnUnsupportedOS();
+#endif
try {
// execute action requested from command line
--
2.11.1
From cca769c75b9421f8ef5090848cea6162ccd85ba7 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 8 Feb 2017 09:42:29 +0100
Subject: [PATCH 1/1] add option to hide nonstandard server warning
Signed-off-by: Christian Hesse <mail@eworm.de>
---
backend/wbprivate/workbench/wb_context.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/backend/wbprivate/workbench/wb_context.cpp b/backend/wbprivate/workbench/wb_context.cpp
index f06ff99..f89006b 100644
--- a/backend/wbprivate/workbench/wb_context.cpp
+++ b/backend/wbprivate/workbench/wb_context.cpp
@@ -3038,7 +3038,7 @@ std::shared_ptr<SqlEditorForm> WBContext::add_new_query_window(const db_mgmt_Con
logError("Unsupported server version: %s %s\n", form->connection_details()["dbmsProductName"].c_str(),
form->connection_details()["dbmsProductVersion"].c_str());
- if (mforms::Utilities::show_warning(
+ if (mforms::Utilities::show_message_and_remember(
base::strfmt("Connection Warning (%s)", targetConnection->name().c_str()),
base::strfmt(
"Incompatible/nonstandard server version or connection protocol detected (%s).\n\n"
@@ -3046,7 +3046,8 @@ std::shared_ptr<SqlEditorForm> WBContext::add_new_query_window(const db_mgmt_Con
"properly since the database is not fully compatible with the supported versions of MySQL.\n\n"
"MySQL Workbench is developed and tested for MySQL Server versions 5.1, 5.5, 5.6 and 5.7",
bec::sanitize_server_version_number(form->connection_details()["dbmsProductVersion"]).c_str()),
- "Continue Anyway", "Cancel") != mforms::ResultOk) {
+ "Continue Anyway", "Cancel", "", "wb.supported_server_check.suppress_warning",
+ "Don't show this message again") != mforms::ResultOk) {
_frontendCallbacks->show_status_text(_("Unsupported server"));
return SqlEditorForm::Ref();
}
--
2.11.1
--- mysql-workbench-community-6.3.9-src.orig/plugins/migration/copytable/copytable.cpp 2016-10-14 15:12:03.000000000 +0300
+++ mysql-workbench-community-6.3.9-src/plugins/migration/copytable/copytable.cpp 2016-11-17 16:27:43.044632958 +0200
@@ -2847,7 +2847,7 @@
// This is needed because the escaping depends on the character set in use by the server
unsigned long ret_length = 0;
-#if MYSQL_CHECK_VERSION(5, 7, 6)
+#if MYSQL_CHECK_VERSION(5, 7, 6) && !defined(MARIADB_BASE_VERSION)
if (_target->is_mysql_version_at_least(5, 7, 6))
ret_length += mysql_real_escape_string_quote(_mysql, buffer + length, data, (unsigned long)dlength, '"');
else
diff -uNr mysql-workbench-community-6.3.10-src.org/library/cdbc/src/driver_manager.cpp mysql-workbench-community-6.3.10-src/library/cdbc/src/driver_manager.cpp
--- mysql-workbench-community-6.3.10-src.org/library/cdbc/src/driver_manager.cpp 2017-11-09 18:11:42.000000000 +0200
+++ mysql-workbench-community-6.3.10-src/library/cdbc/src/driver_manager.cpp 2018-02-05 11:51:59.083657042 +0200
@@ -297,7 +297,7 @@
if (properties.find("OPT_READ_TIMEOUT") == properties.end())
properties["OPT_READ_TIMEOUT"] = read_timeout;
}
- properties["OPT_CAN_HANDLE_EXPIRED_PASSWORDS"] = true;
+ //properties["OPT_CAN_HANDLE_EXPIRED_PASSWORDS"] = true;
properties["CLIENT_MULTI_STATEMENTS"] = true;
properties["metadataUseInfoSchema"] =
false; // I_S is way too slow for many things as of MySQL 5.6.10, so disable it for now
@@ -324,7 +324,7 @@
properties.erase("sslCipher");
}
- ssize_t sslModeWb = parameter_values.get_int("useSSL", 0);
+ /*ssize_t sslModeWb = parameter_values.get_int("useSSL", 0);
sql::ssl_mode sslMode = sql::SSL_MODE_DISABLED;
switch(sslModeWb)
{
@@ -344,7 +344,7 @@
sslMode = sql::SSL_MODE_VERIFY_IDENTITY;
break;
}
- properties["OPT_SSL_MODE"] = sslMode;
+ properties["OPT_SSL_MODE"] = sslMode;*/
// If we are on a pipe connection then set the host name explicitly.
// However, pipe connections can only be established on the local box (Win only).
diff -uNr mysql-workbench-community-6.3.10-src.org/library/sql.parser/source/my_config.h mysql-workbench-community-6.3.10-src/library/sql.parser/source/my_config.h
--- mysql-workbench-community-6.3.10-src.org/library/sql.parser/source/my_config.h 1970-01-01 03:00:00.000000000 +0300
+++ mysql-workbench-community-6.3.10-src/library/sql.parser/source/my_config.h 2018-02-05 14:09:01.328469741 +0200
@@ -0,0 +1,44 @@
+// include everything from system my_config.h
+#include_next <my_config.h>
+
+// add charsets for workbench
+#define HAVE_CHARSET_armscii8 1
+#define HAVE_CHARSET_ascii 1
+#define HAVE_CHARSET_big5 1
+#define HAVE_CHARSET_cp1250 1
+#define HAVE_CHARSET_cp1251 1
+#define HAVE_CHARSET_cp1256 1
+#define HAVE_CHARSET_cp1257 1
+#define HAVE_CHARSET_cp850 1
+#define HAVE_CHARSET_cp852 1
+#define HAVE_CHARSET_cp866 1
+#define HAVE_CHARSET_cp932 1
+#define HAVE_CHARSET_dec8 1
+#define HAVE_CHARSET_eucjpms 1
+#define HAVE_CHARSET_euckr 1
+#define HAVE_CHARSET_gb2312 1
+#define HAVE_CHARSET_gbk 1
+#define HAVE_CHARSET_geostd8 1
+#define HAVE_CHARSET_greek 1
+#define HAVE_CHARSET_hebrew 1
+#define HAVE_CHARSET_hp8 1
+#define HAVE_CHARSET_keybcs2 1
+#define HAVE_CHARSET_koi8r 1
+#define HAVE_CHARSET_koi8u 1
+#define HAVE_CHARSET_latin1 1
+#define HAVE_CHARSET_latin2 1
+#define HAVE_CHARSET_latin5 1
+#define HAVE_CHARSET_latin7 1
+#define HAVE_CHARSET_macce 1
+#define HAVE_CHARSET_macroman 1
+#define HAVE_CHARSET_sjis 1
+#define HAVE_CHARSET_swe7 1
+#define HAVE_CHARSET_tis620 1
+#define HAVE_CHARSET_ucs2 1
+#define HAVE_CHARSET_ujis 1
+#define HAVE_CHARSET_utf8mb4 1
+#define HAVE_CHARSET_utf8mb3 1
+#define HAVE_CHARSET_utf8 1
+#define HAVE_CHARSET_utf16 1
+#define HAVE_CHARSET_utf32 1
+#define HAVE_UCA_COLLATIONS 1
diff --git a/plugins/wb.admin/frontend/wb_admin_export.py b/plugins/wb.admin/frontend/wb_admin_export.py
index 40f5167..ebf6c3d 100644
--- a/plugins/wb.admin/frontend/wb_admin_export.py
+++ b/plugins/wb.admin/frontend/wb_admin_export.py
@@ -1858,8 +1858,6 @@ class WbAdminExportTab(WbAdminSchemaListTab):
args.append("--ssl-cipher=%s" % conn["sslCipher"])
# Sets the compatibility parameters if needed
- if self._compatibility_params:
- args.append("--set-gtid-purged=OFF")
if conn.get("OPT_ENABLE_CLEARTEXT_PLUGIN", ""):
args.append("--enable-cleartext-plugin")
diff --git a/plugins/wb.admin/frontend/wb_admin_export_options.py b/plugins/wb.admin/frontend/wb_admin_export_options.py
index e9ec2e7..653f531 100644
--- a/plugins/wb.admin/frontend/wb_admin_export_options.py
+++ b/plugins/wb.admin/frontend/wb_admin_export_options.py
@@ -53,9 +53,9 @@ export_options = {
"order-by-primary":["Dump each table's rows sorted by its primary key, or by its first unique index.","FALSE"],
"dump-date":["Include dump date as \"Dump completed on\" comment if --comments is given.","TRUE"],
"$internal$show-internal-schemas":["Show internal MySQL schemas (mysql, information_schema, performance_schema) in the export schema list.","FALSE"],
- "tz-utc":["Add SET TIME_ZONE='+00:00' to the dump file.","TRUE"],
+ "tz-utc":["Add SET TIME_ZONE='+00:00' to the dump file.","TRUE"]
# "xml":["Produce XML output.","FALSE"]
- "set-gtid-purged":["Add 'SET @@GLOBAL.GTID_PURGED' to the output.","AUTO","STR",("5.6.9", None)]
+# "set-gtid-purged":["Add 'SET @@GLOBAL.GTID_PURGED' to the output.","AUTO","STR",("5.6.9", None)]
}
}
diff --git a/frontend/linux/workbench/mysql-workbench.in b/frontend/linux/workbench/mysql-workbench.in
index 02a8061..f8176f6 100755
--- a/frontend/linux/workbench/mysql-workbench.in
+++ b/frontend/linux/workbench/mysql-workbench.in
@@ -4,6 +4,12 @@
# This will cause passwords to be stored only temporarily for the session.
#WB_NO_GNOME_KEYRING=1
+# Looks like WB expects gnome-keyring to be present as soon as XDG_RUNTIME_DIR
+# environment variable is set. Do an extra check here...
+if ! type gnome-keyring-daemon >/dev/null 2>/dev/null; then
+ export WB_NO_GNOME_KEYRING=1
+fi
+
# force disable the Mac style single menu hack in Ubuntu Unity
export UBUNTU_MENUPROXY=0
diff -Pdpru mysql-workbench-community-6.3.5-src.orig/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
mysql-workbench-community-6.3.5-src/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
--- mysql-workbench-community-6.3.5-src.orig/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp 2015-10-17 16:35:49.000000000 +0200
+++ mysql-workbench-community-6.3.5-src/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp 2015-11-12 06:33:10.787604909 +0100
@@ -314,9 +314,9 @@ public:
case sql::DataType::SET:
type = "string";
break;
- case sql::DataType::JSON:
- type = "json";
- break;
+// case sql::DataType::JSON:
+// type = "json";
+// break;
case sql::DataType::SQLNULL:
type = "null";
break;
diff -Pdpru mysql-workbench-community-6.3.5-src.orig/plugins/migration/copytable/copytable.cpp mysql-workbench-community-6.3.5-src/plugins/migration/copytable/copytable.cpp
--- mysql-workbench-community-6.3.5-src.orig/plugins/migration/copytable/copytable.cpp 2015-10-17 16:35:48.000000000 +0200
+++ mysql-workbench-community-6.3.5-src/plugins/migration/copytable/copytable.cpp 2015-11-12 00:02:35.378227904 +0100
@@ -109,8 +109,8 @@ static const char *mysql_field_type_to_n
return "MYSQL_TYPE_STRING";
case MYSQL_TYPE_GEOMETRY:
return "MYSQL_TYPE_GEOMETRY";
- case MYSQL_TYPE_JSON:
- return "MYSQL_TYPE_JSON";
+// case MYSQL_TYPE_JSON:
+// return "MYSQL_TYPE_JSON";
default:
return "UNKNOWN";
}
@@ -241,7 +241,7 @@ RowBuffer::RowBuffer(boost::shared_ptr<s
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_BIT:
- case MYSQL_TYPE_JSON:
+// case MYSQL_TYPE_JSON:
if (!col->is_long_data)
bind.buffer_length = (unsigned)col->source_length + 1;
@@ -1393,7 +1393,7 @@ bool MySQLCopyDataSource::fetch_row(RowB
rowbuffer[index].buffer_type == MYSQL_TYPE_MEDIUM_BLOB ||
rowbuffer[index].buffer_type == MYSQL_TYPE_LONG_BLOB || rowbuffer[index].buffer_type == MYSQL_TYPE_BLOB ||
rowbuffer[index].buffer_type == MYSQL_TYPE_STRING ||
- rowbuffer[index].buffer_type == MYSQL_TYPE_GEOMETRY || rowbuffer[index].buffer_type == MYSQL_TYPE_JSON) {
+ rowbuffer[index].buffer_type == MYSQL_TYPE_GEOMETRY) {
if (rowbuffer[index].buffer_length)
free(rowbuffer[index].buffer);
@@ -2162,7 +2162,7 @@ bool MySQLCopyDataTarget::append_bulk_co
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_SET:
- case MYSQL_TYPE_JSON:
+// case MYSQL_TYPE_JSON:
_bulk_insert_record.append("'", 1);
ret_val = _bulk_insert_record.append_escaped((char *)(*_row_buffer)[col_index].buffer,
*(*_row_buffer)[col_index].length);
# Arch Contributor: Christian Hesse <mail@eworm.de>
pkgname=mysql-workbench
pkgver=6.3.10
pkgrel=2
pkgver=8.0.15
pkgrel=1
_mysql_version=${pkgver}
_connector_version=${pkgver}
_gdal_version=2.4.0
_boost_version=1.68.0
pkgdesc='A cross-platform, visual database design tool developed by MySQL'
arch=('x86_64')
url='https://www.mysql.com/products/workbench/'
license=('GPL2')
depends=('python2' 'libzip' 'libmariadbclient' 'gtkmm3' 'ctemplate'
'libgnome-keyring' 'libgl' 'python2-paramiko' 'python2-pexpect' 'gdal'
'pcre' 'tinyxml' 'libxml2' 'mysql-python' 'cairo'
'python2-cairo' 'hicolor-icon-theme' 'desktop-file-utils' 'libiodbc'
'mysql-connector-c++' 'vsqlite++' 'unixodbc' 'freetype2'
'libantlr3c')
depends=('cairo' 'ctemplate' 'desktop-file-utils' 'freetype2' 'gtkmm3'
'hicolor-icon-theme' 'libgl' 'libsecret' 'libiodbc' 'libxml2'
'libzip' 'mysql-python' 'pcre' 'python2' 'python2-cairo' 'libssh'
'python2-pexpect' 'tinyxml' 'unixodbc' 'vsqlite++' 'proj' 'json-c'
'antlr4-runtime' 'giflib' 'zstd' 'curl')
optdepends=('python2-pyodbc: database migration')
makedepends=('cmake' 'boost' 'curl' 'mesa' 'swig' 'java-runtime' 'imagemagick')
install=mysql-workbench.install
source=("https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-${pkgver}-src.tar.gz"
'https://www.antlr3.org/download/antlr-3.4-complete.jar'
'0001-mysql-workbench-no-check-for-updates.patch'
'0002-disable-unsupported-operating-system-warning.patch'
'0003-add-option-to-hide-nonstandard-server-warning.patch'
'0004-mariadb-no-escape-string-quote.patch'
'0005-mysql-workbench-mariadb.patch'
'0007-mysql-workbench-no-set-gtid-purged.patch'
'0009-mysql-workbench-gnome-keyring.patch'
'0013-mysql-workbench-no-json.patch'
'arch_linux_profile.xml')
sha256sums=('b5593e439c6f8d50262a8950456a9ba3709b02d1dece0360d5f6e47e1b0d7dc3'
'9d3e866b610460664522520f73b81777b5626fb0a282a5952b9800b751550bf7'
'b189e15c6b6f5a707357d9a9297f39ee3a33264fd28b44d5de6f537f851f82cf'
'0d65832bc5a73d4cfecef4b552bb78a30ce6020a5fabe5558dcf2ade8341b593'
'3c9097af599f08388c471d6fd02f40ea72e5759eaa89f731e662852a5e67feea'
'cfc21dfbf735dc6490c0934db580d769d5d6bf7f155c09dadc7c8813669e4c3d'
'b6cc28627a8e25dcdc6a7e151767f09e3f1e3a599313912f4490f6d03b03f012'
'b49d4ea352d2c2013b9c5834668c44521a0a2c5f9c7e3fe746ad94ce0d2bb865'
'9c2ae2fe7a4f59502bdcf591a07353c350b0ba29c3935c8242d97848cc0e50d3'
'968eadbf672680578c24f6950b1e7a702a178630589751c047a30a4935b4118c'
makedepends=('cmake' 'boost' 'mesa' 'swig' 'java-runtime' 'imagemagick' 'antlr4')
validpgpkeys=('A4A9406876FCBD3C456770C88C718D3B5072E1F5') # MySQL Release Engineering <mysql-build@oss.oracle.com>
source=("https://cdn.mysql.com/Downloads/MySQLGUITools/mysql-workbench-community-${pkgver}-src.tar.gz"{,.asc}
"https://cdn.mysql.com/Downloads/MySQL-${_mysql_version%.*}/mysql-${_mysql_version}.tar.gz"{,.asc}
"https://cdn.mysql.com/Downloads/Connector-C++/mysql-connector-c++-${_connector_version}-src.tar.gz"{,.asc}
"http://download.osgeo.org/gdal/${_gdal_version}/gdal-${_gdal_version}.tar.xz"
"https://downloads.sourceforge.net/project/boost/boost/${_boost_version}/boost_${_boost_version//./_}.tar.bz2"
'0001-mysql-workbench-no-check-for-updates.patch'
'0002-disable-unsupported-operating-system-warning.patch'
'arch_linux_profile.xml')
sha256sums=('a61fb363c34e4e11cacafb368f7121c4f59a1bbaaa0a6978ec4579adbe1a4931'
'SKIP'
'bb1bca2dc2f23ee9dd395cc4db93b64561d4ac20b53be5d1dae563f7be64825e'
'SKIP'
'b7e49cbee7d0e89ece7b2460ca7199dc4368be1b8411251050047232eb527b81'
'SKIP'
'c3791dcc6d37e59f6efa86e2df2a55a4485237b0a48e330ae08949f0cdf00f27'
'7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7'
'cdf687f23bc6e8d52dbee9fa02b23d755e80f88476f0fc2e7c4c71cdfed3792f'
'2d0f6dcf38f22e49ef7ab9de0230484f1ffac41b7ac40feaf5ef4538ae2f7a18'
'28724c4b4cec29ce19aada08279df1b086381cd788fef7ae07c1860f7d17af7e')
noextract=(antlr-3.4-complete.jar)
prepare() {
cd "${srcdir}/mysql-workbench-community-${pkgver}-src/"
......@@ -45,83 +46,118 @@ prepare() {
# Updates are provided via Arch Linux packages
patch -Np1 < "${srcdir}"/0001-mysql-workbench-no-check-for-updates.patch
# mysqldump from mariadb (currently 1.0.16) does not support --set-gtid-purged
patch -Np1 < "${srcdir}"/0007-mysql-workbench-no-set-gtid-purged.patch
# fix gnome-keyring
patch -Np1 < "${srcdir}"/0009-mysql-workbench-gnome-keyring.patch
# we have no JSON, probably missing in mariadb
patch -Np1 < "${srcdir}"/0013-mysql-workbench-no-json.patch
# disable unsupported operating system warning
patch -Np1 < "${srcdir}"/0002-disable-unsupported-operating-system-warning.patch
# add option to hide nonstandard server warning
patch -Np1 < "${srcdir}"/0003-add-option-to-hide-nonstandard-server-warning.patch
# mysql-workbench doesn't like mariadb
patch -Np1 -i ../0004-mariadb-no-escape-string-quote.patch
patch -Np1 -i ../0005-mysql-workbench-mariadb.patch
# make cmake happy with mariadb
sed -i '/^find_package(MySQL /c find_package(MySQL REQUIRED)' \
CMakeLists.txt
# we need python 2.x
sed -i '/^FIND_PROGRAM(PYTHON_EXEC /c FIND_PROGRAM(PYTHON_EXEC "python2")' \
CMakeLists.txt
# GCC 7.x introduced some new warnings, remove '-Werror' for the build to complete
sed -i '/^set/s|-Werror -Wall|-Wall|' CMakeLists.txt
# GCC 7.x complains about unsupported flag
sed -i 's|-Wno-deprecated-register||' ext/scintilla/gtk/CMakeLists.txt
# fix the swig workaround
sed -i '/SWIG_VERSION/s/0x030008/0x030006/' \
library/forms/mforms/textbox.h \
library/forms/swig/mforms.i
# fix GDAL
sed -i '/#include/s|gdal/||' \
backend/wbpublic/grtui/geom_draw_box.h \
backend/wbpublic/grt/spatial_handler.h \
backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
# fix paramiko version
sed -i 's|paramiko 1.15.1|paramiko 2.4.0|' CMakeLists.txt
# disable stringop-truncation for GCC 8.x
sed -i '/^set/s|-Wall|-Wall -Wno-stringop-truncation|' CMakeLists.txt
# put antlr into place
install -D ${srcdir}/antlr-3.4-complete.jar ${srcdir}/linux-res/bin/antlr-3.4-complete.jar
# make sure to link against bundled libraries
sed -i "/target_link_libraries/s|\\$|-L${srcdir}/install-bundle/usr/lib/ \\$|" backend/wbpublic/CMakeLists.txt
}
build() {
cd "${srcdir}/mysql-workbench-community-${pkgver}-src/"
# link to libsigc++, which requires ISO C++ 2011 standard
# so add the flag to enable c++11
cmake . \
# Build mysql
mkdir "${srcdir}/mysql-${_mysql_version}-build"
cd "${srcdir}/mysql-${_mysql_version}-build"
echo "Configure mysql..."
cmake "${srcdir}/mysql-${_mysql_version}" \
-DWITHOUT_SERVER=ON \
-DBUILD_CONFIG=mysql_release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONFDIR=/etc/mysql \
-DMYSQL_DATADIR=/var/lib/mysql \
-DWITH_BOOST="${srcdir}/boost_${_boost_version//./_}"
echo "Build mysql..."
make
echo "Install mysql..."
make DESTDIR="${srcdir}/install-bundle/" install
# Build mysql-connector-c++
mkdir "${srcdir}/mysql-connector-c++-${_connector_version}-src-build"
cd "${srcdir}/mysql-connector-c++-${_connector_version}-src-build"
echo "Configure mysql-connector-c++..."
cmake "${srcdir}/mysql-connector-c++-${_connector_version}-src" \
-Wno-dev \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DINSTALL_LIB_DIR=lib \
-DMYSQL_DIR="${srcdir}/install-bundle/" \
-DMYSQL_CONFIG_EXECUTABLE="${srcdir}/install-bundle/usr/bin/mysql_config" \
-DWITH_JDBC=ON
echo "Build mysql-connector-c++..."
make
echo "Install mysql-connector-c++..."
make DESTDIR="${srcdir}/install-bundle/" install
# Build gdal
cd "${srcdir}/gdal-${_gdal_version}"
echo "Configure gdal..."
./configure \
--prefix=/usr \
--includedir=/usr/include/gdal \
--with-sqlite3 \
--with-mysql="${srcdir}/install-bundle/usr/bin/mysql_config" \
--with-curl \
--without-jasper
echo "Build gdal..."
make LD_LIBRARY_PATH="${srcdir}/install-bundle/usr/lib/"
echo "Install gdal..."
make LD_LIBRARY_PATH="${srcdir}/install-bundle/usr/lib/" DESTDIR="${srcdir}/install-bundle/" install
# Build MySQL Workbench itself with bundled libs
mkdir "${srcdir}/mysql-workbench-community-${pkgver}-src-build"
cd "${srcdir}/mysql-workbench-community-${pkgver}-src-build"
echo "Configure mysql-workbench..."
cmake "${srcdir}/mysql-workbench-community-${pkgver}-src" \
-Wno-dev \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_CXX_FLAGS="-std=c++11"
-DCMAKE_CXX_FLAGS="-std=c++14" \
-DCMAKE_BUILD_TYPE=Release \
-DMySQL_CONFIG_PATH="${srcdir}/install-bundle/usr/bin/mysql_config" \
-DMySQLCppConn_LIBRARY="${srcdir}/install-bundle/usr/lib/libmysqlcppconn.so" \
-DMySQLCppConn_INCLUDE_DIR="${srcdir}/install-bundle/usr/include/jdbc" \
-DGDAL_INCLUDE_DIR="${srcdir}/install-bundle/usr/include" \
-DGDAL_LIBRARY="${srcdir}/install-bundle/usr/lib/libgdal.so" \
-DWITH_ANTLR_JAR='/usr/share/java/antlr-complete.jar' \
-DUSE_BUNDLED_MYSQLDUMP=1
echo "Build mysql-workbench..."
make
}
package() {
cd "${srcdir}/mysql-workbench-community-${pkgver}-src"
# install bundled libraries
for LIBRARY in $(find "${srcdir}/install-bundle/usr/lib/" -type f -regex '.*/lib\(gdal\|mysql\(client\|cppconn\)\)\.so\..*'); do
BASENAME="$(basename "${LIBRARY}")"
SONAME="$(readelf -d "${LIBRARY}" | grep -Po '(?<=(Library soname: \[)).*(?=\])')"
install -D -m0755 "${LIBRARY}" "${pkgdir}"/usr/lib/mysql-workbench/"${BASENAME}"
ln -s "${BASENAME}" "${pkgdir}"/usr/lib/mysql-workbench/"${SONAME}"
done
# install bundled mysql and mysqldump
install -m0755 "${srcdir}/install-bundle/usr/bin/mysql"{,dump} "${pkgdir}"/usr/lib/mysql-workbench/
# install MySQL Workbench itself
cd "${srcdir}/mysql-workbench-community-${pkgver}-src-build"
make DESTDIR="${pkgdir}" install
# icons
for SIZE in 16 24 32 48 64 96 128; do
convert -scale ${SIZE} \
images/icons/linux/128x128/apps/mysql-workbench.png \
${srcdir}/mysql-workbench.png
install -D -m0644 ${srcdir}/mysql-workbench.png "${pkgdir}/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/mysql-workbench.png"
# set modify/create for reproducible builds
convert -scale ${SIZE} +set date:create +set date:modify \
"${srcdir}/mysql-workbench-community-${pkgver}-src/images/icons/MySQLWorkbench-128.png" \
"${srcdir}/mysql-workbench.png"
install -D -m0644 "${srcdir}/mysql-workbench.png" "${pkgdir}/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/mysql-workbench.png"
done
install -D -m 0644 "${srcdir}"/arch_linux_profile.xml \
"${pkgdir}"/usr/share/mysql-workbench/mysql.profiles/Arch_Linux_\(MariaDB_5.5_Package\).xml
"${pkgdir}"/usr/share/mysql-workbench/mysql.profiles/Arch_Linux_\(MariaDB\).xml
}
post_install() {
update-mime-database usr/share/mime
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment