Thread (17 messages) 17 messages, 5 authors, 2026-02-06

Re: [PATCH v2] meson: wire up gitk and git-gui

From: Karthik Nayak <hidden>
Date: 2026-02-04 10:00:13

Patrick Steinhardt [off-list ref] writes:
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 for distributors.

Note that Meson expects subprojects to live in the "subprojects/"
directory. Create symlinks to fulfill this requirement.

Signed-off-by: Patrick Steinhardt <redacted>
---
Hi,

I have upstreamed support for Meson into both gitk [1] and git-gui [2].
This small patch series wires up support in Git.

Changes in v2:
  - Use symlinks instead of moving both gitk and git-gui into the
    "subprojects/" directory.
  - Rebased on v2.53.0, as it's been a while since v1 :)
  - Link to v1: https://lore.kernel.org/r/20250819-b4-pks-meson-tcl-tk-v1-0-6bcaff0bc0a0@pks.im (local)

Thanks!

Patrick

So in the previous version, we moved these projects into 'subprojects/',
but we now use symlinks instead. Do you know if there is perhaps an
issue in Meson to support configurable subproject paths? If so, we could
eventually drop the symlink.
quoted hunk ↗ jump to hunk
[1]: https://github.com/j6t/gitk/pull/8
[2]: https://github.com/j6t/git-gui/pull/9
---
 meson.build         | 14 ++++++++++++++
 meson_options.txt   |  4 ++++
 subprojects/git-gui |  1 +
 subprojects/gitk    |  1 +
 4 files changed, 20 insertions(+)
diff --git a/meson.build b/meson.build
index dd52efd1c8..e96953afec 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
@@ -2250,6 +2252,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
+
So gitk requires 'wish' to exist, whereas 'git_gui' also requires
'tclsh'. Looks good.

[snip]

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help