Package providing URLs for precompiled dependencies used by Membrane plugins.
The package can be installed by adding membrane_precompiled_dependency_provider
to your list of dependencies in mix.exs
:
def deps do
[
{:membrane_precompiled_dependency_provider, "~> 0.1.2"}
]
end
In most cases the package is intended to provide an URL to be used in your project's bundlex.exs
. This text will assume familiarity with Bundlex and it's mechanism of managing precompiled dependencies, so if you're not acquainted with it you can read about it here.
Dependencies that are fully located in a correctly structured repository in membraneframework-precompiled
github organization (details here) will be referred to as Generic. Otherwise they will be referred to as Non-generic.
The simplest example of natives/0
function in bundlex.exs
, where we have an :example
native that has an :example_dep
Generic dependency:
defp natives() do
[
example: [
interface: :nif,
sources: ["example.c"],
os_deps: [
example_dep:
[{
:precompiled,
Membrane.PrecompiledDependencyProvider.get_dependency_url(:example_dep)
}]
],
preprocessor: Unifex
]
]
Pool of dependencies offered by this package can be expanded with new ones, Generic and Non-generic, by modifying lib/membrane_precompiled_dependency_provider.ex
appropriately.
To add any dependency start by adding it's name as one of possible values of precompiled_dependencies()
type:
@type precompiled_dependency() :: ... | :example_dep
When the dependency is Generic (is present on membraneframework-precompiled
) that is all you need to do.
When the precompiled builds of a dependency are already hosted somewhere else they can be added as a Non-generic dependency.
To achieve this create a clause of get_non_generic_dep_url/2
that pattern-matches on your dependency's name and returns an URL appropriate for the passed target:
defp get_non_generic_dep_url(:example_non_generic_dep, target) do
...
end
For an example see implementation for :ffmpeg
.
Copyright 2023, Software Mansion
Licensed under the Apache License, Version 2.0