Patch to support $DESTDIR based installs.

Mads Kiilerich mads at kiilerich.com
Wed Apr 7 04:28:13 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.

Cleanup of inconsistency is a good argument.

But shouldn't you use setup.py --root instead of making DESTDIR a part 
of PREFIX? You just argued that making DESTDIR a part of PREFIX was a 
bad idea.

(contrib/mercurial.spec does something similar and could perhaps be 
improved too)

On 04/07/2010 09:27 AM, toni.arte at nokia.com wrote:
> 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 :-)

You can also specify it as arguments to make - such as

make install PREFIX=/tmp/hg

> 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

I have had a similar issue as well, but I'm not sure I would like to see 
it solved exactly that way.

It could be nice to have "make local" binaries for several architectures 
at the same time. That is very convenient for testing while developing.

/Mads


More information about the Mercurial-devel mailing list