Skip to content

Commit 88965d1

Browse files
committed
Merge branch 'maint'
* maint: git-gui: support Git Gui.app under OS X 10.5
2 parents 5f09a37 + 20a87ec commit 88965d1

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
1313

1414
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
1515
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
16+
uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
1617

1718
SCRIPT_SH = git-gui.sh
1819
GITGUI_MAIN := git-gui
@@ -93,7 +94,14 @@ endif
9394

9495
TCL_PATH ?= tclsh
9596
TCLTK_PATH ?= wish
96-
TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
97+
98+
ifeq ($(uname_S),Darwin)
99+
TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app
100+
ifeq ($(shell expr "$(uname_R)" : '9\.'),2)
101+
TKFRAMEWORK = /System/Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app
102+
endif
103+
TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app)
104+
endif
97105

98106
ifeq ($(findstring $(MAKEFLAGS),s),s)
99107
QUIET_GEN =
@@ -147,7 +155,7 @@ git-gui: GIT-VERSION-FILE GIT-GUI-VARS
147155
echo then >>$@+ && \
148156
echo ' 'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
149157
echo else >>$@+ && \
150-
echo ' 'exec \''$(libdir_SQ)/Git Gui.app/Contents/MacOS/Wish'\' \
158+
echo ' 'exec \''$(libdir_SQ)/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\' \
151159
'"$$0" "$$@"' >>$@+ && \
152160
echo fi >>$@+ && \
153161
chmod +x $@+ && \
@@ -157,14 +165,15 @@ Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-VARS \
157165
macosx/Info.plist \
158166
macosx/git-gui.icns \
159167
macosx/AppMain.tcl \
160-
$(TKFRAMEWORK)/Contents/MacOS/Wish
168+
$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)
161169
$(QUIET_GEN)rm -rf '$@' '$@'+ && \
162170
mkdir -p '$@'+/Contents/MacOS && \
163171
mkdir -p '$@'+/Contents/Resources/Scripts && \
164-
cp '$(subst ','\'',$(TKFRAMEWORK))/Contents/MacOS/Wish' \
172+
cp '$(subst ','\'',$(subst \,,$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)))' \
165173
'$@'+/Contents/MacOS && \
166174
cp macosx/git-gui.icns '$@'+/Contents/Resources && \
167175
sed -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
176+
-e 's/@@GITGUI_TKEXECUTABLE@@/$(TKEXECUTABLE)/g' \
168177
macosx/Info.plist \
169178
>'$@'+/Contents/Info.plist && \
170179
sed -e 's|@@gitexecdir@@|$(gitexecdir_SQ)|' \

macosx/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>CFBundleDevelopmentRegion</key>
66
<string>English</string>
77
<key>CFBundleExecutable</key>
8-
<string>Wish</string>
8+
<string>@@GITGUI_TKEXECUTABLE@@</string>
99
<key>CFBundleGetInfoString</key>
1010
<string>Git Gui @@GITGUI_VERSION@@ © 2006-2007 Shawn Pearce, et. al.</string>
1111
<key>CFBundleIconFile</key>

0 commit comments

Comments
 (0)