This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch improve-macos-support
in repository terminology.

View the commit online.

commit 27ba88c3fe79dc371041bd6d0a0ffba229cc64ac
Author: Cedric BAIL <[email protected]>
AuthorDate: Wed Sep 16 11:42:18 2026 -0600

    macos: install compiled terminfo via add_install_script for portability
    
    The terminfo custom_target hard-coded output: 't', assuming tic lays out
    compiled entries as <first-letter>/<name> (t/terminology). That only holds
    for modern Linux ncurses. macOS' bundled ncurses 6.0.20150808 uses the
    hashed directory layout and writes 74/terminology instead, so the declared
    output data/terminfo/t was never created and 'ninja install' failed with:
    
      ERROR: File 'data/terminfo/t' could not be found
    
    Worse, even a successful install to t/terminology would be unreadable by
    macOS ncurses, which looks up entries by hash (74/terminology).
    
    tic's directory layout is not controllable via any flag, and Meson's
    custom_target cannot declare an output containing a path separator, so a
    single-command custom_target cannot represent tic's output portably.
    Replace it with meson.add_install_script, which runs tic at install time
    straight into the destination terminfo database root. tic then picks the
    layout the host ncurses actually reads (t/terminology on Linux,
    74/terminology on macOS), fixing both the install failure and runtime
    lookup.
    
    Verified on macOS: the entry installs to share/terminfo/74/terminology
    and 'infocmp -x terminology' reads it back successfully.
    
    Co-authored-by: Cursor <[email protected]>
---
 data/terminfo/compile_terminfo.py | 25 +++++++++++++++++++++++++
 data/terminfo/meson.build         | 18 +++++++++++-------
 2 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/data/terminfo/compile_terminfo.py b/data/terminfo/compile_terminfo.py
new file mode 100755
index 00000000..8ca79c69
--- /dev/null
+++ b/data/terminfo/compile_terminfo.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Install-time helper for the terminology terminfo entry.
+#
+# `tic` writes compiled entries into a subdirectory whose name depends on how
+# ncurses was built (first-letter layout on modern Linux, e.g. t/terminology;
+# hashed layout on macOS' bundled ncurses, e.g. 74/terminology). The layout is
+# not controllable via any tic flag, and Meson's custom_target cannot declare
+# an output containing a path separator. Rather than fighting that, we run
+# tic at install time straight into the destination terminfo database root, so
+# tic picks the layout the host ncurses actually reads.
+
+import os
+import subprocess
+import sys
+
+if len(sys.argv) != 4:
+    sys.exit('usage: compile_terminfo.py <terminfo-source> <datadir> <tic>')
+
+src, datadir, tic = sys.argv[1], sys.argv[2], sys.argv[3]
+destdir = os.environ.get('DESTDIR', '')
+dest = os.path.join(destdir, datadir, 'terminfo')
+os.makedirs(dest, exist_ok=True)
+subprocess.check_call([tic, '-x', '-o', dest, src])
diff --git a/data/terminfo/meson.build b/data/terminfo/meson.build
index 466c9c18..c8edd35a 100644
--- a/data/terminfo/meson.build
+++ b/data/terminfo/meson.build
@@ -5,11 +5,15 @@ install_data('terminology.terminfo',
                                      meson.project_name(), 'terminfo'))
 
 if tic.found()
-  # tic lays out <first letter>/<name>
-  custom_target('terminfo',
-    input: 'terminology.terminfo',
-    output: 't',
-    command: [tic, '-x', '-o', '@OUTDIR@', '@INPUT@'],
-    install: true,
-    install_dir: join_paths(get_option('datadir'), 'terminfo'))
+  # tic writes compiled entries into a subdirectory whose name depends on how
+  # ncurses was built (first-letter layout on Linux: t/terminology; hashed
+  # layout on macOS' bundled ncurses: 74/terminology). The layout is not
+  # controllable via any tic flag and Meson's custom_target cannot declare an
+  # output containing a path separator, so run tic at install time straight
+  # into the destination terminfo database root and let tic pick the layout
+  # the host ncurses actually reads.
+  meson.add_install_script('compile_terminfo.py',
+                           files('terminology.terminfo'),
+                           get_option('datadir'),
+                           tic)
 endif

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to