Skip to content

Instantly share code, notes, and snippets.

@yacn
Created July 17, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yacn/79744a876ea4985b21a0ab7de69efea4 to your computer and use it in GitHub Desktop.
Save yacn/79744a876ea4985b21a0ab7de69efea4 to your computer and use it in GitHub Desktop.
librdkafka.rb 0.9.2.x formula
class Librdkafka < Formula
desc "The Apache Kafka C/C++ library"
homepage "https://github.com/edenhill/librdkafka"
url "https://github.com/edenhill/librdkafka/archive/v0.9.2.tar.gz"
sha256 "c243b66956ebb196510ee0efda67825467e31b93639d5f24eb082b5d83f56824"
head "https://github.com/edenhill/librdkafka.git"
bottle do
cellar :any
sha256 "033d6b22393921e086b3e96c321019994fff84c9d34ed8e6033d09d26406d0a0" => :sierra
sha256 "06052eff546aaf4b36a951913a231f606a921082bd94a0bfd2383197df25f1f7" => :el_capitan
sha256 "2f50d32d16bcde11957d514c8fb276df92e5c7a6ebe196c052aa9b61df602ec4" => :yosemite
end
depends_on "pkg-config" => :build
depends_on "lzlib"
depends_on "openssl"
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <librdkafka/rdkafka.h>
int main (int argc, char **argv)
{
int partition = RD_KAFKA_PARTITION_UA; /* random */
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lrdkafka", "-lz", "-lpthread", "-o", "test"
system "./test"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment