class Monero < Formula desc "Official Monero wallet and CPU miner" homepage "https://getmonero.org/" url "https://github.com/monero-project/monero.git", :tag => "v0.16.0.1", :revision => "a498a1b4ce432941dee47d74c7e05bf87acd3ad6" bottle do cellar :any sha256 "4154ef1ba9eb6f9edde06952f6d86766c3f1a83f4d8a2aaae79e6356985caf23" => :catalina sha256 "3f442ab635b2d13ebdb52b4bc1cba06bf78e7e5ad655fe927118cdcdee26d26e" => :mojave sha256 "bafff74dce6d7a44edfbed7abe7ac3792eb5693587f92006afc7357489aa7760" => :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 Label #{plist_name} ProgramArguments #{opt_bin}/monerod --non-interactive RunAtLoad 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