about summary refs log tree commit diff
path: root/pkgs/tools/security/gnupg/20.nix
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2015-03-21 13:01:52 +0000
committerJan Malakhovski <oxij@oxij.org>2015-03-29 23:26:13 +0000
commit6b9bb7231958340d21ed15c3b5e730710a3b9d14 (patch)
treeb293aaa7da27e46594c9686a8d3cedcff0cf695f /pkgs/tools/security/gnupg/20.nix
parenteb22e54243cbd7e63f17a56a6bb73526d8112ed2 (diff)
gnupg: add x11Support option
Diffstat (limited to 'pkgs/tools/security/gnupg/20.nix')
-rw-r--r--pkgs/tools/security/gnupg/20.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/pkgs/tools/security/gnupg/20.nix b/pkgs/tools/security/gnupg/20.nix
index cf11ecb823283..a5fdc2e26924b 100644
--- a/pkgs/tools/security/gnupg/20.nix
+++ b/pkgs/tools/security/gnupg/20.nix
@@ -1,10 +1,16 @@
 { fetchurl, stdenv, readline, zlib, libgpgerror, pth, libgcrypt, libassuan
 , libksba, coreutils, libiconv, pcsclite
+
 # Each of the dependencies below are optional.
 # Gnupg can be built without them at the cost of reduced functionality.
-, pinentry ? null, openldap ? null, bzip2 ? null, libusb ? null, curl ? null
+, pinentry ? null, x11Support ? true
+, openldap ? null, bzip2 ? null, libusb ? null, curl ? null
 }:
 
+with stdenv.lib;
+
+assert x11Support -> pinentry != null;
+
 stdenv.mkDerivation rec {
   name = "gnupg-2.0.27";
 
@@ -27,9 +33,7 @@ stdenv.mkDerivation rec {
     patch gl/stdint_.h < ${./clang.patch}
   '';
 
-  configureFlags =
-    if pinentry != null then "--with-pinentry-pgm=${pinentry}/bin/pinentry"
-                        else "";
+  configureFlags = optional x11Support "--with-pinentry-pgm=${pinentry}/bin/pinentry";
 
   checkPhase="GNUPGHOME=`pwd` ./agent/gpg-agent --daemon make check";