Git fork

Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui:
git-gui: wire up support for the Meson build system
git-gui: stop including GIT-VERSION-FILE file
git-gui: extract script to generate macOS app
git-gui: extract script to generate macOS wrapper
git-gui: extract script to generate "tclIndex"
git-gui: extract script to generate "git-gui"
git-gui: drop no-op GITGUI_SCRIPT replacement
git-gui: make output of GIT-VERSION-GEN source'able
git-gui: prepare GIT-VERSION-GEN for out-of-tree builds
git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS

+451 -100
+1
git-gui/.gitattributes
··· 4 4 /po/*.po encoding=UTF-8 5 5 /GIT-VERSION-GEN eol=lf 6 6 Makefile whitespace=!indent,trail,space 7 + meson.build whitespace=space
+1 -1
git-gui/.gitignore
··· 2 2 config.mak 3 3 Git Gui.app* 4 4 git-gui.tcl 5 + GIT-GUI-BUILD-OPTIONS 5 6 GIT-VERSION-FILE 6 - GIT-GUI-VARS 7 7 git-gui 8 8 lib/tclIndex
+7
git-gui/GIT-GUI-BUILD-OPTIONS.in
··· 1 + GITGUI_GITEXECDIR=@GITGUI_GITEXECDIR@ 2 + GITGUI_LIBDIR=@GITGUI_LIBDIR@ 3 + GITGUI_RELATIVE=@GITGUI_RELATIVE@ 4 + SHELL_PATH=@SHELL_PATH@ 5 + TCLTK_PATH=@TCLTK_PATH@ 6 + TCL_PATH=@TCL_PATH@ 7 + TKEXECUTABLE=@TKEXECUTABLE@
+29 -15
git-gui/GIT-VERSION-GEN
··· 1 1 #!/bin/sh 2 2 3 - GVF=GIT-VERSION-FILE 4 3 DEF_VER=0.21.GITGUI 5 4 6 5 LF=' 7 6 ' 8 7 8 + if test "$#" -ne 2 9 + then 10 + echo >&2 "usage: $0 <SOURCE_DIR> <OUTPUT>" 11 + exit 1 12 + fi 13 + 14 + SOURCE_DIR="$1" 15 + OUTPUT="$2" 16 + 17 + # Protect us from reading Git version information outside of the Git directory 18 + # in case it is not a repository itself, but embedded in an unrelated 19 + # repository. 20 + GIT_CEILING_DIRECTORIES="$SOURCE_DIR/.." 21 + export GIT_CEILING_DIRECTORIES 22 + 9 23 tree_search () 10 24 { 11 25 head=$1 12 26 tree=$2 13 - for p in $(git rev-list --parents --max-count=1 $head 2>/dev/null) 27 + for p in $(git -C "$SOURCE_DIR" rev-list --parents --max-count=1 $head 2>/dev/null) 14 28 do 15 - test $tree = $(git rev-parse $p^{tree} 2>/dev/null) && 16 - vn=$(git describe --abbrev=4 $p 2>/dev/null) && 29 + test $tree = $(git -C "$SOURCE_DIR" rev-parse $p^{tree} 2>/dev/null) && 30 + vn=$(git -C "$SOURCE_DIR" describe --abbrev=4 $p 2>/dev/null) && 17 31 case "$vn" in 18 32 gitgui-[0-9]*) echo $vn; break;; 19 33 esac ··· 34 48 # If we are at the toplevel or the merge assumption fails 35 49 # try looking for a gitgui-* tag. 36 50 37 - if test -f version && 38 - VN=$(cat version) 51 + if test -f "$SOURCE_DIR"/version && 52 + VN=$(cat "$SOURCE_DIR"/version) 39 53 then 40 54 : happy 41 - elif prefix="$(git rev-parse --show-prefix 2>/dev/null)" 55 + elif prefix="$(git -C "$SOURCE_DIR" rev-parse --show-prefix 2>/dev/null)" 42 56 test -n "$prefix" && 43 - head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) && 44 - tree=$(git rev-parse --verify "HEAD:$prefix" 2>/dev/null) && 57 + head=$(git -C "$SOURCE_DIR" rev-list --max-count=1 HEAD -- . 2>/dev/null) && 58 + tree=$(git -C "$SOURCE_DIR" rev-parse --verify "HEAD:$prefix" 2>/dev/null) && 45 59 VN=$(tree_search $head $tree) 46 60 case "$VN" in 47 61 gitgui-[0-9]*) : happy ;; ··· 49 63 esac 50 64 then 51 65 VN=$(echo "$VN" | sed -e 's/^gitgui-//;s/-/./g'); 52 - elif VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && 66 + elif VN=$(git -C "$SOURCE_DIR" describe --abbrev=4 HEAD 2>/dev/null) && 53 67 case "$VN" in 54 68 gitgui-[0-9]*) : happy ;; 55 69 *) (exit 1) ;; ··· 60 74 VN="$DEF_VER" 61 75 fi 62 76 63 - dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty= 77 + dirty=$(git -C "$SOURCE_DIR" diff-index --name-only HEAD 2>/dev/null) || dirty= 64 78 case "$dirty" in 65 79 '') 66 80 ;; ··· 68 82 VN="$VN-dirty" ;; 69 83 esac 70 84 71 - if test -r $GVF 85 + if test -r "$OUTPUT" 72 86 then 73 - VC=$(sed -e 's/^GITGUI_VERSION = //' <$GVF) 87 + VC=$(sed -e 's/^GITGUI_VERSION=//' <"$OUTPUT") 74 88 else 75 89 VC=unset 76 90 fi 77 91 test "$VN" = "$VC" || { 78 - echo >&2 "GITGUI_VERSION = $VN" 79 - echo "GITGUI_VERSION = $VN" >$GVF 92 + echo >&2 "GITGUI_VERSION=$VN" 93 + echo "GITGUI_VERSION=$VN" >"$OUTPUT" 80 94 }
+27 -84
git-gui/Makefile
··· 9 9 # 10 10 11 11 GIT-VERSION-FILE: FORCE 12 - @$(SHELL_PATH) ./GIT-VERSION-GEN 13 - ifneq ($(MAKECMDGOALS),clean) 14 - -include GIT-VERSION-FILE 15 - endif 12 + @$(SHELL_PATH) ./GIT-VERSION-GEN . $@ 16 13 17 14 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') 18 15 uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') ··· 76 73 QUIET_INDEX = $(QUIET)echo ' ' INDEX $(dir $@) && 77 74 QUIET_MSGFMT0 = $(QUIET)printf ' MSGFMT %12s ' $@ && v=` 78 75 QUIET_MSGFMT1 = 2>&1` && echo "$$v" | sed -e 's/fuzzy translations/fuzzy/' | sed -e 's/ messages*//g' 79 - QUIET_2DEVNULL = 2>/dev/null 80 76 81 77 INSTALL_D0 = dir= 82 78 INSTALL_D1 = && echo ' ' DEST $$dir && $(INSTALL) -d -m 755 "$$dir" ··· 114 110 TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app 115 111 endif 116 112 endif 117 - TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app) 113 + TKEXECUTABLE = $(TKFRAMEWORK)/Contents/MacOS/$(shell basename "$(TKFRAMEWORK)" .app) 114 + TKEXECUTABLE_SQ = $(subst ','\'',$(TKEXECUTABLE)) 118 115 endif 119 116 120 117 ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s) ··· 128 125 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) 129 126 TCL_PATH_SQ = $(subst ','\'',$(TCL_PATH)) 130 127 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) 131 - TCLTK_PATH_SED = $(subst ','\'',$(subst \,\\,$(TCLTK_PATH))) 132 128 133 129 gg_libdir ?= $(sharedir)/git-gui/lib 134 130 libdir_SQ = $(subst ','\'',$(gg_libdir)) 135 - libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir_sed_in))) 136 131 exedir = $(dir $(gitexecdir))share/git-gui/lib 137 132 138 - GITGUI_SCRIPT := $$0 139 133 GITGUI_RELATIVE := 140 134 GITGUI_MACOSXAPP := 141 135 142 136 ifeq ($(exedir),$(gg_libdir)) 143 137 GITGUI_RELATIVE := 1 144 138 endif 145 - gg_libdir_sed_in := $(gg_libdir) 146 139 ifeq ($(uname_S),Darwin) 147 140 ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y) 148 141 GITGUI_MACOSXAPP := YesPlease ··· 159 152 ifdef GITGUI_MACOSXAPP 160 153 GITGUI_MAIN := git-gui.tcl 161 154 162 - git-gui: GIT-VERSION-FILE GIT-GUI-VARS 163 - $(QUIET_GEN)rm -f $@ $@+ && \ 164 - echo '#!$(SHELL_PATH_SQ)' >$@+ && \ 165 - echo 'if test "z$$*" = zversion ||' >>$@+ && \ 166 - echo ' test "z$$*" = z--version' >>$@+ && \ 167 - echo then >>$@+ && \ 168 - echo ' 'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \ 169 - echo else >>$@+ && \ 170 - echo ' libdir="$${GIT_GUI_LIB_DIR:-$(libdir_SQ)}"' >>$@+ && \ 171 - echo ' 'exec \"'$$libdir/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\" \ 172 - '"$$0" "$$@"' >>$@+ && \ 173 - echo fi >>$@+ && \ 174 - chmod +x $@+ && \ 175 - mv $@+ $@ 155 + git-gui: generate-macos-wrapper.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS 156 + $(QUIET_GEN)$(SHELL_PATH) generate-macos-wrapper.sh "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE 176 157 177 - Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-VARS \ 158 + Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS \ 178 159 macosx/Info.plist \ 179 160 macosx/git-gui.icns \ 180 161 macosx/AppMain.tcl \ 181 - $(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE) 182 - $(QUIET_GEN)rm -rf '$@' '$@'+ && \ 183 - mkdir -p '$@'+/Contents/MacOS && \ 184 - mkdir -p '$@'+/Contents/Resources/Scripts && \ 185 - cp '$(subst ','\'',$(subst \,,$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)))' \ 186 - '$@'+/Contents/MacOS && \ 187 - cp macosx/git-gui.icns '$@'+/Contents/Resources && \ 188 - sed -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \ 189 - -e 's/@@GITGUI_TKEXECUTABLE@@/$(TKEXECUTABLE)/g' \ 190 - macosx/Info.plist \ 191 - >'$@'+/Contents/Info.plist && \ 192 - sed -e 's|@@gitexecdir@@|$(gitexecdir_SQ)|' \ 193 - -e 's|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \ 194 - macosx/AppMain.tcl \ 195 - >'$@'+/Contents/Resources/Scripts/AppMain.tcl && \ 196 - mv '$@'+ '$@' 162 + $(TKEXECUTABLE) 163 + $(QUIET_GEN)$(SHELL_PATH) generate-macos-app.sh . "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE 197 164 endif 198 165 199 166 ifdef GITGUI_WINDOWS_WRAPPER ··· 203 170 cp $< $@ 204 171 endif 205 172 206 - $(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS 207 - $(QUIET_GEN)rm -f $@ $@+ && \ 208 - sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ 209 - -e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \ 210 - -e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \ 211 - -e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \ 212 - -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \ 213 - -e 's|@@GITGUI_RELATIVE@@|$(GITGUI_RELATIVE)|' \ 214 - -e '$(GITGUI_RELATIVE)s|@@GITGUI_LIBDIR@@|$(libdir_SED)|' \ 215 - git-gui.sh >$@+ && \ 216 - chmod +x $@+ && \ 217 - mv $@+ $@ 173 + $(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS 174 + $(QUIET_GEN)$(SHELL_PATH) generate-git-gui.sh "$<" "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE 218 175 219 176 XGETTEXT ?= xgettext 220 177 ifdef NO_MSGFMT ··· 239 196 $(ALL_MSGFILES): %.msg : %.po 240 197 $(QUIET_MSGFMT0)$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $< $(QUIET_MSGFMT1) 241 198 242 - lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VARS 243 - $(QUIET_INDEX)if echo \ 244 - $(foreach p,$(PRELOAD_FILES),source $p\;) \ 245 - auto_mkindex lib $(patsubst lib/%,%,$(sort $(ALL_LIBFILES))) \ 246 - | $(TCL_PATH) $(QUIET_2DEVNULL); then : ok; \ 247 - else \ 248 - echo >&2 " * $(TCL_PATH) failed; using unoptimized loading"; \ 249 - rm -f $@ ; \ 250 - echo '# Autogenerated by git-gui Makefile' >$@ && \ 251 - echo >>$@ && \ 252 - $(foreach p,$(PRELOAD_FILES) $(sort $(ALL_LIBFILES)),echo '$(subst lib/,,$p)' >>$@ &&) \ 253 - echo >>$@ ; \ 254 - fi 199 + lib/tclIndex: $(ALL_LIBFILES) generate-tclindex.sh GIT-GUI-BUILD-OPTIONS 200 + $(QUIET_INDEX)$(SHELL_PATH) generate-tclindex.sh . ./GIT-GUI-BUILD-OPTIONS $(ALL_LIBFILES) 255 201 256 - TRACK_VARS = \ 257 - $(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \ 258 - $(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \ 259 - $(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \ 260 - $(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \ 261 - $(subst ','\'',gg_libdir='$(libdir_SQ)') \ 262 - GITGUI_MACOSXAPP=$(GITGUI_MACOSXAPP) \ 263 - #end TRACK_VARS 264 - 265 - GIT-GUI-VARS: FORCE 266 - @VARS='$(TRACK_VARS)'; \ 267 - if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ 268 - echo >&2 " * new locations or Tcl/Tk interpreter"; \ 269 - echo >$@ "$$VARS"; \ 270 - fi 202 + GIT-GUI-BUILD-OPTIONS: FORCE 203 + @sed \ 204 + -e 's|@GITGUI_GITEXECDIR@|$(gitexecdir_SQ)|' \ 205 + -e 's|@GITGUI_LIBDIR@|$(libdir_SQ)|' \ 206 + -e 's|@GITGUI_RELATIVE@|$(GITGUI_RELATIVE)|' \ 207 + -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ 208 + -e 's|@TCLTK_PATH@|$(TCLTK_PATH_SQ)|' \ 209 + -e 's|@TCL_PATH@|$(TCL_PATH_SQ)|' \ 210 + -e 's|@TKEXECUTABLE@|$(TKEXECUTABLE_SQ)|' \ 211 + $@.in >$@+ 212 + @if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi 213 + @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi 271 214 272 215 ifdef GITGUI_MACOSXAPP 273 216 all:: git-gui Git\ Gui.app ··· 317 260 $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1) 318 261 $(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1) 319 262 320 - dist-version: 263 + dist-version: GIT-VERSION-FILE 321 264 @mkdir -p $(TARDIR) 322 - @echo $(GITGUI_VERSION) > $(TARDIR)/version 265 + @sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version 323 266 324 267 clean:: 325 268 $(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg $(PO_TEMPLATE) 326 - $(RM_RF) GIT-VERSION-FILE GIT-GUI-VARS 269 + $(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS 327 270 ifdef GITGUI_MACOSXAPP 328 271 $(RM_RF) 'Git Gui.app'* git-gui 329 272 endif
+29
git-gui/generate-git-gui.sh
··· 1 + #!/bin/sh 2 + 3 + set -e 4 + 5 + if test "$#" -ne 4 6 + then 7 + echo >&2 "usage: $0 <INPUT> <OUTPUT> <BUILD_OPTIONS> <VERSION_FILE>" 8 + exit 1 9 + fi 10 + 11 + INPUT="$1" 12 + OUTPUT="$2" 13 + BUILD_OPTIONS="$3" 14 + VERSION_FILE="$4" 15 + 16 + . "${BUILD_OPTIONS}" 17 + . "${VERSION_FILE}" 18 + 19 + rm -f "$OUTPUT" "$OUTPUT+" 20 + sed \ 21 + -e "1s|#!.*/sh|#!$SHELL_PATH|" \ 22 + -e "s|@@SHELL_PATH@@|$SHELL_PATH|" \ 23 + -e "1,30s|^ exec wish | exec '$TCLTK_PATH' |" \ 24 + -e "s|@@GITGUI_VERSION@@|$GITGUI_VERSION|g" \ 25 + -e "s|@@GITGUI_RELATIVE@@|$GITGUI_RELATIVE|" \ 26 + -e "${GITGUI_RELATIVE}s|@@GITGUI_LIBDIR@@|$GITGUI_LIBDIR|" \ 27 + "$INPUT" >"$OUTPUT"+ 28 + chmod +x "$OUTPUT"+ 29 + mv "$OUTPUT"+ "$OUTPUT"
+30
git-gui/generate-macos-app.sh
··· 1 + #!/bin/sh 2 + 3 + set -e 4 + 5 + SOURCE_DIR="$1" 6 + OUTPUT="$2" 7 + BUILD_OPTIONS="$3" 8 + VERSION_FILE="$4" 9 + 10 + . "$BUILD_OPTIONS" 11 + . "$VERSION_FILE" 12 + 13 + rm -rf "$OUTPUT" "$OUTPUT+" 14 + 15 + mkdir -p "$OUTPUT+/Contents/MacOS" 16 + mkdir -p "$OUTPUT+/Contents/Resources/Scripts" 17 + 18 + cp "$TKEXECUTABLE" "$OUTPUT+/Contents/MacOS" 19 + cp "$SOURCE_DIR/macosx/git-gui.icns" "$OUTPUT+/Contents/Resources" 20 + sed \ 21 + -e "s/@@GITGUI_VERSION@@/$GITGUI_VERSION/g" \ 22 + -e "s/@@GITGUI_TKEXECUTABLE@@/$(basename "$TKEXECUTABLE")/g" \ 23 + "$SOURCE_DIR/macosx/Info.plist" \ 24 + >"$OUTPUT+/Contents/Info.plist" 25 + sed \ 26 + -e "s|@@gitexecdir@@|$GITGUI_GITEXECDIR|" \ 27 + -e "s|@@GITGUI_LIBDIR@@|$GITGUI_LIBDIR|" \ 28 + "$SOURCE_DIR/macosx/AppMain.tcl" \ 29 + >"$OUTPUT+/Contents/Resources/Scripts/AppMain.tcl" 30 + mv "$OUTPUT+" "$OUTPUT"
+35
git-gui/generate-macos-wrapper.sh
··· 1 + #!/bin/sh 2 + 3 + set -e 4 + 5 + if test "$#" -ne 3 6 + then 7 + echo >&2 "usage: $0 <OUTPUT> <BUILD_OPTIONS> <VERSION_FILE>" 8 + exit 1 9 + fi 10 + 11 + OUTPUT="$1" 12 + BUILD_OPTIONS="$2" 13 + VERSION_FILE="$3" 14 + 15 + . "$BUILD_OPTIONS" 16 + 17 + rm -f "$OUTPUT" "$OUTPUT+" 18 + 19 + ( 20 + echo "#!$SHELL_PATH" 21 + cat "$BUILD_OPTIONS" "$VERSION_FILE" 22 + cat <<-'EOF' 23 + if test "z$*" = zversion || 24 + test "z$*" = z--version 25 + then 26 + echo "git-gui version $GITGUI_VERSION" 27 + else 28 + libdir="${GIT_GUI_LIB_DIR:-$GITGUI_LIBDIR}" 29 + exec "$libdir/Git Gui.app/Contents/MacOS/$(basename "$TKEXECUTABLE")" "$0" "$@" 30 + fi 31 + EOF 32 + ) >"$OUTPUT+" 33 + 34 + chmod +x "$OUTPUT+" 35 + mv "$OUTPUT+" "$OUTPUT"
+32
git-gui/generate-tclindex.sh
··· 1 + #!/bin/sh 2 + 3 + if test "$#" -lt 3 4 + then 5 + echo >&2 "usage: $0 <BUILD_DIR> <BUILD_OPTIONS> <LIBFILE> [<LIBFILE>...]" 6 + exit 1 7 + fi 8 + 9 + BUILD_DIR="$1" 10 + BUILD_OPTIONS="$2" 11 + shift 2 12 + LIBFILES="$(echo "$@" | sort | sed 's|lib/||g')" 13 + 14 + . "$BUILD_OPTIONS" 15 + 16 + cd "$BUILD_DIR" 17 + 18 + if { 19 + echo "source lib/class.tcl;" 20 + echo "auto_mkindex lib $LIBFILES" 21 + } | "$TCL_PATH" 22 + then 23 + : ok 24 + else 25 + echo >&2 " * $TCL_PATH failed; using unoptimized loading" 26 + rm -f $@ 27 + echo '# Autogenerated by git-gui Makefile' >lib/tclIndex 28 + echo >>lib/tclIndex 29 + echo "class.tcl" >>lib/tclIndex 30 + printf "%s\n" $LIBFILES >>lib/tclIndex 31 + echo >>lib/tclIndex 32 + fi
+74
git-gui/lib/meson.build
··· 1 + libfiles = [ 2 + 'about.tcl', 3 + 'blame.tcl', 4 + 'branch_checkout.tcl', 5 + 'branch_create.tcl', 6 + 'branch_delete.tcl', 7 + 'branch_rename.tcl', 8 + 'branch.tcl', 9 + 'browser.tcl', 10 + 'checkout_op.tcl', 11 + 'choose_font.tcl', 12 + 'choose_repository.tcl', 13 + 'choose_rev.tcl', 14 + 'chord.tcl', 15 + 'class.tcl', 16 + 'commit.tcl', 17 + 'console.tcl', 18 + 'database.tcl', 19 + 'date.tcl', 20 + 'diff.tcl', 21 + 'encoding.tcl', 22 + 'error.tcl', 23 + 'index.tcl', 24 + 'line.tcl', 25 + 'logo.tcl', 26 + 'merge.tcl', 27 + 'mergetool.tcl', 28 + 'option.tcl', 29 + 'remote_add.tcl', 30 + 'remote_branch_delete.tcl', 31 + 'remote.tcl', 32 + 'search.tcl', 33 + 'shortcut.tcl', 34 + 'spellcheck.tcl', 35 + 'sshkey.tcl', 36 + 'status_bar.tcl', 37 + 'themed.tcl', 38 + 'tools_dlg.tcl', 39 + 'tools.tcl', 40 + 'transport.tcl', 41 + 'win32.tcl', 42 + ] 43 + 44 + nontcl_libfiles = [ 45 + 'git-gui.ico', 46 + 'win32_shortcut.js', 47 + ] 48 + 49 + foreach file : libfiles + nontcl_libfiles 50 + configure_file( 51 + input: file, 52 + output: file, 53 + copy: true, 54 + install: true, 55 + install_dir: get_option('datadir') / 'git-gui/lib', 56 + ) 57 + endforeach 58 + 59 + custom_target( 60 + output: 'tclIndex', 61 + command: [ 62 + shell, 63 + meson.project_source_root() / 'generate-tclindex.sh', 64 + meson.project_build_root(), 65 + meson.project_build_root() / 'GIT-GUI-BUILD-OPTIONS', 66 + libfiles, 67 + ], 68 + depend_files: [ 69 + libfiles, 70 + build_options, 71 + ], 72 + install: true, 73 + install_dir: get_option('datadir') / 'git-gui/lib', 74 + )
+148
git-gui/meson.build
··· 1 + project('git-gui', 2 + meson_version: '>=0.61.0', 3 + ) 4 + 5 + fs = import('fs') 6 + 7 + shell = find_program('sh') 8 + tclsh = find_program('tclsh') 9 + wish = find_program('wish') 10 + 11 + build_options_config = configuration_data() 12 + if target_machine.system() == 'windows' 13 + build_options_config.set('GITGUI_RELATIVE', '1') 14 + else 15 + build_options_config.set('GITGUI_RELATIVE', '') 16 + endif 17 + build_options_config.set_quoted('GITGUI_GITEXECDIR', get_option('prefix') / get_option('libexecdir') / 'git-core') 18 + build_options_config.set_quoted('GITGUI_LIBDIR', get_option('prefix') / get_option('datadir') / 'git-gui/lib') 19 + build_options_config.set_quoted('SHELL_PATH', fs.as_posix(shell.full_path())) 20 + build_options_config.set_quoted('TCLTK_PATH', fs.as_posix(wish.full_path())) 21 + build_options_config.set_quoted('TCL_PATH', fs.as_posix(tclsh.full_path())) 22 + if target_machine.system() == 'darwin' 23 + tkexecutables = [ 24 + '/Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish', 25 + '/System/Library/Frameworks/Tk.framework/Resources/Wish.app/Contents/MacOS/Wish', 26 + '/System/Library/Frameworks/Tk.framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell', 27 + ] 28 + tkexecutable = find_program(tkexecutables) 29 + build_options_config.set_quoted('TKEXECUTABLE', tkexecutable.full_path()) 30 + else 31 + build_options_config.set('TKEXECUTABLE', '') 32 + endif 33 + 34 + build_options = configure_file( 35 + input: 'GIT-GUI-BUILD-OPTIONS.in', 36 + output: 'GIT-GUI-BUILD-OPTIONS', 37 + configuration: build_options_config, 38 + ) 39 + 40 + version_file = custom_target( 41 + input: 'GIT-VERSION-GEN', 42 + output: 'GIT-VERSION-FILE', 43 + command: [ 44 + shell, 45 + '@INPUT@', 46 + meson.current_source_dir(), 47 + '@OUTPUT@', 48 + ], 49 + build_always_stale: true, 50 + ) 51 + 52 + configure_file( 53 + input: 'git-gui--askpass', 54 + output: 'git-gui--askpass', 55 + copy: true, 56 + install: true, 57 + install_dir: get_option('libexecdir') / 'git-core', 58 + ) 59 + 60 + gitgui_main = 'git-gui' 61 + gitgui_main_install_dir = get_option('libexecdir') / 'git-core' 62 + 63 + if target_machine.system() == 'windows' 64 + gitgui_main = 'git-gui.tcl' 65 + 66 + configure_file( 67 + input: 'windows/git-gui.sh', 68 + output: 'git-gui', 69 + copy: true, 70 + install: true, 71 + install_dir: get_option('libexecdir') / 'git-core', 72 + ) 73 + elif target_machine.system() == 'darwin' 74 + gitgui_main = 'git-gui.tcl' 75 + gitgui_main_install_dir = get_option('datadir') / 'git-gui/lib' 76 + 77 + custom_target( 78 + output: 'git-gui', 79 + command: [ 80 + shell, 81 + meson.current_source_dir() / 'generate-macos-wrapper.sh', 82 + '@OUTPUT@', 83 + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', 84 + meson.current_build_dir() / 'GIT-VERSION-FILE', 85 + ], 86 + depends: [ 87 + version_file, 88 + ], 89 + depend_files: [ 90 + build_options, 91 + ], 92 + install: true, 93 + install_dir: get_option('libexecdir') / 'git-core', 94 + ) 95 + 96 + custom_target( 97 + output: 'Git Gui.app', 98 + command: [ 99 + shell, 100 + meson.current_source_dir() / 'generate-macos-app.sh', 101 + meson.current_source_dir(), 102 + meson.current_build_dir() / 'Git Gui.app', 103 + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', 104 + meson.current_build_dir() / 'GIT-VERSION-FILE', 105 + ], 106 + depends: [ 107 + version_file, 108 + ], 109 + depend_files: [ 110 + build_options, 111 + 'macosx/AppMain.tcl', 112 + 'macosx/Info.plist', 113 + 'macosx/git-gui.icns', 114 + ], 115 + build_by_default: true, 116 + install: true, 117 + install_dir: get_option('datadir') / 'git-gui/lib', 118 + ) 119 + endif 120 + 121 + custom_target( 122 + input: 'git-gui.sh', 123 + output: gitgui_main, 124 + command: [ 125 + shell, 126 + meson.current_source_dir() / 'generate-git-gui.sh', 127 + '@INPUT@', 128 + '@OUTPUT@', 129 + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', 130 + meson.current_build_dir() / 'GIT-VERSION-FILE', 131 + ], 132 + depends: [ 133 + version_file, 134 + ], 135 + depend_files: [ 136 + build_options, 137 + ], 138 + install: true, 139 + install_dir: gitgui_main_install_dir, 140 + ) 141 + 142 + install_symlink('git-citool', 143 + install_dir: get_option('libexecdir') / 'git-core', 144 + pointing_to: 'git-gui', 145 + ) 146 + 147 + subdir('lib') 148 + subdir('po')
+38
git-gui/po/meson.build
··· 1 + languages = [ 2 + 'bg', 3 + 'de', 4 + 'el', 5 + 'fr', 6 + 'hu', 7 + 'it', 8 + 'ja', 9 + 'nb', 10 + 'pt_br', 11 + 'pt_pt', 12 + 'ru', 13 + 'sv', 14 + 'vi', 15 + 'zh_cn', 16 + ] 17 + 18 + msgfmt = find_program('msgfmt', required: false) 19 + if not msgfmt.found() 20 + subdir_done() 21 + endif 22 + 23 + foreach language : languages 24 + custom_target( 25 + input: language + '.po', 26 + output: language + '.msg', 27 + command: [ 28 + msgfmt, 29 + '--statistics', 30 + '--tcl', 31 + '--locale=' + language, 32 + '-d', meson.current_build_dir(), 33 + '@INPUT@', 34 + ], 35 + install: true, 36 + install_dir: get_option('datadir') / 'git-gui/lib/msgs', 37 + ) 38 + endforeach