git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MGMacario, Gianpaolo <gianpaolo_macario@mentor.com>
Date
Apr 13, 2015, 11:10 UTC
Message-ID
<0CCD6BBA210ECA418BCD82271FCFD94C556A3CEA@EU-MBX-03.mgc.mentorg.com>
In-Reply-To
<xmqq7ftg4l73.fsf@gitster.dls.corp.google.com>
Hello Juno,
Show 14 quoted lines
> Gianpaolo Macario <gianpaolo_macario@mentor.com> writes:
> 
> > By some googling and after reading the git sources and the commit logs
> > I assumed that the `RUNTIME_PREFIX` option (see
> > <https://github.com/git/git/blob/master/exec_cmd.c>) 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 `<install_path>/bin/git --exec-path` return a path which depends on `<install_path>` 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
Previous: Junio C HamanoNext: Jeff King
Message 3 of 4 in “Installing git binaries on a non-default directory (Ubuntu)”
  1. Gianpaolo MacarioApr 10, 2015
  2. Junio C HamanoApr 13, 2015
  3. Macario, GianpaoloApr 13, 2015
  4. Jeff KingApr 23, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.