No LibreOffice in Open With: built bundle claims nothing, no image is mounted (R2.15)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 01:23:06 -04:00
1 parent 5a36ffc272
commit 466afe20a0
8 files changed
+80 -52

No files matched your search

+2
View File
@@ -83,3 +83,5 @@ done
echo "build-libreoffice.sh: dictionaries kept: $(ls "$extensions" | tr '\n' ' ')"
# Ely's kernel defaults: Excel A1 formulas.
cp "$root/packaging/libreoffice/ely.xcd" "$src/instdir/LibreOffice.app/Contents/Resources/registry/"
"$root/scripts/inert-lo.sh" "$src/instdir/LibreOffice.app"
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Unpacks the official kernel's libraries, never mounting the image.
set -euo pipefail
root=$(cd "$(dirname "$0")/.." && pwd)
dmg=$root/engines/LibreOffice_26.2.6_MacOS_aarch64.dmg
out=$root/engines/lo-official
command -v 7zz >/dev/null || { echo "extract-official-lo.sh: needs 7zz (brew install sevenzip)" >&2; exit 1; }
[ -f "$dmg" ] || { echo "extract-official-lo.sh: no $dmg" >&2; exit 1; }
[ "$(stat -f %z "$dmg")" = 297798926 ] || { echo "extract-official-lo.sh: $dmg is not the pinned image" >&2; exit 1; }
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
7zz x -y -snld -o"$work" "$dmg" "LibreOffice/LibreOffice.app/Contents/Frameworks/*" "LibreOffice/LibreOffice.app/Contents/Resources/*" >/dev/null
rm -rf "$out"
mkdir -p "$out"
# A plain folder, not a bundle: nothing for macOS to register.
mv "$work/LibreOffice/LibreOffice.app/Contents" "$out/Contents"
echo "extract-official-lo.sh: $out/Contents/Frameworks"
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# The built LibreOffice bundle holds libraries, nothing to register.
set -euo pipefail
app=${1:?usage: scripts/inert-lo.sh path/to/LibreOffice.app}
plist=$app/Contents/Info.plist
[ -f "$plist" ] || { echo "inert-lo.sh: no $plist" >&2; exit 1; }
lsregister=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
for key in CFBundleDocumentTypes CFBundleURLTypes UTExportedTypeDeclarations UTImportedTypeDeclarations; do
if /usr/libexec/PlistBuddy -c "Print :$key" "$plist" >/dev/null 2>&1; then
/usr/libexec/PlistBuddy -c "Delete :$key" "$plist"
fi
done
rm -rf "$app/Contents/PlugIns" "$app/Contents/Library/Spotlight"
"$lsregister" -u "$app"
# Spotlight would find the bundle and register it again.
touch "$(cd "$app/../../.." && pwd)/.metadata_never_index"
echo "inert-lo.sh: $app claims no files and is unregistered"