2013-06-07 15:42:52 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Neko < Formula
|
|
|
|
homepage 'http://nekovm.org'
|
2013-10-01 17:24:10 +00:00
|
|
|
|
|
|
|
# revision includes recent parameterized build targets for mac. Use a :tag
|
|
|
|
# on the next release
|
2013-06-07 15:42:52 +00:00
|
|
|
url 'https://github.com/HaxeFoundation/neko.git', :revision => '6ab8f48a8dc62e4d917b599b3d8c8e10f764f839'
|
2013-10-01 17:24:10 +00:00
|
|
|
|
2013-06-07 15:42:52 +00:00
|
|
|
version '2.0.0-6ab8f48'
|
|
|
|
|
|
|
|
head 'https://github.com/HaxeFoundation/neko.git'
|
|
|
|
|
2014-03-04 14:56:20 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 "d72b7af1c8ae7c58c613df9883f27466bfcca60f" => :mavericks
|
|
|
|
sha1 "ad22cc3edca5ae05b663edf63d5cd496d3ad2b78" => :mountain_lion
|
|
|
|
sha1 "77daff389d401d6764d1082ecc3448afbe27fccd" => :lion
|
|
|
|
end
|
|
|
|
|
2013-06-07 15:42:52 +00:00
|
|
|
depends_on 'bdw-gc'
|
|
|
|
depends_on 'pcre'
|
|
|
|
|
|
|
|
def install
|
|
|
|
# Build requires targets to be built in specific order
|
|
|
|
ENV.deparallelize
|
|
|
|
system "make", "os=osx", "LIB_PREFIX=#{HOMEBREW_PREFIX}", "INSTALL_FLAGS="
|
|
|
|
|
|
|
|
include.install Dir['vm/neko*.h']
|
|
|
|
neko = lib/'neko'
|
|
|
|
neko.install Dir['bin/*']
|
|
|
|
|
|
|
|
# Symlink into bin so libneko.dylib resolves correctly for custom prefix
|
|
|
|
bin.mkpath
|
2013-08-12 23:47:48 +00:00
|
|
|
%w(neko nekoc nekoml nekotools).each do |file|
|
2013-06-07 15:42:52 +00:00
|
|
|
(bin/file).make_relative_symlink(neko/file)
|
|
|
|
end
|
2013-08-12 23:47:48 +00:00
|
|
|
(lib/'libneko.dylib').make_relative_symlink(neko/'libneko.dylib')
|
2013-06-07 15:42:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2013-08-12 23:47:48 +00:00
|
|
|
ENV["NEKOPATH"] = "#{HOMEBREW_PREFIX}/lib/neko"
|
2013-06-07 15:42:52 +00:00
|
|
|
system "#{bin}/neko", "#{HOMEBREW_PREFIX}/lib/neko/test.n"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
s = ''
|
2013-08-12 23:47:48 +00:00
|
|
|
if HOMEBREW_PREFIX.to_s != '/usr/local'
|
2013-06-07 15:42:52 +00:00
|
|
|
s << <<-EOS.undent
|
|
|
|
You must add the following line to your .bashrc or equivalent:
|
|
|
|
export NEKOPATH="#{HOMEBREW_PREFIX}/lib/neko"
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
s
|
|
|
|
end
|
|
|
|
end
|