crystal: 0.31.1

This commit is contained in:
Brian J. Cardiff 2019-09-27 17:54:22 -03:00 committed by Rui Chen
parent 5c451ec02b
commit 0c9cfcceac
2 changed files with 10 additions and 33 deletions

View file

@ -3,6 +3,7 @@ class BdwGc < Formula
homepage "https://www.hboehm.info/gc/"
url "https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz"
sha256 "436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d"
revision 1
bottle do
cellar :any
@ -21,6 +22,12 @@ class BdwGc < Formula
depends_on "libatomic_ops" => :build
depends_on "pkg-config" => :build
patch do
# Required for v8.0.4. Support for green threads.
url "https://github.com/ivmai/bdwgc/commit/5668de71107022a316ee967162bc16c10754b9ce.patch"
sha256 "784ade9fe1c2668db77a3c08cd195cd7701331bdf8c9d160038cfce099b77e37"
end
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-debug",

View file

@ -1,11 +1,10 @@
class Crystal < Formula
desc "Fast and statically typed, compiled language with Ruby-like syntax"
homepage "https://crystal-lang.org/"
revision 1
stable do
url "https://github.com/crystal-lang/crystal/archive/0.31.0.tar.gz"
sha256 "483ffcdce30b98f89b8c6cf6e48c62652cd0450205f609e04721a37997c32486"
url "https://github.com/crystal-lang/crystal/archive/0.31.1.tar.gz"
sha256 "b4a51164763b891572492e2445d3a69b462675184ea0ccf06fcc57a070f07b80"
resource "shards" do
url "https://github.com/crystal-lang/shards/archive/v0.8.1.tar.gz"
@ -27,11 +26,7 @@ class Crystal < Formula
end
end
depends_on "autoconf" => :build # for building bdw-gc
depends_on "automake" => :build # for building bdw-gc
depends_on "libatomic_ops" => :build # for building bdw-gc
depends_on "libtool" => :build # for building bdw-gc
depends_on "bdw-gc"
depends_on "gmp" # std uses it but it's not linked
depends_on "libevent"
depends_on "libyaml"
@ -39,18 +34,6 @@ class Crystal < Formula
depends_on "pcre"
depends_on "pkg-config" # @[Link] will use pkg-config if available
# Crystal uses an extended version of bdw-gc to handle multi-threading
resource "bdw-gc" do
url "https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz"
sha256 "436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d"
# extension to handle multi-threading
patch :p1 do
url "https://raw.githubusercontent.com/crystal-lang/distribution-scripts/ab683792f34c60159f0e697adf792ff5b0fcbf91/linux/files/feature-thread-stackbottom.patch"
sha256 "acbae8cfe10e3efac403a629490cfd05e809554d23e9c3a88acddbb66f8ef7e0"
end
end
resource "boot" do
url "https://github.com/crystal-lang/crystal/releases/download/0.30.1/crystal-0.30.1-1-darwin-x86_64.tar.gz"
version "0.30.1-1"
@ -65,20 +48,8 @@ class Crystal < Formula
end
ENV["CRYSTAL_CONFIG_PATH"] = prefix/"src:lib"
ENV["CRYSTAL_CONFIG_LIBRARY_PATH"] = prefix/"embedded/lib"
ENV.append_path "PATH", "boot/bin"
resource("bdw-gc").stage(buildpath/"gc")
cd(buildpath/"gc") do
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-shared",
"--enable-large-config"
system "make"
end
ENV.prepend_path "CRYSTAL_LIBRARY_PATH", buildpath/"gc/.libs"
# Build crystal
(buildpath/".build").mkpath
system "make", "deps"
@ -104,7 +75,6 @@ class Crystal < Formula
bin.install ".build/shards"
bin.install ".build/crystal"
prefix.install "src"
(prefix/"embedded/lib").install "#{buildpath/"gc"}/.libs/libgc.a"
bash_completion.install "etc/completion.bash" => "crystal"
zsh_completion.install "etc/completion.zsh" => "_crystal"