<?xml version='1.0' encoding='utf-8'?>
<html lang="en">
<h2>Installation : OS X</h2>
<p>
<strong>This is the newer OCaml version of 0install.</strong>
There is also an older <a href='install-mac.html'>pure Python version</a>.
The OCaml version is completely backwards compatible with the Python version.
</p>
<p>
To use Zero Install, you will need these two dependencies:
</p>
<ul>
<li><a href='http://www.gnupg.org/'>GnuPG</a> (to check the digital signatures).</li>
<li><a href='http://www.gtk.org/'>GTK+</a> (2.12 or later needed for <acronym title="Graphic User Interface">GUI</acronym>).</li>
</ul>
<p>
To build Zero Install from source code, you will also need:
</p>
<ul>
<li><a href='https://developer.apple.com/downloads/'>Xcode</a> (Command Line Tools)</li>
<li><a href='http://git-scm.com/download/mac/'>Git</a> (if not included in Xcode already)</li>
<li><a href='http://pkgconfig.freedesktop.org/'>pkg-config</a> (helper tool used when compiling)</li>
<li><a href='https://www.gnu.org/software/gettext/'>GNU gettext</a> (only "gettext-tools", not "gettext-runtime")</li>
<li><a href='http://www.ocaml.org/'>OCaml</a></li>
<li><a href='http://opam.ocamlpro.com/'>OPAM</a></li>
</ul>
<p>
The easiest way of installing Zero Install and its requirements is by using a “package<br />
manager”, to handle building both it and the dependencies (mentioned above) for you.
</p>
<p>Or you can use the pre-compiled package bundle, which installs GnuPG and optionally<br />
PyGTK (includes glib/gtk+) and their dependencies, for Mac OS X 10.6 and later versions.</p>
<p><i>Note:</i> The binary package of 0install requires a 64-bit Intel processor (x86_64) to run.<br />
It will automatically download and install packages for the GnuPG and GTK+ dependencies.</p>
<quicklinks>
<link href='http://downloads.sourceforge.net/project/zero-install/0install/2.8/ZeroInstall.pkg' img='tango/package-x-generic.png'>Get Zero Install Bundle</link>
</quicklinks>
<h3 id='source'>Source installation</h3>
<p>
<img src='screens/0install-gui-gtk-x11.png' alt='' width='656' height='326' />
</p>
<h4>Short version</h4>
<p>This assumes that you have installed <a href='http://brew.sh/'>Homebrew</a>,
and have downloaded and extracted <a href='install-source.html'>the source archive</a>.</p>
<pre>
$ brew install pkg-config gettext gnupg gtk+ objective-caml opam
$ opam install yojson xmlm ounit react lwt extlib ocurl sha lablgtk
$ make
$ sudo make install
</pre>
<h4>Long version</h4>
<ol>
<li>Terminal</li>
<li>Xcode</li>
<li>Git</li>
<li>Homebrew</li>
<li>pkg-config</li>
<li>gettext-tools</li>
<li>GnuPG</li>
<li>GTK+</li>
<li>OCaml</li>
<li>OPAM</li>
<li>Zero Install</li>
</ol>
<p>Install the Developer Tools, if needed:</p>
<pre class='maybe'>
open /Applications/Utilities/Terminal.app
$ xcode-select --install
</pre>
<p>Install homebrew using git, if needed:</p>
<pre class='maybe'>
$ git clone https://github.com/Homebrew/homebrew.git
$ export PATH=$PWD/homebrew/bin:$PWD/homebrew/sbin:$PATH
</pre>
<p>Install build dependencies:</p>
<pre>
$ brew install pkg-config
$ brew install gettext
</pre>
<p>Install runtime dependencies:</p>
<pre>
$ brew install gnupg
<i>or</i>
$ brew install gnupg2
</pre>
<p>Optionally, install gtk+:</p>
<pre>
$ brew install gtk+
$ brew install gtk-engines # for the "Clearlooks" theme
</pre>
<p>Fix homebrew shortcomings:</p>
<pre class='maybe'>
<i># the gettext-tools are not linked with homebrew:</i>
$ export PATH="`brew --prefix gettext`/bin:$PATH"
<i># the libpng library is not found by homebrew:</i>
$ export PKG_CONFIG_PATH="`brew --prefix libpng`/lib/pkgconfig:$PKG_CONFIG_PATH"
</pre>
<p>Use the Clearlooks theme:</p>
<pre class='maybe'>
$ export GTK2_RC_FILES="`brew --prefix`/share/themes/Clearlooks/gtk-2.0/gtkrc"
$ export GTK_PATH="`brew --prefix`/lib/lib/gtk-2.0"
</pre>
<p>Install OCaml and OPAM:</p>
<pre>
$ brew install ocaml
$ brew install opam # OS X Mavericks or later
<i>or</i>
$ brew install opam --without-aspcud # OS X Mountain Lion or lower
</pre>
<p>Initialize the OPAM root, if needed:</p>
<pre class='maybe'>
$ export OPAMROOT=$PWD/opamroot
$ opam init
</pre>
<p>Install OPAM packages:</p>
<pre>
$ eval `opam config env`
$ opam install yojson xmlm ounit react lwt extlib ocurl sha
<i># optional, for GUI</i>
$ opam install lablgtk
</pre>
<p>Finally, install 0install itself - using the instructions in <a href='install-source.html'>the source package</a>.</p>
<pre>
$ git clone https://github.com/0install/0install.git
$ cd 0install
$ make && make install_home
$ export PATH=$HOME/bin:$PATH
</pre>
<h3 id='generic'>Generic binaries</h3>
<p>
There are some pre-compiled <a href='http://0install.net/tools/0install.xml'>generic binaries</a> available.
These work on Linux, and on Darwin (OS X).</p>
<p>
Download the appropriate archive for your system, unpack it, and run the <b>install.sh</b> script inside.
</p>
<h3 id='bundle'>Bundle installation</h3>
<p>
<img src='screens/0install-gui-gtk-quartz.png' alt='' width='656' height='326' />
</p>
<p>
You can install the <a href='http://downloads.sourceforge.net/project/zero-install/0install/2.8/ZeroInstall.pkg'>ZeroInstall.pkg</a> bundle with <a href='http://en.wikipedia.org/wiki/Installer_(OS_X)'>Installer.app</a>,
which will install requirements like <a href="http://downloads.sourceforge.net/project/macpkg/GnuPG/1.4.18/GnuPG.pkg">GnuPG.pkg</a> and (optionally) <a href="http://downloads.sourceforge.net/project/macpkg/PyGTK/2.24.0/PyGTK.pkg">PyGTK.pkg</a>:
</p>
<pre>$ <b>sudo installer -pkg ZeroInstall.pkg -target /</b></pre>
<h3>After the installation</h3>
<p>
You now have some new commands: <b>0launch</b>, which takes the URL of a program and runs it,
and <b>0install</b>, which provides access to other features.
</p>
<pre>
$ <b>0launch</b> <i>URI</i>
</pre>
<h2>Work in Progress</h2>
<p>
Once a native OS X interface is available, this process will become much simpler...<br/>
It will also blend in more with the desktop than what the current GTK interface does.
</p>
<p>
But it should work OK already. If you'd like to help us make it work better, <a href='support.html'>get in touch!</a><br />
Note that <b>0desktop</b> only works for GNOME/KDE/etc, for Finder you use <a href='http://afb.users.sourceforge.net/zero-install/interfaces/AddApp.xml'><i>AddApp.app</i></a>...
</p>
<quicklinks>
<link href='users.html' img='tango/go-next.png'>Continue to tutorial</link>
</quicklinks>
</html>