1 { lib, stdenv, fetchurl, fetchpatch, openssl, openldap, libkrb5, db, gettext
2 , pam, libxcrypt, fixDarwinDylibNames, autoreconfHook, enableLdap ? false
3 , buildPackages, pruneLibtoolFiles, nixosTests }:
5 stdenv.mkDerivation rec {
11 [ "https://github.com/cyrusimap/${pname}/releases/download/${pname}-${version}/${pname}-${version}.tar.gz"
12 "http://www.cyrusimap.org/releases/${pname}-${version}.tar.gz"
13 "http://www.cyrusimap.org/releases/old/${pname}-${version}.tar.gz"
15 sha256 = "sha256-fM/Gq9Ae1nwaCSSzU+Um8bdmsh9C1FYu5jWo6/xbs4w=";
19 # Fix cross-compilation
20 ./cyrus-sasl-ac-try-run-fix.patch
21 # make compatible with openssl3. can probably be dropped with any release after 2.1.28
23 url = "https://github.com/cyrusimap/cyrus-sasl/compare/cb549ef71c5bb646fe583697ebdcaba93267a237...c2bd3afbca57f176d8c650670ce371444bb7fcc0.patch";
24 hash = "sha256-bYeIkvle1Ms7Lnoob4eLd4RbPFHtPkKRZvfHNCBJY/s=";
28 outputs = [ "bin" "dev" "out" "man" "devdoc" ];
30 depsBuildBuild = [ buildPackages.stdenv.cc ];
31 nativeBuildInputs = [ autoreconfHook pruneLibtoolFiles ]
32 ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
34 [ openssl db gettext libkrb5 libxcrypt ]
35 ++ lib.optional enableLdap openldap
36 ++ lib.optional stdenv.isLinux pam;
39 "--with-openssl=${openssl.dev}"
40 "--with-plugindir=${placeholder "out"}/lib/sasl2"
41 "--with-saslauthd=/run/saslauthd"
44 ] ++ lib.optional enableLdap "--with-ldap=${openldap.dev}";
46 installFlags = lib.optionals stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ];
49 inherit (nixosTests) parsedmarc postfix;
53 homepage = "https://www.cyrusimap.org/sasl";
54 description = "Library for adding authentication support to connection-based protocols";
55 platforms = platforms.unix;
56 license = licenses.bsdOriginal;