67 lines
2.2 KiB
Ruby
67 lines
2.2 KiB
Ruby
class Ortp < Formula
|
|
desc "Real-time transport protocol (RTP, RFC3550) library"
|
|
homepage "https://www.linphone.org/technical-corner/ortp"
|
|
url "https://gitlab.linphone.org/BC/public/ortp/-/archive/4.5.13/ortp-4.5.13.tar.bz2"
|
|
sha256 "57083126b4435c403d827408903266bba922eabec0dac64c037b5d6aba4ed0ed"
|
|
license "GPL-3.0-or-later"
|
|
head "https://gitlab.linphone.org/BC/public/ortp.git"
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "fa8bae5fcd6a930bf99e9e01bda2ef67b3af5316ca4991a9b59882ab6a1bf6c5"
|
|
sha256 big_sur: "f00a002a02525c10e8ba8d47d6fe07b70a2c4065e66056735a5a3ba2de91859d"
|
|
sha256 catalina: "ccb38d638b93297930e67dca4332b01f9d70e9b6410247b1808f9226494bcd7b"
|
|
sha256 mojave: "7473eadec99209aa2b2cda6d81f658d6437157a28cfc168324babdc8475a9f31"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "mbedtls"
|
|
|
|
# bctoolbox appears to follow ortp's version. This can be verified at the GitHub mirror:
|
|
# https://github.com/BelledonneCommunications/bctoolbox
|
|
resource "bctoolbox" do
|
|
url "https://gitlab.linphone.org/BC/public/bctoolbox/-/archive/4.5.13/bctoolbox-4.5.13.tar.bz2"
|
|
sha256 "05510aae43ba23d3443d6380fd6a23627f9db0bf940209fc9f09934779383014"
|
|
end
|
|
|
|
def install
|
|
resource("bctoolbox").stage do
|
|
args = std_cmake_args.reject { |s| s["CMAKE_INSTALL_PREFIX"] } + %W[
|
|
-DCMAKE_INSTALL_PREFIX=#{libexec}
|
|
-DENABLE_TESTS_COMPONENT=OFF
|
|
]
|
|
system "cmake", ".", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
ENV.prepend_path "PKG_CONFIG_PATH", libexec/"lib/pkgconfig"
|
|
|
|
args = std_cmake_args + %W[
|
|
-DCMAKE_PREFIX_PATH=#{libexec}
|
|
-DCMAKE_C_FLAGS=-I#{libexec}/include
|
|
-DCMAKE_CXX_FLAGS=-I#{libexec}/include
|
|
-DENABLE_DOC=NO
|
|
]
|
|
mkdir "build" do
|
|
system "cmake", "..", *args
|
|
system "make", "install"
|
|
end
|
|
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}", "-I#{libexec}/include", "-L#{lib}", "-lortp",
|
|
testpath/"test.c", "-o", "test"
|
|
system "./test"
|
|
end
|
|
end
|