class Nspr < Formula desc "Platform-neutral API for system-level and libc-like functions" homepage "https://developer.mozilla.org/docs/Mozilla/Projects/NSPR" url "https://archive.mozilla.org/pub/mozilla.org/nspr/releases/v4.11/src/nspr-4.11.tar.gz" sha256 "cb320a9eee7028275ac0fce7adc39dee36f14f02fd8432fce1b7e1aa5e3685c2" revision 1 bottle do cellar :any sha256 "0b0e0e80b60b61391b0dade4a94399b58d3ec820a5b1f077fad8222c017c6200" => :el_capitan sha256 "03830bf4a0b8f1df0dde98e08c502e6116f853f458174d259e398f57ba0565a8" => :yosemite sha256 "b6e2ed3adab2e3f96942c00ad7b3bd00e56fd2fb5250234255b6fcc492ce4288" => :mavericks 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? || MacOS.version <= :leopard) ? "-framework Carbon" : "" inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", target_frameworks args = %W[ --disable-debug --prefix=#{prefix} --enable-strip --with-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