Skip to content

Commit

Permalink
disable precompilation, fix pkg-config name on Mac arm (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-hek authored Oct 13, 2023
1 parent d4caaab commit 379519b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The plugin that captures and plays sound using the multiplatform PortAudio libra
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.

```elixir
{:membrane_portaudio_plugin, "~> 0.17.0"}
{:membrane_portaudio_plugin, "~> 0.17.1"}
```

This package depends on the [PortAudio](http://portaudio.com/) library. The precompiled build will be pulled and linked automatically. However, should there be any problems, consider installing it manually.
Expand Down
14 changes: 7 additions & 7 deletions bundlex.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ defmodule Membrane.PortAudio.BundlexProject do
]
end

defp get_portaudio_url() do
defp get_portaudio() do
url_prefix =
"https://github.com/membraneframework-precompiled/precompiled_portaudio/releases/latest/download/portaudio"

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

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

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

_other ->
nil
{[:pkg_config], "portaudio"}
end
end

Expand All @@ -32,14 +32,14 @@ defmodule Membrane.PortAudio.BundlexProject do
interface: :nif,
deps: [membrane_common_c: [:membrane, :membrane_ringbuffer], unifex: :unifex],
sources: ["sink.c", "pa_helper.c"],
os_deps: [{[get_portaudio_url(), :pkg_config], "portaudio"}],
os_deps: [get_portaudio()],
preprocessor: Unifex
],
source: [
interface: :nif,
deps: [membrane_common_c: :membrane, unifex: :unifex],
sources: ["source.c", "pa_helper.c"],
os_deps: [{[get_portaudio_url(), :pkg_config], "portaudio"}],
os_deps: [get_portaudio()],
preprocessor: Unifex
]
]
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Membrane.PortAudio.Mixfile do
use Mix.Project

@github_url "https://github.com/membraneframework/membrane_portaudio_plugin"
@version "0.17.0"
@version "0.17.1"

def project do
[
Expand Down

0 comments on commit 379519b

Please sign in to comment.