meson: wire up gitk and git-gui

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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Feb 4, 2026 at 09:38 UTC 1e3962c6b75f7131a236e35a0f7a3962102452ed
4 files changed +20
meson.build
+14
@@ -239,7 +239,9 @@ git = find_program('git', dirs: program_path, native: true, required: false)
239 sed = find_program('sed', dirs: program_path, native: true)
240 shell = find_program('sh', dirs: program_path, native: true)
241 tar = find_program('tar', dirs: program_path, native: true)
242 +tclsh = find_program('tclsh', required: get_option('git_gui'), native: false)
243 time = find_program('time', dirs: program_path, required: get_option('benchmarks'))
244 +wish = find_program('wish', required: get_option('git_gui').enabled() or get_option('gitk').enabled(), native: false)
245
246 # Detect the target shell that is used by Git at runtime. Note that we prefer
247 # "/bin/sh" over a PATH-based lookup, which provides a working shell on most
@@ -2250,6 +2252,16 @@ configure_file(
2252 configuration: build_options_config,
2253 )
2254
2255 +gitk_option = get_option('gitk').disable_auto_if(not wish.found())
2256 +if gitk_option.allowed()
2257 + subproject('gitk')
2258 +endif
2259 +
2260 +git_gui_option = get_option('git_gui').disable_auto_if(not tclsh.found() or not wish.found())
2261 +if git_gui_option.allowed()
2262 + subproject('git-gui')
2263 +endif
2264 +
2265 # Development environments can be used via `meson devenv -C <builddir>`. This
2266 # allows you to execute test scripts directly with the built Git version and
2267 # puts the built version of Git in your PATH.
@@ -2276,6 +2288,8 @@ summary({
2288 'curl': curl,
2289 'expat': expat,
2290 'gettext': intl,
2291 + 'gitk': gitk_option.allowed(),
2292 + 'git-gui': git_gui_option.allowed(),
2293 'gitweb': gitweb_option.allowed(),
2294 'iconv': iconv,
2295 'pcre2': pcre2,
meson_options.txt
+4
@@ -43,6 +43,10 @@ option('expat', type: 'feature', value: 'enabled',
43 description: 'Build helpers used to push to remotes with the HTTP transport.')
44 option('gettext', type: 'feature', value: 'auto',
45 description: 'Build translation files.')
46 +option('gitk', type: 'feature', value: 'auto',
47 + description: 'Build the Gitk graphical repository browser. Requires Tcl/Tk.')
48 +option('git_gui', type: 'feature', value: 'auto',
49 + description: 'Build the git-gui graphical user interface for Git. Requires Tcl/Tk.')
50 option('gitweb', type: 'feature', value: 'auto',
51 description: 'Build Git web interface. Requires Perl.')
52 option('iconv', type: 'feature', value: 'auto',
subprojects/git-gui new
+1
@@ -0,0 +1 @@
1 +../git-gui
\ No newline at end of file
subprojects/gitk new
+1
@@ -0,0 +1 @@
1 +../gitk-git
\ No newline at end of file