homebrew-core/Formula/zeromq.rb
2019-01-04 11:40:25 +01:00

60 lines
1.7 KiB
Ruby

class Zeromq < Formula
desc "High-performance, asynchronous messaging library"
homepage "http://www.zeromq.org/"
url "https://github.com/zeromq/libzmq/releases/download/v4.3.0/zeromq-4.3.0.tar.gz"
sha256 "8e9c3af6dc5a8540b356697081303be392ade3f014615028b3c896d0148397fd"
bottle do
cellar :any
sha256 "ca0347dd904380b96c4889b323c9e93aeb845775462ff31f2ab00326be11ce76" => :mojave
sha256 "6e60d979c72767be92d568755e78fe59302dc25f35faf18254e1dee0b0516aef" => :high_sierra
sha256 "81f9934a2e44a726a3165aac985c33abad897657590800f1a9c8424e26ae3b32" => :sierra
end
head do
url "https://github.com/zeromq/libzmq.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "asciidoc" => :build
depends_on "pkg-config" => :build
depends_on "xmlto" => :build
def install
# Work around "error: no member named 'signbit' in the global namespace"
if MacOS.version == :high_sierra
ENV.delete("HOMEBREW_SDKROOT")
ENV.delete("SDKROOT")
end
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
ENV["LIBUNWIND_LIBS"] = "-framework System"
sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path
ENV["LIBUNWIND_CFLAGS"] = "-I#{sdk}/usr/include"
system "./autogen.sh" if build.head?
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <assert.h>
#include <zmq.h>
int main()
{
zmq_msg_t query;
assert(0 == zmq_msg_init_size(&query, 1));
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lzmq", "-o", "test"
system "./test"
end
end