diff options
| author | David Peek | 2013-06-08 01:42:52 +1000 |
|---|---|---|
| committer | Samuel John | 2013-08-12 18:34:30 +0200 |
| commit | aaf918ee823e9acfbf4bc5eda8337b76b9010a36 (patch) | |
| tree | 25f87b62891926a1388c0c1dc5aabdd6d3f36475 /Library/Formula | |
| parent | a6da4f056c63d12699f97503fb09321fdeddc02c (diff) | |
| download | homebrew-aaf918ee823e9acfbf4bc5eda8337b76b9010a36.tar.bz2 | |
neko 2.0.0-6ab8f48
Closes #20329.
Signed-off-by: Samuel John <github@SamuelJohn.de>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/neko.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Library/Formula/neko.rb b/Library/Formula/neko.rb new file mode 100644 index 000000000..99030b2be --- /dev/null +++ b/Library/Formula/neko.rb @@ -0,0 +1,49 @@ +require 'formula' + +class Neko < Formula + homepage 'http://nekovm.org' + url 'https://github.com/HaxeFoundation/neko.git', :revision => '6ab8f48a8dc62e4d917b599b3d8c8e10f764f839' + version '2.0.0-6ab8f48' + + head 'https://github.com/HaxeFoundation/neko.git' + + 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=" + + lib.install 'bin/libneko.dylib' + 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 + for file in ['neko', 'nekoc', 'nekoml', 'nekotools'] do + (bin/file).make_relative_symlink(neko/file) + end + end + + def custom_prefix? + HOMEBREW_PREFIX.to_s != '/usr/local' + end + + test do + ENV["NEKOPATH"] = "#{HOMEBREW_PREFIX}/lib/neko" if custom_prefix? + system "#{bin}/neko", "#{HOMEBREW_PREFIX}/lib/neko/test.n" + end + + def caveats + s = '' + if custom_prefix? + 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 |
