anchor.diff:      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/plugin/daemon_example.ini
       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) ''
  +      optionalString (!stdenv.isDarwin) ''
           rm "$out"/lib/mysql/plugin/auth_gssapi_client.so
         ''
       }
       rm "$out"/lib/mysql/plugin/client_ed25519.so
  -  '' + optionalString (! stdenv.isDarwin) ''
  +  '' + optionalString (!stdenv.isDarwin) ''
       sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
     '';
   
  
positive.code:     "-DWITH_SAFEMALLOC=OFF"
      "-DWITH_UNIT_TESTS=OFF"
      "-DEMBEDDED_LIBRARY=OFF"
    ] ++ optional 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 [
      "-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl
    ];
  
    postInstall = ''
      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
    '';
  
    passthru.mysqlVersion = "5.7";
  
    meta = with stdenv.lib; {
      description = "An enhanced, drop-in replacement for MySQL";
      homepage    = https://mariadb.org/;
      license     = licenses.gpl2;
  
negative.code:   postInstall =  common.postInstall + ''
      rm -r "$out"/share/doc
      rm "$out"/bin/{mysqltest,mytop,wsrep_sst_rsync_wan}
      libmysqlclient_path=$(readlink -f $out/lib/mysql/libmysqlclient${libExt})
      rm "$out"/lib/mysql/{libmariadb${libExt},libmysqlclient${libExt},libmysqlclient_r${libExt}}
      mv "$libmysqlclient_path" "$out"/lib/mysql/libmysqlclient${libExt}
      ln -sv libmysqlclient${libExt} "$out"/lib/mysql/libmysqlclient_r${libExt}
  
    '';
  });
  
  server = stdenv.mkDerivation (common // {
  