From 5302ae078997e6fca1ac3d4bdc99e64abbcbd7fb Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Tue, 16 Sep 2014 17:32:39 -0400 Subject: [PATCH 1/7] Configure gnupg to use pinentry by default. This makes gnupg much more usable out of the box. --- pkgs/tools/security/gnupg/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix index 64e2be90d30d..10fb11d32b9b 100644 --- a/pkgs/tools/security/gnupg/default.nix +++ b/pkgs/tools/security/gnupg/default.nix @@ -1,8 +1,6 @@ -# Remember to install Pinentry and -# 'echo "pinentry-program `which pinentry-gtk-2`" >> ~/.gnupg/gpg-agent.conf'. - { fetchurl, stdenv, readline, zlib, libgpgerror, pth, libgcrypt, libassuan , libksba, coreutils, libiconvOrEmpty +, pinentry , useLdap ? true, openldap ? null, useBzip2 ? true, bzip2 ? null , useUsb ? true, libusb ? null, useCurl ? true, curl ? null }: @@ -33,6 +31,10 @@ stdenv.mkDerivation rec { find . -name pcsc-wrapper.c | xargs sed -i 's/typedef unsinged int pcsc_dword_t/typedef unsigned int pcsc_dword_t/' ''; + configureFlags = + if pinentry != null then "--with-pinentry-pgm=${pinentry}/bin/pinentry" + else ""; + checkPhase="GNUPGHOME=`pwd` ./agent/gpg-agent --daemon make check"; doCheck = true; From ae8629a0d4f7f9b6f9ea21f6adaae08fd5d542b8 Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Tue, 16 Sep 2014 17:45:05 -0400 Subject: [PATCH 2/7] Remove obsolete patch. --- pkgs/tools/security/gnupg/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix index 10fb11d32b9b..ff354169dccf 100644 --- a/pkgs/tools/security/gnupg/default.nix +++ b/pkgs/tools/security/gnupg/default.nix @@ -28,7 +28,6 @@ stdenv.mkDerivation rec { patchPhase = '' find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i - find . -name pcsc-wrapper.c | xargs sed -i 's/typedef unsinged int pcsc_dword_t/typedef unsigned int pcsc_dword_t/' ''; configureFlags = From 1274724c6294451a299b830cb4b769290d0c5f8d Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Tue, 16 Sep 2014 18:24:33 -0400 Subject: [PATCH 3/7] Remove use* options and let the user set optional dependies to null if they don't want to use them. --- pkgs/tools/security/gnupg/default.nix | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix index ff354169dccf..d75abc09544d 100644 --- a/pkgs/tools/security/gnupg/default.nix +++ b/pkgs/tools/security/gnupg/default.nix @@ -1,15 +1,8 @@ { fetchurl, stdenv, readline, zlib, libgpgerror, pth, libgcrypt, libassuan , libksba, coreutils, libiconvOrEmpty -, pinentry -, useLdap ? true, openldap ? null, useBzip2 ? true, bzip2 ? null -, useUsb ? true, libusb ? null, useCurl ? true, curl ? null +, pinentry ? null, openldap ? null, bzip2 ? null, libusb ? null, curl ? null }: -assert useLdap -> (openldap != null); -assert useBzip2 -> (bzip2 != null); -assert useUsb -> (libusb != null); -assert useCurl -> (curl != null); - stdenv.mkDerivation rec { name = "gnupg-2.0.26"; @@ -19,12 +12,9 @@ stdenv.mkDerivation rec { }; buildInputs - = [ readline zlib libgpgerror libgcrypt libassuan libksba pth ] - ++ libiconvOrEmpty - ++ stdenv.lib.optional useLdap openldap - ++ stdenv.lib.optional useBzip2 bzip2 - ++ stdenv.lib.optional useUsb libusb - ++ stdenv.lib.optional useCurl curl; + = [ readline zlib libgpgerror libgcrypt libassuan libksba pth + openldap bzip2 libusb curl ] + ++ libiconvOrEmpty; patchPhase = '' find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i From df7444ec65e25dae9a050abc4f52d8847096832d Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Tue, 16 Sep 2014 18:49:16 -0400 Subject: [PATCH 4/7] Apply recent changes from gnupg/default.nix to gnupg/git.nix gnupg/git.nix doesn't build, but it didn't build before either. --- pkgs/tools/security/gnupg/git.nix | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pkgs/tools/security/gnupg/git.nix b/pkgs/tools/security/gnupg/git.nix index 69a0a68319fd..f8b5d8cc1507 100644 --- a/pkgs/tools/security/gnupg/git.nix +++ b/pkgs/tools/security/gnupg/git.nix @@ -1,17 +1,8 @@ -# Remember to install Pinentry and -# 'echo "pinentry-program `which pinentry-gtk-2`" >> ~/.gnupg/gpg-agent.conf'. - { fetchgit, stdenv, readline, zlib, libgpgerror, npth, libgcrypt, libassuan , libksba, coreutils, autoconf, automake, transfig, ghostscript, texinfo -, useLdap ? true, openldap ? null, useBzip2 ? true, bzip2 ? null, useUsb ? true -, libusb ? null, useCurl ? true, curl ? null +, pinentry ? null, openldap ? null, bzip2 ? null, libusb ? null, curl ? null }: -assert useLdap -> (openldap != null); -assert useBzip2 -> (bzip2 != null); -assert useUsb -> (libusb != null); -assert useCurl -> (curl != null); - stdenv.mkDerivation rec { name = "gnupg-2.1pre-git20120407"; @@ -22,18 +13,17 @@ stdenv.mkDerivation rec { }; buildInputs = [ readline zlib libgpgerror npth libgcrypt libassuan libksba - autoconf automake transfig ghostscript texinfo ] - ++ stdenv.lib.optional useLdap openldap - ++ stdenv.lib.optional useBzip2 bzip2 - ++ stdenv.lib.optional useUsb libusb - ++ stdenv.lib.optional useCurl curl; + openldap bzip2 libusb curl + autoconf automake transfig ghostscript texinfo ]; patchPhase = '' find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i ''; preConfigure = "autoreconf -v"; - configureFlags = "--enable-maintainer-mode"; + configureFlags = "--enable-maintainer-mode" + + (if pinentry != null then " --with-pinentry-pgm=${pinentry}/bin/pinentry" + else ""); meta = { description = "GNU Privacy Guard (GnuPG), GNU Project's implementation of the OpenPGP standard"; From 86204e322f2fd8ad663906811c38b5eb2b361652 Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Wed, 17 Sep 2014 19:16:09 -0400 Subject: [PATCH 5/7] Add roconnor to GnuPG maintainers. --- pkgs/tools/security/gnupg/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix index d75abc09544d..d42ae95498a1 100644 --- a/pkgs/tools/security/gnupg/default.nix +++ b/pkgs/tools/security/gnupg/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { S/MIME. ''; - maintainers = with stdenv.lib.maintainers; [ urkud ]; + maintainers = with stdenv.lib.maintainers; [ roconnor urkud ]; platforms = stdenv.lib.platforms.all; }; } From 2b4e35bfd3b4d4dd08e06f6eeece9c88b456eeb6 Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Thu, 18 Sep 2014 14:46:54 -0400 Subject: [PATCH 6/7] Remove unmaintained gnupg2_1. --- pkgs/tools/security/gnupg/git.nix | 47 ------------------------------- pkgs/top-level/all-packages.nix | 4 --- 2 files changed, 51 deletions(-) delete mode 100644 pkgs/tools/security/gnupg/git.nix diff --git a/pkgs/tools/security/gnupg/git.nix b/pkgs/tools/security/gnupg/git.nix deleted file mode 100644 index f8b5d8cc1507..000000000000 --- a/pkgs/tools/security/gnupg/git.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ fetchgit, stdenv, readline, zlib, libgpgerror, npth, libgcrypt, libassuan -, libksba, coreutils, autoconf, automake, transfig, ghostscript, texinfo -, pinentry ? null, openldap ? null, bzip2 ? null, libusb ? null, curl ? null -}: - -stdenv.mkDerivation rec { - name = "gnupg-2.1pre-git20120407"; - - src = fetchgit { - url = "git://git.gnupg.org/gnupg.git"; - rev = "f1e1387bee286c7434f0462185048872bcdb4484"; - sha256 = "8f5a14587beccdd3752f9e430e56c6ea2d393dddb7843bfc17029e1a309045bb"; - }; - - buildInputs = [ readline zlib libgpgerror npth libgcrypt libassuan libksba - openldap bzip2 libusb curl - autoconf automake transfig ghostscript texinfo ]; - - patchPhase = '' - find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i - ''; - - preConfigure = "autoreconf -v"; - configureFlags = "--enable-maintainer-mode" + - (if pinentry != null then " --with-pinentry-pgm=${pinentry}/bin/pinentry" - else ""); - - meta = { - description = "GNU Privacy Guard (GnuPG), GNU Project's implementation of the OpenPGP standard"; - - longDescription = '' - GnuPG is the GNU project's complete and free implementation of - the OpenPGP standard as defined by RFC4880. GnuPG allows to - encrypt and sign your data and communication, features a - versatile key managment system as well as access modules for all - kind of public key directories. GnuPG, also known as GPG, is a - command line tool with features for easy integration with other - applications. A wealth of frontend applications and libraries - are available. Version 2 of GnuPG also provides support for - S/MIME. - ''; - - homepage = http://gnupg.org/; - - license = stdenv.lib.licenses.gpl3Plus; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f1c71b61a288..6b724d395853 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1199,10 +1199,6 @@ let gnupg = callPackage ../tools/security/gnupg { libusb = libusb1; }; - gnupg2_1 = lowPrio (callPackage ../tools/security/gnupg/git.nix { - libassuan = libassuan2_1; - }); - gnuplot = callPackage ../tools/graphics/gnuplot { }; gnuplot_qt = gnuplot.override { withQt = true; }; From 88b7d32beed58f4ddb03c5a1d850719651335e74 Mon Sep 17 00:00:00 2001 From: Russell O'Connor Date: Thu, 18 Sep 2014 14:55:49 -0400 Subject: [PATCH 7/7] Comment on optional dependencies for Gnupg. --- pkgs/tools/security/gnupg/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix index d42ae95498a1..45a25d7e2422 100644 --- a/pkgs/tools/security/gnupg/default.nix +++ b/pkgs/tools/security/gnupg/default.nix @@ -1,5 +1,7 @@ { fetchurl, stdenv, readline, zlib, libgpgerror, pth, libgcrypt, libassuan , libksba, coreutils, libiconvOrEmpty +# 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 }: