Skip to content

neko 2.1.0 #982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 18 additions & 33 deletions Formula/neko.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
class Neko < Formula
desc "High-level, dynamically typed programming language"
homepage "http://nekovm.org"
# revision includes recent parameterized build targets for mac. Use a :tag
# on the next release
url "https://github.com/HaxeFoundation/neko.git", :revision => "22c49a89b56b9f106d7162710102e9475227e882"
version "2.0.0-22c49a8"
revision 2
url "http://nekovm.org/media/neko-2.1.0-src.tar.gz"
sha256 "0c93d5fe96240510e2d1975ae0caa9dd8eadf70d916a868684f66a099a4acf96"

head "https://github.com/HaxeFoundation/neko.git"

Expand All @@ -16,38 +13,26 @@ class Neko < Formula
sha256 "a45ce3f4eab713bea15f8b34045333462d3e6a971c10257b9789ffc8000951e2" => :mountain_lion
end

head do
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "mbedtls"
end

depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "mbedtls"
depends_on "bdw-gc"
depends_on "pcre"
depends_on "openssl"

def install
if build.head?
# Let cmake download its own copy of MariaDBConnector during build and statically link it.
# It is because there is no easy way to define we just need any one of mariadb, mariadb-connector-c,
# mysql, and mysql-connector-c.
system "cmake", ".", "-DSTATIC_DEPS=MariaDBConnector", "-DRUN_LDCONFIG=OFF", *std_cmake_args
system "make", "install"
else
# 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/*"]
patch do
# To workaround issue https://github.com/HaxeFoundation/neko/issues/130
# It is a commit already applied to the upstream.
url "https://github.com/HaxeFoundation/neko/commit/a8c71ad97faaccff6c6e9e09eba2d5efd022f8dc.patch"
sha256 "7bbdbd38f64220aa11fd1725ae99ea53f2d36563249f1828d5452562e3ca9977"
end

# Symlink into bin so libneko.dylib resolves correctly for custom prefix
%w[neko nekoc nekoml nekotools].each do |file|
bin.install_symlink neko/file
end
lib.install_symlink neko/"libneko.dylib"
end
def install
# Let cmake download its own copy of MariaDBConnector during build and statically link it.
# It is because there is no easy way to define we just need any one of mariadb, mariadb-connector-c,
# mysql, and mysql-connector-c.
system "cmake", ".", "-DSTATIC_DEPS=MariaDBConnector", "-DRELOCATABLE=OFF", "-DRUN_LDCONFIG=OFF", *std_cmake_args
system "make", "install"
end

def caveats
Expand All @@ -63,6 +48,6 @@ def caveats

test do
ENV["NEKOPATH"] = "#{HOMEBREW_PREFIX}/lib/neko"
system "#{bin}/neko", "#{HOMEBREW_PREFIX}/lib/neko/test.n"
system "#{bin}/neko", "-version"
end
end