git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* NO_MSGFMT
@ 2017-08-12 13:44 Dominik Mahrer (Teddy)
  2017-08-13  4:58 ` NO_MSGFMT Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Dominik Mahrer (Teddy) @ 2017-08-12 13:44 UTC (permalink / raw)
  To: git

Hi all

I'm compiling git from source code on a mashine without msgfmt. This 
leads to compile errors. To be able to compile git I created a patch 
that at least works for me:

diff -Naur ../git-2.14.1.orig/Makefile ./Makefile
--- ../git-2.14.1.orig/Makefile	2017-08-09 21:54:31.000000000 +0200
+++ ./Makefile	2017-08-12 15:22:06.000000000 +0200
@@ -2261,7 +2261,11 @@
  endif

  po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
+ifndef NO_MSGFMT
  	$(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<
+else
+	@echo Skipping file $@
+endif

  FIND_SOURCE_FILES = ( \
  	git ls-files \
@@ -2523,7 +2527,9 @@
  endif
  ifndef NO_TCLTK
  	$(MAKE) -C gitk-git install
-	$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
+	ifndef NO_MSGFMT
+		$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
+	endif
  endif
  ifneq (,$X)
  	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) 
$(BUILT_INS) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef 
'$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) 
'$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)



It would be great if it (or something similar) could be included in git.

Regards
Teddy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NO_MSGFMT
  2017-08-12 13:44 NO_MSGFMT Dominik Mahrer (Teddy)
@ 2017-08-13  4:58 ` Jeff King
  2017-11-12 11:57   ` NO_MSGFMT Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2017-08-13  4:58 UTC (permalink / raw)
  To: Dominik Mahrer (Teddy); +Cc: git

On Sat, Aug 12, 2017 at 03:44:17PM +0200, Dominik Mahrer (Teddy) wrote:

> Hi all
> 
> I'm compiling git from source code on a mashine without msgfmt. This leads
> to compile errors. To be able to compile git I created a patch that at least
> works for me:

Try:

  make NO_MSGFMT=Nope NO_GETTEXT=Nope

This also works:

  make NO_GETTEXT=Nope NO_TCLTK=Nope

The flags to avoid gettext/msgfmt are sadly different between git itself
and git-gui/gitk, which we include as a subproject. It would be a useful
patch to harmonize though (probably by accepting both in all places for
compatibility).

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NO_MSGFMT
  2017-08-13  4:58 ` NO_MSGFMT Jeff King
@ 2017-11-12 11:57   ` Jeff King
  2017-11-12 17:32     ` NO_MSGFMT Christian Couder
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2017-11-12 11:57 UTC (permalink / raw)
  To: Dominik Mahrer (Teddy); +Cc: git

On Sun, Aug 13, 2017 at 12:58:13AM -0400, Jeff King wrote:

> On Sat, Aug 12, 2017 at 03:44:17PM +0200, Dominik Mahrer (Teddy) wrote:
> 
> > Hi all
> > 
> > I'm compiling git from source code on a mashine without msgfmt. This leads
> > to compile errors. To be able to compile git I created a patch that at least
> > works for me:
> 
> Try:
> 
>   make NO_MSGFMT=Nope NO_GETTEXT=Nope
> 
> This also works:
> 
>   make NO_GETTEXT=Nope NO_TCLTK=Nope
> 
> The flags to avoid gettext/msgfmt are sadly different between git itself
> and git-gui/gitk, which we include as a subproject. It would be a useful
> patch to harmonize though (probably by accepting both in all places for
> compatibility).

I saw somebody else today run into problems about gettext, so I thought
I'd revisit this and write that patch. It turns out the situation is
slightly different than I thought. So no patch, but I wanted to report
here what I found.

It's true that the option is called NO_GETTEXT in git.git, but NO_MSGFMT
in the tcl programs we pull in. So I figured to start with a patch that
turns on NO_MSGFMT automatically when NO_GETTEXT is set. But it's
not necessary.

The gitk and git-gui tests actually check that msgfmt is available.
If it isn't, they automatically fall back to using a pure-tcl
implementation. So there's generally no need to set NO_MSGFMT at
all.

