16 , libmysqlconnectorcpp
46 inherit (python3.pkgs) paramiko pycairo pyodbc;
47 in stdenv.mkDerivation rec {
48 pname = "mysql-workbench";
52 url = "https://cdn.mysql.com//Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
53 sha256 = "sha256-ub/D6HRtXOvX+lai71t1UjMmMzBsz5ljCrJCuf9aq7U=";
58 src = ./hardcode-paths.patch;
59 catchsegv = "${glibc.bin}/bin/catchsegv";
60 bash = "${bash}/bin/bash";
61 cp = "${coreutils}/bin/cp";
62 dd = "${coreutils}/bin/dd";
63 ls = "${coreutils}/bin/ls";
64 mkdir = "${coreutils}/bin/mkdir";
65 nohup = "${coreutils}/bin/nohup";
66 rm = "${coreutils}/bin/rm";
67 rmdir = "${coreutils}/bin/rmdir";
68 stat = "${coreutils}/bin/stat";
69 sudo = "${sudo}/bin/sudo";
72 # Fix swig not being able to find headers
73 # https://github.com/NixOS/nixpkgs/pull/82362#issuecomment-597948461
75 src = ./fix-swig-build.patch;
76 cairoDev = "${cairo.dev}";
80 # 1. have it look for 4.12.0 instead of 4.11.1
81 # 2. for some reason CMakeCache.txt is part of source code
83 substituteInPlace CMakeLists.txt \
84 --replace "antlr-4.11.1-complete.jar" "antlr-4.12.0-complete.jar"
85 rm -f build/CMakeCache.txt
101 antlr4_12.runtime.cpp
121 # python dependencies:
125 # TODO: package sqlanydb and add it here
127 # transitive dependencies:
138 patchShebangs tools/get_wb_version.sh
141 env.NIX_CFLAGS_COMPILE = toString ([
142 # error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
143 "-Wno-error=deprecated-declarations"
144 ] ++ lib.optionals stdenv.isAarch64 [
145 # error: narrowing conversion of '-1' from 'int' to 'char'
146 "-Wno-error=narrowing"
147 ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
148 # Needed with GCC 12 but problematic with some old GCCs
149 "-Wno-error=maybe-uninitialized"
153 "-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
154 "-DIODBC_CONFIG_PATH=${libiodbc}/bin/iodbc-config"
155 # mysql-workbench 8.0.21 depends on libmysqlconnectorcpp 1.1.8.
156 # Newer versions of connector still provide the legacy library when enabled
157 # but the headers are in a different location.
158 "-DWITH_ANTLR_JAR=${antlr4_12.jarLocation}"
159 "-DMySQLCppConn_INCLUDE_DIR=${libmysqlconnectorcpp}/include/jdbc"
162 # There is already an executable and a wrapper in bindir
163 # No need to wrap both
164 dontWrapGApps = true;
168 --prefix PATH : "${python3}/bin"
169 --prefix PROJSO : "${proj}/lib/libproj.so"
170 --set PYTHONPATH $PYTHONPATH
174 # Let’s wrap the programs not ending with bin
175 # until https://bugs.mysql.com/bug.php?id=91948 is fixed
177 find -L "$out/bin" -type f -executable -print0 \
178 | while IFS= read -r -d ''' file; do
179 if [[ "''${file}" != *-bin ]]; then
180 echo "Wrapping program $file"
187 description = "Visual MySQL database modeling, administration and querying tool";
189 MySQL Workbench is a modeling tool that allows you to design
190 and generate MySQL databases graphically. It also has administration
191 and query development modules where you can manage MySQL server instances
192 and execute SQL queries.
195 homepage = "http://wb.mysql.com/";
196 license = licenses.gpl2;
198 platforms = platforms.linux;
199 mainProgram = "mysql-workbench";