Skip to content

Instantly share code, notes, and snippets.

Forked from afb/zero-install.rb
Created Apr 27, 2014
What would you like to do?
require 'formula'
class ZeroInstall < Formula
homepage ''
url ''
sha256 '5755226ef4b32f04723bcbe551f4694ddf78dffbb0f589c3140c2d7056370961'
head ''
option 'without-gui', "Build without the gui (requires GTK+)"
depends_on 'gnupg'
depends_on 'glib' if build.without? 'gui'
depends_on 'gtk+' if build.with? 'gui'
depends_on 'gettext' => :build if build.head?
depends_on 'pkg-config' => :build
depends_on 'objective-caml' => :build
depends_on 'opam' => :build
def install
modules = "yojson xmlm ounit react lwt extlib ssl ocurl"
modules += " lablgtk" if build.with? 'gui'
# TODO: Use $OPAMCURL to store a cache outside the build directory
ENV['OPAMCURL'] = "curl"
ENV['OPAMROOT'] = "opamroot"
ENV['OPAMYES'] = "1"
system "opam init --no-setup"
# Required for lablgtk2 to find Quartz X11 libs.
ENV.append_path 'PKG_CONFIG_PATH', '/opt/X11/lib/pkgconfig' if build.with? 'gui'
system "opam install #{modules}"
system "opam config exec make"
system "cd dist && ./ #{prefix}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment