2019-09-18 16:55:51 +00:00
|
|
|
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",
|
2019-12-28 16:27:42 +00:00
|
|
|
:tag => "v5.3.1",
|
|
|
|
:revision => "b259d15f68dce65591700b0ccccb73311db1de3d"
|
|
|
|
head "https://github.com/confluentinc/libserdes.git"
|
2019-09-18 16:55:51 +00:00
|
|
|
|
|
|
|
bottle do
|
|
|
|
cellar :any
|
2019-12-28 17:35:05 +00:00
|
|
|
rebuild 1
|
|
|
|
sha256 "b67057508abef7929928eeb8971528d72d09a139e6a3c873d27c01b3fd205227" => :catalina
|
|
|
|
sha256 "0502e2247ba623241c2955b9a85114a621400b961765fa02135f806ba79c2c77" => :mojave
|
|
|
|
sha256 "d8f5c959838343a7368798b33cb741fbdbb8a67afbcb4d2acbc94e5098dc19f6" => :high_sierra
|
2019-09-18 16:55:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
depends_on "avro-c"
|
2019-12-28 16:27:42 +00:00
|
|
|
depends_on "jansson"
|
|
|
|
uses_from_macos "curl"
|
2019-09-18 16:55:51 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system "./configure", "--prefix=#{prefix}"
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<~EOS
|
2019-12-28 16:27:42 +00:00
|
|
|
#include <err.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <libserdes/serdes.h>
|
2019-09-18 16:55:51 +00:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2019-12-28 16:27:42 +00:00
|
|
|
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);
|
2019-09-18 16:55:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
2019-12-28 16:27:42 +00:00
|
|
|
system ENV.cc, "test.c", "-L#{lib}", "-lserdes", "-o", "test"
|
2019-09-18 16:55:51 +00:00
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|