homebrew-core/Formula/nspr.rb
2015-03-17 09:39:02 +00:00

51 lines
1.8 KiB
Ruby

require 'formula'
class Nspr < Formula
homepage "https://developer.mozilla.org/docs/Mozilla/Projects/NSPR"
url "https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.10.8/src/nspr-4.10.8.tar.gz"
sha256 "507ea57c525c0c524dae4857a642b4ef5c9d795518754c7f83422d22fe544a15"
revision 1
bottle do
cellar :any
sha256 "9860a936f88a0f57f05240e94daf678ddb8e014c0240e269da78f9207ef41b24" => :yosemite
sha256 "e8ad4221a5a0a1769547f2c8bc6b45f57ae2591896ffde08e6d6ec2a6018fcf7" => :mavericks
sha256 "ad1fb6a460c2f053cd9f6dce964a94354133b546caf7d9def37512c10f833a33" => :mountain_lion
end
keg_only <<-EOS.undent
Having this library symlinked makes Firefox pick it up instead of built-in,
so it then randomly crashes without meaningful explanation.
Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1142646 for details.
EOS
def install
ENV.deparallelize
cd "nspr" do
# Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey
# See: http://openradar.appspot.com/7209349
target_frameworks = (Hardware.is_32_bit? or MacOS.version <= :leopard) ? "-framework Carbon" : ""
inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", target_frameworks
args = %W[
--disable-debug
--prefix=#{prefix}
--enable-strip
--enable-pthreads
--enable-ipv6
--enable-macos-target=#{MacOS.version}
]
args << "--enable-64bit" if MacOS.prefer_64_bit?
system "./configure", *args
# Remove the broken (for anyone but Firefox) install_name
inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ "
system "make"
system "make install"
(bin/"compile-et.pl").unlink
(bin/"prerr.properties").unlink
end
end
end