Last active
January 31, 2017 23:12
-
-
Save tjvr/a8503e40ee5750cce49bf7686f557e79 to your computer and use it in GitHub Desktop.
Homebrew formula for Binaryen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Binaryen < Formula | |
desc "Compiler infrastructure and toolchain library for WebAssembly, in C++" | |
homepage "https://github.com/WebAssembly/binaryen" | |
url "https://github.com/WebAssembly/binaryen/archive/version_26.tar.gz" | |
head "https://github.com/WebAssembly/binaryen.git" | |
version "26" | |
sha256 "e78ff7ea4dbffa0d53084a0bc1ec8ed43445b674a02c17af798f3c0df13d418d" | |
depends_on "cmake" => :build | |
def install | |
system "cmake", ".", *std_cmake_args | |
# TODO brew audit complains (rightly) about the non-executable JS files we installed | |
system "make" | |
system "make", "install" | |
end | |
test do | |
(testpath/"hello-world.asm.js").write("function () { 'use asm'; function add(x, y) { x = x | 0; y = y | 0; return x + y | 0; } return { add: add }; }") | |
system "#{bin}/asm2wasm", "hello-world.asm.js" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment