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

5 messages from 2008-01-05 to 2008-01-18. Participants: Mark Levedahl, Shawn O. Pearce.
Thread: https://gitlist.dev/t/11486

## Mark Levedahl, 2008-01-05 22:32

Subject: [PATCH] git-gui/Makefile - Don't convert gg_libdir on Cygwin
Message-ID: <1199572355-2720-1-git-send-email-mdl123@verizon.net>
URL: https://gitlist.dev/e/1199572355-2720-1-git-send-email-mdl123%40verizon.net

```
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(-)

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, 2008-01-16 06:40

Subject: Re: [PATCH] git-gui/Makefile - Don't convert gg_libdir on Cygwin
Message-ID: <20080116064012.GO24004@spearce.org>
URL: https://gitlist.dev/e/20080116064012.GO24004%40spearce.org
In-Reply-To: <1199572355-2720-1-git-send-email-mdl123@verizon.net>

```
Mark Levedahl <mdl123@verizon.net> wrote:
> 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, 2008-01-17 01:09

Subject: Re: [PATCH] git-gui/Makefile - Don't convert gg_libdir on Cygwin
Message-ID: <478EAACD.80100@verizon.net>
URL: https://gitlist.dev/e/478EAACD.80100%40verizon.net
In-Reply-To: <20080116064012.GO24004@spearce.org>

```
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, 2008-01-18 03:50

Subject: [PATCH] git-gui/Makefile - Handle $DESTDIR on Cygwin
Message-ID: <1200628223-2280-1-git-send-email-mlevedahl@gmail.com>
URL: https://gitlist.dev/e/1200628223-2280-1-git-send-email-mlevedahl%40gmail.com
In-Reply-To: <20080116064012.GO24004@spearce.org>

```
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(-)

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, 2008-01-18 04:01

Subject: Re: [PATCH] git-gui/Makefile - Handle $DESTDIR on Cygwin
Message-ID: <20080118040146.GY24004@spearce.org>
URL: https://gitlist.dev/e/20080118040146.GY24004%40spearce.org
In-Reply-To: <1200628223-2280-1-git-send-email-mlevedahl@gmail.com>

```
Mark Levedahl <mlevedahl@gmail.com> wrote:
> 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.

```
