homebrew-core/Formula/ortp.rb

59 lines
1.9 KiB
Ruby

class Ortp < Formula
desc "Real-time transport protocol (RTP, RFC3550) library"
homepage "https://www.linphone.org/technical-corner/ortp/overview"
url "http://nongnu.askapache.com/linphone/ortp/sources/ortp-0.27.0.tar.gz"
sha256 "eb61a833ab3ad80978d7007411240f46e9b2d1034373b9d9dfaac88c1b6ec0af"
bottle do
sha256 "9413df03ab533dfd11891b57515dc70b2c7810f3fcc50b4df93c4e0e5c987412" => :high_sierra
sha256 "092e0d027dd6e1df83426ae5855aa6754122d845110fd4af868536996ca34fd8" => :sierra
sha256 "bc26e3f79e6d290f30631c84dff5bdeb4582d834c2a9bd9f0f6160a0730348dd" => :el_capitan
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "mbedtls"
resource "bctoolbox" do
url "https://github.com/BelledonneCommunications/bctoolbox/archive/0.6.0.tar.gz"
sha256 "299dedcf8f1edea79964314504f0d24e97cdf24a289896fc09bc69c38eb9f9be"
end
def install
resource("bctoolbox").stage do
args = std_cmake_args + %W[
-DCMAKE_INSTALL_PREFIX=#{libexec}
-DENABLE_TESTS_COMPONENT=OFF
]
system "cmake", ".", *args
system "make", "install"
end
libbctoolbox = (libexec/"lib/libbctoolbox.dylib").readlink
MachO::Tools.change_dylib_id("#{libexec}/lib/libbctoolbox.dylib",
"#{libexec}/lib/#{libbctoolbox}")
ENV.prepend_path "PKG_CONFIG_PATH", libexec/"lib/pkgconfig"
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include "ortp/logging.h"
#include "ortp/rtpsession.h"
#include "ortp/sessionset.h"
int main()
{
ORTP_PUBLIC void ortp_init(void);
return 0;
}
EOS
system ENV.cc, "-I#{include}", "-L#{lib}", "-lortp",
testpath/"test.c", "-o", "test"
system "./test"
end
end