anchor.diff:    postInstall = common.postInstall + ''
       rm -r "$out"/{mysql-test,sql-bench,data} # Don't need testing data
       rm "$out"/share/man/man1/mysql-test-run.pl.1
  +    rm "$out"/bin/rcmysql
     '';
   
     CXXFLAGS = optionalString stdenv.isi686 "-fpermissive";
  
positive.code: 
    # prevent cycle; it needs to reference $dev
    postInstall = common.postInstall + ''
      moveToOutput bin/mysql_config "$dev"
      moveToOutput bin/mariadb_config "$dev"
    '';
  
    enableParallelBuilding = true; # the client should be OK
  
negative.code: };
  
  common = rec { # attributes common to both builds
    version = "10.2.11";
  
    src = fetchurl {
      url    = "https://downloads.mariadb.org/f/mariadb-${version}/source/mariadb-${version}.tar.gz/from/http%3A//ftp.hosteurope.de/mirror/archive.mariadb.org/?serve";
      sha256 = "1s53ravbrxcc8ixvkm56rwgs3cfifzngc56pidd1f1dr1n0mlmb3";
      name   = "mariadb-${version}.tar.gz";
    };
  
    nativeBuildInputs = [ cmake pkgconfig ];
  
    buildInputs = [
      ncurses openssl zlib pcre jemalloc
    ] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd ]
  