git-gui: support Git Gui.app under OS X 10.5
The Tk Framework moved its location in 10.5 compared to 10.4 Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Tested-by: Seth Falcon <seth@userprimary.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Jay Soffian committed
Feb 11, 2008 at 21:33 UTC
20a87ecc5861b0e1b76b99549cfaa965b2b27618
2 files changed
+14
-5
Makefile
+13
-4
@@ -13,6 +13,7 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
13
14
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
15
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')
17
18
SCRIPT_SH = git-gui.sh
19
GITGUI_MAIN := git-gui
@@ -93,7 +94,14 @@ endif
94
95
TCL_PATH ?= tclsh
96
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
105
106
ifeq ($(findstring $(MAKEFLAGS),s),s)
107
QUIET_GEN =
@@ -147,7 +155,7 @@ git-gui: GIT-VERSION-FILE GIT-GUI-VARS
155
echo then >>$@+ && \
156
echo ' 'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
157
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))'\' \
159
'"$$0" "$$@"' >>$@+ && \
160
echo fi >>$@+ && \
161
chmod +x $@+ && \
@@ -157,14 +165,15 @@ Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-VARS \
165
macosx/Info.plist \
166
macosx/git-gui.icns \
167
macosx/AppMain.tcl \
160
- $(TKFRAMEWORK)/Contents/MacOS/Wish
168
+ $(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)
169
$(QUIET_GEN)rm -rf '$@' '$@'+ && \
170
mkdir -p '$@'+/Contents/MacOS && \
171
mkdir -p '$@'+/Contents/Resources/Scripts && \
164
- cp '$(subst ','\'',$(TKFRAMEWORK))/Contents/MacOS/Wish' \
172
+ cp '$(subst ','\'',$(subst \,,$(TKFRAMEWORK)/Contents/MacOS/$(TKEXECUTABLE)))' \
173
'$@'+/Contents/MacOS && \
174
cp macosx/git-gui.icns '$@'+/Contents/Resources && \
175
sed -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
176
+ -e 's/@@GITGUI_TKEXECUTABLE@@/$(TKEXECUTABLE)/g' \
177
macosx/Info.plist \
178
>'$@'+/Contents/Info.plist && \
179
sed -e 's|@@gitexecdir@@|$(gitexecdir_SQ)|' \
macosx/Info.plist
+1
-1
@@ -5,7 +5,7 @@
5
<key>CFBundleDevelopmentRegion</key>
6
<string>English</string>
7
<key>CFBundleExecutable</key>
8
- <string>Wish</string>
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>