Merge pull request #44030 from ajs124/exim_mysql_dovecot

exim: add optional support for MySQL and the Dovecot authenticator

authored by Jörg Thalheim and committed by GitHub 86d7d96d 8f12a9a2

+20 -4
+20 -4
pkgs/servers/mail/exim/default.nix
··· 1 - { coreutils, db, fetchurl, openldap, openssl, pcre, perl, pkgconfig, stdenv 2 - , enableLDAP ? false 3 }: 4 5 stdenv.mkDerivation rec { ··· 11 }; 12 13 nativeBuildInputs = [ pkgconfig ]; 14 - buildInputs = [ coreutils db openssl pcre perl ] 15 - ++ stdenv.lib.optional enableLDAP openldap; 16 17 preBuild = '' 18 sed ' 19 s:^\(BIN_DIRECTORY\)=.*:\1='"$out"'/bin: 20 s:^\(CONFIGURE_FILE\)=.*:\1=/etc/exim.conf: ··· 39 ${stdenv.lib.optionalString enableLDAP '' 40 s:^# \(LDAP_LIB_TYPE=OPENLDAP2\)$:\1: 41 s:^# \(LOOKUP_LDAP=yes\)$:\1: 42 s:^# \(LOOKUP_LIBS\)=.*:\1=-lldap: 43 ''} 44 #/^\s*#.*/d 45 #/^\s*$/d
··· 1 + { coreutils, db, fetchurl, openssl, pcre, perl, pkgconfig, stdenv 2 + , enableLDAP ? false, openldap 3 + , enableMySQL ? false, mysql, zlib 4 + , enableAuthDovecot ? false, dovecot 5 }: 6 7 stdenv.mkDerivation rec { ··· 13 }; 14 15 nativeBuildInputs = [ pkgconfig ]; 16 + buildInputs = [ coreutils db openssl perl pcre ] 17 + ++ stdenv.lib.optional enableLDAP openldap 18 + ++ stdenv.lib.optionals enableMySQL [ mysql zlib ] 19 + ++ stdenv.lib.optional enableAuthDovecot dovecot; 20 21 preBuild = '' 22 + ${stdenv.lib.optionalString enableMySQL "PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${mysql}/share/mysql/pkgconfig/"} 23 sed ' 24 s:^\(BIN_DIRECTORY\)=.*:\1='"$out"'/bin: 25 s:^\(CONFIGURE_FILE\)=.*:\1=/etc/exim.conf: ··· 44 ${stdenv.lib.optionalString enableLDAP '' 45 s:^# \(LDAP_LIB_TYPE=OPENLDAP2\)$:\1: 46 s:^# \(LOOKUP_LDAP=yes\)$:\1: 47 + s:^\(LOOKUP_LIBS\)=\(.*\):\1=\2 -lldap: 48 s:^# \(LOOKUP_LIBS\)=.*:\1=-lldap: 49 + ''} 50 + ${stdenv.lib.optionalString enableMySQL '' 51 + s:^# \(LOOKUP_MYSQL=yes\)$:\1: 52 + s:^# \(LOOKUP_MYSQL_PC=mariadb\)$:\1: 53 + s:^\(LOOKUP_LIBS\)=\(.*\):\1=\2 -lmysqlclient: 54 + s:^# \(LOOKUP_LIBS\)=.*:\1=-lmysqlclient: 55 + s:^# \(LOOKUP_INCLUDE\)=.*:\1=-I${mysql}/include/mysql/: 56 + ''} 57 + ${stdenv.lib.optionalString enableAuthDovecot '' 58 + s:^# \(AUTH_DOVECOT\)=.*:\1=yes: 59 ''} 60 #/^\s*#.*/d 61 #/^\s*$/d