Git fork

Merge branch 'cb/no-tcl86-on-macos'

* cb/no-tcl86-on-macos:
git-gui: ensure own version of git-gui--askpass is used
git-gui: honor TCLTK_PATH in git-gui--askpass
git-gui: retire Git Gui.app
git-gui: fix dependency of GITGUI_MAIN on generator
git-gui: remove uname_O in Makefile

+46 -247
+1 -1
.gitignore
··· 1 1 .DS_Store 2 2 config.mak 3 - Git Gui.app* 4 3 git-gui.tcl 5 4 GIT-GUI-BUILD-OPTIONS 6 5 GIT-VERSION-FILE 7 6 git-gui 7 + git-gui--askpass 8 8 lib/tclIndex
-1
GIT-GUI-BUILD-OPTIONS.in
··· 4 4 SHELL_PATH=@SHELL_PATH@ 5 5 TCLTK_PATH=@TCLTK_PATH@ 6 6 TCL_PATH=@TCL_PATH@ 7 - TKEXECUTABLE=@TKEXECUTABLE@
+6 -55
Makefile
··· 11 11 @$(SHELL_PATH) ./GIT-VERSION-GEN . $@ 12 12 13 13 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') 14 - uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') 15 14 uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') 16 15 17 16 SCRIPT_SH = git-gui.sh ··· 53 52 INSTALL_R1 = 54 53 INSTALL_X0 = $(INSTALL) -m 755 # space is required here 55 54 INSTALL_X1 = 56 - INSTALL_A0 = find # space is required here 57 - INSTALL_A1 = | cpio -pud 58 55 INSTALL_L0 = rm -f # space is required here 59 56 INSTALL_L1 = && ln # space is required here 60 57 INSTALL_L2 = ··· 79 76 INSTALL_R1 = && echo ' ' INSTALL 644 `basename $$src` && $(INSTALL) -m 644 $$src 80 77 INSTALL_X0 = src= 81 78 INSTALL_X1 = && echo ' ' INSTALL 755 `basename $$src` && $(INSTALL) -m 755 $$src 82 - INSTALL_A0 = src= 83 - INSTALL_A1 = && echo ' ' INSTALL ' ' `basename "$$src"` && find "$$src" | cpio -pud 84 79 85 80 INSTALL_L0 = dst= 86 81 INSTALL_L1 = && src= ··· 101 96 TCL_PATH ?= $(dir $(TCLTK_PATH))$(notdir $(subst wish,tclsh,$(TCLTK_PATH))) 102 97 endif 103 98 104 - ifeq ($(uname_S),Darwin) 105 - TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app 106 - ifeq ($(shell echo "$(uname_R)" | awk -F. '{if ($$1 >= 9) print "y"}')_$(shell test -d $(TKFRAMEWORK) || echo n),y_n) 107 - TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish.app 108 - ifeq ($(shell test -d $(TKFRAMEWORK) || echo n),n) 109 - TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app 110 - endif 111 - endif 112 - TKEXECUTABLE = $(TKFRAMEWORK)/Contents/MacOS/$(shell basename "$(TKFRAMEWORK)" .app) 113 - TKEXECUTABLE_SQ = $(subst ','\'',$(TKEXECUTABLE)) 114 - endif 115 - 116 99 ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s) 117 100 QUIET_GEN = 118 101 endif ··· 130 113 exedir = $(dir $(gitexecdir))share/git-gui/lib 131 114 132 115 GITGUI_RELATIVE := 133 - GITGUI_MACOSXAPP := 134 116 135 117 ifeq ($(exedir),$(gg_libdir)) 136 118 GITGUI_RELATIVE := 1 137 119 endif 138 - ifeq ($(uname_S),Darwin) 139 - ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y) 140 - GITGUI_MACOSXAPP := YesPlease 141 - endif 142 - endif 143 120 ifneq (,$(findstring MINGW,$(uname_S))) 144 121 ifeq ($(shell expr "$(uname_R)" : '1\.'),2) 145 122 NO_MSGFMT=1 ··· 148 125 GITGUI_RELATIVE := 1 149 126 endif 150 127 151 - ifdef GITGUI_MACOSXAPP 152 - GITGUI_MAIN := git-gui.tcl 153 - 154 - git-gui: generate-macos-wrapper.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS 155 - $(QUIET_GEN)$(SHELL_PATH) generate-macos-wrapper.sh "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE 156 - 157 - Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS \ 158 - macosx/Info.plist \ 159 - macosx/git-gui.icns \ 160 - macosx/AppMain.tcl \ 161 - $(TKEXECUTABLE) 162 - $(QUIET_GEN)$(SHELL_PATH) generate-macos-app.sh . "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE 163 - endif 164 - 165 128 ifdef GITGUI_WINDOWS_WRAPPER 166 129 GITGUI_MAIN := git-gui.tcl 167 130 ··· 169 132 cp $< $@ 170 133 endif 171 134 172 - $(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS 135 + $(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS generate-git-gui.sh 173 136 $(QUIET_GEN)$(SHELL_PATH) generate-git-gui.sh "$<" "$@" ./GIT-GUI-BUILD-OPTIONS ./GIT-VERSION-FILE 174 137 175 138 XGETTEXT ?= xgettext ··· 206 169 -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ 207 170 -e 's|@TCLTK_PATH@|$(TCLTK_PATH_SQ)|' \ 208 171 -e 's|@TCL_PATH@|$(TCL_PATH_SQ)|' \ 209 - -e 's|@TKEXECUTABLE@|$(TKEXECUTABLE_SQ)|' \ 210 172 $@.in >$@+ 211 173 @if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi 212 174 @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi 213 175 214 - ifdef GITGUI_MACOSXAPP 215 - all:: git-gui Git\ Gui.app 216 - endif 176 + git-gui--askpass: git-gui--askpass.sh GIT-GUI-BUILD-OPTIONS generate-script.sh 177 + $(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< ./GIT-GUI-BUILD-OPTIONS 178 + 217 179 ifdef GITGUI_WINDOWS_WRAPPER 218 180 all:: git-gui 219 181 endif 220 - all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES) 182 + all:: $(GITGUI_MAIN) git-gui--askpass lib/tclIndex $(ALL_MSGFILES) 221 183 222 184 install: all 223 185 $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1) ··· 229 191 endif 230 192 $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1) 231 193 $(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' 232 - ifdef GITGUI_MACOSXAPP 233 - $(QUIET)$(INSTALL_A0)'Git Gui.app' $(INSTALL_A1) '$(DESTDIR_SQ)$(libdir_SQ)' 234 - $(QUIET)$(INSTALL_X0)git-gui.tcl $(INSTALL_X1) '$(DESTDIR_SQ)$(libdir_SQ)' 235 - endif 236 194 $(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true 237 195 $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1) 238 196 $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true ··· 247 205 endif 248 206 $(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(libdir_SQ)' 249 207 $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/tclIndex $(REMOVE_F1) 250 - ifdef GITGUI_MACOSXAPP 251 - $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)/Git Gui.app' $(REMOVE_F1) 252 - $(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/git-gui.tcl $(REMOVE_F1) 253 - endif 254 208 $(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true 255 209 $(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(msgsdir_SQ)' 256 210 $(QUIET)$(foreach p,$(ALL_MSGFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true ··· 264 218 @sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version 265 219 266 220 clean:: 267 - $(RM_RF) $(GITGUI_MAIN) lib/tclIndex po/*.msg $(PO_TEMPLATE) 221 + $(RM_RF) $(GITGUI_MAIN) git-gui--askpass lib/tclIndex po/*.msg $(PO_TEMPLATE) 268 222 $(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS 269 - ifdef GITGUI_MACOSXAPP 270 - $(RM_RF) 'Git Gui.app'* git-gui 271 - endif 272 223 ifdef GITGUI_WINDOWS_WRAPPER 273 224 $(RM_RF) git-gui 274 225 endif
-30
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
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"
+22
generate-script.sh
··· 1 + #!/bin/sh 2 + 3 + set -e 4 + 5 + if test $# -ne 3 6 + then 7 + echo >&2 "USAGE: $0 <OUTPUT> <INPUT> <GIT-GUI-BUILD-OPTIONS>" 8 + exit 1 9 + fi 10 + 11 + OUTPUT="$1" 12 + INPUT="$2" 13 + BUILD_OPTIONS="$3" 14 + 15 + . "$BUILD_OPTIONS" 16 + 17 + sed \ 18 + -e "1s|#!.*/sh|#!$SHELL_PATH|" \ 19 + -e "1,3s|^exec wish|exec '$TCLTK_PATH'|" \ 20 + "$INPUT" >"$OUTPUT" 21 + 22 + chmod a+x "$OUTPUT"
git-gui--askpass git-gui--askpass.sh
+3 -1
git-gui.sh
··· 1126 1126 ## execution environment 1127 1127 1128 1128 # Suggest our implementation of askpass, if none is set 1129 + set argv0dir [file dirname [file normalize $::argv0]] 1129 1130 if {![info exists env(SSH_ASKPASS)]} { 1130 - set env(SSH_ASKPASS) [file join [git --exec-path] git-gui--askpass] 1131 + set env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass] 1131 1132 } 1133 + unset argv0dir 1132 1134 1133 1135 ###################################################################### 1134 1136 ##
-29
macosx/AppMain.tcl
··· 1 - set gitexecdir {@@gitexecdir@@} 2 - if { [info exists ::env(GIT_GUI_LIB_DIR) ] } { 3 - set gitguilib $::env(GIT_GUI_LIB_DIR) 4 - } else { 5 - set gitguilib {@@GITGUI_LIBDIR@@} 6 - } 7 - 8 - set env(PATH) "$gitexecdir:$env(PATH)" 9 - 10 - if {[string first -psn [lindex $argv 0]] == 0} { 11 - lset argv 0 [file join $gitexecdir git-gui] 12 - } 13 - 14 - if {[file tail [lindex $argv 0]] eq {gitk}} { 15 - set argv0 [lindex $argv 0] 16 - set AppMain_source $argv0 17 - } else { 18 - set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]] 19 - set AppMain_source [file join $gitguilib git-gui.tcl] 20 - if {[info exists env(PWD)]} { 21 - cd $env(PWD) 22 - } elseif {[pwd] eq {/}} { 23 - cd $env(HOME) 24 - } 25 - } 26 - 27 - unset gitexecdir gitguilib 28 - set argv [lrange $argv 1 end] 29 - source $AppMain_source
-30
macosx/Info.plist
··· 1 - <?xml version="1.0" encoding="UTF-8"?> 2 - <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 - <plist version="1.0"> 4 - <dict> 5 - <key>CFBundleDevelopmentRegion</key> 6 - <string>English</string> 7 - <key>CFBundleExecutable</key> 8 - <string>@@GITGUI_TKEXECUTABLE@@</string> 9 - <key>CFBundleGetInfoString</key> 10 - <string>Git Gui @@GITGUI_VERSION@@ © 2006-2007 Shawn Pearce, et. al.</string> 11 - <key>CFBundleIconFile</key> 12 - <string>git-gui.icns</string> 13 - <key>CFBundleIdentifier</key> 14 - <string>cz.or.repo.git-gui</string> 15 - <key>CFBundleInfoDictionaryVersion</key> 16 - <string>6.0</string> 17 - <key>CFBundleName</key> 18 - <string>Git Gui</string> 19 - <key>CFBundlePackageType</key> 20 - <string>APPL</string> 21 - <key>CFBundleShortVersionString</key> 22 - <string>@@GITGUI_VERSION@@</string> 23 - <key>CFBundleSignature</key> 24 - <string>GITg</string> 25 - <key>CFBundleVersion</key> 26 - <string>@@GITGUI_VERSION@@</string> 27 - <key>NSHighResolutionCapable</key> 28 - <true/> 29 - </dict> 30 - </plist>
macosx/git-gui.icns

