Skip to contentSkip to conversation

git-gui/Makefile - Don't convert gg_libdir on Cygwin

PATCH In review Mark Levedahl 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-gui/Makefile - Don't convert gg_libdir on Cygwin

gg_libdir was converted to an absolute Windows path as a remnant of logic to check for relative / absolute location of libraries, but that does not work on Cygwin. Converting gg_libdir to a Windows path has the nasty side-effect that it cannot be prefixed with $DESTDIR, and this precludes installing to a staging directory. So, don't convert it.

---
(resend, mistyped the git list address)

 git-gui/Makefile |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
git-gui/Makefile +0 -1
index c109eab..8eb9e05 100644
@@ -119,7 +119,6 @@ GITGUI_MACOSXAPP :=
 
 ifeq ($(uname_O),Cygwin)
 	GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`
-	gg_libdir := $(shell cygpath --windows --absolute "$(gg_libdir)")
 else
 	ifeq ($(exedir),$(gg_libdir))
 		GITGUI_RELATIVE := 1

--
1.5.4.rc2.50.gcfa92

#1 lore raw
Quoted 5 lines · Mark Levedahl

gg_libdir was converted to an absolute Windows path as a remnant of logic to check for relative / absolute location of libraries, but that does not work on Cygwin. Converting gg_libdir to a Windows path has the nasty side-effect that it cannot be prefixed with $DESTDIR, and this precludes installing to a staging directory. So, don't convert it.

Hmmph. That bites.

git-gui/Makefile GITGUI_MACOSXAPP := · line 122

Quoted 4 lines

ifeq ($(uname_O),Cygwin)

git-gui/Makefile +0 -1
 	GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`
-	gg_libdir := $(shell cygpath --windows --absolute "$(gg_libdir)")
 else

The reason I'm doing the UNIX->Windows conversion here is I run git-gui on a pure Win32 Tcl/Tk build, one that is a lot more recent than the version that ships as a Cygwin package. The pure Win32 Tcl/Tk cannot read UNIX paths, so I cannot allow libdir to be a UNIX path in that case.

Now earlier we used to use relative paths on Windows to find the libdir at runtime, but we don't do that anymore either, and I'm not really sure why. In theory it should still work to make it relative when possible, and then my installation with the more native Tcl/Tk would work just fine.

I guess I'm willing to apply your patch and carry the reverse of your patch as a local-only hack for my needs, but I wonder if anyone else is also using git-gui on Cygwin with a pure Win32 Tcl/Tk build...

Signature · 1 line
Shawn.
#2 lore raw

PATCH 1/1 git-gui/Makefile - Handle $DESTDIR on Cygwin

From: Mark Levedahl <[email protected]>

gg_libdir is converted to an absolute Windows path on Cygwin, but a later step attempts to prefix $DESTDIR to install to a staging directory. Explicitly separate the uses of gg_libdir for these two purposes so installation to $DESTDIR will work.

---
git-gui built with this passed tests on cygwin + tcl/tk 8.5, cygwin + normal tcl/tk, and linux. DESTDIR also works on cygwin, so I would suggest this rather than the previous patch.

 git-gui/Makefile |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
git-gui/Makefile +3 -2
index c109eab..1baf4b0 100644
@@ -110,7 +110,7 @@ TCLTK_PATH_SED = $(subst ','\'',$(subst \,\\,$(TCLTK_PATH)))
 
 gg_libdir ?= $(sharedir)/git-gui/lib
 libdir_SQ  = $(subst ','\'',$(gg_libdir))
-libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir)))
+libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir_sed_in)))
 exedir     = $(dir $(gitexecdir))share/git-gui/lib
 
 GITGUI_SCRIPT   := $$0
@@ -119,11 +119,12 @@ GITGUI_MACOSXAPP :=
 
 ifeq ($(uname_O),Cygwin)
 	GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"`
-	gg_libdir := $(shell cygpath --windows --absolute "$(gg_libdir)")
+	gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)")
 else
 	ifeq ($(exedir),$(gg_libdir))
 		GITGUI_RELATIVE := 1
 	endif
+	gg_libdir_sed_in := $(gg_libdir)
 endif
 ifeq ($(uname_S),Darwin)
 	ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y)

--
1.5.4.rc3.26.gf961e

#3 lore raw

Re: [PATCH] git-gui/Makefile - Handle $DESTDIR on Cygwin

Quoted 7 lines · Mark Levedahl

From: Mark Levedahl <[email protected]>

gg_libdir is converted to an absolute Windows path on Cygwin, but a later step attempts to prefix $DESTDIR to install to a staging directory. Explicitly separate the uses of gg_libdir for these two purposes so installation to $DESTDIR will work.

Quoted 5 lines

---
git-gui built with this passed tests on cygwin + tcl/tk 8.5, cygwin + normal tcl/tk, and linux. DESTDIR also works on cygwin, so I would suggest this rather than the previous patch.

Excellent. I was about to think about writing this patch myself, but you beat me to it. I'm applying this and will include it as part of git-gui 0.9.2, which should be in git 1.5.4.

Thanks.

Signature · 1 line
Shawn.
#4 lore raw
In reply to Shawn O. Pearce
Quoted 4 lines · Shawn O. Pearce

I guess I'm willing to apply your patch and carry the reverse of your patch as a local-only hack for my needs, but I wonder if anyone else is also using git-gui on Cygwin with a pure Win32 Tcl/Tk build...

Um, well, I would like to as the Cygwin tcl/tk is *never* going to be update. Drats. There has to be another way? Perhaps have a separate variable for where to install vs. where to look for libraries?

Mark