From c4e68effd2013d40931ea01d678a064edd05e652 Mon Sep 17 00:00:00 2001 From: Emanuel Evans Date: Tue, 28 Oct 2014 13:16:59 -0700 Subject: pass: use any gpgtools. The homebrew-provided version of GPG is quite difficult to configure, and Homebrew Cask provides a nice option to install GPGTools (which takes care of a lot of configuration). This changes the pass formula to skip installing the Homebrew gnupg2 package if gpg is already installed through some other method (most likely GPGTools). Closes #33684. Signed-off-by: Mike McQuaid --- Library/Formula/pass.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Library/Formula') diff --git a/Library/Formula/pass.rb b/Library/Formula/pass.rb index 082b6ea1b..23bf0abc7 100644 --- a/Library/Formula/pass.rb +++ b/Library/Formula/pass.rb @@ -1,5 +1,22 @@ require 'formula' +class GpgRequirement < Requirement + fatal true + default_formula 'gnupg2' + + satisfy do + %w(gpg gpg2).any? { |gpg| which gpg } + end + + def message; <<-EOS.undent + pass requires GPG to be installed. Please install GPG in one of three ways: + - Install the gnupg2 package through Homebrew + - Install the gpgtools package through Homebrew Cask + - Download and install gpgtools from https://gpgtools.org/ + EOS + end +end + class Pass < Formula homepage 'http://www.passwordstore.org/' url 'http://git.zx2c4.com/password-store/snapshot/password-store-1.6.3.tar.xz' @@ -17,7 +34,7 @@ class Pass < Formula depends_on 'pwgen' depends_on 'tree' depends_on 'gnu-getopt' - depends_on 'gnupg2' + depends_on GpgRequirement def install system "make DESTDIR=#{prefix} PREFIX=/ install" -- cgit v1.2.3