Skip to content

Commit 005827f

Browse files
committed
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>
1 parent c57fce2 commit 005827f

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ git = find_program('git', dirs: program_path, native: true, required: false)
239239
sed = find_program('sed', dirs: program_path, native: true)
240240
shell = find_program('sh', dirs: program_path, native: true)
241241
tar = find_program('tar', dirs: program_path, native: true)
242+
tclsh = find_program('tclsh', required: get_option('git_gui'), native: false)
242243
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)
243245

244246
# Detect the target shell that is used by Git at runtime. Note that we prefer
245247
# "/bin/sh" over a PATH-based lookup, which provides a working shell on most
@@ -2250,6 +2252,16 @@ configure_file(
22502252
configuration: build_options_config,
22512253
)
22522254

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+
22532265
# Development environments can be used via `meson devenv -C <builddir>`. This
22542266
# allows you to execute test scripts directly with the built Git version and
22552267
# puts the built version of Git in your PATH.
@@ -2276,6 +2288,8 @@ summary({
22762288
'curl': curl,
22772289
'expat': expat,
22782290
'gettext': intl,
2291+
'gitk': gitk_option.allowed(),
2292+
'git-gui': git_gui_option.allowed(),
22792293
'gitweb': gitweb_option.allowed(),
22802294
'iconv': iconv,
22812295
'pcre2': pcre2,

meson_options.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ option('expat', type: 'feature', value: 'enabled',
4343
description: 'Build helpers used to push to remotes with the HTTP transport.')
4444
option('gettext', type: 'feature', value: 'auto',
4545
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.')
4650
option('gitweb', type: 'feature', value: 'auto',
4751
description: 'Build Git web interface. Requires Perl.')
4852
option('iconv', type: 'feature', value: 'auto',

subprojects/git-gui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../git-gui

subprojects/gitk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gitk-git

0 commit comments

Comments
 (0)