mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Updated the macOS bundling script to dynamically adapt the enchant data path before invoking gtk-mac-bundler, instead of assuming share/enchant always exists. It now checks the resolved enchant prefix and rewrites the bundle definition to use share/enchant or share/enchant-2 depending on what is present.
Added a fallback that removes the enchant <data> copy stanza entirely when neither share directory exists, preventing the exact Cannot find source to copy bundler failure you reported.
This commit is contained in:
@@ -30,6 +30,27 @@ fi
|
||||
rm -rf "$APP_NAME"
|
||||
rm -f ./*.app.zip
|
||||
|
||||
# Enchant packaging changed between releases/package managers:
|
||||
# - some installs provide share/enchant
|
||||
# - others provide share/enchant-2
|
||||
# - some have no share-level config dir at all
|
||||
# Keep the bundle definition in sync with what's actually available so
|
||||
# gtk-mac-bundler doesn't fail on a missing source path.
|
||||
ENCHANT_PREFIX_PATH="${ENCHANT_PREFIX:-}"
|
||||
if [ -z "$ENCHANT_PREFIX_PATH" ] && command -v brew >/dev/null 2>&1; then
|
||||
ENCHANT_PREFIX_PATH="$(brew --prefix enchant 2>/dev/null || true)"
|
||||
fi
|
||||
|
||||
if [ -n "$ENCHANT_PREFIX_PATH" ]; then
|
||||
if [ -d "$ENCHANT_PREFIX_PATH/share/enchant" ]; then
|
||||
perl -0pi -e 's|(<data>\s*)\$\{prefix:enchant\}/share/enchant(?:-2)?(\s*</data>)|$1\$\{prefix:enchant\}/share/enchant$2|s' "$BUNDLE_DEF"
|
||||
elif [ -d "$ENCHANT_PREFIX_PATH/share/enchant-2" ]; then
|
||||
perl -0pi -e 's|(<data>\s*)\$\{prefix:enchant\}/share/enchant(?:-2)?(\s*</data>)|$1\$\{prefix:enchant\}/share/enchant-2$2|s' "$BUNDLE_DEF"
|
||||
else
|
||||
perl -0pi -e 's|\n\s*<data>\s*\$\{prefix:enchant\}/share/enchant(?:-2)?\s*</data>\n|\n|s' "$BUNDLE_DEF"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Keep Info.plist generation deterministic by always rendering from template
|
||||
# using a single, explicit version source.
|
||||
|
||||
Reference in New Issue
Block a user