aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/emscripten.rb27
1 files changed, 14 insertions, 13 deletions
diff --git a/Library/Formula/emscripten.rb b/Library/Formula/emscripten.rb
index 0d58b7bd8..f0a3451d7 100644
--- a/Library/Formula/emscripten.rb
+++ b/Library/Formula/emscripten.rb
@@ -40,13 +40,16 @@ class Emscripten < Formula
depends_on "yuicompressor"
def install
- # note - OS X doesn't provide a python2 binary. Use the default python instead
- system "grep --null -rl '^#!/usr/bin/env python2$' . | xargs -0 sed -i '' 's,^#!/usr/bin/env python2$,#!/usr/bin/env python,'"
- system "grep --null -rl '^#!/usr/bin/python2$' . | xargs -0 sed -i '' 's,^#!/usr/bin/python2$,#!/usr/bin/python,'"
-
- # Note - as per documentation, _all_ files from the repository are
- # required, as emscripten is just a collection of scripts that need to
- # be installed in exactly the same layout as in the git repo
+ # OSX doesn't provide a "python2" binary so use "python" instead.
+ python2_shebangs = `grep --recursive --files-with-matches ^#!/usr/bin/.*python2$ #{buildpath}`
+ python2_shebang_files = python2_shebangs.lines.sort.uniq
+ python2_shebang_files.map! {|f| Pathname(f.chomp)}
+ python2_shebang_files.reject! &:symlink?
+ inreplace python2_shebang_files, %r{^(#!/usr/bin/.*python)2$}, "\\1"
+
+ # All files from the repository are required as emscripten is a collection
+ # of scripts which need to be installed in the same layout as in the Git
+ # repository.
libexec.install Dir['*']
(buildpath/"fastcomp").install resource("fastcomp")
@@ -66,21 +69,19 @@ class Emscripten < Formula
system "make", "install"
end
- emscripts = %w(em++ em-config emar emcc emconfigure emlink.py emmake emranlib emrun emscons)
-
- emscripts.each do |emscript|
- bin.install_symlink libexec/emscript
+ %w(em++ em-config emar emcc emconfigure emlink.py emmake
+ emranlib emrun emscons).each do |emscript|
+ bin.install_symlink libexec/emscript
end
end
test do
- # copied from the vanilla llvm formula
system "#{libexec}/llvm/bin/llvm-config", "--version"
end
def caveats; <<-EOS.undent
Manually set LLVM_ROOT to \"#{opt_prefix}/libexec/llvm/bin\"
- in ~/.emscripten after running emcc for the first time.
+ in ~/.emscripten after running `emcc` for the first time.
EOS
end
end