Testing tangled. Original: https://github.com/j6t/gitk

Merge branch 'pks-meson-support' of https://github.com/pks-t/gitk

* 'pks-meson-support' of https://github.com/pks-t/gitk:
gitk: introduce support for the Meson build system
gitk: extract script to build executable

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

+2 -3
Makefile
··· 8 8 msgsdir ?= $(gitk_libdir)/msgs 9 9 msgsdir_SQ = $(subst ','\'',$(msgsdir)) 10 10 11 + SHELL_PATH ?= /bin/sh 11 12 TCL_PATH ?= tclsh 12 13 TCLTK_PATH ?= wish 13 14 INSTALL ?= install ··· 64 65 65 66 gitk-wish: gitk GIT-TCLTK-VARS 66 67 $(QUIET_GEN)$(RM) $@ $@+ && \ 67 - sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \ 68 - chmod +x $@+ && \ 69 - mv -f $@+ $@ 68 + $(SHELL_PATH) ./generate-tcl.sh "$(TCLTK_PATH_SQ)" "$<" "$@" 70 69 71 70 $(PO_TEMPLATE): gitk 72 71 $(XGETTEXT) -kmc -LTcl -o $@ gitk
+11
generate-tcl.sh
··· 1 + #!/bin/sh 2 + 3 + set -e 4 + 5 + WISH=$(echo "$1" | sed 's/|/\\|/g') 6 + INPUT="$2" 7 + OUTPUT="$3" 8 + 9 + sed -e "1,3s|^exec .* \"\$0\"|exec $WISH \"\$0\"|" "$INPUT" >"$OUTPUT"+ 10 + chmod a+x "$OUTPUT"+ 11 + mv "$OUTPUT"+ "$OUTPUT"
+30
meson.build
··· 1 + project('gitk') 2 + 3 + shell = find_program('sh') 4 + wish = find_program('wish') 5 + 6 + # Verify that dependencies of "generate-tcl.sh" are satisfied. 7 + foreach dependency : [ 'chmod', 'mv', 'sed' ] 8 + find_program(dependency) 9 + endforeach 10 + 11 + custom_target( 12 + command: [ 13 + shell, 14 + meson.current_source_dir() / 'generate-tcl.sh', 15 + wish.full_path(), 16 + '@INPUT@', 17 + '@OUTPUT@', 18 + ], 19 + input: 'gitk', 20 + output: 'gitk', 21 + depend_files: [ 22 + 'generate-tcl.sh', 23 + ], 24 + install: true, 25 + install_dir: get_option('bindir'), 26 + ) 27 + 28 + if find_program('msgfmt').found() 29 + subdir('po') 30 + endif
+19
po/meson.build
··· 1 + import('i18n').gettext('gitk', 2 + languages: [ 3 + 'bg', 4 + 'ca', 5 + 'de', 6 + 'es', 7 + 'fr', 8 + 'hu', 9 + 'it', 10 + 'ja', 11 + 'pt_br', 12 + 'pt_pt', 13 + 'ru', 14 + 'sv', 15 + 'vi', 16 + 'zh_cn', 17 + ], 18 + install: true, 19 + )