nspr 4.9.3

- Upgrade to 4.9.3.
- Remove the hand made `nspr.pc` that is created automatically now.
- Add flags to enable pthreads and ipv6.
- Remove flag to enable optimize, because Homebrew does that.
- Works with superenv on 10.8.2.

Closes Homebrew/homebrew#16047.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
nibbles 2bits 2012-11-13 22:44:44 -08:00 committed by Jack Nagel
parent 51a54f445f
commit f6578a4538

View file

@ -2,8 +2,8 @@ require 'formula'
class Nspr < Formula
homepage 'http://www.mozilla.org/projects/nspr/'
url 'http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz'
sha256 '92f3f4ded2ee313e396c180d5445cc3c718ff347d86c06b7bf14a1b5e049d4c9'
url 'https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.9.3/src/nspr-4.9.3.tar.gz'
sha256 '9ca3f30b5ae6784f9820b32939284a7f14f67230a916c5752acd8ddace72f3c5'
def install
ENV.deparallelize
@ -13,30 +13,20 @@ class Nspr < Formula
target_frameworks = (Hardware.is_32_bit? or MacOS.version == :leopard) ? "-framework Carbon" : ""
inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", target_frameworks
args = ["--prefix=#{prefix}", "--disable-debug", "--enable-strip", "--enable-optimize"]
args = %W[
--disable-debug
--prefix=#{prefix}
--enable-strip
--enable-pthreads
--enable-ipv6
]
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"
(lib+'pkgconfig/nspr.pc').write pkg_file
end
end
def pkg_file; <<-EOF
prefix=#{HOMEBREW_PREFIX}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/nspr
Name: NSPR
Description: Netscape Portable Runtime
Version: 4.8.8
Libs: -L${libdir} -lplds4 -lplc4 -lnspr4
Cflags: -I${includedir}
EOF
end
end