zero-install 2.12-1

also serves as revision for ocaml
This commit is contained in:
ilovezfs 2016-11-30 08:16:07 -08:00
parent a8f1b464ca
commit 6580411dcc

View file

@ -1,17 +1,9 @@
class ZeroInstall < Formula
desc "Zero Install is a decentralised software installation system"
homepage "http://0install.net/"
# This is a fairly nasty hack to avoid backporting 10k+ lines of
# changes in patch format. It should be reverted to use the SF tarball
# as pointed to on the upstream website on next release.
# One of the resources, lwt, was updated in an incompatible way,
# but the older versions of lwt no longer support the ocaml Homebrew
# ships since May 5th 2016. Upstream pushed changes to fix this
# but those haven't made it into a stable release yet.
# There's also a build fix for Ocaml 4.03.0 not in latest release.
url "https://github.com/0install/0install.git",
:revision => "5ec4a9f55ba8e38b60cceeef5da982847395928c"
version "2.11"
url "https://github.com/0install/0install/archive/v2.12-1.tar.gz"
version "2.12-1"
sha256 "317ac6ac680d021cb475962b7f6c2bcee9c35ce7cf04ae00d72bba8113f13559"
bottle do
cellar :any_skip_relocation
@ -26,88 +18,16 @@ class ZeroInstall < Formula
depends_on "ocamlbuild" => :build
depends_on "opam" => :build
depends_on "camlp4" => :build
depends_on "gtk+" => :optional
depends_on :gpg => :run
resource "easy-format" do # [required by yojson]
url "https://github.com/mjambon/easy-format/archive/v1.2.0.tar.gz"
sha256 "a288fabcdc19c2262e76cf93e0fd987fe1b21493edd13309522fbae405329ffd"
end
resource "biniou" do # [required by yojson]
url "http://mjambon.com/releases/biniou/biniou-1.0.9.tar.gz"
sha256 "eb47c48f61b169e652629e7f2ee582dfd5965e640ee51bf28fab63b960864392"
end
resource "cppo" do # [required by yojson]
url "https://github.com/mjambon/cppo/archive/v1.3.2.tar.gz"
sha256 "c49e3080b3326466c7ddd97100c63bd568301802b3e48cebea3406e1ca76ebc8"
end
resource "yojson" do
url "https://github.com/mjambon/yojson/archive/v1.3.2.tar.gz"
sha256 "eff510621efd6dcfb86b65eaf1d4d6f3b9b680143d88e652b6f14072523a2351"
end
resource "xmlm" do
url "http://erratique.ch/software/xmlm/releases/xmlm-1.2.0.tbz"
sha256 "d012018af5d1948f65404e1cc811ae0eab563b23006416f79b6ffc627966dccb"
end
resource "ounit" do
url "https://forge.ocamlcore.org/frs/download.php/1258/ounit-2.0.0.tar.gz"
sha256 "4d4a05b20c39c60d7486fb7a90eb4c5c08e8c9862360b5938b97a09e9bd21d85"
end
resource "react" do
url "http://erratique.ch/software/react/releases/react-1.2.0.tbz"
sha256 "887aaea9191870bc0f37f945c02ec4c90497d949cd4dedc3d565c3fbec7ad04e"
end
resource "ppx_tools" do # [required by lwt]
url "https://github.com/alainfrisch/ppx_tools/archive/5.0+4.03.0.tar.gz"
sha256 "2cd990ef36145c35b0fd2cfaadc379cf032dd0987c07bea094d4437277d573e5"
end
resource "lwt" do
url "https://github.com/ocsigen/lwt/archive/2.5.2.tar.gz"
sha256 "b319514cf51656780a8f609a63ead08d3052a442546b218530ce146d37bf6331"
end
resource "extlib" do
url "https://github.com/ygrek/ocaml-extlib/archive/1.7.0.tar.gz"
sha256 "3c9fd159a4ec401559905f96e578317a4933452ced9a7f3a4f89f9c7130d9a63"
end
resource "ocurl" do
url "http://ygrek.org.ua/p/release/ocurl/ocurl-0.7.7.tar.gz"
sha256 "79805776f207ae8e64d63cda63d0bf8c6ee079c70b0d7f3bd2114faba0d5f41c"
end
resource "lablgtk" do
url "https://forge.ocamlcore.org/frs/download.php/1602/lablgtk-2.18.4.tar.gz"
sha256 "b316ae0b92e760c1ab0d1bdeaa0a3c2a6ab14face5a0fe2b93445be3a3d013c0"
end
resource "sha" do
url "https://github.com/vincenthz/ocaml-sha/archive/ocaml-sha-v1.9.tar.gz"
sha256 "caa1dd9071c2c56ca180061bb8e1824ac3b5e83de8ec4ed197275006c2a088d0"
end
depends_on "gtk+" => :optional
def install
opamroot = buildpath/"opamroot"
ENV["OPAMROOT"] = opamroot
ENV["OPAMYES"] = "1"
system "opam", "init", "--no-setup"
archives = opamroot/"repo/default/archives"
modules = []
resources.each do |r|
next if build.without?("gtk+") && r.name == "lablgtk"
r.verify_download_integrity(r.fetch)
original_name = File.basename(r.url)
cp r.cached_download, archives/original_name
modules << "#{r.name}=#{r.version}"
end
modules = %w[yojson xmlm ounit react ppx_tools lwt extlib ocurl sha]
modules << "lablgtk" if build.with? "gtk+"
system "opam", "install", *modules
system "opam", "config", "exec", "make"