From 6a3bb6380228189dad28b030f85c4974df84eccf Mon Sep 17 00:00:00 2001 From: Dave Thomas Date: Wed, 18 Sep 2019 09:55:51 -0700 Subject: [PATCH] serdes 5.3.1 (new formula) Closes #44391. Signed-off-by: FX Coudert --- Formula/kafkacat.rb | 6 ++++-- Formula/libserdes.rb | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 Formula/libserdes.rb diff --git a/Formula/kafkacat.rb b/Formula/kafkacat.rb index 022c88e009..e477a660cc 100644 --- a/Formula/kafkacat.rb +++ b/Formula/kafkacat.rb @@ -13,12 +13,14 @@ class Kafkacat < Formula sha256 "e09845976996cd838656e0065309e06f65e8446e1f0eb01f471bda2da36553ed" => :sierra end - depends_on "librdkafka" + depends_on "avro-c" + depends_on "libserdes" depends_on "yajl" def install system "./configure", "--prefix=#{prefix}", - "--enable-json" + "--enable-json", + "--enable-avro" system "make" system "make", "install" end diff --git a/Formula/libserdes.rb b/Formula/libserdes.rb new file mode 100644 index 0000000000..56ef485b8b --- /dev/null +++ b/Formula/libserdes.rb @@ -0,0 +1,41 @@ +class Libserdes < Formula + desc "Schema ser/deserializer lib for Avro + Confluent Schema Registry" + homepage "https://github.com/confluentinc/libserdes" + url "https://github.com/confluentinc/libserdes.git", + :tag => "v5.3.1", + :revision => "b259d15f68dce65591700b0ccccb73311db1de3d" + + bottle do + cellar :any + end + + depends_on "avro-c" + depends_on "librdkafka" + + def install + system "./configure", "--prefix=#{prefix}" + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~EOS + #include + #include + #include + #include + #include + #include + #include + + int main() + { + rd_kafka_conf_t *rk_conf; + rk_conf = rd_kafka_conf_new(); + return 0; + } + EOS + system ENV.cc, "test.c", "-I#{include}/libserdes", "-L/usr/local/lib/", "-L#{lib}", "-lrdkafka", "-lserdes", "-o", "test" + system "./test" + end +end