From f0189a8b40acb81fa4a0898f7df582fef049c4f5 Mon Sep 17 00:00:00 2001
From: Nikolay Amiantov <ab@fmap.me>
Date: Sat, 30 Apr 2016 04:51:50 +0300
Subject: [PATCH] dspam: fix build with PostgreSQL support

---
 pkgs/servers/mail/dspam/default.nix | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pkgs/servers/mail/dspam/default.nix b/pkgs/servers/mail/dspam/default.nix
index 3cd3ca7492dd..4c615e6f6b33 100644
--- a/pkgs/servers/mail/dspam/default.nix
+++ b/pkgs/servers/mail/dspam/default.nix
@@ -49,7 +49,8 @@ in stdenv.mkDerivation rec {
     "--enable-preferences-extension"
     "--enable-long-usernames"
     "--enable-external-lookup"
-  ] ++ lib.optional withMySQL "--with-mysql-includes=${libmysql}/include/mysql";
+  ] ++ lib.optional withMySQL "--with-mysql-includes=${libmysql}/include/mysql"
+    ++ lib.optional withPgSQL "--with-pgsql-libraries=${postgresql.lib}/lib";
 
   # Lots of things are hardwired to paths like sysconfdir. That's why we install with both "prefix" and "DESTDIR"
   # and fix directory structure manually after that.