Repository URL to install this package:
Version:
6.3.9-1ubuntu16.10 ▾
|
#!/bin/bash
# Uncomment the following line if you're having trouble with gnome-keyring lockups.
# This will cause passwords to be stored only temporarily for the session.
#WB_NO_GNOME_KEYRING=1
# force disable the Mac style single menu hack in Ubuntu Unity
export UBUNTU_MENUPROXY=0
# another Ubuntu bug, this this one causes modal dialogs to not work as intended
# https://bugs.launchpad.net/ubuntu/+source/overlay-scrollbar/+bug/903302
export LIBOVERLAY_SCROLLBAR=0
# force x11 backend on systems that use wayland
export GDK_BACKEND=x11
# Set the destdir=<some_dir> when ever you install using DESTDIR=<some_dir>.
destdir="$WB_DEST_DIR"
wblibdir="$destdir/usr/lib/mysql-workbench"
# Set the PROJSO env variable so gdal can find proj cause it's using dlopen instead ld
PROJLOC=""
for lib in libproj.so.0 libproj.so.9
do
for loc in /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu
do
if test -f "$loc/$lib"; then
PROJLOC="$loc/$lib"
break 2
fi
done
done
if [ -z "$PROJLOC" ]; then
echo "Workbench can't find libproj.so, some options may be unavailable."
else
export PROJSO=$PROJLOC
fi
if test -f $wblibdir/libsqlite3.so; then
if test "$LD_PRELOAD" != ""; then
export LD_PRELOAD="$LD_PRELOAD:$wblibdir/libsqlite3.so"
else
export LD_PRELOAD="$wblibdir/libsqlite3.so"
fi
fi
# if libcairo and pixman are in the wb libraries dir, force them to be preloaded
if test -f $wblibdir/libcairo.so.2; then
if test "$LD_PRELOAD" != ""; then
export LD_PRELOAD="$LD_PRELOAD:$wblibdir/libcairo.so.2"
else
export LD_PRELOAD="$wblibdir/libcairo.so.2"
fi
fi
if test -f $wblibdir/libpixman-1.so.0; then
if test "$LD_PRELOAD" != ""; then
export LD_PRELOAD="$LD_PRELOAD:$wblibdir/libpixman.so.0"
else
export LD_PRELOAD="$wblibdir/libpixman.so.0"
fi
fi
if test "$LD_LIBRARY_PATH" != ""; then
export LD_LIBRARY_PATH="$wblibdir:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$wblibdir"
fi
if test "$PYTHONPATH" != ""; then
export PYTHONPATH="$wblibdir:$PYTHONPATH"
else
export PYTHONPATH="$wblibdir"
fi
export MWB_DATA_DIR="$destdir/usr/share/mysql-workbench"
export MWB_LIBRARY_DIR="$destdir/usr/share/mysql-workbench/libraries"
export MWB_MODULE_DIR="$destdir/usr/lib/mysql-workbench/modules"
export MWB_PLUGIN_DIR="$destdir/usr/lib/mysql-workbench/plugins"
export DBC_DRIVER_PATH="$destdir/usr/lib/mysql-workbench"
export MWB_BASE_DIR="$destdir/usr"
export MWB_BINARIES_DIR="$destdir/usr/bin"
export MWBX_JSMODULES_DIR=""
CAIRO=`ldd $MWB_BINARIES_DIR/mysql-workbench-bin | grep libcairo\.so | cut -d " " -f 3`
PNG=`ldd $CAIRO | grep libpng | cut -d " " -f 3`
LIBZ=`ldd $PNG | grep libz\.so | cut -d " " -f 3`
if test "$LD_PRELOAD" != ""; then
export LD_PRELOAD="$LD_PRELOAD:$LIBZ"
else
export LD_PRELOAD="$LIBZ"
fi
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 "$@"
else
$MWB_BINARIES_DIR/mysql-workbench-bin "$@"
fi
fi