2018-10-31 22:28:10 +00:00
|
|
|
class Libpulsar < Formula
|
|
|
|
desc "Apache Pulsar C++ library"
|
|
|
|
homepage "https://pulsar.apache.org/"
|
2019-02-21 06:32:16 +00:00
|
|
|
url "https://www.apache.org/dyn/closer.cgi?path=pulsar/pulsar-2.3.0/apache-pulsar-2.3.0-src.tar.gz"
|
|
|
|
sha256 "ac182c83f2fff03e8242cb9f9540d5ae2a32e3b9b382a2340f139dfa0bfb0a28"
|
2019-03-04 20:41:16 +00:00
|
|
|
revision 2
|
2018-10-31 22:28:10 +00:00
|
|
|
|
2019-01-10 02:18:31 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2019-03-21 03:14:25 +00:00
|
|
|
sha256 "4f4a0f80acd2be124172bb0667da8ff3b26a6a94320c2b59714af39665fd870a" => :mojave
|
|
|
|
sha256 "ce4426388c88d059802fdf7976c7a4e13fbfd62fa8ab310435fbff3b270a0df0" => :high_sierra
|
|
|
|
sha256 "bcf540fa7a12f291ed4e59476dc3288cda6a65d381d5348303e2640053a576c7" => :sierra
|
2019-01-10 02:18:31 +00:00
|
|
|
end
|
|
|
|
|
2018-10-31 22:28:10 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "boost"
|
|
|
|
depends_on "openssl"
|
|
|
|
depends_on "protobuf"
|
2019-02-21 06:32:16 +00:00
|
|
|
depends_on "zstd"
|
2018-10-31 22:28:10 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
cd "pulsar-client-cpp" do
|
|
|
|
system "cmake", ".", *std_cmake_args,
|
|
|
|
"-DBUILD_TESTS=OFF",
|
|
|
|
"-DBUILD_PYTHON_WRAPPER=OFF",
|
|
|
|
"-DBoost_INCLUDE_DIRS=#{Formula["boost"].include}",
|
|
|
|
"-DProtobuf_INCLUDE_DIR=#{Formula["protobuf"].include}",
|
|
|
|
"-DProtobuf_LIBRARIES=#{Formula["protobuf"].lib}/libprotobuf.dylib"
|
|
|
|
system "make", "pulsarShared", "pulsarStatic"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cc").write <<~EOS
|
|
|
|
#include <pulsar/Client.h>
|
|
|
|
|
|
|
|
int main (int argc, char **argv) {
|
|
|
|
pulsar::Client client("pulsar://localhost:6650");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
2019-02-21 06:32:16 +00:00
|
|
|
system ENV.cxx, "test.cc", "-L#{lib}", "-lpulsar", "-o", "test"
|
2018-10-31 22:28:10 +00:00
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|