Repository URL to install this package:
|
Version:
8.0.21-1ubuntu20.04 ▾
|
#!/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"
wbpluginsdir="$destdir/usr/lib/mysql-workbench/plugins"
# Check if PROJSO env is set and file exists, if not, try to handle this on our own
if [[ -z "${PROJSO}" ]]; then
# Set the PROJSO env variable so gdal can find proj cause it's using dlopen instead ld
TMPLOC=`ldconfig -p | grep libproj\.so | awk '{printf $4;exit;}'`
if [[ -f "$TMPLOC" ]]; then
echo "Found $TMPLOC"
export PROJSO=$TMPLOC
else
echo "Workbench can't find libproj.so, some options may be unavailable."
fi
else
if [[ ! -f ${PROJSO} ]]; then
echo "PROJSO is set to ${PROJSO} but the library doesn't exist, some option may be unavailable."
else
echo "Using ${PROJSO}."
fi
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:$wbpluginsdir:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$wblibdir:$wbpluginsdir"
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