Skip to content

Commit

Permalink
emscripten: update post_install
Browse files Browse the repository at this point in the history
Closes #96406.

Signed-off-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
  • Loading branch information
carlocab authored and BrewTestBot committed Mar 8, 2022
1 parent 57fdf3e commit 6859664
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Formula/emscripten.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,12 @@ def install
end

def post_install
system bin/"emcc", "--check"
if File.exist?(libexec/".emscripten") && !File.exist?(libexec/".homebrew")
touch libexec/".homebrew"
inreplace "#{libexec}/.emscripten" do |s|
s.gsub!(/^(LLVM_ROOT.*)/, "#\\1\nLLVM_ROOT = \"#{opt_libexec}/llvm/bin\"\\2")
s.gsub!(/^(BINARYEN_ROOT.*)/, "#\\1\nBINARYEN_ROOT = \"#{opt_libexec}/binaryen\"\\2")
end
return if (libexec/".emscripten").exist?

system bin/"emcc", "--generate-config"
inreplace libexec/".emscripten" do |s|
s.gsub!(/^(LLVM_ROOT.*)/, "#\\1\nLLVM_ROOT = \"#{libexec}/llvm/bin\"\\2")
s.gsub!(/^(BINARYEN_ROOT.*)/, "#\\1\nBINARYEN_ROOT = \"#{libexec}/binaryen\"\\2")
end
end

Expand Down

0 comments on commit 6859664

Please sign in to comment.