Skip to content

Commit

Permalink
crystal-lang: vendor libevent 2.0.22 during the build
Browse files Browse the repository at this point in the history
The crystal-lang bootstrap binary is linked against our libevent 2.0.22,
so this will unblock the libevent 2.1.8 PR.

Closes #9389.

Signed-off-by: Tomasz Pajor <tomek@polishgeeks.com>
  • Loading branch information
ilovezfs authored and nijikon committed Jan 29, 2017
1 parent 12472b3 commit 10b0200
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Formula/crystal-lang.rb
Expand Up @@ -33,9 +33,29 @@ class CrystalLang < Formula
sha256 "31de819c66518479682ec781a39ef42c157a1a8e6e865544194534e2567cb110"
end

resource "libevent-2.0.22" do
url "https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz"
sha256 "71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3"
end

def install
resource("libevent-2.0.22").stage do
system "./configure", "--disable-dependency-tracking",
"--disable-debug-mode",
"--prefix=#{buildpath}/vendor/libevent"
ENV.deparallelize do
system "make"
system "make", "install"
end
end

(buildpath/"boot").install resource("boot")

macho = MachO.open("#{buildpath}/boot/embedded/bin/crystal")
macho.change_dylib("/usr/local/opt/libevent/lib/libevent-2.0.5.dylib",
"#{buildpath}/vendor/libevent/lib/libevent-2.0.5.dylib")
macho.write!

if build.head?
ENV["CRYSTAL_CONFIG_VERSION"] = Utils.popen_read("git rev-parse --short HEAD").strip
else
Expand Down

0 comments on commit 10b0200

Please sign in to comment.