From ba57d31e925bd5e8f3a5d136cc4339ed74c217e0 Mon Sep 17 00:00:00 2001 From: Doro Rose Date: Thu, 30 Apr 2026 00:41:07 +0200 Subject: [PATCH] dovecot: fix fts_flatcurve linking errors 1. "Undefined symbols" errors were caused by wrong linker flags being used for plugin builds on darwin. 2. Openssl build error surfaced on darwin machines with sandboxing being enabled. This is fixed by disabling sandboxing on darwin machines. --- pkgs/by-name/do/dovecot/generic.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/do/dovecot/generic.nix b/pkgs/by-name/do/dovecot/generic.nix index f7aa58bae20e..b84f947e3357 100644 --- a/pkgs/by-name/do/dovecot/generic.nix +++ b/pkgs/by-name/do/dovecot/generic.nix @@ -4,6 +4,7 @@ patches, }: { + autoreconfHook, stdenv, lib, fetchzip, @@ -64,7 +65,8 @@ stdenv.mkDerivation (finalAttrs: { perl pkg-config ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; + ++ lib.optionals (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ autoreconfHook ]; buildInputs = [ openssl @@ -137,6 +139,12 @@ stdenv.mkDerivation (finalAttrs: { ) + lib.optionalString stdenv.hostPlatform.isLinux '' export systemdsystemunitdir=$out/etc/systemd/system + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure.ac \ + --replace-fail \ + 'NOPLUGIN_LDFLAGS="-no-undefined"' \ + 'NOPLUGIN_LDFLAGS="-undefined dynamic_lookup"' ''; preBuild = lib.optionalString (lib.strings.versionOlder version "2.4" && stdenv.isDarwin) '' @@ -203,7 +211,6 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; meta = { - broken = lib.versionAtLeast version "2.4" && stdenv.hostPlatform.isDarwin; # fails to link openssl homepage = "https://dovecot.org/"; description = "Open source IMAP and POP3 email server written with security primarily in mind"; license = with lib.licenses; [