Skip to content

Commit

Permalink
libserdes 5.3.1 (new formula)
Browse files Browse the repository at this point in the history
Add formula for libserdes, an Avro serialization/deserialization for
C/C++ with support for the Confluent Schema Registry.
  • Loading branch information
benesch committed Oct 23, 2019
1 parent a80abc0 commit 23a2c0c
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Formula/libserdes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class Libserdes < Formula
desc "Avro serialization/deserialization library for C/C++"
homepage "https://github.com/confluentinc/libserdes"
url "http://packages.confluent.io/deb/5.3/pool/main/c/confluent-libserdes/confluent-libserdes_5.3.1.orig.tar.gz"
sha256 "06bcb4066f6f13d2f4ece7987188c1feb9510c36bb5828e3283c267267c3d470"

depends_on "avro-c"
depends_on "jansson"
uses_from_macos "curl"

def install
system "./configure", "--prefix=#{prefix}"
system "make"
system "make", "install"
end

test do
(testpath/"test.c").write <<~EOS
#include <err.h>
#include <stddef.h>
#include <sys/types.h>
#include <libserdes/serdes.h>
int main()
{
char errstr[512];
serdes_conf_t *sconf = serdes_conf_new(NULL, 0, NULL);
serdes_t *serdes = serdes_new(sconf, errstr, sizeof(errstr));
if (serdes == NULL) {
errx(1, "constructing serdes: %s", errstr);
}
serdes_destroy(serdes);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lserdes", "-o", "test"
system "./test"
end
end

0 comments on commit 23a2c0c

Please sign in to comment.