Compile Git without gettext

3.4k views Asked by At

I'm trying to compile a static Git 2.17.1 on Debian (Windows Subsystem for Linux):

$ mkdir _git
$ make configure
$ ./configure --prefix=$PWD/_git NO_TCLTK=true NO_GETTEXT=true CFLAGS="${CFLAGS} -static"
$ make all

but I'm getting the error

...
    MSGFMT po/build/locale/pt_PT/LC_MESSAGES/git.mo
/bin/sh: 1: msgfmt: not found
Makefile:2309: recipe for target 'po/build/locale/pt_PT/LC_MESSAGES/git.mo' failed
make: *** [po/build/locale/pt_PT/LC_MESSAGES/git.mo] Error 127

The information about NO_GETTEXT I have from the configure file:

# Define NO_GETTEXT if you don't want Git output to be translated.

Does it need msgfmt nonetheless?

4

There are 4 answers

0
Vittore Marcas On

Please install gettext:

sudo apt-get install gettext

Manually install Git needs:

sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip
0
Guido Flohr On

The variable NO_GETTEXT is set by the configure script. If your build host has the gettext runtime, it is set to false.

You have several options to work around this:

  • Install the gettext tools (including msgfmt) on your build host.
  • Install a dummy msgfmt that just creates an empty output file.
  • /usr/bin/touch all .mo files before you run make and make sure that their last-modified time is more recent than that of the .po files.
  • Patch the Makefile before you run make. Setting the variable MOFILES to empty looks promising.

You probably have to patch the Makefile anyway, so maybe just go with the last option.

3
tanaydin On

Try with 1 instead of true...

https://www.atlassian.com/git/tutorials/install-git

NO_GETTEXT=1
1
5p0ng3b0b On

This worked for me.

make NO_GETTEXT=YesPlease