75 lines
2.5 KiB
Ruby
75 lines
2.5 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.14.1.2",
|
|
:revision => "8f0aedfa1ad7090ff1580cdce55b152fcb5655c0"
|
|
revision 1
|
|
|
|
bottle do
|
|
cellar :any
|
|
rebuild 1
|
|
sha256 "66645be8b44348dccf1772f32a25aa4d20f7c0f1d70d94143f97031099912c1b" => :mojave
|
|
sha256 "35d6e058a89875c99bb16ceb1c0452c5da5df0c99c8d247933fac4b62f998f73" => :high_sierra
|
|
sha256 "cd796d88fab23f151cdf7a959935629e072f7295ea1a5a05ac7d859306f64717" => :sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "boost"
|
|
depends_on "libsodium"
|
|
depends_on "openssl@1.1"
|
|
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
|
|
<?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
|