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 cc587e905f6d17171b4916e6282abf05c4338fcc
Author: Cedric BAIL <[email protected]>
AuthorDate: Mon Mar 23 10:50:09 2026 -0600
macos: add .app bundle generation for Spotlight integration
Build and install a Terminology.app bundle on macOS so the
application is discoverable through Spotlight. The bundle
contains a native Mach-O launcher that sets $HOME as the
working directory before executing the real binary, ensuring
the correct architecture propagates to child processes. An
Info.plist provides version metadata, and an icns icon is
generated from the existing PNG via sips/iconutil. A
post-install script copies the bundle into /Applications
(or ~/Applications as fallback) for Spotlight indexing.
Made-with: Cursor
---
data/macos/Info.plist.in | 28 ++++++++++++++++++++++++++
data/macos/gen_icns.sh | 23 ++++++++++++++++++++++
data/macos/launcher.c | 17 ++++++++++++++++
data/macos/link_app.sh | 21 ++++++++++++++++++++
data/macos/meson.build | 51 ++++++++++++++++++++++++++++++++++++++++++++++++
data/meson.build | 3 +++
6 files changed, 143 insertions(+)
diff --git a/data/macos/Info.plist.in b/data/macos/Info.plist.in
new file mode 100644
index 00000000..b9334ba3
--- /dev/null
+++ b/data/macos/Info.plist.in
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>terminology</string>
+ <key>CFBundleIconFile</key>
+ <string>@icon_file@</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.enlightenment.terminology</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Terminology</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@version@</string>
+ <key>CFBundleVersion</key>
+ <string>@version@</string>
+ <key>NSHighResolutionCapable</key>
+ <true/>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © The Enlightenment Project. Licensed under BSD.</string>
+</dict>
+</plist>
diff --git a/data/macos/gen_icns.sh b/data/macos/gen_icns.sh
new file mode 100755
index 00000000..c75d9323
--- /dev/null
+++ b/data/macos/gen_icns.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+
+INPUT="$1"
+OUTPUT="$2"
+
+WORK=$(mktemp -d)
+ICONSET="${WORK}/terminology.iconset"
+mkdir -p "${ICONSET}"
+
+sips -z 16 16 "${INPUT}" --out "${ICONSET}/icon_16x16.png" > /dev/null 2>&1
+sips -z 32 32 "${INPUT}" --out "${ICONSET}/[email protected]" > /dev/null 2>&1
+sips -z 32 32 "${INPUT}" --out "${ICONSET}/icon_32x32.png" > /dev/null 2>&1
+sips -z 64 64 "${INPUT}" --out "${ICONSET}/[email protected]" > /dev/null 2>&1
+sips -z 128 128 "${INPUT}" --out "${ICONSET}/icon_128x128.png" > /dev/null 2>&1
+sips -z 256 256 "${INPUT}" --out "${ICONSET}/[email protected]" > /dev/null 2>&1
+sips -z 256 256 "${INPUT}" --out "${ICONSET}/icon_256x256.png" > /dev/null 2>&1
+sips -z 512 512 "${INPUT}" --out "${ICONSET}/[email protected]" > /dev/null 2>&1
+sips -z 512 512 "${INPUT}" --out "${ICONSET}/icon_512x512.png" > /dev/null 2>&1
+sips -z 1024 1024 "${INPUT}" --out "${ICONSET}/[email protected]" > /dev/null 2>&1
+
+iconutil -c icns -o "${OUTPUT}" "${ICONSET}"
+rm -rf "${WORK}"
diff --git a/data/macos/launcher.c b/data/macos/launcher.c
new file mode 100644
index 00000000..26f7638f
--- /dev/null
+++ b/data/macos/launcher.c
@@ -0,0 +1,17 @@
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifndef TERMINOLOGY_BIN
+# error "TERMINOLOGY_BIN must be defined at compile time"
+#endif
+
+int
+main(int argc, char *argv[])
+{
+ const char *home = getenv("HOME");
+ if (home)
+ chdir(home);
+
+ execv(TERMINOLOGY_BIN, argv);
+ return 1;
+}
diff --git a/data/macos/link_app.sh b/data/macos/link_app.sh
new file mode 100755
index 00000000..d5bc5b12
--- /dev/null
+++ b/data/macos/link_app.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Skip when packaging with DESTDIR
+if [ -n "${DESTDIR}" ]; then
+ exit 0
+fi
+
+APP_BUNDLE="${MESON_INSTALL_PREFIX}/Applications/Terminology.app"
+
+# Spotlight does not follow symlinks, so copy the bundle into a
+# directory it indexes.
+if [ -w /Applications ] || [ -w /Applications/Terminology.app ]; then
+ rm -rf /Applications/Terminology.app
+ cp -R "${APP_BUNDLE}" /Applications/Terminology.app
+ echo "Installed /Applications/Terminology.app"
+elif [ -d "${HOME}" ]; then
+ mkdir -p "${HOME}/Applications"
+ rm -rf "${HOME}/Applications/Terminology.app"
+ cp -R "${APP_BUNDLE}" "${HOME}/Applications/Terminology.app"
+ echo "Installed ~/Applications/Terminology.app (use sudo for /Applications)"
+fi
diff --git a/data/macos/meson.build b/data/macos/meson.build
new file mode 100644
index 00000000..9f0f37ef
--- /dev/null
+++ b/data/macos/meson.build
@@ -0,0 +1,51 @@
+app_name = 'Terminology'
+app_bundle = app_name + '.app'
+app_contents = join_paths('Applications', app_bundle, 'Contents')
+
+plist_conf = configuration_data()
+plist_conf.set('version', meson.project_version())
+
+icon_png = files('../icons/terminology.png')
+
+iconutil = find_program('iconutil', required: false)
+sips_prog = find_program('sips', required: false)
+
+if iconutil.found() and sips_prog.found()
+ bash = find_program('bash')
+ plist_conf.set('icon_file', 'terminology')
+ icns = custom_target('terminology_icns',
+ input: icon_png,
+ output: 'terminology.icns',
+ command: [bash, files('gen_icns.sh'), '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: join_paths(prefix, app_contents, 'Resources')
+ )
+else
+ plist_conf.set('icon_file', 'terminology.png')
+ install_data(icon_png,
+ install_dir: join_paths(app_contents, 'Resources'))
+endif
+
+plist = configure_file(
+ input: 'Info.plist.in',
+ output: 'Info.plist',
+ configuration: plist_conf
+)
+install_data(plist,
+ install_dir: app_contents)
+
+bin_path = join_paths(prefix, get_option('bindir'), 'terminology')
+
+launcher = custom_target('terminology_app_launcher',
+ input: files('launcher.c'),
+ output: 'terminology',
+ command: [
+ cc.cmd_array(), '@INPUT@',
+ '-DTERMINOLOGY_BIN="' + bin_path + '"',
+ '-o', '@OUTPUT@'
+ ],
+ install: true,
+ install_dir: join_paths(prefix, app_contents, 'MacOS')
+)
+
+meson.add_install_script('link_app.sh')
diff --git a/data/meson.build b/data/meson.build
index 62e897c9..4c56ef28 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -5,3 +5,6 @@ subdir('fonts')
subdir('themes')
subdir('backgrounds')
subdir('colorschemes')
+if host_os == 'darwin'
+ subdir('macos')
+endif
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.