Skip to content

Commit

Permalink
Merge branch 'branch/v0.1' of https://github.com/membraneframework/me…
Browse files Browse the repository at this point in the history
…mbrane_agora_plugin into branch/v0.1
  • Loading branch information
varsill committed Jan 8, 2024
2 parents bbf36bb + 2320e5e commit 05613d4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
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

{_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

0 comments on commit 05613d4

Please sign in to comment.