anchor.diff:  
     buildInputs = [
       ncurses openssl zlib pcre jemalloc libiconv curl
  -  ] ++ optionals stdenv.isLinux [ libaio systemd libkrb5 ]
  -    ++ optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
  +  ] ++ optionals stdenv.hostPlatform.isLinux [ libaio systemd libkrb5 ]
  +    ++ optionals stdenv.hostPlatform.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
   
     prePatch = ''
       sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
  
positive.code:     "-DWITH_INNODB_DISALLOW_WRITES=ON"
      "-DWITHOUT_EXAMPLE=1"
      "-DWITHOUT_FEDERATED=1"
    ] ++ stdenv.lib.optionals withoutClient [
      "-DWITHOUT_CLIENT=ON"
    ] ++ stdenv.lib.optionals stdenv.isDarwin [
      "-DWITHOUT_OQGRAPH=1"
      "-DWITHOUT_TOKUDB=1"
    ];
  
    preConfigure = optionalString (!stdenv.isDarwin) ''
      patchShebangs scripts/mytop.sh
    '';
  
    postInstall = common.postInstall + ''
      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/{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
    '';
  
    # perlPackages.DBDmysql is broken on darwin
    postFixup = optionalString (!stdenv.isDarwin) ''
      wrapProgram $out/bin/mytop --set PATH ${less}/bin/less
    '';
  
    CXXFLAGS = optionalString stdenv.isi686 "-fpermissive";
  });
  in mariadb
  
negative.code: { stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, makeWrapper, ncurses, zlib, xz, lzo, lz4, bzip2, snappy
  , libiconv, openssl, pcre, boost, judy, bison, libxml2, libkrb5, linux-pam, curl
  , libaio, libevent, jemalloc, cracklib, systemd, numactl, perl
  , fixDarwinDylibNames, cctools, CoreServices, less
  , withoutClient ? false
  }:
  
  