Skip to content

Instantly share code, notes, and snippets.

@mikesparr
Created May 26, 2016 20:37
Show Gist options
  • Save mikesparr/164c4dec9e37ad78d3b0ffcbad12909c to your computer and use it in GitHub Desktop.
Save mikesparr/164c4dec9e37ad78d3b0ffcbad12909c to your computer and use it in GitHub Desktop.
Updated Homebrew formula for librdkafka so you can install confluent-kafka Python client via PIP (requires > 0.9.01)
class Librdkafka < Formula
desc "The Apache Kafka C/C++ library"
homepage "https://github.com/edenhill/librdkafka"
url "https://github.com/edenhill/librdkafka/archive/0.9.1.tar.gz"
sha256 "5ad57e0c9a4ec8121e19f13f05bacc41556489dfe8f46ff509af567fdee98d82"
#bottle do
# cellar :any
# sha256 "63b97ce272e07632f10e33a7963f291bf1a0457f0823d4ab4bdce01eb3e65bbe" => :el_capitan
# sha256 "ffa2e218bbd43230c3a999b3adb7f4e08f132a15fa43ae552dd7692874834f91" => :yosemite
# sha256 "bc601cb49f68155fd4a6f6ef67c5030fb59766d0c86701a284419a4256f640f8" => :mavericks
#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