anchor.diff:      "-DINSTALL_DOCREADMEDIR=share/mysql"
       "-DINSTALL_SUPPORTFILESDIR=share/mysql"
       "-DINSTALL_MYSQLSHAREDIR=share/mysql"
  +    "-DINSTALL_MYSQLTESTDIR="
       "-DINSTALL_DOCDIR=share/mysql/docs"
       "-DINSTALL_SHAREDIR=share/mysql"
     ];
  
positive.code:   outputs = [ "out" "static" ];
  
    cmakeFlags = [
      "-DWITH_SSL=yes"
      "-DWITH_EMBEDDED_SERVER=yes"
      "-DWITH_UNITTEST=no"
      "-DWITH_ZLIB=yes"
      "-DWITH_ARCHIVE_STORAGE_ENGINE=yes"
      "-DWITH_BLACKHOLE_STORAGE_ENGINE=yes"
      "-DWITH_FEDERATED_STORAGE_ENGINE=yes"
      "-DCMAKE_VERBOSE_MAKEFILE=yes"
      "-DHAVE_IPV6=yes"
      "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
      "-DMYSQL_DATADIR=/var/lib/mysql"
  
negative.code:   NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
  
    prePatch = ''
      sed -i -e "s|/usr/bin/libtool|libtool|" cmake/merge_archives.cmake.in
    '';
    postInstall = ''
      moveToOutput "lib/*.a" $static
      ln -s libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libmysqlclient_r${stdenv.hostPlatform.extensions.sharedLibrary}
    '';
  
  