This is a binary file and will not be displayed.

+14 -65
meson.build
··· 19 19 build_options_config.set_quoted('SHELL_PATH', fs.as_posix(shell.full_path())) 20 20 build_options_config.set_quoted('TCLTK_PATH', fs.as_posix(wish.full_path())) 21 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 22 34 23 build_options = configure_file( 35 24 input: 'GIT-GUI-BUILD-OPTIONS.in', ··· 49 38 build_always_stale: true, 50 39 ) 51 40 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 41 gitgui_main = 'git-gui' 61 42 gitgui_main_install_dir = get_option('libexecdir') / 'git-core' 62 43 ··· 70 51 install: true, 71 52 install_dir: get_option('libexecdir') / 'git-core', 72 53 ) 73 - elif target_machine.system() == 'darwin' 74 - gitgui_main = 'git-gui.tcl' 75 - gitgui_main_install_dir = get_option('datadir') / 'git-gui/lib' 54 + endif 76 55 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 56 + custom_target( 57 + output: 'git-gui--askpass', 58 + input: 'git-gui--askpass.sh', 59 + command: [ 60 + shell, 61 + meson.current_source_dir() / 'generate-script.sh', 62 + '@OUTPUT@', 63 + '@INPUT@', 64 + meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS', 65 + ], 66 + install: true, 67 + install_dir: get_option('libexecdir') / 'git-core', 68 + ) 120 69 121 70 custom_target( 122 71 input: 'git-gui.sh',