Skip to content

Commit

Permalink
Fix bundlex and unifex dependency (#49)
Browse files Browse the repository at this point in the history
* Fix bundlex and unifex dependency

* Update README.md

* update to bundlex new API
  • Loading branch information
mat-hek authored Nov 27, 2023
1 parent f6f646e commit 6e5da11
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The package can be installed by adding `membrane_aac_fdk_plugin` to your list of
```elixir
def deps do
[
{:membrane_aac_fdk_plugin, "~> 0.18.0"}
{:membrane_aac_fdk_plugin, "~> 0.18.1"}
]
end
```
Expand Down
31 changes: 17 additions & 14 deletions bundlex.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,42 @@ defmodule Membrane.AAC.FDK.BundlexProject do
]
end

defp get_fdk_aac_url() do
defp get_fdk_aac() do
url_prefix =
"https://github.com/membraneframework-precompiled/precompiled_fdk_aac/releases/latest/download/fdk-aac"

case Bundlex.get_target() do
%{os: "linux"} ->
{:precompiled, "#{url_prefix}_linux.tar.gz"}
url =
case Bundlex.get_target() do
%{os: "linux"} ->
"#{url_prefix}_linux.tar.gz"

%{architecture: "x86_64", os: "darwin" <> _rest_of_os_name} ->
{:precompiled, "#{url_prefix}_macos_intel.tar.gz"}
%{architecture: "x86_64", os: "darwin" <> _rest_of_os_name} ->
"#{url_prefix}_macos_intel.tar.gz"

%{architecture: "aarch64", os: "darwin" <> _rest_of_os_name} ->
{:precompiled, "#{url_prefix}_macos_arm.tar.gz"}
%{architecture: "aarch64", os: "darwin" <> _rest_of_os_name} ->
"#{url_prefix}_macos_arm.tar.gz"

_other ->
nil
end
_other ->
nil
end

[{:precompiled, url}, :pkg_config]
end

def natives() do
defp natives() do
[
decoder: [
interface: :nif,
deps: [membrane_common_c: :membrane],
sources: ["decoder.c"],
os_deps: [{[get_fdk_aac_url(), :pkg_config], "fdk-aac"}],
os_deps: ["fdk-aac": get_fdk_aac()],
preprocessor: Unifex
],
encoder: [
interface: :nif,
deps: [membrane_common_c: :membrane],
sources: ["encoder.c"],
os_deps: [{[get_fdk_aac_url(), :pkg_config], "fdk-aac"}],
os_deps: ["fdk-aac": get_fdk_aac()],
preprocessor: Unifex
]
]
Expand Down
6 changes: 3 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.AAC.FDK.Plugin.MixProject do
use Mix.Project

@version "0.18.0"
@version "0.18.1"
@github_url "https://github.com/membraneframework/membrane_aac_fdk_plugin"

def project do
Expand Down Expand Up @@ -58,8 +58,8 @@ defmodule Membrane.AAC.FDK.Plugin.MixProject do
{:bunch, "~> 1.4"},
{:membrane_core, "~> 1.0"},
{:membrane_common_c, "~> 0.16.0"},
{:unifex, "~> 1.1.0"},
{:bundlex, "~> 1.2.0"},
{:unifex, "~> 1.1"},
{:bundlex, "~> 1.3"},
{:membrane_raw_audio_format, "~> 0.12.0"},
{:membrane_aac_format, "~> 0.8.0"},
{:membrane_file_plugin, "~> 0.16.0", only: :test},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"bimap": {:hex, :bimap, "1.3.0", "3ea4832e58dc83a9b5b407c6731e7bae87458aa618e6d11d8e12114a17afa4b3", [:mix], [], "hexpm", "bf5a2b078528465aa705f405a5c638becd63e41d280ada41e0f77e6d255a10b4"},
"bunch": {:hex, :bunch, "1.6.0", "4775f8cdf5e801c06beed3913b0bd53fceec9d63380cdcccbda6be125a6cfd54", [:mix], [], "hexpm", "ef4e9abf83f0299d599daed3764d19e8eac5d27a5237e5e4d5e2c129cfeb9a22"},
"bunch_native": {:hex, :bunch_native, "0.5.0", "8ac1536789a597599c10b652e0b526d8833348c19e4739a0759a2bedfd924e63", [:mix], [{:bundlex, "~> 1.0", [hex: :bundlex, repo: "hexpm", optional: false]}], "hexpm", "24190c760e32b23b36edeb2dc4852515c7c5b3b8675b1a864e0715bdd1c8f80d"},
"bundlex": {:hex, :bundlex, "1.2.0", "a89869208a019376a38e8a10e1bd573dcbeae8addd381c2cd74e2817010bef8f", [:mix], [{:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.5", [hex: :qex, repo: "hexpm", optional: false]}, {:req, "~> 0.4.0", [hex: :req, repo: "hexpm", optional: false]}, {:secure_random, "~> 0.5", [hex: :secure_random, repo: "hexpm", optional: false]}, {:zarex, "~> 1.0", [hex: :zarex, repo: "hexpm", optional: false]}], "hexpm", "d2182b91a2a53847baadf4745ad2291853e786ad28671f474a611e7703dbca9b"},
"bundlex": {:hex, :bundlex, "1.3.1", "5791b4037df961f092eac9a51d8df91030a80381e442e580a3f4d82c9e5d34f0", [:mix], [{:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.5", [hex: :qex, repo: "hexpm", optional: false]}, {:req, "~> 0.4.0", [hex: :req, repo: "hexpm", optional: false]}, {:secure_random, "~> 0.5", [hex: :secure_random, repo: "hexpm", optional: false]}, {:zarex, "~> 1.0", [hex: :zarex, repo: "hexpm", optional: false]}], "hexpm", "9651ddc7e627dd1bd0eed9aaaba3de8b4bbc06c10980089f7276cdb82bb3fc51"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"castore": {:hex, :castore, "1.0.4", "ff4d0fb2e6411c0479b1d965a814ea6d00e51eb2f58697446e9c41a97d940b28", [:mix], [], "hexpm", "9418c1b8144e11656f0be99943db4caf04612e3eaecefb5dae9a2a87565584f8"},
"coerce": {:hex, :coerce, "1.0.1", "211c27386315dc2894ac11bc1f413a0e38505d808153367bd5c6e75a4003d096", [:mix], [], "hexpm", "b44a691700f7a1a15b4b7e2ff1fa30bebd669929ac8aa43cffe9e2f8bf051cf1"},
Expand Down

0 comments on commit 6e5da11

Please sign in to comment.