aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorFabian Freyer2014-08-07 19:19:53 +0200
committerMike McQuaid2014-08-08 13:56:27 +0100
commit5efa7a6be49015e3b327da0a215b9b5d827a69fb (patch)
tree74ab93a8be54fa9d4017cce7368cdae4f8e64c38 /Library/Formula
parent6e647795393b3c7337a91d7d60570bf4bf0743e8 (diff)
downloadhomebrew-5efa7a6be49015e3b327da0a215b9b5d827a69fb.tar.bz2
libstrophe 0.8.5 (new formula)
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/libstrophe.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/Library/Formula/libstrophe.rb b/Library/Formula/libstrophe.rb
new file mode 100644
index 000000000..b2f204a24
--- /dev/null
+++ b/Library/Formula/libstrophe.rb
@@ -0,0 +1,52 @@
+require "formula"
+
+class Libstrophe < Formula
+ homepage "http://strophe.im/libstrophe/"
+ url "https://github.com/strophe/libstrophe/archive/0.8.5.tar.gz"
+ sha1 "11f80abb8e578c5bc446ff94603e7e0f560547f7"
+ head "https://github.com/strophe/libstrophe.git"
+
+ depends_on "autoconf" => :build
+ depends_on "automake" => :build
+ depends_on "pkg-config" => :build
+ depends_on "libtool" => :build
+ depends_on "openssl"
+ depends_on "check"
+
+ def install
+ # see https://github.com/strophe/libstrophe/issues/28
+ ENV.deparallelize
+
+ system "./bootstrap.sh"
+ system "./configure", "--disable-dependency-tracking",
+ "--disable-silent-rules",
+ "--prefix=#{prefix}"
+ system "make", "install"
+ end
+
+ test do
+ (testpath/'test.c').write <<-EOS.undent
+ #include <strophe.h>
+ #include <assert.h>
+
+ int main(void) {
+ xmpp_ctx_t *ctx;
+ xmpp_log_t *log;
+
+ xmpp_initialize();
+ log = xmpp_get_default_logger(XMPP_LEVEL_DEBUG);
+ assert(log);
+
+ ctx = xmpp_ctx_new(NULL, log);
+ assert(ctx);
+
+ xmpp_ctx_free(ctx);
+ xmpp_shutdown();
+ return 0;
+ }
+ EOS
+ flags = ["-I#{include}/", "-lstrophe"]
+ system ENV.cc, "-o", "test", "test.c", *(flags + ENV.cflags.split)
+ system "./test"
+ end
+end