Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediamtx 1.9.2 #193130

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions Formula/m/mediamtx.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
class Mediamtx < Formula
desc "Zero-dependency real-time media server and media proxy"
homepage "https://github.com/bluenviron/mediamtx"
url "https://github.com/bluenviron/mediamtx/archive/refs/tags/v1.9.1.tar.gz"
sha256 "96df7d7dd5362b6971eadcd07d738810d2a3e993ea49b71a7f41c46b43b0a17e"
# need to use the tag to generate the version info
url "https://github.com/bluenviron/mediamtx.git",
tag: "v1.9.2",
revision: "32d3fc55ccc631ad125462063b7bf387595209fe"
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
license "MIT"

bottle do
Expand All @@ -18,9 +20,7 @@ class Mediamtx < Formula

def install
system "go", "generate", "./..."

ldflags = "-s -w -X github.com/bluenviron/mediamtx/internal/core.version=#{version}"
system "go", "build", *std_go_args(ldflags:)
system "go", "build", *std_go_args(ldflags: "-s -w")

# Install default config
(etc/"mediamtx").install "mediamtx.yml"
Expand All @@ -39,10 +39,13 @@ def post_install
end

test do
assert_equal version, shell_output(bin/"mediamtx --version")
port = free_port

# version report has some issue, https://github.com/bluenviron/mediamtx/issues/3846
assert_match version.to_s, shell_output("#{bin}/mediamtx --help")

mediamtx_api = "127.0.0.1:#{free_port}"
mediamtx = fork do
mediamtx_api = "127.0.0.1:#{port}"
pid = fork do
exec({ "MTX_API" => "yes", "MTX_APIADDRESS" => mediamtx_api }, bin/"mediamtx", etc/"mediamtx/mediamtx.yml")
end
sleep 3
Expand All @@ -51,7 +54,7 @@ def post_install
curl_output = shell_output("curl --silent http://#{mediamtx_api}/v3/config/global/get")
assert_match "\"apiAddress\":\"#{mediamtx_api}\"", curl_output
ensure
Process.kill("TERM", mediamtx)
Process.wait mediamtx
Process.kill("TERM", pid)
Process.wait pid
end
end
Loading