2021-01-15 22:18:51 +00:00
|
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, fetchurl
|
|
|
|
|
, substituteAll
|
|
|
|
|
, cmake
|
|
|
|
|
, ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, glibc
|
|
|
|
|
, gtk3
|
|
|
|
|
, gtkmm3
|
|
|
|
|
, pcre
|
|
|
|
|
, swig
|
2022-11-04 12:27:35 +00:00
|
|
|
|
, antlr4_9
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, sudo
|
|
|
|
|
, mysql
|
|
|
|
|
, libxml2
|
|
|
|
|
, libmysqlconnectorcpp
|
|
|
|
|
, vsqlite
|
|
|
|
|
, gdal
|
|
|
|
|
, libiodbc
|
|
|
|
|
, libpthreadstubs
|
|
|
|
|
, libXdmcp
|
|
|
|
|
, libuuid
|
|
|
|
|
, libzip
|
|
|
|
|
, libsecret
|
|
|
|
|
, libssh
|
2022-11-04 12:27:35 +00:00
|
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, jre
|
|
|
|
|
, boost
|
|
|
|
|
, libsigcxx
|
|
|
|
|
, libX11
|
|
|
|
|
, openssl
|
|
|
|
|
, rapidjson
|
|
|
|
|
, proj
|
|
|
|
|
, cairo
|
|
|
|
|
, libxkbcommon
|
2021-12-06 16:07:01 +00:00
|
|
|
|
, libepoxy
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, at-spi2-core
|
|
|
|
|
, dbus
|
|
|
|
|
, bash
|
|
|
|
|
, coreutils
|
2022-10-30 15:09:59 +00:00
|
|
|
|
, zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
let
|
2022-11-04 12:27:35 +00:00
|
|
|
|
inherit (python3.pkgs) paramiko pycairo pyodbc;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
|
pname = "mysql-workbench";
|
2022-11-04 12:27:35 +00:00
|
|
|
|
version = "8.0.30";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
|
2022-11-04 12:27:35 +00:00
|
|
|
|
sha256 = "d094b391760948f42a3b879e8473040ae9bb26991eced482eb982a52c8ff8185";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
|
./fix-gdal-includes.patch
|
|
|
|
|
|
|
|
|
|
(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";
|
2022-11-04 12:27:35 +00:00
|
|
|
|
stat = "${coreutils}/bin/stat";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
sudo = "${sudo}/bin/sudo";
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
# 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}";
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
|
# 1. have it look for 4.9.3 instead of 4.9.1
|
|
|
|
|
# 2. for some reason CMakeCache.txt is part of source code
|
2020-04-24 23:36:52 +00:00
|
|
|
|
preConfigure = ''
|
|
|
|
|
substituteInPlace CMakeLists.txt \
|
2022-11-04 12:27:35 +00:00
|
|
|
|
--replace "antlr-4.9.1-complete.jar" "antlr-4.9.3-complete.jar"
|
|
|
|
|
rm -f build/CMakeCache.txt
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
cmake
|
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
|
jre
|
|
|
|
|
swig
|
|
|
|
|
wrapGAppsHook
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
gtk3
|
|
|
|
|
gtkmm3
|
|
|
|
|
libX11
|
2022-11-04 12:27:35 +00:00
|
|
|
|
antlr4_9.runtime.cpp
|
|
|
|
|
python3
|
2020-04-24 23:36:52 +00:00
|
|
|
|
mysql
|
|
|
|
|
libxml2
|
|
|
|
|
libmysqlconnectorcpp
|
|
|
|
|
vsqlite
|
|
|
|
|
gdal
|
|
|
|
|
boost
|
|
|
|
|
libssh
|
|
|
|
|
openssl
|
|
|
|
|
rapidjson
|
|
|
|
|
libiodbc
|
|
|
|
|
pcre
|
|
|
|
|
cairo
|
|
|
|
|
libuuid
|
|
|
|
|
libzip
|
|
|
|
|
libsecret
|
|
|
|
|
libsigcxx
|
|
|
|
|
proj
|
|
|
|
|
|
|
|
|
|
# python dependencies:
|
|
|
|
|
paramiko
|
|
|
|
|
pycairo
|
|
|
|
|
pyodbc
|
|
|
|
|
# TODO: package sqlanydb and add it here
|
|
|
|
|
|
|
|
|
|
# transitive dependencies:
|
|
|
|
|
libpthreadstubs
|
|
|
|
|
libXdmcp
|
|
|
|
|
libxkbcommon
|
2021-12-06 16:07:01 +00:00
|
|
|
|
libepoxy
|
2020-04-24 23:36:52 +00:00
|
|
|
|
at-spi2-core
|
|
|
|
|
dbus
|
2022-10-30 15:09:59 +00:00
|
|
|
|
zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs tools/get_wb_version.sh
|
|
|
|
|
'';
|
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
|
NIX_CFLAGS_COMPILE = [
|
2023-02-02 18:25:31 +00:00
|
|
|
|
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
|
|
|
|
|
"-Wno-error=deprecated-declarations"
|
|
|
|
|
] ++ lib.optionals stdenv.isAarch64 [
|
|
|
|
|
# error: narrowing conversion of '-1' from 'int' to 'char'
|
|
|
|
|
"-Wno-error=narrowing"
|
2023-02-16 17:41:37 +00:00
|
|
|
|
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
|
|
|
|
|
# Needed with GCC 12 but problematic with some old GCCs
|
|
|
|
|
"-Wno-error=maybe-uninitalized"
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
|
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
|
|
|
|
|
"-DIODBC_CONFIG_PATH=${libiodbc}/bin/iodbc-config"
|
2020-08-20 17:08:02 +00:00
|
|
|
|
# mysql-workbench 8.0.21 depends on libmysqlconnectorcpp 1.1.8.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# Newer versions of connector still provide the legacy library when enabled
|
|
|
|
|
# but the headers are in a different location.
|
2022-11-04 12:27:35 +00:00
|
|
|
|
"-DWITH_ANTLR_JAR=${antlr4_9.jarLocation}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
"-DMySQLCppConn_INCLUDE_DIR=${libmysqlconnectorcpp}/include/jdbc"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# There is already an executable and a wrapper in bindir
|
|
|
|
|
# No need to wrap both
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
|
gappsWrapperArgs+=(
|
2022-11-04 12:27:35 +00:00
|
|
|
|
--prefix PATH : "${python3}/bin"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
--prefix PROJSO : "${proj}/lib/libproj.so"
|
|
|
|
|
--set PYTHONPATH $PYTHONPATH
|
|
|
|
|
)
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
echo "Wrapping program $file"
|
|
|
|
|
wrapGApp "$file"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
'';
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Visual MySQL 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;
|
2022-07-14 12:49:19 +00:00
|
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|