]> Kevux Git Server - rit/commitdiff
meson: wire up gitk and git-gui
authorPatrick Steinhardt <ps@pks.im>
Wed, 4 Feb 2026 08:38:11 +0000 (09:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Feb 2026 17:42:50 +0000 (09:42 -0800)
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>
meson.build
meson_options.txt
subprojects/git-gui [new symlink]
subprojects/gitk [new symlink]

index dd52efd1c875746304c717d8fc4a572d1f26a0cc..e96953afecbe1829aed6eb028bb810e537640f72 100644 (file)
@@ -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
+
 # 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.
@@ -2276,6 +2288,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,
index e0be260ae1bce84f53971e1b987a079758d00b31..659cbb218f46e080c1d4c763b5a299446ea9234f 100644 (file)
@@ -43,6 +43,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',
diff --git a/subprojects/git-gui b/subprojects/git-gui
new file mode 120000 (symlink)
index 0000000..c6d9170
--- /dev/null
@@ -0,0 +1 @@
+../git-gui
\ No newline at end of file
diff --git a/subprojects/gitk b/subprojects/gitk
new file mode 120000 (symlink)
index 0000000..b66ad18
--- /dev/null
@@ -0,0 +1 @@
+../gitk-git
\ No newline at end of file