threads / patch / 11486

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

Subject: [PATCH] git-gui/Makefile - Don't convert gg_libdir on Cygwin

## tl;dr

5 messages between Jan 5, 2008 and Jan 18, 2008. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Mark Levedahl· Jan 5, 2008, 22:32 UTC · lore

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.

Signed-off-by: Mark Levedahl <mdl123@verizon.net>
---
(resend, mistyped the git list address)
 git-gui/Makefile |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Show changes to git-gui/Makefile +0 −2
diff --git a/git-gui/Makefile b/git-gui/Makefile
index c109eab..8eb9e05 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -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
Shawn O. Pearce· Jan 16, 2008, 06:40 UTC · re: Mark Levedahl · lore

Re: [PATCH] git-gui/Makefile - Don't convert gg_libdir on Cygwin

Mark Levedahl <mdl123@verizon.net> wrote:
Show 5 quoted lines
> 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.
>  ifeq ($(uname_O),Cygwin)
>  	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...

-- 
Shawn.
Mark Levedahl· Jan 17, 2008, 01:09 UTC · re: Shawn O. Pearce · lore

Re: [PATCH] git-gui/Makefile - Don't convert gg_libdir on Cygwin

Shawn O. Pearce wrote:
> 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
Mark Levedahl· Jan 18, 2008, 03:50 UTC · re: Shawn O. Pearce · lore

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

From: Mark Levedahl <mdl123@verizon.net>

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.

Signed-off-by: Mark Levedahl <mdl123@verizon.net>
---
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(-)
Show changes to git-gui/Makefile +3 −3
diff --git a/git-gui/Makefile b/git-gui/Makefile
index c109eab..1baf4b0 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -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
Shawn O. Pearce· Jan 18, 2008, 04:01 UTC · re: Mark Levedahl · lore

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

Mark Levedahl <mlevedahl@gmail.com> wrote:
Show 12 quoted lines
> From: Mark Levedahl <mdl123@verizon.net>
> 
> 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.
> 
> Signed-off-by: Mark Levedahl <mdl123@verizon.net>
> ---
> 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.
 
-- 
Shawn.

← back to recent threads