anchor.diff:      # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
       "--localstatedir=/var"
       "--with-ldap"
  -    "--with-lucene"
       "--with-ssl=openssl"
  -    "--with-sqlite"
       "--with-zlib"
       "--with-bzlib"
  -  ] ++ stdenv.lib.optionals (stdenv.isLinux) [
  -    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
  -  ];
  +    "--with-ldap"
  +    "--with-lucene"
  +    "--with-icu"
  +  ] ++ lib.optional (stdenv.isLinux) "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
  +    ++ lib.optional withMySQL "--with-mysql"
  +    ++ lib.optional withPgSQL "--with-pgsql"
  +    ++ lib.optional withSQLite "--with-sqlite";
   
     meta = {
       homepage = "http://dovecot.org/";
  
positive.code: 
    patches = [
      # Make dovecot look for plugins in /etc/dovecot/modules
      # so we can symlink plugins from several packages there
      # The symlinking needs to be done in NixOS, as part of the
      # dovecot service start-up
      ./2.2.x-module_dir.patch
    ];
  
  
negative.code:   };
  
    preConfigure = ''
      patchShebangs src/config/settings-get.pl
    '';
  
    postInstall = lib.optionalString stdenv.isDarwin ''
      install_name_tool -change libclucene-shared.1.dylib \
          ${clucene_core_2}/lib/libclucene-shared.1.dylib \
          $out/lib/dovecot/lib21_fts_lucene_plugin.so
  