1 { stdenv, fetchurl, makeWrapper, autoconf, automake, boost, file, gettext
2 , glib, glibc, gnome_keyring, gtk, gtkmm, intltool, libctemplate, libglade
3 , libgnome, libsigcxx, libtool, libuuid, libxml2, libzip, lua, mesa, mysql
4 , pango, paramiko, pcre, pexpect, pkgconfig, pycrypto, python, sqlite
7 stdenv.mkDerivation rec {
8 pname = "mysql-workbench";
10 name = "${pname}-${version}";
13 url = "http://mirror.services.wisc.edu/mysql/Downloads/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";
14 sha256 = "1i7icrf3z09rijlvlg99w6m1n3xw0650840hk95ymgrb95kc3437";
17 buildInputs = [ autoconf automake boost file gettext glib glibc gnome_keyring gtk gtkmm intltool
18 libctemplate libglade libgnome libsigcxx libtool libuuid libxml2 libzip lua makeWrapper mesa
19 mysql paramiko pcre pexpect pkgconfig pycrypto python sqlite ];
22 substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc}/bin/catchsegv"
24 ./autogen.sh --prefix=$out
28 wrapProgram "$out/bin/mysql-workbench-bin" \
29 --prefix LD_LIBRARY_PATH : "${python}/lib" \
30 --prefix LD_LIBRARY_PATH : "$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib64" \
31 --prefix PATH : "${gnome_keyring}/bin" \
32 --set PYTHONPATH $PYTHONPATH \
34 # The gnome-keyring-daemon must be running. To allow for environments like
35 # kde, xfce where this is not so, we start it first.
36 # It is cleaned up using a supervisor subshell which detects that
37 # the parent has finished via the closed pipe as terminate signal idiom,
38 # used because we cannot clean up after ourselves due to the exec call.
40 # Start gnome-keyring-daemon, export the environment variables it asks us to set.
41 for expr in $( gnome-keyring-daemon --components=ssh,pkcs11 --start ) ; do eval "export "$expr ; done
44 FIFOCTL="/tmp/gnome-keyring-daemon-ctl.$$.fifo"
45 [ -p $FIFOCTL ] && rm $FIFOCTL
48 # Supervisor subshell waits reading from pipe, will receive EOF when parent
49 # closes pipe on termination. Negate read with ! operator to avoid subshell
50 # quitting when read EOF returns 1 due to -e option being set.
55 kill $GNOME_KEYRING_PID
63 meta = with stdenv.lib; {
64 description = "A MySQL visual database modeling, administration and querying tool.";
66 MySQL Workbench is a modeling tool that allows you to design
67 and generate MySQL databases graphically. It also has administration
68 and query development modules where you can manage MySQL server instances
69 and execute SQL queries.
72 homepage = http://wb.mysql.com/;
73 license = licenses.gpl2;
74 maintainers = [ maintainers.kkallio ];
75 platforms = platforms.linux;