bos@559: <!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : --> bos@85: bos@559: <appendix id="chap:srcinstall"> bos@572: <?dbhtml filename="installing-mercurial-from-source.html"?> bos@559: <title>Installing Mercurial from source</title> bos@85: bos@559: <sect1 id="sec:srcinstall:unixlike"> bos@559: <title>On a Unix-like system</title> bos@85: bos@584: <para id="x_5e0">If you are using a Unix-like system that has a sufficiently bos@559: recent version of Python (2.3 or newer) available, it is easy to bos@559: install Mercurial from source.</para> bos@559: <orderedlist> bos@584: <listitem><para id="x_5e1">Download a recent source tarball from <ulink bos@559: url="http://www.selenic.com/mercurial/download">http://www.selenic.com/mercurial/download</ulink>.</para> bos@559: </listitem> bos@584: <listitem><para id="x_5e2">Unpack the tarball:</para> bos@559: <programlisting>gzip -dc mercurial-MYVERSION.tar.gz | tar xf -</programlisting> bos@559: </listitem> bos@584: <listitem><para id="x_5e3">Go into the source directory and run the bos@559: installer script. This will build Mercurial and install it bos@559: in your home directory.</para> bos@559: <programlisting>cd mercurial-MYVERSION bos@559: python setup.py install --force --home=$HOME</programlisting> bos@559: </listitem> bos@559: </orderedlist> bos@584: <para id="x_5e4">Once the install finishes, Mercurial will be in the bos@559: <literal>bin</literal> subdirectory of your home directory. bos@559: Don't forget to make sure that this directory is present in your bos@559: shell's search path.</para> bos@85: bos@584: <para id="x_5e5">You will probably need to set the <envar>PYTHONPATH</envar> bos@559: environment variable so that the Mercurial executable can find bos@559: the rest of the Mercurial packages. For example, on my laptop, bos@559: I have set it to <literal>/home/bos/lib/python</literal>. The bos@559: exact path that you will need to use depends on how Python was bos@559: built for your system, but should be easy to figure out. If bos@559: you're uncertain, look through the output of the installer bos@559: script above, and see where the contents of the bos@559: <literal>mercurial</literal> directory were installed to.</para> bos@85: bos@559: </sect1> bos@559: <sect1> bos@559: <title>On Windows</title> bos@85: bos@584: <para id="x_5e6">Building and installing Mercurial on Windows requires a bos@559: variety of tools, a fair amount of technical knowledge, and bos@559: considerable patience. I very much <emphasis>do not bos@559: recommend</emphasis> this route if you are a <quote>casual bos@559: user</quote>. Unless you intend to hack on Mercurial, I bos@559: strongly suggest that you use a binary package instead.</para> bos@85: bos@584: <para id="x_5e7">If you are intent on building Mercurial from source on bos@559: Windows, follow the <quote>hard way</quote> directions on the bos@559: Mercurial wiki at <ulink bos@559: url="http://www.selenic.com/mercurial/wiki/index.cgi/WindowsInstall">http://www.selenic.com/mercurial/wiki/index.cgi/WindowsInstall</ulink>, bos@559: and expect the process to involve a lot of fiddly work.</para> bos@559: bos@559: </sect1> bos@559: </appendix> bos@559: bos@559: <!-- bos@559: local variables: bos@559: sgml-parent-document: ("00book.xml" "book" "appendix") bos@559: end: bos@559: -->