Skip to content

Commit

Permalink
Add ability to specify Agora's SDK build URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Front authored and Mateusz Front committed Dec 7, 2023
1 parent b7e9dff commit ea24637
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
21 changes: 18 additions & 3 deletions bundlex.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,25 @@ defmodule Membrane.Agora.BundlexProject do

def project do
case get_target() do
%{os: "linux"} ->
System.shell("./install.sh")
%{os: "linux", architecture: :x86_64} ->
System.shell("./install.sh 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
{_output, result} = System.shell("./install.sh #{url}")
if result != 0 do
IO.warn("""
Couldn't fetch SDK from the following URL: #{url}
""")
end
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

[
Expand Down
4 changes: 1 addition & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#! /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
wget -qO- $1 | tar xvz
mv agora_rtc_sdk/agora_sdk .
rm -r agora_rtc_sdk
fi

0 comments on commit ea24637

Please sign in to comment.