# DESCRIPTION: add -DUSE_LDAP_SASL # TODO: remove when using nixpkgs with https://github.com/NixOS/nixpkgs/pull/46883 self: super: let lib = super.lib; ccargs = lib.concatStringsSep " " ([ "-DUSE_TLS" "-DUSE_SASL_AUTH" "-DUSE_CYRUS_SASL" "-I${self.cyrus_sasl.dev}/include/sasl" "-DHAS_DB_BYPASS_MAKEDEFS_CHECK" ] ++ lib.optional self.withPgSQL "-DHAS_PGSQL" ++ lib.optionals self.withMySQL [ "-DHAS_MYSQL" "-I${self.mysql.connector-c}/include/mysql" "-L${self.mysql.connector-c}/lib/mysql" ] ++ lib.optional self.withSQLite "-DHAS_SQLITE" ++ lib.optional self.withLDAP "-DHAS_LDAP -DUSE_LDAP_SASL"); auxlibs = lib.concatStringsSep " " ([ "-ldb" "-lnsl" "-lresolv" "-lsasl2" "-lcrypto" "-lssl" ] ++ lib.optional self.withPgSQL "-lpq" ++ lib.optional self.withMySQL "-lmysqlclient" ++ lib.optional self.withSQLite "-lsqlite3" ++ lib.optional self.withLDAP "-lldap"); in { withLDAP = true; withPgSQL = false; withMySQL = false; withSQLite = false; postfix = super.postfix.overrideAttrs (old: { preBuild = '' sed -e '/^PATH=/d' -i postfix-install sed -e "s|@PACKAGE@|$out|" -i conf/post-install # post-install need skip permissions check/set on all symlinks following to /nix/store sed -e "s|@NIX_STORE@|$NIX_STORE|" -i conf/post-install export command_directory=$out/sbin export config_directory=/etc/postfix export meta_directory=$out/etc/postfix export daemon_directory=$out/libexec/postfix export data_directory=/var/lib/postfix/data export html_directory=$out/share/postfix/doc/html export mailq_path=$out/bin/mailq export manpage_directory=$out/share/man export newaliases_path=$out/bin/newaliases export queue_directory=/var/lib/postfix/queue export readme_directory=$out/share/postfix/doc export sendmail_path=$out/bin/sendmail make makefiles CCARGS='${ccargs}' AUXLIBS='${auxlibs}' ''; }); }