Source

thg-winbuild /

Filename Size Date modified Message
asciidoc [f90db4ee6f11]
contrib
gtk-dist
hg-main [37042e8b3b34]
hg-stable [3ac42ca1f3e6]
hgfold [63b82f40acc8]
misc
tortoisehg [6649b4674f01]
156 B
248 B
250 B
6.6 KB
9.6 KB

TortoiseHg and Mercurial installer builder for Windows

The most up to date version of this information can be found on this repository's wiki: http://bitbucket.org/tortoisehg/thg-winbuild/wiki/Home

Subrepos:

asciidoc - for Mercurial man pages, up to release 1.3 hg-main - Mercurial repository hg-stable - Mercurial stable repository tortoisehg - TortoiseHg repository hgfold - case folding conflict detection and resolution extension

Provided subdirs:

contrib/ - Bundled libraries and utilities external to (T)HG misc/ - Miscellaneous files used to build packages gtk-dist/ - directory where you copy GTK+ redistribution files

=== Prerequisites ===

=== Mercurial Man Pages ===

On the 1.3 stable branch, asciidoc is used to build HTML man pages. On the 1.4 unstable branch, rst2html (from docutils) is used to build HTML man pages.

rst2html is a recent addition to docutils and has not yet been released as a packaged tool. If you install docutils from my mirror:

http://bitbucket.org/sborho/docutils-mirror

rst2html.py will be installed in your PythonNNScripts folder.

=== TortoiseHg Doc Prerequisites ===

To build documentation, you need sphinx and it's ken. These commands should do the trick.

> hg clone http://bitbucket.org/birkenfeld/sphinx/ > cd sphinx > python setup.py install

This will install any missing sphinx prereqs setuptools, docutils 0.5, jinja2, and pygments. Once this is done, you can use easy_install to install iniparse. The always-unzip argument is important, because py2exe cannot read into egg files.

> easy_install --always-unzip iniparse

To build PDFs you need miktex installed: http://miktex.org/2.7/setup After install, you must place %ProgramFiles%MikTex NNNmiktexbin in your path.

The build scripts assume sphinx, miktex, and HTML Help compiler are all installed. You will have to modify the iss file of TortoiseHg if you do not want to build the documentation. The details of this are left as an excercise to the reader.

== Compiling shell extensions ==

If you do not have an x86 windows machine or you have a version of visual Ctudion other than VC8 (2005), you will need to edit misc/build_extensions.bat anc change the vcvarsall variable to point at your vcvarsall.bat.

Support for x64 compiler targets is not installed by default by Visual Studio, even on x64 machines, so may have to re-run the Visual Studio setup tool to add support for x64 targets.

If you do not have Visual Studio at all, you should be able to compile the shell extensions with MinGW. The Makefile in the win32/shellext directory of the TortoiseHg repository can build the 32-bit shellext. I leave 64-bit compilation as an excercise for the reader. Copy the compiled DLLs into the misc folder at the root of thg-winbuild, named as ThgShellx86.dll and ThgShellx64.dll.

Once those two files are present in the misc/ directory, no matter how they were compiled, the setup script will not overwrite them. Pre- built extensions are available under misc/prebuilt-extensions. You have the option of copying those DLLs into misc/. The prebuilt extensions will be statically linked.

== DLL dependencies ==

Your python DLL will have C runtime library dependencies. To be safe you should open your pythonXX.dll in the "dependency walker" tool to be absolutely sure you know which DLL it needs, then copy that DLL into the contrib folder in the root of thg-winbuild.

Also be aware of dependencies reported by py2exe. At least once you should run 'python setup.py py2exe -b2' manually inside build-thg and look at the library depdendencies. You'll want to copy into contrib/ any DLL whose name begins with "msvcr".

== Build Steps ==

It's mostly automated. For help, use

python setup.py --help

If you are doing automated builds, it is recommend you use the -fF flags to force the scripts to re-clone the build targets each time. If you are building by hand, you should use the -fF flags or --clean anytime you switch between stable and unstable targets, or just to get a clean start.

Note that setup.py assumes that .py files are registered with Windows so that they can execute directly. That is, entering

setup.py --help

(without "python") in the Windows command prompt should start the setup script (see the section "Registering .py files with Windows" for how to fix this if it doesn't).

== Default Paths ==

Subrepo clones do not setup default paths in .hg/hgrc files like normal clones do. As a result, you will not be be able to pull or push from the subrepos yourself until you create .hg/hgrc files in each subrepo.

As a convenience, the setup.py script has a --pull command that pulls the TortoiseHg repository and hg-stable. Any command that builds a nightly or unstable package will also pull the source repositories.

== Registering .py files with Windows ==

In Explorer go to Tools->Folder Options...->File Types. Scroll to the registered file type of PY and then click on the Change... button to choose the program to associate (e.g. "C:Python25python.exe"). Including ".py" in the PATHEXT environment variable might be needed in addition, so that the command prompt will attempt to execute .py files, using the registry associations to find the executable.

Reference: http://nedbatchelder.com/blog/200810/switching_python_versions_on_windows.html