From 213dc2144357761ccb0dda36b137e5aaea29283d Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Fri, 17 Jun 2016 12:27:59 +0300 Subject: [PATCH] gnupg: Variable path to pinentry This is needed for pinentry-mac which has the pinentry binary at an OS X-ish path. --- pkgs/tools/security/gnupg/20.nix | 3 ++- pkgs/tools/security/gnupg/21.nix | 3 ++- pkgs/tools/security/pinentry-mac/default.nix | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/gnupg/20.nix b/pkgs/tools/security/gnupg/20.nix index 2783031c7b57..fd79419d82ac 100644 --- a/pkgs/tools/security/gnupg/20.nix +++ b/pkgs/tools/security/gnupg/20.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation rec { patch gl/stdint_.h < ${./clang.patch} ''; - configureFlags = optional guiSupport "--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"; diff --git a/pkgs/tools/security/gnupg/21.nix b/pkgs/tools/security/gnupg/21.nix index a548088f1e5c..b7a71332e772 100644 --- a/pkgs/tools/security/gnupg/21.nix +++ b/pkgs/tools/security/gnupg/21.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { sed -i 's,"libpcsclite\.so[^"]*","${pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c ''; #" fix Emacs syntax highlighting :-( - configureFlags = optional guiSupport "--with-pinentry-pgm=${pinentry}/bin/pinentry"; + pinentryBinaryPath = pinentry.binaryPath or "bin/pinentry"; + configureFlags = optional guiSupport "--with-pinentry-pgm=${pinentry}/${pinentryBinaryPath}"; meta = with stdenv.lib; { homepage = http://gnupg.org; diff --git a/pkgs/tools/security/pinentry-mac/default.nix b/pkgs/tools/security/pinentry-mac/default.nix index faf8c613ea83..7116d1777d6d 100644 --- a/pkgs/tools/security/pinentry-mac/default.nix +++ b/pkgs/tools/security/pinentry-mac/default.nix @@ -17,6 +17,10 @@ stdenv.mkDerivation rec { mv build/Release/pinentry-mac.app $out/Applications ''; + passthru = { + binaryPath = "Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac"; + }; + meta = { description = "Pinentry for GPG on Mac"; license = stdenv.lib.licenses.gpl2Plus;