Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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
Expand Down Expand Up @@ -64,9 +65,7 @@ clean::

gitk-wish: gitk GIT-TCLTK-VARS
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
chmod +x $@+ && \
mv -f $@+ $@
$(SHELL_PATH) ./generate-tcl.sh "$(TCLTK_PATH_SQ)" "$<" "$@"

$(PO_TEMPLATE): gitk
$(XGETTEXT) -kmc -LTcl -o $@ gitk
Expand Down
11 changes: 11 additions & 0 deletions generate-tcl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

WISH=$(echo "$1" | sed 's/|/\\|/g')
INPUT="$2"
OUTPUT="$3"

sed -e "1,3s|^exec .* \"\$0\"|exec $WISH \"\$0\"|" "$INPUT" >"$OUTPUT"+
chmod a+x "$OUTPUT"+
mv "$OUTPUT"+ "$OUTPUT"
30 changes: 30 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,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
19 changes: 19 additions & 0 deletions po/meson.build
Original file line number Diff line number Diff line change
@@ -0,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,
)