2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Nspr < Formula
|
2011-06-14 11:36:34 +00:00
|
|
|
url 'http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz'
|
2010-04-12 19:19:08 +00:00
|
|
|
homepage 'http://www.mozilla.org/projects/nspr/'
|
2011-06-14 11:36:34 +00:00
|
|
|
sha256 '92f3f4ded2ee313e396c180d5445cc3c718ff347d86c06b7bf14a1b5e049d4c9'
|
2009-09-01 14:17:44 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.deparallelize
|
|
|
|
Dir.chdir "mozilla/nsprpub" do
|
2010-07-07 20:02:40 +00:00
|
|
|
# Fixes a bug with linking against CoreFoundation, needed to work with SpiderMonkey
|
2010-04-08 22:12:57 +00:00
|
|
|
# See: http://openradar.appspot.com/7209349
|
2011-04-08 18:16:37 +00:00
|
|
|
target_frameworks = (Hardware.is_32_bit? or MacOS.leopard?) ? "-framework Carbon" : ""
|
2010-07-07 20:02:40 +00:00
|
|
|
inreplace "pr/src/Makefile.in", "-framework CoreServices -framework CoreFoundation", target_frameworks
|
2010-01-24 13:57:44 +00:00
|
|
|
|
2010-08-08 04:04:37 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--disable-debug", "--enable-strip", "--enable-optimize"]
|
2011-03-18 17:30:47 +00:00
|
|
|
args << "--enable-64bit" if MacOS.prefer_64_bit?
|
2010-08-08 04:04:37 +00:00
|
|
|
system "./configure", *args
|
2010-01-24 13:57:44 +00:00
|
|
|
|
2010-07-07 20:02:40 +00:00
|
|
|
# Remove the broken (for anyone but Firefox) install_name
|
2010-11-02 16:09:10 +00:00
|
|
|
inreplace "config/autoconf.mk", "-install_name @executable_path/$@ ", "-install_name #{lib}/$@ "
|
2010-01-24 13:57:44 +00:00
|
|
|
|
2009-09-01 14:17:44 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
2012-01-21 14:28:28 +00:00
|
|
|
(lib+'pkgconfig/nspr.pc').write pkg_file
|
2009-09-01 14:17:44 +00:00
|
|
|
end
|
|
|
|
end
|
2012-01-21 14:28:28 +00:00
|
|
|
|
|
|
|
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
|
2009-09-01 14:17:44 +00:00
|
|
|
end
|