61 lines
1.9 KiB
Ruby
61 lines
1.9 KiB
Ruby
class Libexosip < Formula
|
|
desc "Toolkit for eXosip2"
|
|
homepage "https://savannah.nongnu.org/projects/exosip"
|
|
url "https://download.savannah.gnu.org/releases/exosip/libexosip2-5.1.0.tar.gz"
|
|
sha256 "41107e5bd6dca50899b7381f7f68bfd9ae8df584c534c8a4c9ca668b66a88a4b"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "d6b0db0936c9adf0f44c60ab85bef01e14185641a47146f747f9899c0dc8d2e4" => :mojave
|
|
sha256 "08d9015d8f44320adba9c3bc3b553d5dd2658b51ac48312e461e57db6ae9b7f3" => :high_sierra
|
|
sha256 "bddac62d46e048a3312ef181bd616f7d02bac8942a75f5ba3cbe9ae2da355a34" => :sierra
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "c-ares"
|
|
depends_on "libosip"
|
|
depends_on "openssl"
|
|
|
|
def install
|
|
# Extra linker flags are needed to build this on macOS. See:
|
|
# https://growingshoot.blogspot.com/2013/02/manually-install-osip-and-exosip-as.html
|
|
# Upstream bug ticket: https://savannah.nongnu.org/bugs/index.php?45079
|
|
ENV.append "LDFLAGS", "-framework CoreFoundation -framework CoreServices "\
|
|
"-framework Security"
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~EOS
|
|
#include <netinet/in.h>
|
|
#include <eXosip2/eXosip.h>
|
|
|
|
int main() {
|
|
struct eXosip_t *ctx;
|
|
int i;
|
|
int port = 35060;
|
|
|
|
ctx = eXosip_malloc();
|
|
if (ctx == NULL)
|
|
return -1;
|
|
|
|
i = eXosip_init(ctx);
|
|
if (i != 0)
|
|
return -1;
|
|
|
|
i = eXosip_listen_addr(ctx, IPPROTO_UDP, NULL, port, AF_INET, 0);
|
|
if (i != 0) {
|
|
eXosip_quit(ctx);
|
|
fprintf(stderr, "could not initialize transport layer\\n");
|
|
return -1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
EOS
|
|
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-leXosip2", "-o", "test"
|
|
system "./test"
|
|
end
|
|
end
|