Skip to content

Instantly share code, notes, and snippets.

@afb
Created Apr 26, 2014
Embed
What would you like to do?
homebrew formula
require 'formula'
class ZeroInstall < Formula
homepage 'http://0install.net/injector.html'
url 'https://downloads.sf.net/project/zero-install/0install/2.6.2/0install-2.6.2.tar.bz2'
sha256 '5755226ef4b32f04723bcbe551f4694ddf78dffbb0f589c3140c2d7056370961'
head 'https://github.com/0install/0install'
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 && ./install.sh #{prefix}"
end
end
@avsm
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: https://gist.github.com/avsm/39d0ced39f9ed45165d5

Are you planning to submit this upstream to Homebrew?

Loading

@avsm
Copy link

avsm commented Apr 28, 2014

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

Loading

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