paramiko: fix chroot build: use pycrypto from Nixpkgs instead of getting it from...
[nixpkgs-libre.git] / pkgs / applications / misc / mysql-workbench / default.nix
blobf3aac956c366c2acc79d191cde309e21f4cb6d77
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
5 }:
7 stdenv.mkDerivation rec {
8   pname = "mysql-workbench";
9   version = "5.2.28";
10   name = "${pname}-${version}";
12   src = fetchurl {
13     url = "http://mirror.services.wisc.edu/mysql/Downloads/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";
14     sha256 = "1i7icrf3z09rijlvlg99w6m1n3xw0650840hk95ymgrb95kc3437";
15   };
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 ];
21   preConfigure = ''
22     substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc}/bin/catchsegv"
24     ./autogen.sh --prefix=$out
25   '';
27   postInstall = ''
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 \
33       --run '
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
43 # Prepare fifo pipe.
44 FIFOCTL="/tmp/gnome-keyring-daemon-ctl.$$.fifo"
45 [ -p $FIFOCTL ] && rm $FIFOCTL
46 mkfifo $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.
52     exec 19< $FIFOCTL
53     ! read -u 19
55     kill $GNOME_KEYRING_PID
56     rm $FIFOCTL
57 ) &
59 exec 19> $FIFOCTL
60             ' 
61   '';
63   meta = with stdenv.lib; {
64     description = "A MySQL visual database modeling, administration and querying tool.";
65     longDescription = ''
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.
70     '';
72     homepage = http://wb.mysql.com/;
73     license = licenses.gpl2;
74     maintainers = [ maintainers.kkallio ];
75     platforms = platforms.linux;
76   };