Skip to content

Commit

Permalink
Start using Precompiled Dependency Provider (#33)
Browse files Browse the repository at this point in the history
* Start using Precompiled Dependency Provider
  • Loading branch information
Noarkhh authored Dec 14, 2023
1 parent 7b4e5ee commit 807fa8e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 34 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 @@ Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.
```elixir
def deps do
[
{:membrane_sdl_plugin, "~> 0.18.0"}
{:membrane_sdl_plugin, "~> 0.18.1"}
]
end
```
Expand Down
25 changes: 5 additions & 20 deletions bundlex.exs
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
defmodule Membrane.SDL.BundlexProject do
use Bundlex.Project

defp get_sdl2_url() do
url_prefix =
"https://github.com/membraneframework-precompiled/precompiled_sdl2/releases/latest/download/sdl2"

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

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

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

_other ->
nil
end
end

def project do
[
natives: natives()
Expand All @@ -32,7 +13,11 @@ defmodule Membrane.SDL.BundlexProject do
interface: :cnode,
sources: ["player.c"],
os_deps: [
{[get_sdl2_url(), :pkg_config], "SDL2"}
sdl2: [
{:precompiled, Membrane.PrecompiledDependencyProvider.get_dependency_url(:sdl2),
"SDL2"},
{:pkg_config, "SDL2"}
]
],
preprocessor: Unifex
]
Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.SDL.Plugin.MixProject do
use Mix.Project

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

def project do
Expand Down Expand Up @@ -59,6 +59,7 @@ defmodule Membrane.SDL.Plugin.MixProject do
{:membrane_common_c, "~> 0.16.0"},
{:membrane_raw_video_format, "~> 0.3.0"},
{:bundlex, "~> 1.2"},
{:membrane_precompiled_dependency_provider, "~> 0.1.0"},
# Testing
{:membrane_h264_ffmpeg_plugin, "~> 0.31.0", only: :test},
{:membrane_h264_plugin, "~> 0.9.0", only: :test},
Expand Down
Loading

0 comments on commit 807fa8e

Please sign in to comment.