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

Add ability to specify Agora's SDK build URL #12

Merged
merged 5 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 21 additions & 4 deletions bundlex.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,28 @@ defmodule Membrane.Agora.BundlexProject do
end

def project do
case get_target() do
%{os: "linux"} ->
System.shell("./install.sh")
url = case get_target() do
%{os: "linux", architecture: "x86_64"} ->
"https://download.agora.io/sdk/release/Agora-RTC-x86_64-linux-gnu-v3.8.202.20-20220627_152601-214165.tgz"

other_target ->
IO.warn("Agora's Server Gateway SDK is unavailable for this target: #{inspect(other_target)}")
url = System.get_env("AGORA_SDK_URL")
if url do
url
else
IO.warn("""
Agora's Server Gateway SDK build location unknown for target #{inspect(other_target)}.
You can pass the URL as AGORA_SDK_URL environmental variable.
""")
""
end
end
Comment on lines +16 to +31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply formatter


{_output, result} = System.shell("./install.sh #{url}")
if result != 0 do
IO.warn("""
Couldn't get SDK with the following URL: #{url}
""")
end

[
Expand Down
12 changes: 8 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#! /bin/bash

if ! test -d ./agora_sdk; then
wget https://download.agora.io/sdk/release/Agora-RTC-x86_64-linux-gnu-v3.8.202.20-20220627_152601-214165.tgz
tar xvf Agora-RTC-x86_64-linux-gnu-v3.8.202.20-20220627_152601-214165.tgz
rm Agora-RTC-x86_64-linux-gnu-v3.8.202.20-20220627_152601-214165.tgz
if [[ $1 == http* ]]; then
wget -qO- $1 | tar xvz
else
tar xvf $1
fi

mv agora_rtc_sdk/agora_sdk .
rm -r agora_rtc_sdk
rm -r agora_rtc_sdk

fi