2014-01-07 00:57:18 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
# speed up head clone, see: https://developer.mozilla.org/en-US/docs/Developer_Guide/Source_Code/Mercurial/Bundles
|
|
|
|
class HgBundleDownloadStrategy < CurlDownloadStrategy
|
|
|
|
def hgpath
|
|
|
|
MercurialDownloadStrategy.new(@name, @resource).hgpath
|
|
|
|
end
|
|
|
|
|
|
|
|
def fetch
|
|
|
|
@repo = @url.split("|").last
|
|
|
|
@url = @url.split("|").first
|
|
|
|
super()
|
|
|
|
end
|
|
|
|
|
|
|
|
def stage
|
|
|
|
safe_system "mkdir mozilla-central"
|
|
|
|
safe_system hgpath, "init", "mozilla-central"
|
|
|
|
chdir
|
|
|
|
safe_system hgpath, "unbundle", @tarball_path
|
|
|
|
safe_system hgpath, "pull", @repo
|
|
|
|
safe_system hgpath, "update"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Python273Requirement < Requirement
|
|
|
|
fatal true
|
|
|
|
default_formula "python"
|
|
|
|
|
|
|
|
satisfy do
|
|
|
|
`python -V 2>&1` =~ /^Python 2.7.(\d+)/
|
|
|
|
$1.to_i >= 3
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Xulrunner < Formula
|
|
|
|
homepage "https://developer.mozilla.org/docs/XULRunner"
|
2014-06-12 19:06:30 +00:00
|
|
|
url "https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/30.0/source/xulrunner-30.0.source.tar.bz2"
|
|
|
|
sha1 "d987efafc67cb0170c6a5dabb9cede3b98e5c24b"
|
2014-02-04 12:07:03 +00:00
|
|
|
|
2014-03-23 10:10:56 +00:00
|
|
|
bottle do
|
2014-06-12 20:06:45 +00:00
|
|
|
cellar :any
|
|
|
|
sha1 "b9ce9af762ae4fcbafc3812f81461dc01edca322" => :mavericks
|
|
|
|
sha1 "390f9aee89766814b38f9aba9360c8dec1a2cb07" => :mountain_lion
|
|
|
|
sha1 "7d1245a5c30266fc379ed6d68feb5736741e9019" => :lion
|
2014-03-23 10:10:56 +00:00
|
|
|
end
|
|
|
|
|
2014-02-04 12:07:03 +00:00
|
|
|
devel do
|
2014-06-12 19:06:30 +00:00
|
|
|
url "https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/31.0b1/source/xulrunner-31.0b1.source.tar.bz2"
|
|
|
|
sha1 "defcf12f71082ddc167ac5c49fd3a307faa5e8f2"
|
|
|
|
version "31.0b1"
|
2014-02-04 12:07:03 +00:00
|
|
|
end
|
2014-01-07 00:57:18 +00:00
|
|
|
|
|
|
|
head do
|
2014-03-08 19:16:42 +00:00
|
|
|
url "https://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/mozilla-central.hg|https://hg.mozilla.org/mozilla-central/",
|
2014-02-02 11:06:26 +00:00
|
|
|
:using => HgBundleDownloadStrategy
|
2014-03-08 19:16:42 +00:00
|
|
|
depends_on :hg => :build
|
2014-01-07 00:57:18 +00:00
|
|
|
depends_on "gettext" => :build
|
|
|
|
end
|
|
|
|
|
|
|
|
depends_on :macos => :lion # needs clang++
|
2014-05-30 20:35:03 +00:00
|
|
|
depends_on :xcode => :build
|
2014-02-20 00:08:37 +00:00
|
|
|
depends_on :python => :build
|
|
|
|
depends_on Python273Requirement => :build
|
2014-01-07 00:57:18 +00:00
|
|
|
depends_on "gnu-tar" => :build
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "yasm"
|
2014-03-23 08:52:18 +00:00
|
|
|
depends_on "nss"
|
2014-06-12 19:06:30 +00:00
|
|
|
depends_on "nspr"
|
2014-01-07 00:57:18 +00:00
|
|
|
|
|
|
|
fails_with :gcc do
|
|
|
|
cause "Mozilla XULRunner only supports Clang on OS X"
|
|
|
|
end
|
|
|
|
|
|
|
|
fails_with :llvm do
|
|
|
|
cause "Mozilla XULRunner only supports Clang on OS X"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "autoconf213" do
|
|
|
|
url "http://ftpmirror.gnu.org/autoconf/autoconf-2.13.tar.gz"
|
2014-03-08 19:16:42 +00:00
|
|
|
mirror "https://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz"
|
2014-01-07 00:57:18 +00:00
|
|
|
sha1 "e4826c8bd85325067818f19b2b2ad2b625da66fc"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
if build.head?
|
|
|
|
resource("autoconf213").stage do
|
|
|
|
system "./configure", "--disable-debug", "--program-suffix=213", "--prefix=#{buildpath}/ac213"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
ENV["AUTOCONF"] = buildpath/"ac213/bin/autoconf213"
|
|
|
|
end
|
|
|
|
|
2014-02-20 00:08:37 +00:00
|
|
|
# build xulrunner to objdir and disable tests, updater.app and crashreporter.app, specify sdk path
|
|
|
|
(buildpath/"mozconfig").write <<-EOS.undent
|
|
|
|
. $topsrcdir/xulrunner/config/mozconfig
|
|
|
|
mk_add_options MOZ_OBJDIR=objdir
|
|
|
|
ac_add_options --disable-tests
|
|
|
|
ac_add_options --disable-updater
|
|
|
|
ac_add_options --disable-crashreporter
|
|
|
|
ac_add_options --with-macos-sdk=#{MacOS.sdk_path}
|
2014-03-23 08:52:18 +00:00
|
|
|
ac_add_options --with-nss-prefix=#{Formula["nss"].opt_prefix}
|
2014-06-12 19:06:30 +00:00
|
|
|
ac_add_options --with-nspr-prefix=#{Formula["nspr"].opt_prefix}
|
2014-02-20 00:08:37 +00:00
|
|
|
EOS
|
2014-01-07 00:57:18 +00:00
|
|
|
# fixed usage of bsdtar with unsupported parameters (replaced with gnu-tar)
|
|
|
|
inreplace "toolkit/mozapps/installer/packager.mk", "$(TAR) -c --owner=0 --group=0 --numeric-owner",
|
2014-03-23 08:52:18 +00:00
|
|
|
"#{Formula["gnu-tar"].opt_bin}/gtar -c --owner=0 --group=0 --numeric-owner"
|
2014-01-07 00:57:18 +00:00
|
|
|
|
|
|
|
system "make", "-f", "client.mk", "build"
|
|
|
|
system "make", "-f", "client.mk", "package"
|
|
|
|
|
|
|
|
frameworks.mkpath
|
|
|
|
if build.head?
|
|
|
|
# update HEAD version here with every version bump
|
2014-06-12 19:06:30 +00:00
|
|
|
tar_path = "objdir/dist/xulrunner-33.0a1.en-US.mac64.tar.bz2"
|
2014-01-07 00:57:18 +00:00
|
|
|
else
|
2014-02-20 00:08:37 +00:00
|
|
|
tar_path = "objdir/dist/xulrunner-#{version.to_s[/\d+\.\d+(\.\d+)?/]}.en-US.mac64.tar.bz2"
|
2014-01-07 00:57:18 +00:00
|
|
|
end
|
2014-02-14 22:12:17 +00:00
|
|
|
system "tar", "-xvj", "-C", frameworks, "-f", tar_path
|
2014-01-07 00:57:18 +00:00
|
|
|
|
|
|
|
# symlink only xulrunner here will fail (assumes dylibs in same directory)
|
|
|
|
bin.write_exec_script frameworks/"XUL.framework/Versions/Current/xulrunner"
|
|
|
|
|
|
|
|
# fix Trace/BPT trap: 5 error on OS X 10.9, see laurentj/slimerjs#135
|
|
|
|
# and https://bugzilla.mozilla.org/show_bug.cgi?id=922590#c4
|
|
|
|
if MacOS.version >= :mavericks
|
|
|
|
(frameworks/"XUL.framework/Versions/Current/Info.plist").write <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<dict>
|
|
|
|
<key>CFBundleIdentifier</key>
|
|
|
|
<string>org.mozilla.xulrunner</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/xulrunner", "-v"
|
|
|
|
end
|
|
|
|
end
|