Re: Installing git binaries on a non-default directory (Ubuntu)

2015-04-23 Thread Jeff King
On Mon, Apr 13, 2015 at 11:10:51AM +, Macario, Gianpaolo wrote:

> Unfortunately it looks to me that the `--prefix=xxx` option provided
> to configure will be hardcoded to the path returned by 'git
> --exec-path', and I do not see how this may actually be made dependent
> on the directory where the binary tarball will be extracted.

Sorry for the late reply, but I just noticed this and happened to be
looking at RUNTIME_PREFIX issues recently.

You're right that no amount of --prefix or other settings can help you
with making binaries that are relocatable after the fact. You do need
something like RUNTIME_PREFIX, but as you found, it does not work very
well on Unix systems.

I do not know if there are other issues, but at least the _first_ issue
that must be dealt with is that git_extract_argv0_path may get a bare
name like "git", without its PATH. So you will have to compute the full
path to the binary in order to find the rest of the files.

There was some minor discussion here:

  http://thread.gmane.org/gmane.comp.version-control.git/267143/focus=267606

(see the notes after the commit message, and the response from
Jonathan).

I hope that helps.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: Installing git binaries on a non-default directory (Ubuntu)

2015-04-13 Thread Macario, Gianpaolo
Hello Juno,

> Gianpaolo Macario  writes:
> 
> > By some googling and after reading the git sources and the commit logs
> > I assumed that the `RUNTIME_PREFIX` option (see
> > ) was designed for
> > that purpose,
> 
> I do not think so.
> 
> The standard procedure to stage into a temporary with "make install"
> and then make a tarball is done by using DESTDIR, e.g. something like
> 
>   $ make DESTDIR=/var/tmp/gittt ...other args... install
>   $ tar zCf /var/tmp/gittt git-version.tar.gz

[Macario, Gianpaolo] Thanks for your reply.

Unfortunately it looks to me that the `--prefix=xxx` option provided to 
configure will be hardcoded to the path returned by 'git --exec-path', and I do 
not see how this may actually be made dependent on the directory where the 
binary tarball will be extracted.

How should I configure/make git to have `/bin/git --exec-path` 
return a path which depends on `` rather than what provided to 
`./configure` ?

I tried the following

$ mkdir -p ~/tmp
$ cd ~/tmp
$ wget http://kernel.org/pub/software/scm/git/git-2.3.5.tar.gz
$ tar -xvzf git-2.3.5.tar.gz
$ cd git-2.3.5
$ ./configure --prefix= \
--with-curl --with-openssl --without-tcltk \
CFLAGS="${CFLAGS} `pkg-config --static --libs libcurl`"
$ make
$ make DESTDIR=/var/tmp/gittt install
$ cd /var/tmp/gittt
$ tar -cvzf ~/git-install-2.3.5.tar.gz .
$ cd
$ rm -rf ~/tmp/git-2.3.5
$ rm -rf /var/tmp/gittt

then extracted the tarball

$ sudo mkdir -p /opt/tools
$ sudo chown $USER /opt/tools
$ cd /opt/tools
$ tar -xvzf ~/git-install-2.3.5.tar.gz

This is the result when executing

$ /opt/tools/bin/git --exec-path
/libexec/git-core

I wanted to have it return `/opt/tools/libexec/git-core` instead.

If I do not specify any `--prefix=xxx` when running `./configure`, this 
defaults to `/usr/local` which is not good either.

Thanks in advance, and apologies if I am doing something stupid...

Gianpaolo
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Installing git binaries on a non-default directory (Ubuntu)

2015-04-12 Thread Junio C Hamano
Gianpaolo Macario  writes:

> By some googling and after reading the git sources and the commit logs I 
> assumed that the `RUNTIME_PREFIX` option
> (see ) was designed for 
> that purpose,

I do not think so.

The standard procedure to stage into a temporary with "make install"
and then make a tarball is done by using DESTDIR, e.g. something
like

  $ make DESTDIR=/var/tmp/gittt ...other args... install
  $ tar zCf /var/tmp/gittt git-version.tar.gz

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html