dovecot: add mysql-config dependency

Required when using `withMySQL` with `strictDeps` set to true.
This commit is contained in:
magicquark
2026-03-10 00:56:42 +00:00
parent d9113d4e31
commit 6316ae4c30

View File

@@ -7,6 +7,7 @@
autoreconfHook,
stdenv,
lib,
buildPackages,
fetchzip,
flex,
bison,
@@ -54,7 +55,20 @@
withLua ? false,
lua5_3,
}:
let
# The `nativeBuildInputs` version of `mysql_config` emits headers and libraries for
# the build platform, not the host platform; `pkg-config` emits the correct versions.
fake_mysql_config = buildPackages.writeShellScriptBin "mysql_config" ''
if [ "$1" == "--include" ]; then
"$PKG_CONFIG" --cflags mysqlclient
elif [ "$1" == "--libs" ]; then
"$PKG_CONFIG" --libs mysqlclient
else
echo "fake_mysql_config: unsupported option: $1" >&2
exit 1
fi
'';
in
stdenv.mkDerivation (finalAttrs: {
pname = "dovecot";
inherit version;
@@ -66,7 +80,8 @@ stdenv.mkDerivation (finalAttrs: {
pkg-config
]
++ lib.optionals (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [ autoreconfHook ];
++ lib.optionals (stdenv.hostPlatform.isDarwin) [ autoreconfHook ]
++ lib.optional (withMySQL && lib.versionOlder version "2.4") fake_mysql_config;
buildInputs = [
openssl