The attached patches to the current master update the mysql workbench
expression to the latest version and fix the build, as well as adding
or updating some dependencies.

I am not recently using the mysql workbench and so have not extensively
tested this build, but it did make a connection and run some queries.
>From 766ec62ea1b68d432fa6179ee2efa5354138571c Mon Sep 17 00:00:00 2001
From: Karn Kallio <kkal...@skami.org>
Date: Wed, 31 Dec 2014 20:54:26 -0430
Subject: [PATCH 1/5] Add MySQL Connector C++, a mysql server client library.

---
 .../libraries/libmysqlconnectorcpp/default.nix     | 22 ++++++++++++++++++++++
 pkgs/top-level/all-packages.nix                    |  4 ++++
 2 files changed, 26 insertions(+)
 create mode 100644 pkgs/development/libraries/libmysqlconnectorcpp/default.nix

diff --git a/pkgs/development/libraries/libmysqlconnectorcpp/default.nix b/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
new file mode 100644
index 0000000..3905ba1
--- /dev/null
+++ b/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, cmake, boost, mysql }:
+
+stdenv.mkDerivation rec {
+  name = "libmysqlconnectorcpp-${version}";
+  version = "1.1.7";
+
+  src = fetchurl {
+    url = "http://cdn.mysql.com/Downloads/Connector-C++/mysql-connector-c++-${version}.tar.gz";;
+    sha256 = "0qy7kxz8h1zswr50ysyl2cc9gy0ip2j7ikl714m7lq3gsay3ydav";
+  };
+
+  buildInputs = [ cmake boost mysql ];
+
+  cmakeFlags = [ "-DMYSQL_LIB_DIR=${mysql}/lib" ];
+
+  meta = {
+    homepage = http://dev.mysql.com/downloads/connector/cpp/;
+    description = "C++ library for connecting to mysql servers.";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index a823488..10f8560 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8279,6 +8279,10 @@ in
   libmsgpack_0_5 = callPackage ../development/libraries/libmsgpack/0.5.nix { };
   libmsgpack_1_4 = callPackage ../development/libraries/libmsgpack/1.4.nix { };
 
+  libmysqlconnectorcpp = callPackage ../development/libraries/libmysqlconnectorcpp {
+    mysql = mysql57;
+  };
+
   libnatspec = callPackage ../development/libraries/libnatspec (
     stdenv.lib.optionalAttrs stdenv.isDarwin {
       inherit (darwin) libiconv;
-- 
2.9.3

>From a5c5932b98776c17ac944d9762c52d463e00c3c3 Mon Sep 17 00:00:00 2001
From: Karn Kallio <kkal...@skami.org>
Date: Wed, 31 Dec 2014 21:06:35 -0430
Subject: [PATCH 2/5] Add vsqlite, a C++ wrapper library for sqlite.

---
 pkgs/development/libraries/vsqlite/default.nix | 20 ++++++++++++++++++++
 pkgs/top-level/all-packages.nix                |  2 ++
 2 files changed, 22 insertions(+)
 create mode 100644 pkgs/development/libraries/vsqlite/default.nix

diff --git a/pkgs/development/libraries/vsqlite/default.nix b/pkgs/development/libraries/vsqlite/default.nix
new file mode 100644
index 0000000..43a8f7d
--- /dev/null
+++ b/pkgs/development/libraries/vsqlite/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, boost, sqlite }:
+
+stdenv.mkDerivation rec {
+  name = "vsqlite-${version}";
+  version = "0.3.13";
+
+  src = fetchurl {
+    url = "http://evilissimo.fedorapeople.org/releases/vsqlite--/0.3.13/vsqlite++-${version}.tar.gz";;
+    sha256 = "17fkj0d2jh0xkjpcayhs1xvbnh1d69f026i7vs1zqnbiwbkpz237";
+  };
+
+  buildInputs = [ boost sqlite ];
+
+  meta = {
+    homepage = http://vsqlite.virtuosic-bytes.com/;
+    description = "C++ wrapper library for sqlite.";
+    license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 10f8560..905bab5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9772,6 +9772,8 @@ in
 
   vrpn = callPackage ../development/libraries/vrpn { };
 
+  vsqlite = callPackage ../development/libraries/vsqlite { };
+
   vtk = callPackage ../development/libraries/vtk { };
 
   vtkWithQt4 = vtk.override { qtLib = qt4; };
-- 
2.9.3

>From 22cf4abfaf95599e35d6db5a18b8c37d8eb387d4 Mon Sep 17 00:00:00 2001
From: Karn Kallio <kkal...@skami.org>
Date: Sat, 17 Sep 2016 01:42:29 -0400
Subject: [PATCH 3/5] mysql: Add version 5.7.x of Oracle mysql for building
 mysql workbench.

---
 pkgs/servers/sql/mysql/5.7.x.nix | 64 ++++++++++++++++++++++++++++++++++++++++
 pkgs/top-level/all-packages.nix  |  6 ++++
 2 files changed, 70 insertions(+)
 create mode 100644 pkgs/servers/sql/mysql/5.7.x.nix

diff --git a/pkgs/servers/sql/mysql/5.7.x.nix b/pkgs/servers/sql/mysql/5.7.x.nix
new file mode 100644
index 0000000..a2052ec
--- /dev/null
+++ b/pkgs/servers/sql/mysql/5.7.x.nix
@@ -0,0 +1,64 @@
+{ stdenv, fetchurl, cmake, bison, ncurses, openssl, readline, zlib, perl
+, boost, cctools, CoreServices }:
+
+# Note: zlib is not required; MySQL can use an internal zlib.
+
+stdenv.mkDerivation rec {
+  name = "mysql-${version}";
+  version = "5.7.15";
+
+  src = fetchurl {
+    url = "mirror://mysql/MySQL-5.7/${name}.tar.gz";
+    sha256 = "0mlrxcvkn6bf869hjw9fb6m24ak26ndffnd91b4mknmz8cqkb1ch";
+  };
+
+  preConfigure = stdenv.lib.optional stdenv.isDarwin ''
+    ln -s /bin/ps $TMPDIR/ps
+    export PATH=$PATH:$TMPDIR
+  '';
+
+  buildInputs = [ cmake bison ncurses openssl readline zlib boost ]
+     ++ stdenv.lib.optionals stdenv.isDarwin [ perl cctools CoreServices ];
+
+  enableParallelBuilding = true;
+
+  cmakeFlags = [
+    "-DWITH_SSL=yes"
+    "-DWITH_READLINE=yes"
+    "-DWITH_EMBEDDED_SERVER=yes"
+    "-DWITH_ZLIB=yes"
+    "-DHAVE_IPV6=yes"
+    "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
+    "-DMYSQL_DATADIR=/var/lib/mysql"
+    "-DINSTALL_SYSCONFDIR=etc/mysql"
+    "-DINSTALL_INFODIR=share/mysql/docs"
+    "-DINSTALL_MANDIR=share/man"
+    "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
+    "-DINSTALL_SCRIPTDIR=bin"
+    "-DINSTALL_INCLUDEDIR=include/mysql"
+    "-DINSTALL_DOCREADMEDIR=share/mysql"
+    "-DINSTALL_SUPPORTFILESDIR=share/mysql"
+    "-DINSTALL_MYSQLSHAREDIR=share/mysql"
+    "-DINSTALL_DOCDIR=share/mysql/docs"
+    "-DINSTALL_SHAREDIR=share/mysql"
+  ];
+
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
+
+  prePatch = ''
+    sed -i -e "s|/usr/bin/libtool|libtool|" cmake/libutils.cmake
+  '';
+  postInstall = ''
+    sed -i -e "s|basedir=\"\"|basedir=\"$out\"|" $out/bin/mysql_install_db
+    rm -r $out/mysql-test "$out"/lib/*.a
+    rm $out/share/man/man1/mysql-test-run.pl.1
+  '';
+
+  passthru.mysqlVersion = "5.7";
+
+  meta = {
+    homepage = http://www.mysql.com/;
+    description = "The world's most popular open source database";
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 905bab5..80daa4d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -10575,6 +10575,12 @@ in
     inherit (darwin.apple_sdk.frameworks) CoreServices;
   };
 
+  mysql57 = callPackage ../servers/sql/mysql/5.7.x.nix {
+    inherit (darwin) cctools;
+    inherit (darwin.apple_sdk.frameworks) CoreServices;
+    boost = boost159;
+  };
+
   mysql = mariadb;
   libmysql = mysql.client; # `libmysql` is a slight misnomer ATM
 
-- 
2.9.3

>From b20f22c37c2bc9a8f7f6f6705a033edf9c279583 Mon Sep 17 00:00:00 2001
From: Karn Kallio <kkal...@skami.org>
Date: Sat, 17 Sep 2016 01:44:12 -0400
Subject: [PATCH 4/5] libctemplate : update URL for downloading source

---
 pkgs/development/libraries/libctemplate/default.nix | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkgs/development/libraries/libctemplate/default.nix b/pkgs/development/libraries/libctemplate/default.nix
index 142025c..d2c202b 100644
--- a/pkgs/development/libraries/libctemplate/default.nix
+++ b/pkgs/development/libraries/libctemplate/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchsvn, python }:
+{ stdenv, fetchurl, python }:
 
 stdenv.mkDerivation rec {
   name = "ctemplate-${version}";
 
   version = "2.3";
 
-  src = fetchsvn {
-    url = "http://ctemplate.googlecode.com/svn/tags/${name}";;
-    sha256 = "1kvh82mhazf4qz7blnv0rcax7vi524dmz6v6rp89z2h3qjilbvc7";
+  src = fetchurl {
+    url = "https://github.com/OlafvdSpek/ctemplate/archive/ctemplate-${version}.tar.gz";;
+    sha256 = "0mi5g2xlws10z1g4x0cj6kd1r673kkav35pgzyqxa1w47xnwprcr";
   };
 
   buildInputs = [ python ];
-- 
2.9.3

>From 024b112f8f8b714b3cdf8705db4e34cbd5aa958e Mon Sep 17 00:00:00 2001
From: Karn Kallio <kkal...@skami.org>
Date: Sat, 17 Sep 2016 01:46:14 -0400
Subject: [PATCH 5/5] mysqlworkbench : fix build and update to latest version
 6.3.7

---
 pkgs/applications/misc/mysql-workbench/default.nix | 70 +++++++++++++++++-----
 pkgs/top-level/all-packages.nix                    | 10 ++--
 2 files changed, 61 insertions(+), 19 deletions(-)

diff --git a/pkgs/applications/misc/mysql-workbench/default.nix b/pkgs/applications/misc/mysql-workbench/default.nix
index 775d344..fbb10bc 100644
--- a/pkgs/applications/misc/mysql-workbench/default.nix
+++ b/pkgs/applications/misc/mysql-workbench/default.nix
@@ -1,32 +1,72 @@
-{ stdenv, fetchurl, makeWrapper, autoreconfHook, boost, file
-, glib, glibc, libgnome_keyring, gnome_keyring, gtk, gtkmm, intltool
-, libctemplate, libglade
-, libiodbc
-, libgnome, libsigcxx, libuuid, libxml2, libzip, lua, mesa, mysql
-, pango, pcre, pkgconfig, sqlite, sudo
-, pythonPackages
+{ stdenv, fetchurl, makeWrapper, cmake, pkgconfig
+, glibc, gnome_keyring, gtk, gtkmm, pcre, swig, sudo
+, mysql, libxml2, libctemplate, libmysqlconnectorcpp
+, vsqlite, tinyxml, gdal, libiodbc, libpthreadstubs
+, libXdmcp, libuuid, libzip, libgnome_keyring, file
+, pythonPackages, jre, autoconf, automake, libtool
+, boost, glibmm, libsigcxx, pangomm, libX11, openssl
+, proj, cairo, libglade
 }:
 
 let
   inherit (pythonPackages) pexpect pycrypto python paramiko;
 in stdenv.mkDerivation rec {
   pname = "mysql-workbench";
-  version = "5.2.47";
+  version = "6.3.7";
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "http://mirror.cogentco.com/pub/mysql/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";;
-    sha256 = "1343fn3msdxqfpxw0kgm0mdx5r7g9ra1cpc8p2xhl7kz2pmqp4p6";
+    url = "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";;
+    sha256 = "1v4k04facdn2qzflf0clf3ir5hghqlabq89ssm2s4x1nqdniz544";
   };
 
-  buildInputs = [ autoreconfHook boost file glib glibc libgnome_keyring gtk gtkmm intltool
-    libctemplate libglade libgnome libiodbc libsigcxx libuuid libxml2 libzip lua makeWrapper mesa
-    mysql.lib paramiko pcre pexpect pkgconfig pycrypto python sqlite ];
+  buildInputs = [ cmake pkgconfig glibc gnome_keyring gtk gtk.dev gtkmm pcre swig python sudo
+    paramiko mysql libxml2 libctemplate libmysqlconnectorcpp vsqlite tinyxml gdal libiodbc file
+    libpthreadstubs libXdmcp libuuid libzip libgnome_keyring libgnome_keyring.dev jre autoconf
+    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
 
-  preConfigure = ''
     substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc.bin}/bin/catchsegv"
+    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
   '';
 
+  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"
+  ];
+
   postInstall = ''
     patchShebangs $out/share/mysql-workbench/extras/build_freetds.sh
 
@@ -52,7 +92,7 @@ in stdenv.mkDerivation rec {
 # 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
+for expr in $( gnome-keyring-daemon --start ) ; do eval "export "$expr ; done
 
 # Prepare fifo pipe.
 FIFOCTL="/tmp/gnome-keyring-daemon-ctl.$$.fifo"
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 80daa4d..48e5ae1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17374,10 +17374,12 @@ in
 
   mnemonicode = callPackage ../misc/mnemonicode { };
 
-  mysqlWorkbench = newScope gnome2 ../applications/misc/mysql-workbench {
-    lua = lua5_1;
-    libctemplate = libctemplate_2_2;
-  };
+  mysqlWorkbench = newScope gnome2 ../applications/misc/mysql-workbench (let mysql = mysql57; in {
+    automake = automake113x;
+    gdal = gdal.override {mysql = mysql // {lib = {dev = mysql;};};};
+    mysql = mysql;
+    pcre = pcre-cpp;
+  });
 
   redis-desktop-manager = qt55.callPackage ../applications/misc/redis-desktop-manager { };
 
-- 
2.9.3

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to