├── Formula ├── servo-bin.rb └── servo.rb └── README.md /Formula/servo-bin.rb: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | class ServoBin < Formula 6 | desc "Servo, the Parallel Browser Engine Project (binary version)" 7 | homepage "http://servo.org" 8 | url "https://download.servo.org/nightly/macbrew/2017-05-08T01-13-53Z-servo.tar.gz" 9 | version "2017.05.08" 10 | sha256 "0c80a84eda375b6a3304b1a34d3554418dbf25d11768b269b09d48e5affb845c" 11 | 12 | bottle :unneeded 13 | 14 | def install 15 | prefix.install "bin", "libexec", "resources" 16 | end 17 | 18 | test do 19 | system bin/"servo", "-o", "/dev/null", "-x", "http://example.com" 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /Formula/servo.rb: -------------------------------------------------------------------------------- 1 | class Servo < Formula 2 | desc "Servo, the Parallel Browser Engine Project" 3 | homepage "http://servo.org" 4 | head "https://github.com/servo/servo.git" 5 | option "with-debug", "debug build" 6 | 7 | depends_on "autoconf" => :build 8 | depends_on "automake" => :build 9 | depends_on "pkg-config" => :build 10 | depends_on "python" => :build 11 | depends_on "cmake" => :build 12 | depends_on "openssl" 13 | 14 | resource "virtualenv" do 15 | url "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-13.1.2.tar.gz" 16 | sha256 "aabc8ef18cddbd8a2a9c7f92bc43e2fea54b1147330d65db920ef3ce9812e3dc" 17 | end 18 | 19 | def install 20 | ENV["OPENSSL_INCLUDE_DIR"] = Formula["openssl"].include 21 | 22 | # Install virtualenv in a temporary directory (anything in the buildpath will eventually be deleted) 23 | ve_dir = buildpath/"_vedir" 24 | ENV.prepend_create_path "PYTHONPATH", ve_dir/"lib/python2.7/site-packages" 25 | resource("virtualenv").stage { system "python", *Language::Python.setup_install_args(ve_dir) } 26 | ENV.prepend_path "PATH", ve_dir/"bin" 27 | 28 | build_type = "release" 29 | build_type_arg = "-r" 30 | 31 | if build.with? "debug" 32 | build_type = "debug" 33 | build_type_arg = "-d" 34 | end 35 | 36 | # build 37 | ohai "Compiling Servo" 38 | system "./mach", "build", build_type_arg 39 | 40 | # install 41 | prefix.install "target/#{build_type}/servo" 42 | prefix.install "resources" 43 | 44 | bin.install_symlink prefix/"servo" 45 | end 46 | 47 | test do 48 | system prefix/"servo", "-o", "/dev/null", "-x", "http://example.com" 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | homebrew-servo 2 | =============== 3 | 4 | Homebrew formula for [Servo](http://servo.org). 5 | 6 | ## Usage 7 | 8 | ### Install pre-built binary (nightly builds): 9 | 10 | $ brew install servo/servo/servo-bin 11 | $ servo http://servo.org # See `servo --help` 12 | 13 | To upgrade: 14 | 15 | $ brew update 16 | $ brew upgrade servo-bin 17 | 18 | Switch version (useful to find regression window): 19 | 20 | $ brew switch servo-bin YYYY.MM.DD 21 | 22 | Previously installed binaries are available in `/usr/local/Cellar/servo-bin/`. 23 | 24 | ### Build from source: 25 | 26 | $ brew tap servo/servo 27 | $ brew install --HEAD servo 28 | $ servo -w http://servo.org # See `servo --help` 29 | 30 | For debug build: 31 | 32 | $ brew install --HEAD --with-debug servo 33 | 34 | To upgrade: 35 | 36 | $ brew update 37 | $ brew reinstall --HEAD servo 38 | --------------------------------------------------------------------------------