Packages

Idiomatic Elixir wrapper over the wa_embedder WebAssembly-to-BEAM compiler (the Erlang :wa_embedder core). Compiles a .wasm binary into a native BEAM module and raises %WaEmbedder.ImportError{} on unsatisfiable imports.

Current section

Files

Jump to
Raw

mix.exs

defmodule WaEmbedderEx.MixProject do
use Mix.Project
@version "0.1.0"
@source_url "https://nest.pijul.com/couchemar/wa_embedder"
def project do
[
app: :wa_embedder_ex,
version: @version,
elixir: "~> 1.12",
start_permanent: Mix.env() == :prod,
deps: deps(),
description: description(),
package: package(),
docs: docs(),
name: "WaEmbedderEx",
source_url: @source_url
]
end
def application do
[
extra_applications: [:logger, :crypto]
]
end
# The compiler core (`:wa_embedder`) is a separate hex package built with
# rebar3. Locally it lives in the parent directory (the repo root); set
# WA_EMBEDDER_PATH (the nix dev shell sets it to "..") to build against the
# sibling source instead of the published release. The core transitively
# pulls the Erlang `:wa_parser` package — this wrapper does NOT depend on
# `wa_parser_ex`.
defp deps do
core =
case System.get_env("WA_EMBEDDER_PATH") do
nil -> {:wa_embedder, "~> 0.1.0"}
path -> {:wa_embedder, path: path, manager: :rebar3, override: true}
end
[
core,
{:ex_doc, "~> 0.34", only: :dev, runtime: false}
]
end
defp description do
"Idiomatic Elixir wrapper over the wa_embedder WebAssembly-to-BEAM compiler " <>
"(the Erlang :wa_embedder core). Compiles a .wasm binary into a native BEAM " <>
"module and raises %WaEmbedder.ImportError{} on unsatisfiable imports."
end
defp package do
[
licenses: ["Unlicense"],
links: %{
"Pijul" => @source_url,
"Core (Erlang)" => "https://hex.pm/packages/wa_embedder"
},
files: ~w(lib mix.exs README.md UNLICENSE .formatter.exs)
]
end
defp docs do
[
main: "readme",
extras: ["README.md", "UNLICENSE"]
]
end
end