diff mbox series

[10/12] meson: wire up Gitk

Message ID 20250218-b4-pks-meson-contrib-v1-10-c3edd292beb8@pks.im (mailing list archive)
State Superseded
Headers show
Series meson: wire up bits and pieces from "contrib/" | expand

Commit Message

Patrick Steinhardt Feb. 18, 2025, 7:45 a.m. UTC
Wire up the Gitk graphical repository browser in Meson.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 gitk-git/meson.build    | 28 ++++++++++++++++++++++++++++
 gitk-git/po/meson.build | 19 +++++++++++++++++++
 meson.build             |  2 ++
 meson_options.txt       |  2 ++
 4 files changed, 51 insertions(+)
diff mbox series

Patch

diff --git a/gitk-git/meson.build b/gitk-git/meson.build
new file mode 100644
index 00000000000..7b16cd3c4d3
--- /dev/null
+++ b/gitk-git/meson.build
@@ -0,0 +1,28 @@ 
+wish = find_program('wish', required: get_option('gitk'))
+gitk_enabled = wish.found()
+
+if not gitk_enabled
+  subdir_done()
+endif
+
+custom_target(
+  command: [
+    shell,
+    meson.current_source_dir() / 'generate-tcl.sh',
+    wish.full_path(),
+    '@INPUT@',
+    '@OUTPUT@',
+  ],
+  input: 'gitk',
+  output: 'gitk',
+  depend_files: [
+    'generate-tcl.sh',
+  ],
+  env: script_environment,
+  install: true,
+  install_dir: get_option('bindir'),
+)
+
+if intl.found()
+  subdir('po')
+endif
diff --git a/gitk-git/po/meson.build b/gitk-git/po/meson.build
new file mode 100644
index 00000000000..b1ed0198285
--- /dev/null
+++ b/gitk-git/po/meson.build
@@ -0,0 +1,19 @@ 
+import('i18n').gettext('gitk',
+  languages: [
+    'bg',
+    'ca',
+    'de',
+    'es',
+    'fr',
+    'hu',
+    'it',
+    'ja',
+    'pt_br',
+    'pt_pt',
+    'ru',
+    'sv',
+    'vi',
+    'zh_cn',
+  ],
+  install: true,
+)
diff --git a/meson.build b/meson.build
index 20159cef83d..5f2db6b0419 100644
--- a/meson.build
+++ b/meson.build
@@ -1957,6 +1957,7 @@  if get_option('docs') != []
 endif
 
 subdir('contrib')
+subdir('gitk-git')
 
 foreach key, value : {
   'DIFF': diff.full_path(),
@@ -2010,6 +2011,7 @@  summary({
   'curl': curl.found(),
   'expat': expat.found(),
   'gettext': intl.found(),
+  'gitk': gitk_enabled,
   'gitweb': gitweb_option.allowed(),
   'https': https_backend,
   'iconv': iconv.found(),
diff --git a/meson_options.txt b/meson_options.txt
index afa908d6c53..4cce8a81154 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -41,6 +41,8 @@  option('gitweb', type: 'feature', value: 'auto',
   description: 'Build Git web interface. Requires Perl.')
 option('iconv', type: 'feature', value: 'auto',
   description: 'Support reencoding strings with different encodings.')
+option('gitk', type: 'feature', value: 'auto',
+  description: 'Build and install gitk(1), which requires Tcl.')
 option('pcre2', type: 'feature', value: 'enabled',
   description: 'Support Perl-compatible regular expressions in e.g. git-grep(1).')
 option('perl', type: 'feature', value: 'auto',