homebrew-core/Formula/monero.rb

72 lines
2.3 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.17.1.1",
revision: "76cc82c29234fc2805f936f0fc53d48acc9cedf7"
license "BSD-3-Clause"
revision 1
bottle do
cellar :any
sha256 "60eb3afef941672e2880ffcb21efbdf539d6dd1f8f4dea2230a65e0f93c82a58" => :catalina
sha256 "9a342ca4bae514e78bd6f0f30414dbc85ca24a2cd295e9e67aafe2db05621dfa" => :mojave
sha256 "6e9751f79341c33f9caafda5a76049994e4c873e8010370e5db8bdff8a03eb20" => :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"
conflicts_with "wownero", because: "both install a wallet2_api.h header"
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