+ +
b0d80ca chore(release): bump version to v0.2.2 and finalize release docs/docker
saifmukhtar · 2026-11-25
ruby · 48 lines · 1.8 KB
main
| 1 | class Openavx < Formula |
| 2 | desc "Open Audio-Video eXchange (OpenAVX) C99 high-performance IP streaming suite" |
| 3 | homepage "https://github.com/saifmukhtar/openavx" |
| 4 | url "https://github.com/saifmukhtar/openavx/archive/refs/tags/v0.2.2.tar.gz" |
| 5 | sha256 "SKIP" # TODO: set tarball sha256 once v0.2.2 tag is published |
| 6 | license "AGPL-3.0-or-later WITH Classpath-exception-2.0" |
| 7 | head "https://github.com/saifmukhtar/openavx.git", branch: "main" |
| 8 | |
| 9 | depends_on "cmake" => :build |
| 10 | |
| 11 | def install |
| 12 | args = std_cmake_args + %w[ |
| 13 | -DCMAKE_BUILD_TYPE=Release |
| 14 | -DBUILD_TESTING=ON |
| 15 | ] |
| 16 | |
| 17 | system "cmake", "-S", ".", "-B", "build", *args |
| 18 | system "cmake", "--build", "build" |
| 19 | system "ctest", "--test-dir", "build", "--output-on-failure" |
| 20 | system "cmake", "--install", "build" |
| 21 | end |
| 22 | |
| 23 | service do |
| 24 | run [opt_bin/"openavx-discovery-server", "--port", "7959"] |
| 25 | keep_alive true |
| 26 | log_path var/"log/openavx-discovery-server.log" |
| 27 | error_log_path var/"log/openavx-discovery-server.err" |
| 28 | end |
| 29 | |
| 30 | test do |
| 31 | assert_match "OpenAVX CLI", shell_output("#{bin}/openavx --help") |
| 32 | assert_match "OpenAVX Network Source Finder", shell_output("#{bin}/openavx-find --help") |
| 33 | assert_match "OpenAVX Test Pattern Generator", shell_output("#{bin}/openavx-test-pattern --help") |
| 34 | assert_match "OpenAVX Web & RTSP Gateway", shell_output("#{bin}/openavx-gateway --help") |
| 35 | assert_match "OpenAVX Standalone Discovery Server Daemon", shell_output("#{bin}/openavx-discovery-server --help") |
| 36 | |
| 37 | (testpath/"test.c").write <<~EOS |
| 38 | #include <openavx.h> |
| 39 | #include <stdio.h> |
| 40 | int main(void) { |
| 41 | printf("OpenAVX version: %s\\n", oavx_version()); |
| 42 | return 0; |
| 43 | } |
| 44 | EOS |
| 45 | system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-Wl,-rpath,#{lib}", "-lopenavx", "-o", "test" |
| 46 | assert_match "openavx v0.2.2", shell_output("./test") |
| 47 | end |
| 48 | end |