git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Makefile: check that tcl/tk is installed

From
Christian Couder <christian.couder@gmail.com>
Date
Nov 15, 2017, 12:52 UTC
Message-ID
<20171115125200.17006-1-chriscool@tuxfamily.org>

By default running `make install` in the root directory of the project will set TCLTK_PATH to `wish` and then go into the "git-gui" and "gitk-git" sub-directories to build and install these 2 sub-projects.

When Tcl/Tk is not installed, the above will succeed if gettext is installed, as Tcl/Tk is only required as a substitute for msgfmt when msgfmt is not installed. But then running the installed gitk and git-gui will fail.

If neither Tcl/Tk nor gettext are installed, then processing po files will fail in the git-gui directory. The error message when this happens is very confusing to new comers as it is difficult to understand that we tried to use Tcl/Tk as a substitute for msgfmt, and that the solution is to either install gettext or Tcl/Tk, or to set both NO_GETTEXT and NO_TCLTK.

To improve the current behavior when Tcl/Tk is not installed, let's just check that TCLTK_PATH points to something and error out right away if this is not the case.

This should benefit people who actually want to install and use git-gui or gitk as they will have to install Tcl/Tk anyway, and it is better for them if they are told about installing it soon in the build process, rather than if they have to debug it after installing.

For people who don't want to use git-gui or gitk, this forces them to specify NO_TCLTK. If they don't have gettext, this will make it much easier to fix the problems they would have had to fix anyway. If they have gettext, setting NO_TCLTK is a small additional step they will have to make, but it might be a good thing as it will not install what they don't want and it will build a bit faster.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/Makefile b/Makefile
index ee9d5eb11e..ada6164e15 100644
--- a/Makefile
+++ b/Makefile
@@ -1636,6 +1636,13 @@ ifeq ($(TCLTK_PATH),)
 NO_TCLTK = NoThanks
 endif
 
+ifndef NO_TCLTK
+	has_tcltk := $(shell type $(TCLTK_PATH) 2>/dev/null)
+	ifndef has_tcltk
+$(error "Tcl/Tk is not installed ('$(TCLTK_PATH)' not found). Consider setting NO_TCLTK or installing Tcl/Tk")
+	endif
+endif
+
 ifeq ($(PERL_PATH),)
 NO_PERL = NoThanks
 endif
-- 
2.15.0.165.g42c5887
Next: Junio C Hamano
Message 1 of 7 in “Makefile: check that tcl/tk is installed”
  1. Makefile: check that tcl/tk is installedChristian Couder, Nov 15, 2017
  2. Junio C HamanoNov 16, 2017
  3. Christian CouderNov 17, 2017
  4. Todd ZullingerNov 17, 2017
  5. Jeff KingNov 17, 2017
  6. Christian CouderNov 20, 2017
  7. Christian CouderNov 20, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.