Merge pull request #16286 from kirelagin/gpg2-osx

Enhance gnupg experience on OS X
This commit is contained in:
Graham Christensen 2016-10-28 21:35:37 -04:00 committed by GitHub
commit 55909c32d1
4 changed files with 18 additions and 8 deletions

View file

@ -3,13 +3,13 @@
# Each of the dependencies below are optional. # Each of the dependencies below are optional.
# Gnupg can be built without them at the cost of reduced functionality. # Gnupg can be built without them at the cost of reduced functionality.
, pinentry ? null, x11Support ? true , pinentry ? null, guiSupport ? true
, openldap ? null, bzip2 ? null, libusb ? null, curl ? null , openldap ? null, bzip2 ? null, libusb ? null, curl ? null
}: }:
with stdenv.lib; with stdenv.lib;
assert x11Support -> pinentry != null; assert guiSupport -> pinentry != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gnupg-2.0.30"; name = "gnupg-2.0.30";
@ -35,7 +35,8 @@ stdenv.mkDerivation rec {
patch gl/stdint_.h < ${./clang.patch} patch gl/stdint_.h < ${./clang.patch}
''; '';
configureFlags = optional x11Support "--with-pinentry-pgm=${pinentry}/bin/pinentry"; pinentryBinaryPath = pinentry.binaryPath or "bin/pinentry";
configureFlags = optional guiSupport "--with-pinentry-pgm=${pinentry}/${pinentryBinaryPath}";
postConfigure = "substituteAllInPlace tools/gpgkey2ssh.c"; postConfigure = "substituteAllInPlace tools/gpgkey2ssh.c";

View file

@ -3,14 +3,14 @@
# Each of the dependencies below are optional. # Each of the dependencies below are optional.
# Gnupg can be built without them at the cost of reduced functionality. # Gnupg can be built without them at the cost of reduced functionality.
, pinentry ? null, x11Support ? true , pinentry ? null, guiSupport ? true
, adns ? null, gnutls ? null, libusb ? null, openldap ? null , adns ? null, gnutls ? null, libusb ? null, openldap ? null
, readline ? null, zlib ? null, bzip2 ? null , readline ? null, zlib ? null, bzip2 ? null
}: }:
with stdenv.lib; with stdenv.lib;
assert x11Support -> pinentry != null; assert guiSupport -> pinentry != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gnupg-${version}"; name = "gnupg-${version}";
@ -32,7 +32,8 @@ stdenv.mkDerivation rec {
sed -i 's,"libpcsclite\.so[^"]*","${pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c sed -i 's,"libpcsclite\.so[^"]*","${pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c
''; #" fix Emacs syntax highlighting :-( ''; #" fix Emacs syntax highlighting :-(
configureFlags = optional x11Support "--with-pinentry-pgm=${pinentry}/bin/pinentry"; pinentryBinaryPath = pinentry.binaryPath or "bin/pinentry";
configureFlags = optional guiSupport "--with-pinentry-pgm=${pinentry}/${pinentryBinaryPath}";
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://gnupg.org; homepage = http://gnupg.org;

View file

@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
mv build/Release/pinentry-mac.app $out/Applications mv build/Release/pinentry-mac.app $out/Applications
''; '';
passthru = {
binaryPath = "Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac";
};
meta = { meta = {
description = "Pinentry for GPG on Mac"; description = "Pinentry for GPG on Mac";
license = stdenv.lib.licenses.gpl2Plus; license = stdenv.lib.licenses.gpl2Plus;

View file

@ -1845,8 +1845,12 @@ in
gnupg1orig = callPackage ../tools/security/gnupg/1.nix { }; gnupg1orig = callPackage ../tools/security/gnupg/1.nix { };
gnupg1compat = callPackage ../tools/security/gnupg/1compat.nix { }; gnupg1compat = callPackage ../tools/security/gnupg/1compat.nix { };
gnupg1 = gnupg1compat; # use config.packageOverrides if you prefer original gnupg1 gnupg1 = gnupg1compat; # use config.packageOverrides if you prefer original gnupg1
gnupg20 = callPackage ../tools/security/gnupg/20.nix { }; gnupg20 = callPackage ../tools/security/gnupg/20.nix {
gnupg21 = callPackage ../tools/security/gnupg/21.nix { }; pinentry = if stdenv.isDarwin then pinentry_mac else pinentry;
};
gnupg21 = callPackage ../tools/security/gnupg/21.nix {
pinentry = if stdenv.isDarwin then pinentry_mac else pinentry;
};
gnupg = gnupg21; gnupg = gnupg21;
gnuplot = callPackage ../tools/graphics/gnuplot { qt = qt4; }; gnuplot = callPackage ../tools/graphics/gnuplot { qt = qt4; };