homebrew-core/Formula/monero.rb

70 lines
2.2 KiB
Ruby

class Monero < Formula
desc "Official Monero wallet and CPU miner"
homepage "https://www.getmonero.org/"
url "https://github.com/monero-project/monero.git",
tag: "v0.16.0.3",
revision: "7bd1ed03dd29d1f194503b6fdce6588306328b72"
license "BSD-3-Clause"
revision 1
bottle do
cellar :any
sha256 "e306cdfa4c7b77e987028b5504e46358c4160ff92037a080b9bca18aa1830d64" => :catalina
sha256 "765c37c2b78d4f5b5065d78896653e42c34bc2c7d1a0e7952086a6d07039a37f" => :mojave
sha256 "f53b3c727491aa78b8bad4e5d1484817f0390e3366606beb845559c89f4b80f0" => :high_sierra
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "boost"
depends_on "hidapi"
depends_on "libsodium"
depends_on "openssl@1.1"
depends_on "protobuf"
depends_on "readline"
depends_on "unbound"
depends_on "zeromq"
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
# Fix conflict with miniupnpc.
# This has been reported at https://github.com/monero-project/monero/issues/3862
rm lib/"libminiupnpc.a"
end
plist_options manual: "monerod"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/monerod</string>
<string>--non-interactive</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
cmd = "yes '' | #{bin}/monero-wallet-cli --restore-deterministic-wallet " \
"--password brew-test --restore-height 1 --generate-new-wallet wallet " \
"--electrum-seed 'baptism cousin whole exquisite bobsled fuselage left " \
"scoop emerge puzzled diet reinvest basin feast nautical upon mullet " \
"ponies sixteen refer enhanced maul aztec bemused basin'" \
"--command address"
address = "4BDtRc8Ym9wGzx8vpkQQvpejxBNVpjEmVBebBPCT4XqvMxW3YaCALFraiQibejyMAxUXB5zqn4pVgHVm3JzhP2WzVAJDpHf"
assert_equal address, shell_output(cmd).lines.last.split[1]
end
end