mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
dovecot: add mysql-config dependency
Required when using `withMySQL` with `strictDeps` set to true.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user