aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pinentry-mac.rb
blob: 742eeab51fef9e89d3bb2d1b9a3fcd2eb6a6457a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class PinentryMac < Formula
  homepage "https://github.com/GPGTools/pinentry-mac"
  head "https://github.com/GPGTools/pinentry-mac.git"

  stable do
    url "https://github.com/GPGTools/pinentry-mac/archive/v0.8.1.tar.gz"
    sha256 "79aaa11fa8076ff335b3a1f41c230ef7c8435a757705e6484199f562f26b490f"

    # Removes the remote code execution previously run automatically.
    patch do
      url "https://github.com/GPGTools/pinentry-mac/commit/89dd4789818894.diff"
      sha1 "ab4db3264e1eb5ec9f9e1a31ad28b43d869c0f82"
    end
  end

  bottle do
    cellar :any
    revision 1
    sha1 "c4a4832d79deb076f727eebde1ca2a2148eb2104" => :yosemite
    sha1 "c3fceef899c53c1b16fb2262f31fa5b46d6c13f5" => :mavericks
    sha1 "49db48b86524242985fba13304a2c8116c087e6b" => :mountain_lion
  end

  # Manual cloning of this repo is now the upstream default:
  # https://github.com/GPGTools/pinentry-mac/commit/89dd47898188
  resource "core_clone" do
    url "https://github.com/GPGTools/GPGTools_Core.git",
        :revision => "f1e458ab2daeb104328ea4ec2aa7c71e8fca758d"
  end

  depends_on :xcode => :build

  def install
    (buildpath/"Dependencies/GPGTools_Core").install resource("core_clone")

    system "make"
    prefix.install "build/Release/pinentry-mac.app"
    bin.write_exec_script "#{prefix}/pinentry-mac.app/Contents/MacOS/pinentry-mac"
  end

  def caveats; <<-EOS.undent
    You can now set this as your pinentry program like

    ~/.gnupg/gpg-agent.conf
        pinentry-program #{HOMEBREW_PREFIX}/bin/pinentry-mac
    EOS
  end
end