Skip to content

Commit

Permalink
Updated wasm package to include wasm-wasi-component.
Browse files Browse the repository at this point in the history
This also requires a small patch to unit source code to fix FTBFS on an
older macOS version still used in github actions CI.
  • Loading branch information
thresheek committed Feb 27, 2024
1 parent 8b721e7 commit 0fd9151
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Formula/unit-wasm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ class UnitWasm < Formula
sha256 "4b5e9be3f3990fceabf06292c2b7853667aceb71fd8de5dc67cb7fb05d247a20"
head "https://github.com/nginx/unit.git", branch: "master"

depends_on "rust" => :build
depends_on "openssl"
depends_on "[email protected]"
depends_on "wasmtime"

# uname -o does not seem to exist on macOS 12.7 currently used in github actions
# which leads to FTBFS on that target
patch :DATA

def install
system "./configure",
"--prefix=#{prefix}",
Expand All @@ -33,5 +38,23 @@ def install
"--include-path=#{HOMEBREW_PREFIX}/usr/include/",
"--lib-path=#{HOMEBREW_PREFIX}/lib/"
system "make", "wasm-install"

system "./configure", "wasm-wasi-component"
system "make", "wasm-wasi-component-install"
end
end

__END__
diff --git a/auto/modules/wasm-wasi-component b/auto/modules/wasm-wasi-component
index bfb6ffcb..6c8258d7 100644
--- a/auto/modules/wasm-wasi-component
+++ b/auto/modules/wasm-wasi-component
@@ -82,7 +82,7 @@ fi
$echo " + $NXT_WCM_MODULE module: $NXT_WCM_MOD_NAME"


-NXT_OS=$(uname -o)
+NXT_OS=$(uname -s)

if [ $NXT_OS = "Darwin" ]; then
NXT_CARGO_CMD="cargo rustc --release --manifest-path src/wasm-wasi-component/Cargo.toml -- --emit link=target/release/libwasm_wasi_component.so -C link-args='-undefined dynamic_lookup'"

0 comments on commit 0fd9151

Please sign in to comment.