mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 16:00:18 +00:00
Updated osx/makebundle.sh to use a robust bundler invocation flow: prefer gtk-mac-bundler, fall back to python3 -m gtk_mac_bundler, fail fast with clear install guidance if neither is available, and verify the .app was actually produced before zipping. Also added macOS prefix/library expectation comments.
Updated osx/zoitechat.bundle to target GTK3 (gtk+-3.0), refreshed runtime module paths (immodules, printbackends, gdk-pixbuf, pango), removed GTK2-specific engine/theme entries, and added prefix comments. This also keeps the requested anchor locations (launcher-script, ${prefix}/lib/${gtkdir}).
Updated osx/launcher.sh to remove obsolete GTK2 environment assumptions (including GTK2_RC_FILES and old GTK2 loader file paths), set GTK3-relevant variables (GTK_IM_MODULE_FILE, GDK_PIXBUF_MODULE_FILE, GSETTINGS_SCHEMA_DIR), and minimize DYLD path hacking by only prepending when already set. Added launcher-script comment anchor and prefix/library docs.
This commit is contained in:
@@ -23,18 +23,28 @@ bundle_data="$bundle_res"/share
|
||||
bundle_etc="$bundle_res"/etc
|
||||
|
||||
export PREFIX="$bundle_res"
|
||||
export DYLD_LIBRARY_PATH="$bundle_lib"
|
||||
|
||||
# launcher-script: runtime environment for bundled GTK3 on macOS.
|
||||
# Expected package prefixes when building the app bundle:
|
||||
# Homebrew: /opt/homebrew (Apple Silicon) or /usr/local (Intel)
|
||||
# MacPorts: /opt/local
|
||||
# Required libraries include GTK3, Pango, GDK-Pixbuf and enchant.
|
||||
|
||||
# Keep DYLD path hacks to a minimum; install_name_tool should resolve most libs.
|
||||
if test -n "${DYLD_LIBRARY_PATH:-}"; then
|
||||
export DYLD_LIBRARY_PATH="$bundle_lib:$DYLD_LIBRARY_PATH"
|
||||
fi
|
||||
|
||||
export XDG_CONFIG_DIRS="$bundle_etc"/xdg
|
||||
export XDG_DATA_DIRS="$bundle_data"
|
||||
export GTK_DATA_PREFIX="$bundle_res"
|
||||
export GTK_EXE_PREFIX="$bundle_res"
|
||||
export GTK_PATH="$bundle_res"
|
||||
|
||||
export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
|
||||
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
|
||||
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
|
||||
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-3.0/gtk.immodules"
|
||||
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-3.0/gdk-pixbuf.loaders"
|
||||
export PANGO_LIBDIR="$bundle_lib"
|
||||
export PANGO_SYSCONFDIR="$bundle_etc"
|
||||
export GSETTINGS_SCHEMA_DIR="$bundle_data/glib-2.0/schemas"
|
||||
|
||||
export OPENSSL_CONF="/System/Library/OpenSSL/openssl.cnf"
|
||||
|
||||
|
||||
@@ -1,11 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -rf ZoiteChat.app
|
||||
rm -f *.app.zip
|
||||
set -eu
|
||||
|
||||
python $HOME/.local/bin/gtk-mac-bundler zoitechat.bundle
|
||||
BUNDLE_DEF="zoitechat.bundle"
|
||||
APP_NAME="ZoiteChat.app"
|
||||
|
||||
# Expected prefixes for macOS GTK dependencies:
|
||||
# - Homebrew: /opt/homebrew (Apple Silicon) or /usr/local (Intel)
|
||||
# - MacPorts: /opt/local
|
||||
# Required runtime stack includes GTK3, Pango, GDK-Pixbuf and enchant.
|
||||
|
||||
if command -v gtk-mac-bundler >/dev/null 2>&1; then
|
||||
BUNDLER_CMD="gtk-mac-bundler"
|
||||
elif command -v python3 >/dev/null 2>&1 && python3 -c 'import gtk_mac_bundler' >/dev/null 2>&1; then
|
||||
BUNDLER_CMD="python3 -m gtk_mac_bundler"
|
||||
else
|
||||
cat >&2 <<'MSG'
|
||||
error: gtk-mac-bundler not found.
|
||||
Install one of the following before running osx/makebundle.sh:
|
||||
- executable: gtk-mac-bundler
|
||||
- python module: gtk_mac_bundler (invoked via: python3 -m gtk_mac_bundler)
|
||||
MSG
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf "$APP_NAME"
|
||||
rm -f ./*.app.zip
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
$BUNDLER_CMD "$BUNDLE_DEF"
|
||||
|
||||
if [ ! -d "$APP_NAME" ]; then
|
||||
echo "error: bundler finished but $APP_NAME was not created" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Compressing bundle"
|
||||
#hdiutil create -format UDBZ -srcdir ZoiteChat.app -quiet ZoiteChat-2.9.6.1-$(git rev-parse --short master).dmg
|
||||
zip -9rXq ./ZoiteChat-$(git describe --tags).app.zip ./ZoiteChat.app
|
||||
|
||||
zip -9rXq "./ZoiteChat-$(git describe --tags).app.zip" "./$APP_NAME"
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
<app-bundle>
|
||||
|
||||
<meta>
|
||||
<!-- Expected prefixes:
|
||||
Homebrew: /opt/homebrew (Apple Silicon) or /usr/local (Intel)
|
||||
MacPorts: /opt/local -->
|
||||
<prefix name="default">/usr/local</prefix>
|
||||
<prefix name="enchant">/usr/local/opt/enchant-applespell</prefix>
|
||||
<destination overwrite="yes">${project}</destination>
|
||||
|
||||
<run-install-name-tool/>
|
||||
<launcher-script>${project}/launcher.sh</launcher-script >
|
||||
<gtk>gtk+-2.0</gtk>
|
||||
<launcher-script>${project}/launcher.sh</launcher-script>
|
||||
<gtk>gtk+-3.0</gtk>
|
||||
</meta>
|
||||
|
||||
<plist>${project}/Info.plist</plist>
|
||||
@@ -28,39 +31,28 @@
|
||||
${prefix:enchant}/lib/enchant/libenchant_applespell.so
|
||||
</binary>
|
||||
|
||||
<!-- GTK3 runtime modules: ${prefix}/lib/${gtkdir} -->
|
||||
<binary>
|
||||
${prefix}/lib/${gtkdir}/modules/*.so
|
||||
</binary>
|
||||
<binary>
|
||||
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/libquartz.so
|
||||
</binary>
|
||||
<binary>
|
||||
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/libxamarin.so
|
||||
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/immodules/*.so
|
||||
</binary>
|
||||
<binary>
|
||||
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
|
||||
</binary>
|
||||
<binary>
|
||||
${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so
|
||||
</binary>
|
||||
<binary>
|
||||
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
|
||||
</binary>
|
||||
<data>
|
||||
${prefix}/share/themes/Mac/gtk-2.0-key/gtkrc
|
||||
</data>
|
||||
|
||||
<translations name="gtk20">
|
||||
<binary>
|
||||
${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so
|
||||
</binary>
|
||||
<binary>
|
||||
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/*.so
|
||||
</binary>
|
||||
|
||||
<translations name="gtk30">
|
||||
${prefix}/share/locale
|
||||
</translations>
|
||||
<translations name="zoitechat">
|
||||
${prefix}/share/locale
|
||||
</translations>
|
||||
|
||||
<data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
|
||||
${project}/gtkrc
|
||||
</data>
|
||||
|
||||
<data dest="${bundle}/Contents/Resources">
|
||||
${project}/zoitechat.icns
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user