2014-04-15 13:15:49 +00:00
|
|
|
class Emscripten < Formula
|
2014-11-26 01:18:16 +00:00
|
|
|
homepage "https://kripken.github.io/emscripten-site/"
|
2015-01-10 17:45:41 +00:00
|
|
|
url "https://github.com/kripken/emscripten/archive/1.28.2.tar.gz"
|
|
|
|
sha1 "39f25db710874d835ac1ffe1941ef854a0a8f23a"
|
2014-04-15 13:15:49 +00:00
|
|
|
|
2014-05-08 08:52:56 +00:00
|
|
|
bottle do
|
2015-01-12 07:40:39 +00:00
|
|
|
sha1 "f73edf45833d349803c37f911eb3be78a8053a5c" => :yosemite
|
|
|
|
sha1 "d5c0dc65320975927bffe7bd38c59d6a07ae4f9b" => :mavericks
|
|
|
|
sha1 "50318165485dda92de1fea4ccbacc627a4762264" => :mountain_lion
|
2014-05-08 08:52:56 +00:00
|
|
|
end
|
|
|
|
|
2014-04-15 13:15:49 +00:00
|
|
|
head do
|
2014-09-05 00:49:29 +00:00
|
|
|
url "https://github.com/kripken/emscripten.git", :branch => "incoming"
|
|
|
|
|
2014-04-15 13:15:49 +00:00
|
|
|
resource "fastcomp" do
|
|
|
|
url "https://github.com/kripken/emscripten-fastcomp.git", :branch => "incoming"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "fastcomp-clang" do
|
|
|
|
url "https://github.com/kripken/emscripten-fastcomp-clang.git", :branch => "incoming"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
stable do
|
|
|
|
resource "fastcomp" do
|
2015-01-10 17:45:41 +00:00
|
|
|
url "https://github.com/kripken/emscripten-fastcomp/archive/1.28.2.tar.gz"
|
|
|
|
sha1 "967aa51c32b806ad15af3d8d61d66a004ada453d"
|
2014-04-15 13:15:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "fastcomp-clang" do
|
2015-01-10 17:45:41 +00:00
|
|
|
url "https://github.com/kripken/emscripten-fastcomp-clang/archive/1.28.2.tar.gz"
|
|
|
|
sha1 "87cdf58e83ef6bf0af813b336515ada52b124588"
|
2014-04-15 13:15:49 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-10-17 05:45:01 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
2014-04-15 13:15:49 +00:00
|
|
|
depends_on "node"
|
|
|
|
depends_on "closure-compiler" => :optional
|
|
|
|
depends_on "yuicompressor"
|
|
|
|
|
|
|
|
def install
|
2014-06-07 13:59:48 +00:00
|
|
|
# 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.
|
2014-07-21 02:32:04 +00:00
|
|
|
libexec.install Dir["*"]
|
2014-04-15 13:15:49 +00:00
|
|
|
|
|
|
|
(buildpath/"fastcomp").install resource("fastcomp")
|
|
|
|
(buildpath/"fastcomp/tools/clang").install resource("fastcomp-clang")
|
|
|
|
|
|
|
|
args = [
|
|
|
|
"--prefix=#{libexec}/llvm",
|
|
|
|
"--enable-optimized",
|
|
|
|
"--enable-targets=host,js",
|
|
|
|
"--disable-assertions",
|
|
|
|
"--disable-bindings",
|
|
|
|
]
|
|
|
|
|
|
|
|
cd "fastcomp" do
|
|
|
|
system "./configure", *args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
2014-06-13 16:41:54 +00:00
|
|
|
%w(em++ em-config emar emcc emcmake emconfigure emlink.py emmake
|
2014-06-07 13:59:48 +00:00
|
|
|
emranlib emrun emscons).each do |emscript|
|
|
|
|
bin.install_symlink libexec/emscript
|
2014-04-15 13:15:49 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{libexec}/llvm/bin/llvm-config", "--version"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2014-10-27 03:30:28 +00:00
|
|
|
Manually set LLVM_ROOT to
|
|
|
|
#{opt_libexec}/llvm/bin
|
2014-06-07 13:59:48 +00:00
|
|
|
in ~/.emscripten after running `emcc` for the first time.
|
2014-04-15 13:15:49 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|