anchor.diff:      "-DWITH_SAFEMALLOC=OFF"
       "-DWITH_UNIT_TESTS=OFF"
       "-DEMBEDDED_LIBRARY=OFF"
  -  ] ++ optional stdenv.isDarwin [
  +  ] ++ optionals stdenv.isDarwin [
       # On Darwin without sandbox, CMake will find the system java and attempt to build with java support, but
       # then it will fail during the actual build. Let's just disable the flag explicitly until someone decides
       # to pass in java explicitly.
       "-DCONNECT_WITH_JDBC=OFF"
       "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
  -  ] ++ optional stdenv.hostPlatform.isMusl [
  +  ] ++ optionals stdenv.hostPlatform.isMusl [
       "-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl
     ];
   
     postInstall = ''
  +    rm "$out"/lib/mysql/plugin/daemon_example.ini
       mkdir -p "$dev"/bin && mv "$out"/bin/{mariadb_config,mysql_config} "$dev"/bin
       mkdir -p "$dev"/lib/mysql && mv "$out"/lib/mysql/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib/mysql
       mkdir -p "$dev"/lib/mysql/plugin && mv "$out"/lib/mysql/plugin/{caching_sha2_password.so,dialog.so,mysql_clear_password.so,sha256_password.so} "$dev"/lib/mysql/plugin
     '';
   
  +  enableParallelBuilding = true;
  +
     passthru.mysqlVersion = "5.7";
   
  -  meta = with stdenv.lib; {
  +  meta = {
       description = "An enhanced, drop-in replacement for MySQL";
       homepage    = https://mariadb.org/;
       license     = licenses.gpl2;
  
positive.code: 
    buildInputs = [
      ncurses openssl zlib pcre jemalloc libiconv
    ] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd libkrb5 ]
      ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
  
    prePatch = ''
      sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
  
negative.code:     chmod +x "$out"/bin/wsrep_sst_common
      rm "$out"/bin/mysql_client_test
      rm -r "$out"/data # Don't need testing data
      rm "$out"/lib/mysql/{libmysqlclient${libExt},libmysqlclient_r${libExt}}
      mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql
    '' + optionalString withoutClient ''
      ${ # We don't build with GSSAPI on Darwin
        optionalString (!stdenv.isDarwin) ''
          rm "$out"/lib/mysql/plugin/auth_gssapi_client.so
        ''
      }
      rm "$out"/lib/mysql/plugin/client_ed25519.so
    '' + optionalString (!stdenv.isDarwin) ''
      sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
    '';
  
  