class Monero < Formula desc "Official monero wallet and cpu miner" homepage "https://getmonero.org/" url "https://github.com/monero-project/monero.git", :tag => "v0.14.0.2", :revision => "6cadbdcd2d952433db3c2422511ed4d13b2cc824" revision 1 bottle do cellar :any sha256 "02a31124feedd3dd840367ae9d6cccd0c800a83a0ea9284854b750ae1e2006d5" => :mojave sha256 "733ae2e0521db05cf07f4907125da164ee4adc6f3e7c4772ddbf1bf007250a07" => :high_sierra sha256 "8ec50fe41fda424f00d147852689b50e0a8e9f72d7be1f9a45483864c4978d65" => :sierra end depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "boost" depends_on "libsodium" depends_on "openssl" depends_on "readline" depends_on "unbound" depends_on "zeromq" resource "cppzmq" do url "https://github.com/zeromq/cppzmq/archive/v4.3.0.tar.gz" sha256 "27d1f56406ba94ee779e639203218820975cf68174f92fbeae0f645df0fcada4" end def install (buildpath/"cppzmq").install resource("cppzmq") system "cmake", ".", "-DZMQ_INCLUDE_PATH=#{buildpath}/cppzmq", "-DReadline_ROOT_DIR=#{Formula["readline"].opt_prefix}", *std_cmake_args system "make", "install" # Avoid conflicting with miniupnpc # Reported upstream 25 May 2018 https://github.com/monero-project/monero/issues/3862 rm lib/"libminiupnpc.a" rm_rf include/"miniupnpc" 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