homebrew-core/Formula/monero.rb
2018-09-20 21:08:59 +02:00

52 lines
2 KiB
Ruby

class Monero < Formula
desc "Official monero wallet and cpu miner"
homepage "https://getmonero.org/"
url "https://github.com/monero-project/monero.git",
:tag => "v0.12.3.0",
:revision => "a486cae407b109a7a95060daa85e4efed2046c01"
bottle do
cellar :any
sha256 "2923389dc0e087a5fc701ee1ee51c4021687a5c0970d8d3e805350344d758a2f" => :mojave
sha256 "19eafd4f8b9d564d093559cb61d259885033d069daea63995d6dd13e952e4fdf" => :high_sierra
sha256 "fc88beb6f27c809f2c5d0d6f000d89b0cc3df38a60a703069b28ea8e8c54fc92" => :sierra
sha256 "c8ff3020d112959d888fbb9009f91889ea50610585e80c10af9801a26a71f06d" => :el_capitan
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "boost"
depends_on "openssl"
depends_on "readline"
depends_on "unbound"
depends_on "zeromq"
resource "cppzmq" do
url "https://github.com/zeromq/cppzmq/archive/v4.2.3.tar.gz"
sha256 "3e6b57bf49115f4ae893b1ff7848ead7267013087dc7be1ab27636a97144d373"
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
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