2011-03-17 05:18:59 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, boost, file, gettext
|
2010-09-28 11:33:56 +02:00
|
|
|
, glib, glibc, gnome_keyring, gtk, gtkmm, intltool, libctemplate, libglade
|
|
|
|
, libgnome, libsigcxx, libtool, libuuid, libxml2, libzip, lua, mesa, mysql
|
2010-10-26 03:42:22 +02:00
|
|
|
, pango, paramiko, pcre, pexpect, pkgconfig, pycrypto, python, sqlite
|
2010-09-28 11:33:56 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2010-10-26 02:22:44 +02:00
|
|
|
pname = "mysql-workbench";
|
2011-09-23 02:03:21 +02:00
|
|
|
version = "5.2.34";
|
2010-10-26 02:22:44 +02:00
|
|
|
name = "${pname}-${version}";
|
2010-09-28 11:33:56 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2010-10-26 03:38:28 +02:00
|
|
|
url = "http://mirror.services.wisc.edu/mysql/Downloads/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";
|
2011-09-23 02:03:21 +02:00
|
|
|
sha256 = "1b5ijaccy2k7if4pld8ihz1wa1wr1f9gj2m5xa4kf7v05zcx93c6";
|
2010-09-28 11:33:56 +02:00
|
|
|
};
|
|
|
|
|
2011-03-17 05:18:59 +01:00
|
|
|
buildInputs = [ boost file gettext glib glibc gnome_keyring gtk gtkmm intltool
|
2010-09-28 11:33:56 +02:00
|
|
|
libctemplate libglade libgnome libsigcxx libtool libuuid libxml2 libzip lua makeWrapper mesa
|
2010-10-26 03:42:22 +02:00
|
|
|
mysql paramiko pcre pexpect pkgconfig pycrypto python sqlite ];
|
2010-09-28 11:33:56 +02:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc}/bin/catchsegv"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/mysql-workbench-bin" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${python}/lib" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib64" \
|
|
|
|
--prefix PATH : "${gnome_keyring}/bin" \
|
2011-02-20 00:45:04 +01:00
|
|
|
--prefix PATH : "${python}/bin" \
|
2010-09-28 11:33:56 +02: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 05:18:59 +01:00
|
|
|
'
|
2010-09-28 11:33:56 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A MySQL visual database modeling, administration and querying tool.";
|
|
|
|
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 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|