mysql-workbench: 6.3.8 → 8.0.12

This commit is contained in:
Jan Tojnar 2018-08-09 00:22:59 +02:00
parent 5a2229c321
commit 807f582d63
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
4 changed files with 303 additions and 92 deletions

View file

@ -1,118 +1,95 @@
{ stdenv, fetchurl, makeWrapper, cmake, pkgconfig
, glibc, gnome-keyring, gtk, gtkmm, pcre, swig, sudo
, mysql, libxml2, libctemplate, libmysqlconnectorcpp
, vsqlite, tinyxml, gdal, libiodbc, libpthreadstubs
, libXdmcp, libuuid, libzip, libgnome-keyring, file
, pythonPackages, jre, autoconf, automake, libtool
, boost, glibmm, libsigcxx, pangomm, libX11, openssl
, proj, cairo, libglade
{ stdenv, fetchurl, substituteAll, cmake, ninja, pkgconfig
, glibc, gtk3, gtkmm3, pcre, swig, antlr4_7, sudo
, mysql, libxml2, libmysqlconnectorcpp
, vsqlite, gdal, libiodbc, libpthreadstubs
, libXdmcp, libuuid, libzip, libsecret, libssh
, python2, jre
, boost, libsigcxx, libX11, openssl
, proj, cairo, libxkbcommon, epoxy, wrapGAppsHook
, at-spi2-core, dbus, bash, coreutils
}:
let
inherit (pythonPackages) pexpect pycrypto python paramiko;
inherit (python2.pkgs) paramiko pycairo pyodbc;
in stdenv.mkDerivation rec {
pname = "mysql-workbench";
version = "6.3.8";
version = "8.0.12";
name = "${pname}-${version}";
src = fetchurl {
url = "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
sha256 = "1bxd828nrawmym6d8awh1vrni8dsbwh1k5am1lrq5ihp5c3kw9ka";
sha256 = "0d6k1kw0bi3q5dlilzlgds1gcrlf7pis4asm3d6pssh2jmn5hh82";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cmake gnome-keyring gtk gtk.dev gtkmm pcre swig python sudo
paramiko mysql libxml2 libctemplate libmysqlconnectorcpp vsqlite tinyxml gdal libiodbc file
libpthreadstubs libXdmcp libuuid libzip libgnome-keyring libgnome-keyring.dev jre autoconf
automake libtool boost glibmm glibmm.dev libsigcxx pangomm libX11 pexpect pycrypto openssl
proj cairo cairo.dev makeWrapper libglade ] ;
patches = [
./fix-gdal-includes.patch
(substituteAll {
src = ./hardcode-paths.patch;
catchsegv = "${glibc.bin}/bin/catchsegv";
bash = "${bash}/bin/bash";
cp = "${coreutils}/bin/cp";
dd = "${coreutils}/bin/dd";
ls = "${coreutils}/bin/ls";
mkdir = "${coreutils}/bin/mkdir";
nohup = "${coreutils}/bin/nohup";
rm = "${coreutils}/bin/rm";
rmdir = "${coreutils}/bin/rmdir";
sudo = "${sudo}/bin/sudo";
})
];
prePatch = ''
for f in backend/wbpublic/{grt/spatial_handler.h,grtui/geom_draw_box.h,objimpl/db.query/db_query_Resultset.cpp} ;
do
sed -i 's@#include <gdal/@#include <@' $f ;
done
nativeBuildInputs = [
cmake ninja pkgconfig jre swig wrapGAppsHook
];
sed -i '32s@mysqlparser@mysqlparser sqlparser@' library/mysql.parser/CMakeLists.txt
buildInputs = [
gtk3 gtkmm3 libX11 antlr4_7.runtime.cpp python2 mysql libxml2
libmysqlconnectorcpp vsqlite gdal boost libssh openssl
libiodbc pcre cairo libuuid libzip libsecret
libsigcxx proj
# python dependencies:
paramiko pycairo pyodbc # sqlanydb
# transitive dependencies:
libpthreadstubs libXdmcp libxkbcommon epoxy at-spi2-core dbus
];
cat <<EOF > ext/antlr-runtime/fix-configure
#!${stdenv.shell}
echo "fixing bundled antlr3c configure" ;
sed -i 's@/usr/bin/file@${file}/bin/file@' configure
sed -i '12121d' configure
EOF
chmod +x ext/antlr-runtime/fix-configure
sed -i '236s@&&@& ''${PROJECT_SOURCE_DIR}/ext/antlr-runtime/fix-configure &@' CMakeLists.txt
substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc.bin}/bin/catchsegv"
substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "/usr/lib/x86_64-linux-gnu" "${proj}/lib"
patchShebangs $(pwd)/library/mysql.parser/grammar/build-parser
patchShebangs $(pwd)/tools/get_wb_version.sh
postPatch = ''
patchShebangs tools/get_wb_version.sh
'';
NIX_CFLAGS_COMPILE = [
"-I${libsigcxx}/lib/sigc++-2.0/include"
"-I${pangomm}/lib/pangomm-1.4/include"
"-I${glibmm}/lib/giomm-2.4/include"
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
"-Wno-error=deprecated-declarations"
];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
"-DCTemplate_INCLUDE_DIR=${libctemplate}/include"
"-DCAIRO_INCLUDE_DIRS=${cairo.dev}/include"
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk}/lib/gtk-2.0/include"
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${gtk.dev}/include"
"-DGTK2_GTKMMCONFIG_INCLUDE_DIR=${gtkmm}/lib/gtkmm-2.4/include"
"-DGTK2_GDKMMCONFIG_INCLUDE_DIR=${gtkmm}/lib/gdkmm-2.4/include"
"-DGTK2_GLIBMMCONFIG_INCLUDE_DIR=${glibmm}/lib/glibmm-2.4/include"
"-DIODBC_CONFIG_PATH=${libiodbc}/bin/iodbc-config"
"-DWITH_ANTLR_JAR=${antlr4_7.jarLocation}"
];
postInstall = ''
patchShebangs $out/share/mysql-workbench/extras/build_freetds.sh
# There is already an executable and a wrapper in bindir
# No need to wrap both
dontWrapGApps = true;
for i in $out/lib/mysql-workbench/modules/wb_utils_grt.py \
$out/lib/mysql-workbench/modules/wb_server_management.py \
$out/lib/mysql-workbench/modules/wb_admin_grt.py; do
substituteInPlace $i \
--replace "/bin/bash" ${stdenv.shell} \
--replace "/usr/bin/sudo" ${sudo}/bin/sudo
preFixup = ''
gappsWrapperArgs+=(
--prefix PATH : "${python2}/bin"
--prefix PROJSO : "${proj}/lib/libproj.so"
--set PYTHONPATH $PYTHONPATH
)
'';
# Lets wrap the programs not ending with bin
# until https://bugs.mysql.com/bug.php?id=91948 is fixed
postFixup = ''
find -L "$out/bin" -type f -executable -print0 \
| while IFS= read -r -d ''' file; do
if [[ "''${file}" != *-bin ]]; then
echo "Wrapping program ''${file}"
wrapProgram "''${file}" "''${gappsWrapperArgs[@]}"
fi
done
wrapProgram "$out/bin/mysql-workbench" \
--prefix LD_LIBRARY_PATH : "${python}/lib" \
--prefix LD_LIBRARY_PATH : "$(cat ${stdenv.cc}/nix-support/orig-cc)/lib64" \
--prefix PATH : "${gnome-keyring}/bin" \
--prefix PATH : "${python}/bin" \
--set PYTHONPATH $PYTHONPATH \
--run '
# The gnome-keyring-daemon must be running. To allow for environments like
# kde, xfce where this is not so, we start it first.
# It is cleaned up using a supervisor subshell which detects that
# the parent has finished via the closed pipe as terminate signal idiom,
# used because we cannot clean up after ourselves due to the exec call.
# Start gnome-keyring-daemon, export the environment variables it asks us to set.
for expr in $( gnome-keyring-daemon --start ) ; do eval "export "$expr ; done
# Prepare fifo pipe.
FIFOCTL="/tmp/gnome-keyring-daemon-ctl.$$.fifo"
[ -p $FIFOCTL ] && rm $FIFOCTL
mkfifo $FIFOCTL
# Supervisor subshell waits reading from pipe, will receive EOF when parent
# closes pipe on termination. Negate read with ! operator to avoid subshell
# quitting when read EOF returns 1 due to -e option being set.
(
exec 19< $FIFOCTL
! read -u 19
kill $GNOME_KEYRING_PID
rm $FIFOCTL
) &
exec 19> $FIFOCTL
'
'';
meta = with stdenv.lib; {
@ -127,6 +104,6 @@ exec 19> $FIFOCTL
homepage = http://wb.mysql.com/;
license = licenses.gpl2;
maintainers = [ maintainers.kkallio ];
platforms = [ "x86_64-linux" ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,47 @@
--- a/backend/wbpublic/grt/spatial_handler.h
+++ b/backend/wbpublic/grt/spatial_handler.h
@@ -24,12 +24,12 @@
#ifndef SPATIAL_HANDLER_H_
#define SPATIAL_HANDLER_H_
-#include <gdal/ogrsf_frmts.h>
-#include <gdal/ogr_api.h>
-#include <gdal/gdal_pam.h>
-#include <gdal/memdataset.h>
-#include <gdal/gdal_alg.h>
-#include <gdal/gdal.h>
+#include <ogrsf_frmts.h>
+#include <ogr_api.h>
+#include <gdal_pam.h>
+#include <memdataset.h>
+#include <gdal_alg.h>
+#include <gdal.h>
#include <deque>
#include "base/geometry.h"
#include "wbpublic_public_interface.h"
--- a/backend/wbpublic/grtui/geom_draw_box.h
+++ b/backend/wbpublic/grtui/geom_draw_box.h
@@ -25,7 +25,7 @@
#define _GEOM_DRAW_BOX_H_
#include <mforms/drawbox.h>
-#include <gdal/ogr_geometry.h>
+#include <ogr_geometry.h>
#include "wbpublic_public_interface.h"
class WBPUBLICBACKEND_PUBLIC_FUNC GeomDrawBox : public mforms::DrawBox {
--- a/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
+++ b/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
@@ -21,9 +21,9 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <gdal/ogrsf_frmts.h>
-#include <gdal/ogr_api.h>
-#include <gdal/gdal.h>
+#include <ogrsf_frmts.h>
+#include <ogr_api.h>
+#include <gdal.h>
#include <grts/structs.db.query.h>
#include <grtpp_util.h>

View file

@ -0,0 +1,187 @@
--- a/frontend/linux/workbench/mysql-workbench.in
+++ b/frontend/linux/workbench/mysql-workbench.in
@@ -99,8 +99,8 @@
if test "$WB_DEBUG" != ""; then
$WB_DEBUG $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
else
- if type -p catchsegv > /dev/null; then
- catchsegv $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
+ if type -p @catchsegv@ > /dev/null; then
+ @catchsegv@ $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
else
$MWB_BINARIES_DIR/mysql-workbench-bin "$@"
fi
--- a/plugins/migration/frontend/migration_bulk_copy_data.py
+++ b/plugins/migration/frontend/migration_bulk_copy_data.py
@@ -110,7 +110,7 @@
return 'sh'
def generate_import_script(self, connection_args, path_to_file, schema_name):
- output = ['#!/bin/bash']
+ output = ['#!/usr/bin/env bash']
output.append('MYPATH=\`pwd\`')
output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
@@ -164,7 +164,7 @@
return 'sh'
def generate_import_script(self, connection_args, path_to_file, schema_name):
- output = ['#!/bin/bash']
+ output = ['#!/usr/bin/env bash']
output.append('MYPATH=\`pwd\`')
output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
@@ -417,7 +417,7 @@
with open(script_path, 'w+') as f:
os.chmod(script_path, 0700)
- f.write('#!/bin/bash\n\n')
+ f.write('#!/usr/bin/env bash\n\n')
f.write('MYPATH=`pwd`\n')
f.write("arg_source_password=\"<put source password here>\"\n")
@@ -521,7 +521,7 @@
with open(script_path, 'w+') as f:
os.chmod(script_path, 0700)
- f.write('#!/bin/bash\n\n')
+ f.write('#!/usr/bin/env bash\n\n')
f.write('MYPATH=`pwd`\n')
f.write("arg_source_password=\"<put source password here>\"\n")
--- a/plugins/wb.admin/backend/wb_server_control.py
+++ b/plugins/wb.admin/backend/wb_server_control.py
@@ -39,7 +39,7 @@
UnixVariant = {
"" : {
- 'sudo_command' : "/usr/bin/sudo -k -S -p EnterPasswordHere ",
+ 'sudo_command' : "@sudo@ -k -S -p EnterPasswordHere ",
}
}
--- a/plugins/wb.admin/backend/wb_server_management.py
+++ b/plugins/wb.admin/backend/wb_server_management.py
@@ -40,7 +40,7 @@
def reset_sudo_prefix():
global default_sudo_prefix
- default_sudo_prefix = '/usr/bin/sudo -k -S -p EnterPasswordHere'
+ default_sudo_prefix = '@sudo@ -k -S -p EnterPasswordHere'
reset_sudo_prefix()
@@ -100,7 +100,7 @@
if to_spawn:
command += ' &'
- sudo_prefix += ' /usr/bin/nohup'
+ sudo_prefix += ' @nohup@'
# If as_user is the CURRENT then there's no need to sudo
if as_user != Users.CURRENT:
@@ -111,7 +111,7 @@
if '/bin/sh' in sudo_prefix or '/bin/bash' in sudo_prefix:
command = "LANG=C " + sudo_prefix + " \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
else:
- command = "LANG=C " + sudo_prefix + " /bin/bash -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
+ command = "LANG=C " + sudo_prefix + " @bash@ -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
return command
@@ -896,9 +896,9 @@
if as_user == Users.CURRENT:
raise PermissionDeniedError("Cannot set owner of directory %s" % path)
else:
- command = "/bin/mkdir %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
+ command = "@mkdir@ %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
else:
- command = "/bin/mkdir %s" % (quote_path(path))
+ command = "@mkdir@ %s" % (quote_path(path))
res = self.process_ops.exec_cmd(command,
as_user = as_user,
@@ -927,7 +927,7 @@
@useAbsPath("path")
def remove_directory(self, path, as_user = Users.CURRENT, user_password = None):
output = StringIO.StringIO()
- res = self.process_ops.exec_cmd('/bin/rmdir ' + quote_path(path),
+ res = self.process_ops.exec_cmd('@rmdir@ ' + quote_path(path),
as_user = as_user,
user_password = user_password,
output_handler = output.write,
@@ -940,7 +940,7 @@
@useAbsPath("path")
def remove_directory_recursive(self, path, as_user = Users.CURRENT, user_password = None):
output = StringIO.StringIO()
- res = self.process_ops.exec_cmd('/bin/rm -R ' + quote_path(path),
+ res = self.process_ops.exec_cmd('@rm@ -R ' + quote_path(path),
as_user = as_user,
user_password = user_password,
output_handler = output.write,
@@ -953,7 +953,7 @@
@useAbsPath("path")
def delete_file(self, path, as_user = Users.CURRENT, user_password = None):
output = StringIO.StringIO()
- res = self.process_ops.exec_cmd("/bin/rm " + quote_path(path),
+ res = self.process_ops.exec_cmd("@rm@ " + quote_path(path),
as_user = as_user,
user_password = user_password,
output_handler = output.write,
@@ -1001,7 +1001,7 @@
def _copy_file(self, source, dest, as_user = Users.CURRENT, user_password = None):
output = StringIO.StringIO()
- res = self.process_ops.exec_cmd("LC_ALL=C /bin/cp " + quote_path(source) + " " + quote_path(dest),
+ res = self.process_ops.exec_cmd("LC_ALL=C @cp@ " + quote_path(source) + " " + quote_path(dest),
as_user = as_user,
user_password = user_password,
output_handler = output.write,
@@ -1077,9 +1077,9 @@
# for ls -l, the output format changes depending on stdout being a terminal or not
# since both cases are possible, we need to handle both at the same time (1st line being total <nnnn> or not)
# the good news is that if the line is there, then it will always start with total, regardless of the locale
- command = 'LC_ALL=C /bin/ls -l -p %s' % quote_path(path)
+ command = 'LC_ALL=C @ls@ -l -p %s' % quote_path(path)
else:
- command = 'LC_ALL=C /bin/ls -1 -p %s' % quote_path(path)
+ command = 'LC_ALL=C @ls@ -1 -p %s' % quote_path(path)
output = StringIO.StringIO()
res = self.process_ops.exec_cmd(command,
@@ -2160,9 +2160,9 @@
def get_range(self, start, end):
f = StringIO.StringIO()
if not self._need_sudo:
- ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
+ ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
else:
- ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write)
+ ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write)
if ret != 0:
raise RuntimeError("Could not get data from file %s" % self.path)
@@ -2170,9 +2170,9 @@
def read_task(self, offset, file):
if not self._need_sudo:
- self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write)
+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write)
else:
- self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write)
+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write)
# this will signal the reader end that there's no more data
file.close()
@@ -2198,9 +2198,9 @@
self._pos = offset
f = StringIO.StringIO()
if not self._need_sudo:
- self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
else:
- self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write)
+ self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write)
self.data = f
self.data.seek(0)
if self.skip_first_newline:

View file

@ -21501,7 +21501,7 @@ with pkgs;
mnemonicode = callPackage ../misc/mnemonicode { };
mysql-workbench = newScope gnome2 ../applications/misc/mysql-workbench (let mysql = mysql57; in {
mysql-workbench = callPackage ../applications/misc/mysql-workbench (let mysql = mysql57; in {
gdal = gdal.override {mysql = mysql // {lib = {dev = mysql;};};};
mysql = mysql;
pcre = pcre-cpp;