2016-01-17 23:04:40 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper, autoreconfHook, boost, file
|
2012-03-14 19:39:04 +00:00
|
|
|
, glib, glibc, libgnome_keyring, gnome_keyring, gtk, gtkmm, intltool
|
|
|
|
, libctemplate, libglade
|
2013-03-06 19:04:12 +00:00
|
|
|
, libiodbc
|
2016-01-17 23:04:40 +00:00
|
|
|
, libgnome, libsigcxx, libuuid, libxml2, libzip, lua, mesa, mysql
|
2016-08-14 13:28:05 +01:00
|
|
|
, pango, pcre, pkgconfig, sqlite, sudo
|
|
|
|
, pythonPackages
|
2010-09-28 10:33:56 +01:00
|
|
|
}:
|
|
|
|
|
2016-08-14 13:28:05 +01:00
|
|
|
let
|
|
|
|
inherit (pythonPackages) pexpect pycrypto python paramiko;
|
|
|
|
in stdenv.mkDerivation rec {
|
2010-10-26 01:22:44 +01:00
|
|
|
pname = "mysql-workbench";
|
2013-03-06 19:04:12 +00:00
|
|
|
version = "5.2.47";
|
2010-10-26 01:22:44 +01:00
|
|
|
name = "${pname}-${version}";
|
2010-09-28 10:33:56 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-03-06 19:04:12 +00:00
|
|
|
url = "http://mirror.cogentco.com/pub/mysql/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";
|
|
|
|
sha256 = "1343fn3msdxqfpxw0kgm0mdx5r7g9ra1cpc8p2xhl7kz2pmqp4p6";
|
2010-09-28 10:33:56 +01:00
|
|
|
};
|
|
|
|
|
2016-01-17 23:04:40 +00:00
|
|
|
buildInputs = [ autoreconfHook boost file glib glibc libgnome_keyring gtk gtkmm intltool
|
|
|
|
libctemplate libglade libgnome libiodbc libsigcxx libuuid libxml2 libzip lua makeWrapper mesa
|
2015-04-02 00:39:50 +01:00
|
|
|
mysql.lib paramiko pcre pexpect pkgconfig pycrypto python sqlite ];
|
2010-09-28 10:33:56 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
2015-04-26 18:54:51 +01:00
|
|
|
substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc.bin}/bin/catchsegv"
|
2010-09-28 10:33:56 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2015-05-28 17:40:33 +01:00
|
|
|
patchShebangs $out/share/mysql-workbench/extras/build_freetds.sh
|
|
|
|
|
|
|
|
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
|
|
|
|
done
|
|
|
|
|
2013-03-06 19:04:12 +00:00
|
|
|
wrapProgram "$out/bin/mysql-workbench" \
|
2010-09-28 10:33:56 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${python}/lib" \
|
2015-03-04 21:15:10 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "$(cat ${stdenv.cc}/nix-support/orig-cc)/lib64" \
|
2010-09-28 10:33:56 +01:00
|
|
|
--prefix PATH : "${gnome_keyring}/bin" \
|
2011-02-19 23:45:04 +00:00
|
|
|
--prefix PATH : "${python}/bin" \
|
2010-09-28 10:33:56 +01:00
|
|
|
--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 --components=ssh,pkcs11 --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
|
2011-03-17 04:18:59 +00:00
|
|
|
'
|
2010-09-28 10:33:56 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Visual MySQL database modeling, administration and querying tool";
|
2010-09-28 10:33:56 +01:00
|
|
|
longDescription = ''
|
|
|
|
MySQL Workbench is a modeling tool that allows you to design
|
|
|
|
and generate MySQL databases graphically. It also has administration
|
|
|
|
and query development modules where you can manage MySQL server instances
|
|
|
|
and execute SQL queries.
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = http://wb.mysql.com/;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.kkallio ];
|
2012-04-27 10:31:11 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2010-09-28 10:33:56 +01:00
|
|
|
};
|
|
|
|
}
|