From 10b020018b04ea55dd5c9e079cd66bbaeb432786 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Sat, 28 Jan 2017 11:09:43 -0800 Subject: [PATCH] crystal-lang: vendor libevent 2.0.22 during the build 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 --- Formula/crystal-lang.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Formula/crystal-lang.rb b/Formula/crystal-lang.rb index a7bf616208013..e34ceb549541f 100644 --- a/Formula/crystal-lang.rb +++ b/Formula/crystal-lang.rb @@ -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