xmrig 2.5.2

use shared libuv library instead of linking libuv statically
update test

Closes #25819.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ilovezfs 2018-04-21 07:26:14 -07:00
parent f04ce9c42f
commit 875a10345e

View file

@ -1,8 +1,8 @@
class Xmrig < Formula
desc "Monero (XMR) CPU miner"
homepage "https://github.com/xmrig/xmrig"
url "https://github.com/xmrig/xmrig/archive/v2.5.1.tar.gz"
sha256 "6547004d136dbd9496cd21b49c890c326fcdea853dd11305ab2af67cf7cd506d"
url "https://github.com/xmrig/xmrig/archive/v2.5.2.tar.gz"
sha256 "809592cd70335e7984a16738b435e9a08071bda938b251c48258a8f946f0bdb3"
bottle do
cellar :any
@ -17,7 +17,8 @@ class Xmrig < Formula
def install
mkdir "build" do
system "cmake", "..", "-DUV_LIBRARY=#{Formula["libuv"].opt_lib}/libuv.a", *std_cmake_args
system "cmake", "..", "-DUV_LIBRARY=#{Formula["libuv"].opt_lib}/libuv.dylib",
*std_cmake_args
system "make"
bin.install "xmrig"
end
@ -25,18 +26,22 @@ class Xmrig < Formula
end
test do
require "open3"
assert_match version.to_s, shell_output("#{bin}/xmrig -V", 2)
test_server="donotexist.localhost:65535"
timeout=10
Open3.popen2e("#{bin}/xmrig", "--no-color", "--max-cpu-usage=1", "--print-time=1",
"--threads=1", "--retries=1", "--url=#{test_server}") do |stdin, stdouts, _wait_thr|
start_time=Time.now
stdin.close_write
stdouts.each do |line|
assert (Time.now - start_time <= timeout), "No server connect after timeout"
break if line.include? "\] \[#{test_server}\] DNS error: \"unknown node or service\""
begin
read, write = IO.pipe
pid = fork do
exec "#{bin}/xmrig", "--no-color", "--max-cpu-usage=1", "--print-time=1",
"--threads=1", "--retries=1", "--url=#{test_server}", :out => write
end
start_time=Time.now
loop do
assert (Time.now - start_time <= timeout), "No server connect after timeout"
break if read.gets.include? "\] \[#{test_server}\] DNS error: \"unknown node or service\""
end
ensure
Process.kill("SIGINT", pid)
end
end
end