From 6b9bb7231958340d21ed15c3b5e730710a3b9d14 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 21 Mar 2015 13:01:52 +0000 Subject: [PATCH 1/2] gnupg: add x11Support option --- pkgs/tools/security/gnupg/20.nix | 12 ++++++++---- pkgs/tools/security/gnupg/21.nix | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/security/gnupg/20.nix b/pkgs/tools/security/gnupg/20.nix index cf11ecb8232..a5fdc2e2692 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"; diff --git a/pkgs/tools/security/gnupg/21.nix b/pkgs/tools/security/gnupg/21.nix index 440d2294b0d..fc5da48a1b9 100644 --- a/pkgs/tools/security/gnupg/21.nix +++ b/pkgs/tools/security/gnupg/21.nix @@ -1,10 +1,17 @@ { fetchurl, stdenv, pkgconfig, libgcrypt, libassuan, libksba, npth -, readline ? null, libusb ? null, gnutls ? null, adns ? null, openldap ? null -, zlib ? null, bzip2 ? null, pinentry ? null, autoreconfHook, gettext, texinfo -, pcsclite +, autoreconfHook, gettext, texinfo, pcsclite + +# Each of the dependencies below are optional. +# Gnupg can be built without them at the cost of reduced functionality. +, pinentry ? null, x11Support ? true +, adns ? null, gnutls ? null, libusb ? null, openldap ? null +, readline ? null, zlib ? null, bzip2 ? null }: with stdenv.lib; + +assert x11Support -> pinentry != null; + stdenv.mkDerivation rec { name = "gnupg-2.1.2"; @@ -21,12 +28,11 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig libgcrypt libassuan libksba npth - readline libusb gnutls adns openldap zlib bzip2 autoreconfHook gettext texinfo + readline libusb gnutls adns openldap zlib bzip2 ]; - configureFlags = - optional (pinentry != null) "--with-pinentry-pgm=${pinentry}/bin/pinentry"; + configureFlags = optional x11Support "--with-pinentry-pgm=${pinentry}/bin/pinentry"; meta = with stdenv.lib; { homepage = http://gnupg.org; From 1ddc9e4be3662955e0fdd3e7afd4b59f23a085ac Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 21 Mar 2015 12:57:01 +0000 Subject: [PATCH 2/2] pass: rename withX into x11Support, cleanup a bit --- pkgs/tools/security/pass/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/security/pass/default.nix b/pkgs/tools/security/pass/default.nix index 0e37443c3ed..1aa5e0b51f1 100644 --- a/pkgs/tools/security/pass/default.nix +++ b/pkgs/tools/security/pass/default.nix @@ -1,12 +1,14 @@ { stdenv, fetchurl , coreutils, gnused, getopt, pwgen, git, tree, gnupg , makeWrapper -, withX ? true, xclip, xdotool, dmenu + +, xclip ? null, xdotool ? null, dmenu ? null +, x11Support ? true }: -assert withX -> xclip != null; -assert withX -> xdotool != null; -assert withX -> dmenu != null; +assert x11Support -> xclip != null + && xdotool != null + && dmenu != null; stdenv.mkDerivation rec { version = "1.6.5"; @@ -52,7 +54,7 @@ stdenv.mkDerivation rec { mkdir -p "$out/share/emacs/site-lisp" cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/" - ${if withX then '' + ${if x11Support then '' cp "contrib/dmenu/passmenu" "$out/bin/" '' else ""} ''; @@ -64,9 +66,9 @@ stdenv.mkDerivation rec { # Ensure all dependencies are in PATH wrapProgram $out/bin/pass \ - --prefix PATH : "${coreutils}/bin:${gnused}/bin:${getopt}/bin:${gnupg}/bin:${git}/bin:${tree}/bin:${pwgen}/bin${if withX then ":${xclip}/bin" else ""}" + --prefix PATH : "${coreutils}/bin:${gnused}/bin:${getopt}/bin:${gnupg}/bin:${git}/bin:${tree}/bin:${pwgen}/bin${if x11Support then ":${xclip}/bin" else ""}" - ${if withX then '' + ${if x11Support then '' wrapProgram $out/bin/passmenu \ --prefix PATH : "$out/bin:${xdotool}/bin:${dmenu}/bin" '' else ""}