Fixed macOS bundling prefix rendering by introducing BUNDLE_PREFIX_XML="${BUNDLE_PREFIX%/}/" so the bundle XML always gets a trailing slash, preventing malformed translation paths like .../x86_64locale/... during gtk-mac-bundler translation copy steps.

Kept runtime path checks and enchant defaults based on the original BUNDLE_PREFIX, so only the XML-injected default prefix behavior changed.
This commit is contained in:
2026-02-19 16:30:14 -07:00
parent 1efba4ffdf
commit 819535679c

View File

@@ -58,10 +58,15 @@ if [ -z "$BUNDLE_PREFIX" ]; then
BUNDLE_PREFIX="/usr/local"
fi
# gtk-mac-bundler rebases translation paths using string concatenation on
# ${prefix}. Keep a trailing slash in the bundle metadata to avoid malformed
# paths like ".../x86_64locale/..." when copying locale catalogs.
BUNDLE_PREFIX_XML="${BUNDLE_PREFIX%/}/"
ENCHANT_PREFIX_DEFAULT="${BUNDLE_PREFIX}/opt/enchant"
ENCHANT_PREFIX_PATH="${ENCHANT_PREFIX:-$ENCHANT_PREFIX_DEFAULT}"
perl -0pi -e 's|(<prefix\s+name="default">)[^<]+(</prefix>)|$1'"$BUNDLE_PREFIX"'$2|s' "$BUNDLE_DEF"
perl -0pi -e 's|(<prefix\s+name="default">)[^<]+(</prefix>)|$1'"$BUNDLE_PREFIX_XML"'$2|s' "$BUNDLE_DEF"
perl -0pi -e 's|(<prefix\s+name="enchant">)[^<]+(</prefix>)|$1'"$ENCHANT_PREFIX_PATH"'$2|s' "$BUNDLE_DEF"
if command -v brew >/dev/null 2>&1; then