From d12fcb69b9f8aaa29552195baec4c8099fcef32f Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Tue, 25 Nov 2014 21:31:11 +0000 Subject: glog: gflags compatibility fix Closes #34416. The upstream issue tracker for Glog is pretty dead, and gflags development seems to be outpacing it considerably, so vendoring the old version of gflags is a workaround. Closes #34451. Signed-off-by: Mike McQuaid --- Library/Formula/glog.rb | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/glog.rb b/Library/Formula/glog.rb index bfdcdcf61..54d31864d 100644 --- a/Library/Formula/glog.rb +++ b/Library/Formula/glog.rb @@ -1,11 +1,15 @@ -require 'formula' +require "formula" class Glog < Formula - homepage 'http://code.google.com/p/google-glog/' - url 'https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz' - sha1 'ed40c26ecffc5ad47c618684415799ebaaa30d65' + homepage "https://code.google.com/p/google-glog/" + url "https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz" + sha1 "ed40c26ecffc5ad47c618684415799ebaaa30d65" - depends_on 'gflags' + # Vendor an older version of gflags as the new version makes compile = nope. + resource "gflags" do + url "https://gflags.googlecode.com/files/gflags-2.0.tar.gz" + sha1 "dfb0add1b59433308749875ac42796c41e824908" + end if MacOS.version >= :mavericks # Since 0.3.4 has not yet been released, manually apply @@ -24,8 +28,22 @@ class Glog < Formula end def install + resource("gflags").stage do + system "./configure", "--disable-dependency-tracking", "--prefix=#{libexec}/gflags" + system "make", "install" + end + + # Find our sandboxed gflags. + ENV.append_to_cflags "-I#{libexec}/gflags/include" + ENV.append "LDFLAGS", "-L#{libexec}/gflags/lib" + system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" - system "make install" + system "make", "install" + end + + test do + assert_equal "#{libexec}/gflags/lib/libgflags.2.dylib (compatibility version 4.0.0, current version 4.0.0)", + shell_output("otool -L #{lib}/libglog.0.dylib | grep libgflags").strip end end -- cgit v1.2.3