49 lines
1.9 KiB
Ruby
49 lines
1.9 KiB
Ruby
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.10.10/src/nspr-4.10.10.tar.gz"
|
|
sha256 "343614971c30520d0fa55f4af0a72578e2d8674bb71caf7187490c3379523107"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "4a7a5cc541a308d7621f4da9da1cfafe46fcd0aa997d391d66dd54e2555eea30" => :el_capitan
|
|
sha256 "121e9afb075e94538f0c231cf72cf9daa122633b4395e56cd4aa11346a659d20" => :yosemite
|
|
sha256 "6b3b2ae585784346e27963d52aa438b4b1909f8cf329463d9483350c7504771c" => :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
|
|
--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
|