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

[PATCH 3/3] meson: wire up gitk and git-gui

From
Patrick Steinhardt <ps@pks.im>
Date
Aug 19, 2025, 08:18 UTC
Message-ID
<20250819-b4-pks-meson-tcl-tk-v1-3-6bcaff0bc0a0@pks.im>
In-Reply-To
<20250819-b4-pks-meson-tcl-tk-v1-0-6bcaff0bc0a0@pks.im>

Wire up both gitk and git-gui in Meson as subprojects. These two programs should be the last missing pieces for feature compatibility with our Makefile.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 meson.build       | 14 ++++++++++++++
 meson_options.txt |  4 ++++
 2 files changed, 18 insertions(+)
diff --git a/meson.build b/meson.build
index 5dd299b496..edf7b69a00 100644
--- a/meson.build
+++ b/meson.build
@@ -239,7 +239,9 @@ git = find_program('git', dirs: program_path, native: true, required: false)
 sed = find_program('sed', dirs: program_path, native: true)
 shell = find_program('sh', dirs: program_path, native: true)
 tar = find_program('tar', dirs: program_path, native: true)
+tclsh = find_program('tclsh', required: get_option('git_gui'), native: false)
 time = find_program('time', dirs: program_path, required: get_option('benchmarks'))
+wish = find_program('wish', required: get_option('git_gui').enabled() or get_option('gitk').enabled(), native: false)
 
 # Detect the target shell that is used by Git at runtime. Note that we prefer
 # "/bin/sh" over a PATH-based lookup, which provides a working shell on most
@@ -2207,6 +2209,16 @@ configure_file(
   configuration: build_options_config,
 )
 
+gitk_option = get_option('gitk').disable_auto_if(not wish.found())
+if gitk_option.allowed()
+  subproject('gitk')
+endif
+
+git_gui_option = get_option('git_gui').disable_auto_if(not tclsh.found() or not wish.found())
+if git_gui_option.allowed()
+  subproject('git-gui')
+endif
+
 # Development environments can be used via `meson devenv -C <builddir>`. This
 # allows you to execute test scripts directly with the built Git version and
 # puts the built version of Git in your PATH.
@@ -2233,6 +2245,8 @@ summary({
   'curl': curl,
   'expat': expat,
   'gettext': intl,
+  'gitk': gitk_option.allowed(),
+  'git-gui': git_gui_option.allowed(),
   'gitweb': gitweb_option.allowed(),
   'iconv': iconv,
   'pcre2': pcre2,
diff --git a/meson_options.txt b/meson_options.txt
index 1668f260a1..8fa330771b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -41,6 +41,10 @@ option('expat', type: 'feature', value: 'enabled',
   description: 'Build helpers used to push to remotes with the HTTP transport.')
 option('gettext', type: 'feature', value: 'auto',
   description: 'Build translation files.')
+option('gitk', type: 'feature', value: 'auto',
+  description: 'Build the Gitk graphical repository browser. Requires Tcl/Tk.')
+option('git_gui', type: 'feature', value: 'auto',
+  description: 'Build the git-gui graphical user interface for Git. Requires Tcl/Tk.')
 option('gitweb', type: 'feature', value: 'auto',
   description: 'Build Git web interface. Requires Perl.')
 option('iconv', type: 'feature', value: 'auto',
-- 
2.51.0.261.g7ce5a0a67e.dirty
Previous: Junio C HamanoNext: Karthik Nayak
Message 8 of 29 in “meson: wire up gitk and git-gui”
  1. 0/3 meson: wire up gitk and git-guiPatrick Steinhardt, Aug 19, 2025
  2. 1/3 git-gui: move into "subprojects/"Patrick Steinhardt, Aug 19, 2025
  3. Karthik NayakAug 19, 2025
  4. 2/3 gitk: move into "subprojects/"Patrick Steinhardt, Aug 19, 2025
  5. doc/gitk: update reference to the external projectJohannes Sixt, Aug 20, 2025
  6. doc/gitk: update reference to the external projectJohannes Sixt, Aug 20, 2025
  7. Junio C HamanoAug 20, 2025
  8. 3/3 meson: wire up gitk and git-guiPatrick Steinhardt, Aug 19, 2025
  9. Karthik NayakAug 19, 2025
  10. Patrick SteinhardtAug 24, 2025
  11. Junio C HamanoAug 19, 2025
  12. Patrick SteinhardtAug 24, 2025
  13. Junio C HamanoAug 26, 2025
  14. Patrick SteinhardtSep 2, 2025
  15. Ramsay JonesAug 19, 2025
  16. Patrick SteinhardtAug 24, 2025
  17. meson: wire up gitk and git-guiPatrick Steinhardt, Feb 4, 2026
  18. Karthik NayakFeb 4, 2026
  19. Patrick SteinhardtFeb 4, 2026
  20. Junio C HamanoFeb 4, 2026
  21. Patrick SteinhardtFeb 5, 2026
  22. Jeff KingFeb 5, 2026
  23. Patrick SteinhardtFeb 5, 2026
  24. Patrick SteinhardtFeb 6, 2026
  25. Junio C HamanoFeb 6, 2026
  26. Patrick SteinhardtFeb 9, 2026
  27. Junio C HamanoFeb 11, 2026
  28. Johannes SixtFeb 11, 2026
  29. Junio C HamanoFeb 11, 2026

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.