Skip to content

Commit

Permalink
neko: fix HEAD.
Browse files Browse the repository at this point in the history
* Fixed neko head.
* neko: put the head dependencies in "head do"
  • Loading branch information
andyli authored and MikeMcQuaid committed Apr 21, 2016
1 parent ad136cc commit dc6f08e
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions Formula/neko.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,38 @@ 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 "bdw-gc"
depends_on "pcre"
depends_on "openssl"

def install
# Build requires targets to be built in specific order
ENV.deparallelize
system "make", "os=osx", "LIB_PREFIX=#{HOMEBREW_PREFIX}", "INSTALL_FLAGS="
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/*"]
include.install Dir["vm/neko*.h"]
neko = lib/"neko"
neko.install Dir["bin/*"]

# Symlink into bin so libneko.dylib resolves correctly for custom prefix
%w[neko nekoc nekoml nekotools].each do |file|
bin.install_symlink neko/file
# 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
lib.install_symlink neko/"libneko.dylib"
end

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

def caveats
Expand All @@ -51,4 +60,9 @@ def caveats
end
s
end

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

0 comments on commit dc6f08e

Please sign in to comment.