From 5ba0dd1ad7aa54b2d695d4c91251c73b7d2551b2 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Tue, 23 May 2017 09:51:38 -0500
Subject: [PATCH] qgpgme: build with -DQT_NO_DEBUG

qgpgme uses Q_ASSERT which causes build inputs to be retained unnecessarily at
runtime unless debugging is disabled.
---
 pkgs/development/libraries/gpgme/default.nix | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index aae24587302..9773ef8b896 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -32,9 +32,12 @@ stdenv.mkDerivation rec {
     "--enable-fixed-path=${gnupg}/bin"
   ];
 
-  # https://www.gnupg.org/documentation/manuals/gpgme/Largefile-Support-_0028LFS_0029.html
   NIX_CFLAGS_COMPILE =
-    lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64";
+    # qgpgme uses Q_ASSERT which retains build inputs at runtime unless
+    # debugging is disabled
+    lib.optional (qtbase != null) "-DQT_NO_DEBUG"
+    # https://www.gnupg.org/documentation/manuals/gpgme/Largefile-Support-_0028LFS_0029.html
+    ++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64";
 
   meta = with stdenv.lib; {
     homepage = https://gnupg.org/software/gpgme/index.html;