Patch to support $DESTDIR based installs.

toni.arte at nokia.com toni.arte at nokia.com
Wed Apr 7 02:27:22 CDT 2010


Dévai Tamás wrote:
>installing software (including, but not limited to Mercurial) not to the
>live system, but another place (what packagers usually do) can be
>accomplished via two ways:
>
>1) setting PREFIX (or the equivalent Makefile variable) to the full
>installation path, e.g. PREFIX=/var/pkg/install/usr. This approach might
>cause troubles with symlinks. (Yes, I know that currently Mercurial
>doesn't install any symlinks.)
>
>2) using the de facto standard DESTDIR variable, e.g.
>DESTDIR=/var/pkg/install PREFIX=/usr.
>
>You must understand, that in the case of Mercurial it doesn't matter,
>whether I choose (1) or (2) from above. There is an inconsistency in the
>Makefiles, the one in doc/ does support DESTDIR, the main one doesn't.
>Therefore I thought it would be best to unify them (in this regard), so
>that either both support DESTDIR or both doesn't.

I only now realized that you need to use -e on GNU Make to override
variables, like:

PREFIX=/path/to/destination gmake -e install

So far I've been hacking the Makefile :-)

---

Anyway, another change I'd like to see is the ability to set the library
directory, i.e. support setting a value for the '--install-platlib' 
switch on the 'setup.py' when installing Mercurial.

The reason for this is that I'm installing Mercurial for Linux 32-bit,
Linux 64-bit (with 64-bit Python, so it needs the six .so files built
as 64-bit libraries) and Solaris sparc. I'm currently installing on NFS,
using the same PREFIX for all of them, so that the installation directory
is the same, regardless of the OS platform and architecture. The difference
is in the library directory, which I set like this:
* lib-Linux-i686
* lib-Linux-x86_64
* lib-SunOS-sparc

Then of course the $PYTHONPATH environment variable needs to include the
OS platform and architecture-dependent library path. Or it can be set within
bin/hg itself, by appending into sys.path.
--
Toni Arte


More information about the Mercurial-devel mailing list