2016-09-17 06:46:14 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, cmake, pkgconfig
|
2018-02-25 02:23:58 +00:00
|
|
|
, glibc, gnome-keyring, gtk, gtkmm, pcre, swig, sudo
|
2016-09-17 06:46:14 +01:00
|
|
|
, mysql, libxml2, libctemplate, libmysqlconnectorcpp
|
|
|
|
, vsqlite, tinyxml, gdal, libiodbc, libpthreadstubs
|
2018-02-25 02:23:58 +00:00
|
|
|
, libXdmcp, libuuid, libzip, libgnome-keyring, file
|
2016-09-17 06:46:14 +01:00
|
|
|
, pythonPackages, jre, autoconf, automake, libtool
|
|
|
|
, boost, glibmm, libsigcxx, pangomm, libX11, openssl
|
|
|
|
, proj, cairo, libglade
|
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";
|
2017-01-19 15:38:00 +00:00
|
|
|
version = "6.3.8";
|
2010-10-26 01:22:44 +01:00
|
|
|
name = "${pname}-${version}";
|
2010-09-28 10:33:56 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-09-17 06:46:14 +01:00
|
|
|
url = "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
|
2017-01-19 15:38:00 +00:00
|
|
|
sha256 = "1bxd828nrawmym6d8awh1vrni8dsbwh1k5am1lrq5ihp5c3kw9ka";
|
2010-09-28 10:33:56 +01:00
|
|
|
};
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2018-02-25 02:23:58 +00:00
|
|
|
buildInputs = [ cmake gnome-keyring gtk gtk.dev gtkmm pcre swig python sudo
|
2016-09-17 06:46:14 +01:00
|
|
|
paramiko mysql libxml2 libctemplate libmysqlconnectorcpp vsqlite tinyxml gdal libiodbc file
|
2018-02-25 02:23:58 +00:00
|
|
|
libpthreadstubs libXdmcp libuuid libzip libgnome-keyring libgnome-keyring.dev jre autoconf
|
2016-09-17 06:46:14 +01:00
|
|
|
automake libtool boost glibmm glibmm.dev libsigcxx pangomm libX11 pexpect pycrypto openssl
|
|
|
|
proj cairo cairo.dev makeWrapper libglade ] ;
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
for f in backend/wbpublic/{grt/spatial_handler.h,grtui/geom_draw_box.h,objimpl/db.query/db_query_Resultset.cpp} ;
|
|
|
|
do
|
|
|
|
sed -i 's@#include <gdal/@#include <@' $f ;
|
|
|
|
done
|
|
|
|
|
|
|
|
sed -i '32s@mysqlparser@mysqlparser sqlparser@' library/mysql.parser/CMakeLists.txt
|
|
|
|
|
|
|
|
cat <<EOF > ext/antlr-runtime/fix-configure
|
|
|
|
#!${stdenv.shell}
|
|
|
|
echo "fixing bundled antlr3c configure" ;
|
|
|
|
sed -i 's@/usr/bin/file@${file}/bin/file@' configure
|
|
|
|
sed -i '12121d' configure
|
|
|
|
EOF
|
|
|
|
chmod +x ext/antlr-runtime/fix-configure
|
|
|
|
sed -i '236s@&&@& ''${PROJECT_SOURCE_DIR}/ext/antlr-runtime/fix-configure &@' CMakeLists.txt
|
2010-09-28 10:33:56 +01:00
|
|
|
|
2015-04-26 18:54:51 +01:00
|
|
|
substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc.bin}/bin/catchsegv"
|
2016-09-17 06:46:14 +01:00
|
|
|
substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "/usr/lib/x86_64-linux-gnu" "${proj}/lib"
|
|
|
|
patchShebangs $(pwd)/library/mysql.parser/grammar/build-parser
|
|
|
|
patchShebangs $(pwd)/tools/get_wb_version.sh
|
2010-09-28 10:33:56 +01:00
|
|
|
'';
|
|
|
|
|
2016-09-17 06:46:14 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-I${libsigcxx}/lib/sigc++-2.0/include"
|
|
|
|
"-I${pangomm}/lib/pangomm-1.4/include"
|
|
|
|
"-I${glibmm}/lib/giomm-2.4/include"
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
|
|
|
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
|
|
|
|
"-DCTemplate_INCLUDE_DIR=${libctemplate}/include"
|
|
|
|
"-DCAIRO_INCLUDE_DIRS=${cairo.dev}/include"
|
|
|
|
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk}/lib/gtk-2.0/include"
|
|
|
|
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${gtk.dev}/include"
|
|
|
|
"-DGTK2_GTKMMCONFIG_INCLUDE_DIR=${gtkmm}/lib/gtkmm-2.4/include"
|
|
|
|
"-DGTK2_GDKMMCONFIG_INCLUDE_DIR=${gtkmm}/lib/gdkmm-2.4/include"
|
|
|
|
"-DGTK2_GLIBMMCONFIG_INCLUDE_DIR=${glibmm}/lib/glibmm-2.4/include"
|
|
|
|
];
|
|
|
|
|
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" \
|
2018-02-25 02:23:58 +00: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.
|
2016-09-17 06:46:14 +01:00
|
|
|
for expr in $( gnome-keyring-daemon --start ) ; do eval "export "$expr ; done
|
2010-09-28 10:33:56 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
};
|
|
|
|
}
|