homebrew-core/Formula/wownero.rb

68 lines
2.2 KiB
Ruby

class Wownero < Formula
desc "Official wallet and node software for the Wownero cryptocurrency"
homepage "https://wownero.org"
url "https://git.wownero.com/wownero/wownero.git",
tag: "v0.8.0.2",
revision: "7d1693b1601cb4b3d56191953f403c92a1c51f64"
license "BSD-3-Clause"
bottle do
cellar :any
rebuild 1
sha256 "f68be29309c6d6fe1e9f4d3a96938d9884390e1cd5a94175513f8d6e9a882b8f" => :catalina
sha256 "7a828b16ea78869a1ab52d349b2f3a4821b56d28d6a4d726a397bd02cb648868" => :mojave
sha256 "544f680ced811219370bd6aa5dc7eb303fa7e90edb771192dbf9528afd09fd25" => :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 "miniupnpc", because: "wownero ships its own copy of miniupnpc"
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
plist_options manual: "wownerod --non-interactive"
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}/wownerod</string>
<string>--non-interactive</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
cmd = "yes '' | #{bin}/wownero-wallet-cli --restore-deterministic-wallet " \
"--password brew-test --restore-height 238084 --generate-new-wallet wallet " \
"--electrum-seed 'maze vixen spiders luggage vibrate western nugget older " \
"emails oozed frown isolated ledge business vaults budget " \
"saucepan faxed aloof down emulate younger jump legion saucepan'" \
"--command address"
address = "Wo3YLuTzJLTQjSkyNKPQxQYz5JzR6xi2CTS1PPDJD6nQAZ1ZCk1TDEHHx8CRjHNQ9JDmwCDGhvGF3CZXmmX1sM9a1YhmcQPJM"
assert_equal address, shell_output(cmd).lines.last.split[1]
end
end