Skip to content

Instantly share code, notes, and snippets.

Created Apr 26, 2014
What would you like to do?
homebrew formula
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 '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"
system "opam init --no-setup"
ENV['OPAMYES'] = "1"
system "eval \`opam config env\`; opam install #{modules}"
system "make"
system "cd dist && ./ #{prefix}"
Copy link

avsm commented Apr 27, 2014

I've made some build fixes (notably deparallelise, lablgtk2 build fixes, and use opam config exec to run make) in my fork:

Are you planning to submit this upstream to Homebrew?


Copy link

avsm commented Apr 28, 2014

Submitted upstream with a patch to fix installation in Homebrew/legacy-homebrew#28806


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment