From eba20743064c8b79f4e733392cad5c350f08e6fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Fri, 5 Jan 2024 10:16:16 +0100 Subject: [PATCH 1/2] Add ability to specify Agora's SDK build URL (#12) * Add ability to specify Agora's SDK build URL * Update bundlex.exs * Add support for URLs being paths --------- Co-authored-by: Mateusz Front --- bundlex.exs | 25 +++++++++++++++++++++---- install.sh | 12 ++++++++---- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/bundlex.exs b/bundlex.exs index 97fd1e0..fcaca95 100644 --- a/bundlex.exs +++ b/bundlex.exs @@ -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 [ diff --git a/install.sh b/install.sh index 2648dbe..59ad79e 100755 --- a/install.sh +++ b/install.sh @@ -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 From 2320e5ea061049799820d28ef1a95fe40dc5ba7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Mon, 8 Jan 2024 14:23:31 +0100 Subject: [PATCH 2/2] Bump to v0.1.2 (#13) --- README.md | 2 +- mix.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 538a77f..e1f97a6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ docker run -it membraneframeworklabs/docker_membrane To use that plugin in your project, add the following line to your deps in `mix.exs`: ``` -{:membrane_agora_plugin, "~> 0.1.1"} +{:membrane_agora_plugin, "~> 0.1.2"} ``` Run `mix deps.get`. diff --git a/mix.exs b/mix.exs index bb112fd..8e4ba81 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.Agora.Mixfile do use Mix.Project - @version "0.1.1" + @version "0.1.2" @github_url "https://github.com/membraneframework/membrane_agora_plugin" def project do