anchor.diff:    outputs = [ "out" "static" ];
   
     cmakeFlags = [
  +    "-DCMAKE_SKIP_BUILD_RPATH=OFF" # To run libmysql/libmysql_api_test during build.
       "-DWITH_SSL=yes"
       "-DWITH_EMBEDDED_SERVER=yes"
  -    "-DWITH_UNITTEST=no"
  +    "-DWITH_UNIT_TESTS=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"
  
positive.code:   NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
  
    prePatch = ''
      sed -i -e "s|/usr/bin/libtool|libtool|" cmake/libutils.cmake
    '';
    postInstall = ''
      sed -i -e "s|basedir=\"\"|basedir=\"$out\"|" $out/bin/mysql_install_db
      install -vD $out/lib/*.a -t $static/lib
      rm -r $out/mysql-test
      rm $out/share/man/man1/mysql-test-run.pl.1 $out/lib/*.a
      ln -s libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libmysqlclient_r${stdenv.hostPlatform.extensions.sharedLibrary}
    '';
  
  
negative.code:     "-DINSTALL_DOCREADMEDIR=share/mysql"
      "-DINSTALL_SUPPORTFILESDIR=share/mysql"
      "-DINSTALL_MYSQLSHAREDIR=share/mysql"
      "-DINSTALL_MYSQLTESTDIR="
      "-DINSTALL_DOCDIR=share/mysql/docs"
      "-DINSTALL_SHAREDIR=share/mysql"
    ];
  