2021-01-11 08:54:33 +01:00
|
|
|
|
{ lib, stdenv
|
2020-03-11 21:24:13 +01:00
|
|
|
|
, fetchurl
|
|
|
|
|
, substituteAll
|
|
|
|
|
, cmake
|
|
|
|
|
, ninja
|
2021-01-17 03:09:27 +01:00
|
|
|
|
, pkg-config
|
2020-03-11 21:24:13 +01:00
|
|
|
|
, glibc
|
|
|
|
|
, gtk3
|
|
|
|
|
, gtkmm3
|
|
|
|
|
, pcre
|
|
|
|
|
, swig
|
2020-11-04 19:58:32 +01:00
|
|
|
|
, antlr4_8
|
2020-03-11 21:24:13 +01:00
|
|
|
|
, sudo
|
|
|
|
|
, mysql
|
|
|
|
|
, libxml2
|
|
|
|
|
, libmysqlconnectorcpp
|
|
|
|
|
, vsqlite
|
|
|
|
|
, gdal
|
|
|
|
|
, libiodbc
|
|
|
|
|
, libpthreadstubs
|
|
|
|
|
, libXdmcp
|
|
|
|
|
, libuuid
|
|
|
|
|
, libzip
|
|
|
|
|
, libsecret
|
|
|
|
|
, libssh
|
|
|
|
|
, python2
|
|
|
|
|
, jre
|
|
|
|
|
, boost
|
|
|
|
|
, libsigcxx
|
|
|
|
|
, libX11
|
|
|
|
|
, openssl
|
2020-03-12 01:08:10 +01:00
|
|
|
|
, rapidjson
|
2020-03-11 21:24:13 +01:00
|
|
|
|
, proj
|
|
|
|
|
, cairo
|
|
|
|
|
, libxkbcommon
|
|
|
|
|
, epoxy
|
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, at-spi2-core
|
|
|
|
|
, dbus
|
|
|
|
|
, bash
|
|
|
|
|
, coreutils
|
2010-09-28 11:33:56 +02:00
|
|
|
|
}:
|
|
|
|
|
|
2016-08-14 14:28:05 +02:00
|
|
|
|
let
|
2018-08-09 00:22:59 +02:00
|
|
|
|
inherit (python2.pkgs) paramiko pycairo pyodbc;
|
2016-08-14 14:28:05 +02:00
|
|
|
|
in stdenv.mkDerivation rec {
|
2010-10-26 02:22:44 +02:00
|
|
|
|
pname = "mysql-workbench";
|
2020-07-25 16:35:42 +02:00
|
|
|
|
version = "8.0.21";
|
2010-09-28 11:33:56 +02:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-09-17 07:46:14 +02:00
|
|
|
|
url = "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
|
2020-07-25 16:35:42 +02:00
|
|
|
|
sha256 = "0rqgr1dcbf6yp60hninbw5dnwykx5ngbyhhx0sbhgv0m0cq5a44h";
|
2010-09-28 11:33:56 +02:00
|
|
|
|
};
|
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
patches = [
|
|
|
|
|
./fix-gdal-includes.patch
|
2020-03-11 21:24:13 +01:00
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./hardcode-paths.patch;
|
|
|
|
|
catchsegv = "${glibc.bin}/bin/catchsegv";
|
|
|
|
|
bash = "${bash}/bin/bash";
|
|
|
|
|
cp = "${coreutils}/bin/cp";
|
|
|
|
|
dd = "${coreutils}/bin/dd";
|
|
|
|
|
ls = "${coreutils}/bin/ls";
|
|
|
|
|
mkdir = "${coreutils}/bin/mkdir";
|
|
|
|
|
nohup = "${coreutils}/bin/nohup";
|
|
|
|
|
rm = "${coreutils}/bin/rm";
|
|
|
|
|
rmdir = "${coreutils}/bin/rmdir";
|
|
|
|
|
sudo = "${sudo}/bin/sudo";
|
|
|
|
|
})
|
2020-03-12 01:08:10 +01:00
|
|
|
|
|
|
|
|
|
# Fix swig not being able to find headers
|
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/82362#issuecomment-597948461
|
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./fix-swig-build.patch;
|
|
|
|
|
cairoDev = "${cairo.dev}";
|
|
|
|
|
})
|
2018-08-09 00:22:59 +02:00
|
|
|
|
];
|
2016-09-17 07:46:14 +02:00
|
|
|
|
|
2019-08-14 22:46:52 +02:00
|
|
|
|
# have it look for 4.7.2 instead of 4.7.1
|
|
|
|
|
preConfigure = ''
|
|
|
|
|
substituteInPlace CMakeLists.txt \
|
2020-11-04 19:58:32 +01:00
|
|
|
|
--replace "antlr-4.7.1-complete.jar" "antlr-4.8-complete.jar"
|
2019-08-14 22:46:52 +02:00
|
|
|
|
'';
|
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
nativeBuildInputs = [
|
2020-03-11 21:24:13 +01:00
|
|
|
|
cmake
|
|
|
|
|
ninja
|
2021-01-17 03:09:27 +01:00
|
|
|
|
pkg-config
|
2020-03-11 21:24:13 +01:00
|
|
|
|
jre
|
|
|
|
|
swig
|
|
|
|
|
wrapGAppsHook
|
2018-08-09 00:22:59 +02:00
|
|
|
|
];
|
2016-09-17 07:46:14 +02:00
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
buildInputs = [
|
2020-03-11 21:24:13 +01:00
|
|
|
|
gtk3
|
|
|
|
|
gtkmm3
|
|
|
|
|
libX11
|
2020-11-04 19:58:32 +01:00
|
|
|
|
antlr4_8.runtime.cpp
|
2020-03-11 21:24:13 +01:00
|
|
|
|
python2
|
|
|
|
|
mysql
|
|
|
|
|
libxml2
|
|
|
|
|
libmysqlconnectorcpp
|
|
|
|
|
vsqlite
|
|
|
|
|
gdal
|
|
|
|
|
boost
|
|
|
|
|
libssh
|
|
|
|
|
openssl
|
2020-03-12 01:08:10 +01:00
|
|
|
|
rapidjson
|
2020-03-11 21:24:13 +01:00
|
|
|
|
libiodbc
|
|
|
|
|
pcre
|
|
|
|
|
cairo
|
|
|
|
|
libuuid
|
|
|
|
|
libzip
|
|
|
|
|
libsecret
|
|
|
|
|
libsigcxx
|
|
|
|
|
proj
|
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
# python dependencies:
|
2020-03-11 21:24:13 +01:00
|
|
|
|
paramiko
|
|
|
|
|
pycairo
|
|
|
|
|
pyodbc
|
|
|
|
|
# TODO: package sqlanydb and add it here
|
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
# transitive dependencies:
|
2020-03-11 21:24:13 +01:00
|
|
|
|
libpthreadstubs
|
|
|
|
|
libXdmcp
|
|
|
|
|
libxkbcommon
|
|
|
|
|
epoxy
|
|
|
|
|
at-spi2-core
|
|
|
|
|
dbus
|
2018-08-09 00:22:59 +02:00
|
|
|
|
];
|
2010-09-28 11:33:56 +02:00
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs tools/get_wb_version.sh
|
2010-09-28 11:33:56 +02:00
|
|
|
|
'';
|
|
|
|
|
|
2020-03-11 21:24:13 +01:00
|
|
|
|
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
|
2019-10-30 12:34:47 +01:00
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
|
2016-09-17 07:46:14 +02:00
|
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
|
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
|
2018-08-09 00:22:59 +02:00
|
|
|
|
"-DIODBC_CONFIG_PATH=${libiodbc}/bin/iodbc-config"
|
2020-11-04 19:58:32 +01:00
|
|
|
|
"-DWITH_ANTLR_JAR=${antlr4_8.jarLocation}"
|
2020-07-25 16:35:42 +02:00
|
|
|
|
# mysql-workbench 8.0.21 depends on libmysqlconnectorcpp 1.1.8.
|
2020-03-12 01:08:10 +01:00
|
|
|
|
# Newer versions of connector still provide the legacy library when enabled
|
|
|
|
|
# but the headers are in a different location.
|
|
|
|
|
"-DMySQLCppConn_INCLUDE_DIR=${libmysqlconnectorcpp}/include/jdbc"
|
2016-09-17 07:46:14 +02:00
|
|
|
|
];
|
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
# There is already an executable and a wrapper in bindir
|
|
|
|
|
# No need to wrap both
|
|
|
|
|
dontWrapGApps = true;
|
2015-05-28 18:40:33 +02:00
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
preFixup = ''
|
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
|
--prefix PATH : "${python2}/bin"
|
|
|
|
|
--prefix PROJSO : "${proj}/lib/libproj.so"
|
|
|
|
|
--set PYTHONPATH $PYTHONPATH
|
|
|
|
|
)
|
|
|
|
|
'';
|
2010-09-28 11:33:56 +02:00
|
|
|
|
|
2018-08-09 00:22:59 +02:00
|
|
|
|
# Let’s wrap the programs not ending with bin
|
|
|
|
|
# until https://bugs.mysql.com/bug.php?id=91948 is fixed
|
|
|
|
|
postFixup = ''
|
|
|
|
|
find -L "$out/bin" -type f -executable -print0 \
|
|
|
|
|
| while IFS= read -r -d ''' file; do
|
|
|
|
|
if [[ "''${file}" != *-bin ]]; then
|
2019-09-22 09:38:09 +02:00
|
|
|
|
echo "Wrapping program $file"
|
|
|
|
|
wrapGApp "$file"
|
2018-08-09 00:22:59 +02:00
|
|
|
|
fi
|
|
|
|
|
done
|
2010-09-28 11:33:56 +02:00
|
|
|
|
'';
|
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
|
meta = with lib; {
|
2013-10-06 11:49:53 +02:00
|
|
|
|
description = "Visual MySQL database modeling, administration and querying tool";
|
2010-09-28 11:33:56 +02: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.
|
|
|
|
|
'';
|
|
|
|
|
|
2020-03-11 21:24:13 +01:00
|
|
|
|
homepage = "http://wb.mysql.com/";
|
2010-09-28 11:33:56 +02:00
|
|
|
|
license = licenses.gpl2;
|
|
|
|
|
maintainers = [ maintainers.kkallio ];
|
2018-08-09 00:22:59 +02:00
|
|
|
|
platforms = platforms.linux;
|
2010-09-28 11:33:56 +02:00
|
|
|
|
};
|
|
|
|
|
}
|