Skip to content

Commit

Permalink
neko 2.1.0
Browse files Browse the repository at this point in the history
Closes #982.

Signed-off-by: Martin Afanasjew <[email protected]>
  • Loading branch information
andyli authored and UniqMartin committed May 12, 2016
1 parent 65f1d0b commit 8292d2e
Showing 1 changed file with 18 additions and 33 deletions.
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

0 comments on commit 8292d2e

Please sign in to comment.