But that fallback is implemented using tcl. So if you _also_ don't have
tcl installed (and I don't), you get quite a confusing output from make:

  $ make -j1 
    SUBDIR git-gui
    MSGFMT po/pt_pt.msg Makefile:252: recipe for target 'po/pt_pt.msg' failed
make[1]: *** [po/pt_pt.msg] Error 127

If you run with V=1, you can see that it's not running msgfmt at all,
but:

  tclsh po/po2msg.sh --statistics --tcl -l pt_pt -d po/ po/pt_pt.po 

So my takeaways are:

  1. You should never need to set NO_MSGFMT; it falls back
     automatically.

  2. If you don't have gettext, you should set NO_GETTEXT to tell the
     rest of git not to use it.

  3. If you see msgfmt errors even after NO_GETTEXT, try NO_TCLTK.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NO_MSGFMT
  2017-11-12 11:57   ` NO_MSGFMT Jeff King
@ 2017-11-12 17:32     ` Christian Couder
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Couder @ 2017-11-12 17:32 UTC (permalink / raw)
  To: Jeff King; +Cc: Dominik Mahrer (Teddy), git

On Sun, Nov 12, 2017 at 12:57 PM, Jeff King <peff@peff.net> wrote:
> On Sun, Aug 13, 2017 at 12:58:13AM -0400, Jeff King wrote:
>
>> On Sat, Aug 12, 2017 at 03:44:17PM +0200, Dominik Mahrer (Teddy) wrote:
>>
>> > Hi all
>> >
>> > I'm compiling git from source code on a mashine without msgfmt. This leads
>> > to compile errors. To be able to compile git I created a patch that at least
>> > works for me:
>>
>> Try:
>>
>>   make NO_MSGFMT=Nope NO_GETTEXT=Nope
>>
>> This also works:
>>
>>   make NO_GETTEXT=Nope NO_TCLTK=Nope
>>
>> The flags to avoid gettext/msgfmt are sadly different between git itself
>> and git-gui/gitk, which we include as a subproject. It would be a useful
>> patch to harmonize though (probably by accepting both in all places for
>> compatibility).
>
> I saw somebody else today run into problems about gettext, so I thought
> I'd revisit this and write that patch. It turns out the situation is
> slightly different than I thought. So no patch, but I wanted to report
> here what I found.
>
> It's true that the option is called NO_GETTEXT in git.git, but NO_MSGFMT
> in the tcl programs we pull in. So I figured to start with a patch that
> turns on NO_MSGFMT automatically when NO_GETTEXT is set. But it's
> not necessary.
>
> The gitk and git-gui tests actually check that msgfmt is available.
> If it isn't, they automatically fall back to using a pure-tcl
> implementation. So there's generally no need to set NO_MSGFMT at
> all.
>
> But that fallback is implemented using tcl. So if you _also_ don't have
> tcl installed (and I don't), you get quite a confusing output from make:
>
>   $ make -j1
>     SUBDIR git-gui
>     MSGFMT po/pt_pt.msg Makefile:252: recipe for target 'po/pt_pt.msg' failed
> make[1]: *** [po/pt_pt.msg] Error 127
>
> If you run with V=1, you can see that it's not running msgfmt at all,
> but:
>
>   tclsh po/po2msg.sh --statistics --tcl -l pt_pt -d po/ po/pt_pt.po
>
> So my takeaways are:
>
>   1. You should never need to set NO_MSGFMT; it falls back
>      automatically.
>
>   2. If you don't have gettext, you should set NO_GETTEXT to tell the
>      rest of git not to use it.
>
>   3. If you see msgfmt errors even after NO_GETTEXT, try NO_TCLTK.

I wonder if something like following patch could help, as anyway the
build will fail if Tcl/Tk is not installed and people often prefer
builds failing at the beginning rather than towards the end.

diff --git a/Makefile b/Makefile
index ee9d5eb11e..9789027739 100644
--- a/Makefile
+++ b/Makefile
@@ -1636,6 +1636,13 @@ ifeq ($(TCLTK_PATH),)
 NO_TCLTK = NoThanks
 endif

+ifndef NO_TCLTK
+       has_tcltk := $(shell type $(TCLTK_PATH) 2>/dev/null)
+       ifndef has_tcltk
+$(error "Tcl/Tk is not installed ('$(TCLTK_PATH)' not found).
Consider setting NO_TCLTK or installing it")
+       endif
+endif
+
 ifeq ($(PERL_PATH),)
 NO_PERL = NoThanks
 endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-12 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-12 13:44 NO_MSGFMT Dominik Mahrer (Teddy)
2017-08-13  4:58 ` NO_MSGFMT Jeff King
2017-11-12 11:57   ` NO_MSGFMT Jeff King
2017-11-12 17:32     ` NO_MSGFMT Christian Couder

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git