anchor.diff: -{ coreutils, db, fetchurl, openldap, openssl, pcre, perl, pkgconfig, stdenv
  -, enableLDAP ? false
  +{ coreutils, db, fetchurl, openssl, pcre, perl, pkgconfig, stdenv
  +, enableLDAP ? false, openldap
  +, enableMySQL ? false, mysql, zlib
  +, enableAuthDovecot ? false, dovecot
   }:
   
   stdenv.mkDerivation rec {
  
positive.code:       ${stdenv.lib.optionalString enableLDAP ''
          s:^# \(LDAP_LIB_TYPE=OPENLDAP2\)$:\1:
          s:^# \(LOOKUP_LDAP=yes\)$:\1:
          s:^# \(LOOKUP_LIBS\)=.*:\1=-lldap:
        ''}
        #/^\s*#.*/d
        #/^\s*$/d
  
negative.code:   };
  
    nativeBuildInputs = [ pkgconfig ];
    buildInputs = [ coreutils db openssl perl pcre ]
      ++ stdenv.lib.optional enableLDAP openldap
      ++ stdenv.lib.optionals enableMySQL [ mysql zlib ]
      ++ stdenv.lib.optional enableAuthDovecot dovecot;
  
    preBuild = ''
      ${stdenv.lib.optionalString enableMySQL "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${mysql}/share/mysql/pkgconfig/"}
      sed '
        s:^\(BIN_DIRECTORY\)=.*:\1='"$out"'/bin:
        s:^\(CONFIGURE_FILE\)=.*:\1=/etc/exim.conf:
  