From: Junio C Hamano Date: Thu, 20 Feb 2025 13:59:56 +0000 (-0800) Subject: Merge branch 'master' of https://github.com/j6t/gitk X-Git-Tag: v2.49.0-rc0~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b838bf1938926a7a900166136d995d86f8a00e24;p=thirdparty%2Fgit.git Merge branch 'master' of https://github.com/j6t/gitk * 'master' of https://github.com/j6t/gitk: gitk: introduce support for the Meson build system gitk: extract script to build executable gitk: make the "list references" default window width wider gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6 gitk: Use an external icon file on Windows gitk: Unicode file name support gitk(Windows): avoid inadvertently calling executables in the worktree --- b838bf1938926a7a900166136d995d86f8a00e24 diff --cc gitk-git/Makefile index e1f0aff4a1,0000000000..3a3c56c318 mode 100644,000000..100644 --- a/gitk-git/Makefile +++ b/gitk-git/Makefile @@@ -1,80 -1,0 +1,79 @@@ +# The default target of this Makefile is... +all:: + +prefix ?= $(HOME) +bindir ?= $(prefix)/bin +sharedir ?= $(prefix)/share +gitk_libdir ?= $(sharedir)/gitk/lib +msgsdir ?= $(gitk_libdir)/msgs +msgsdir_SQ = $(subst ','\'',$(msgsdir)) + ++SHELL_PATH ?= /bin/sh +TCL_PATH ?= tclsh +TCLTK_PATH ?= wish +INSTALL ?= install +RM ?= rm -f + +DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) +bindir_SQ = $(subst ','\'',$(bindir)) +TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) + +### Detect Tck/Tk interpreter path changes +TRACK_TCLTK = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)') + +GIT-TCLTK-VARS: FORCE + @VARS='$(TRACK_TCLTK)'; \ + if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ + echo 1>&2 " * new Tcl/Tk interpreter location"; \ + echo "$$VARS" >$@; \ + fi + +## po-file creation rules +XGETTEXT ?= xgettext +ifdef NO_MSGFMT + MSGFMT ?= $(TCL_PATH) po/po2msg.sh +else + MSGFMT ?= msgfmt + ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0) + MSGFMT := $(TCL_PATH) po/po2msg.sh + endif +endif + +PO_TEMPLATE = po/gitk.pot +ALL_POFILES = $(wildcard po/*.po) +ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES)) + +ifndef V + QUIET = @ + QUIET_GEN = $(QUIET)echo ' ' GEN $@ && +endif + +all:: gitk-wish $(ALL_MSGFILES) + +install:: all + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' + $(INSTALL) -m 755 gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(msgsdir_SQ)' + $(foreach p,$(ALL_MSGFILES), $(INSTALL) -m 644 $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true + +uninstall:: + $(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true + $(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk + +clean:: + $(RM) gitk-wish po/*.msg GIT-TCLTK-VARS + +gitk-wish: gitk GIT-TCLTK-VARS + $(QUIET_GEN)$(RM) $@ $@+ && \ - sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' $@+ && \ - chmod +x $@+ && \ - mv -f $@+ $@ ++ $(SHELL_PATH) ./generate-tcl.sh "$(TCLTK_PATH_SQ)" "$<" "$@" + +$(PO_TEMPLATE): gitk + $(XGETTEXT) -kmc -LTcl -o $@ gitk +update-po:: $(PO_TEMPLATE) + $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; ) +$(ALL_MSGFILES): %.msg : %.po + @echo Generating catalog $@ + $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@) + +.PHONY: all install uninstall clean update-po +.PHONY: FORCE diff --cc gitk-git/generate-tcl.sh index 0000000000,46bba6d246..46bba6d246 mode 000000,100755..100755 --- a/gitk-git/generate-tcl.sh +++ b/gitk-git/generate-tcl.sh diff --cc gitk-git/meson.build index 0000000000,0000000000..ca3c0cec58 new file mode 100644 --- /dev/null +++ b/gitk-git/meson.build @@@ -1,0 -1,0 +1,30 @@@ ++project('gitk') ++ ++shell = find_program('sh') ++wish = find_program('wish') ++ ++# Verify that dependencies of "generate-tcl.sh" are satisfied. ++foreach dependency : [ 'chmod', 'mv', 'sed' ] ++ find_program(dependency) ++endforeach ++ ++custom_target( ++ command: [ ++ shell, ++ meson.current_source_dir() / 'generate-tcl.sh', ++ wish.full_path(), ++ '@INPUT@', ++ '@OUTPUT@', ++ ], ++ input: 'gitk', ++ output: 'gitk', ++ depend_files: [ ++ 'generate-tcl.sh', ++ ], ++ install: true, ++ install_dir: get_option('bindir'), ++) ++ ++if find_program('msgfmt').found() ++ subdir('po') ++endif diff --cc gitk-git/po/meson.build index 0000000000,0000000000..b1ed019828 new file mode 100644 --- /dev/null +++ b/gitk-git/po/meson.build @@@ -1,0 -1,0 +1,19 @@@ ++import('i18n').gettext('gitk', ++ languages: [ ++ 'bg', ++ 'ca', ++ 'de', ++ 'es', ++ 'fr', ++ 'hu', ++ 'it', ++ 'ja', ++ 'pt_br', ++ 'pt_pt', ++ 'ru', ++ 'sv', ++ 'vi', ++ 'zh_cn', ++ ], ++ install: true, ++)