You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.nix 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. { stdenv, fetchurl, substituteAll, cmake, ninja, pkgconfig
  2. , glibc, gtk3, gtkmm3, pcre, swig, antlr4_7, sudo
  3. , mysql, libxml2, libmysqlconnectorcpp
  4. , vsqlite, gdal, libiodbc, libpthreadstubs
  5. , libXdmcp, libuuid, libzip, libsecret, libssh
  6. , python2, jre
  7. , boost, libsigcxx, libX11, openssl
  8. , proj, cairo, libxkbcommon, epoxy, wrapGAppsHook
  9. , at-spi2-core, dbus, bash, coreutils
  10. }:
  11. let
  12. inherit (python2.pkgs) paramiko pycairo pyodbc;
  13. in stdenv.mkDerivation rec {
  14. pname = "mysql-workbench";
  15. version = "8.0.15";
  16. src = fetchurl {
  17. url = "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
  18. sha256 = "0ca93azasya5xiw6j2map8drmxf445qqydpvrb512kjfqdiv67x6";
  19. };
  20. patches = [
  21. ./fix-gdal-includes.patch
  22. (substituteAll {
  23. src = ./hardcode-paths.patch;
  24. catchsegv = "${glibc.bin}/bin/catchsegv";
  25. bash = "${bash}/bin/bash";
  26. cp = "${coreutils}/bin/cp";
  27. dd = "${coreutils}/bin/dd";
  28. ls = "${coreutils}/bin/ls";
  29. mkdir = "${coreutils}/bin/mkdir";
  30. nohup = "${coreutils}/bin/nohup";
  31. rm = "${coreutils}/bin/rm";
  32. rmdir = "${coreutils}/bin/rmdir";
  33. sudo = "${sudo}/bin/sudo";
  34. })
  35. ];
  36. # have it look for 4.7.2 instead of 4.7.1
  37. preConfigure = ''
  38. substituteInPlace CMakeLists.txt \
  39. --replace "antlr-4.7.1-complete.jar" "antlr-4.7.2-complete.jar"
  40. '';
  41. nativeBuildInputs = [
  42. cmake ninja pkgconfig jre swig wrapGAppsHook
  43. ];
  44. buildInputs = [
  45. gtk3 gtkmm3 libX11 antlr4_7.runtime.cpp python2 mysql libxml2
  46. libmysqlconnectorcpp vsqlite gdal boost libssh openssl
  47. libiodbc pcre cairo libuuid libzip libsecret
  48. libsigcxx proj
  49. # python dependencies:
  50. paramiko pycairo pyodbc # sqlanydb
  51. # transitive dependencies:
  52. libpthreadstubs libXdmcp libxkbcommon epoxy at-spi2-core dbus
  53. ];
  54. postPatch = ''
  55. patchShebangs tools/get_wb_version.sh
  56. '';
  57. NIX_CFLAGS_COMPILE = [
  58. # error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
  59. "-Wno-error=deprecated-declarations"
  60. ];
  61. cmakeFlags = [
  62. "-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
  63. "-DIODBC_CONFIG_PATH=${libiodbc}/bin/iodbc-config"
  64. "-DWITH_ANTLR_JAR=${antlr4_7.jarLocation}"
  65. ];
  66. # There is already an executable and a wrapper in bindir
  67. # No need to wrap both
  68. dontWrapGApps = true;
  69. preFixup = ''
  70. gappsWrapperArgs+=(
  71. --prefix PATH : "${python2}/bin"
  72. --prefix PROJSO : "${proj}/lib/libproj.so"
  73. --set PYTHONPATH $PYTHONPATH
  74. )
  75. '';
  76. # Let’s wrap the programs not ending with bin
  77. # until https://bugs.mysql.com/bug.php?id=91948 is fixed
  78. postFixup = ''
  79. find -L "$out/bin" -type f -executable -print0 \
  80. | while IFS= read -r -d ''' file; do
  81. if [[ "''${file}" != *-bin ]]; then
  82. echo "Wrapping program $file"
  83. wrapGApp "$file"
  84. fi
  85. done
  86. '';
  87. meta = with stdenv.lib; {
  88. description = "Visual MySQL database modeling, administration and querying tool";
  89. longDescription = ''
  90. MySQL Workbench is a modeling tool that allows you to design
  91. and generate MySQL databases graphically. It also has administration
  92. and query development modules where you can manage MySQL server instances
  93. and execute SQL queries.
  94. '';
  95. homepage = http://wb.mysql.com/;
  96. license = licenses.gpl2;
  97. maintainers = [ maintainers.kkallio ];
  98. platforms = platforms.linux;
  99. };
  100. }