LOK runs on Windows and Linux; packaging stages engines (W-01, K-01)
The kernel is the merged library on every platform; Windows and Linux find it beside the app in libreoffice/program. All three run unipoll: macOS through GCD, Linux by answering one request per poll, Windows through a message-only window on the loop's thread (LOK's own main thread had deadlocked Calc loads). Patch 0043 flushes callbacks inline everywhere, so a request sees its result; 0042 stops MSVC's Boost auto-link. Linux paints with cairo, BGRA; the start-up check now paints red text and finds red in byte two on every platform, since getTileMode does not see Skia. ely-lok on Windows: 180 of 189 pass; on Linux 187. The rest are listed after 0.1.3 (spelling, Calc dark tiles, show layers and fields, a11y selection). Tests build file URLs portably and accept CRLF where Windows writes it. packaging/stage.sh lays out an app with its engines for Windows and Linux; licenses.sh finds each licence on all three. ElyMark finds its page beside the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc4c1ed0fe
commit
c96d39a342
34 files changed
+658
-214
No files matched your search
+20
-7
@@ -25,10 +25,16 @@ case $slug in
|
||||
*) crates=() ;;
|
||||
esac
|
||||
python3 "$root/packaging/crates.py" "$slug" ${crates[@]+"${crates[@]}"} >"$out/rust-crates.txt"
|
||||
lo=${ELY_LO_APP:-$root/engines/lo-src/instdir/LibreOffice.app}/Contents/Resources
|
||||
case $(uname) in
|
||||
Darwin) lo=${ELY_LO_APP:-$root/engines/lo-src/instdir/LibreOffice.app}/Contents/Resources ;;
|
||||
*) lo=${ELY_LO_DIR:-$root/engines/lo-src/instdir} ;;
|
||||
esac
|
||||
# Windows builds name LibreOffice's licence license.txt.
|
||||
lo_licence=$lo/LICENSE
|
||||
[ -e "$lo_licence" ] || lo_licence=$lo/license.txt
|
||||
case $slug in
|
||||
ely-doc | ely-table | ely-show)
|
||||
put LibreOffice "$lo/LICENSE" "$lo/LICENSE.html" "$lo/NOTICE" "$lo/CREDITS.fodt"
|
||||
put LibreOffice "$lo_licence" "$lo/LICENSE.html" "$lo/NOTICE" "$lo/CREDITS.fodt"
|
||||
;;
|
||||
ely-pdf)
|
||||
put MuPDF "$root/engines/mupdf-src/COPYING"
|
||||
@@ -53,16 +59,23 @@ case $slug in
|
||||
# shellcheck disable=SC2086
|
||||
put "MuPDF/fonts/$name" $found
|
||||
done
|
||||
put OpenSSL "$(pkg-config --variable=prefix libcrypto)/LICENSE.txt"
|
||||
case $(uname) in
|
||||
MINGW* | MSYS*) put OpenSSL "$root/engines/vcpkg/installed/x64-windows-static/share/openssl/copyright" ;;
|
||||
*) put OpenSSL "$(pkg-config --variable=prefix libcrypto)/LICENSE.txt" ;;
|
||||
esac
|
||||
put tessdata "${ELY_TESSDATA:-$root/engines/tessdata}/LICENSE"
|
||||
put GreatVibes "$root/crates/ely-pdf-engine/fonts/OFL.txt"
|
||||
;;
|
||||
ely-tree)
|
||||
put Git "$root/engines/git-src/COPYING" "$root/engines/git-src/LGPL-2.1"
|
||||
put git-lfs "$root/engines/git/share/doc/git-lfs/LICENSE.md"
|
||||
;;
|
||||
ely-mark)
|
||||
put CEF "$root/reference/cef/LICENSE.txt" "${ELY_CEF:-$root/engines/cef}/CREDITS.html"
|
||||
put content "$root/engines/content/ely-mark/THIRD-PARTY-NOTICES.txt"
|
||||
;;
|
||||
esac
|
||||
# ElyTree carries Git; on Windows and Linux ElyMark does too.
|
||||
if [ "$slug" = ely-tree ] || { [ "$slug" = ely-mark ] && [ "$(uname)" != Darwin ]; }; then
|
||||
case $(uname) in
|
||||
MINGW* | MSYS*) put Git "$root/engines/git/LICENSE.txt" ;;
|
||||
*) put Git "$root/engines/git-src/COPYING" "$root/engines/git-src/LGPL-2.1" ;;
|
||||
esac
|
||||
put git-lfs "$root/engines/git/share/doc/git-lfs/LICENSE.md"
|
||||
fi
|
||||
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env bash
|
||||
# Stages an app with its engines. Usage: stage.sh <slug> <dir>
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
slug=${1:?app slug, such as ely-doc}
|
||||
out=${2:?the folder to fill}
|
||||
case $(uname) in
|
||||
MINGW* | MSYS*) exe=.exe ;;
|
||||
Linux) exe= ;;
|
||||
*)
|
||||
echo "stage.sh: Windows or Linux only" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
grep -q "^$slug " "$root/packaging/apps.tsv" || {
|
||||
echo "stage.sh: unknown app $slug" >&2
|
||||
exit 1
|
||||
}
|
||||
uses() { grep -q "^$1" "$root/apps/$slug/Cargo.toml"; }
|
||||
need() { # path, what to run
|
||||
[ -e "$1" ] || {
|
||||
echo "stage.sh: no $1; run $2" >&2
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
build() { cargo build --manifest-path "$root/Cargo.toml" --release "$@"; }
|
||||
|
||||
rm -rf "$out"
|
||||
mkdir -p "$out"
|
||||
build -p "$slug"
|
||||
cp "$root/target/release/$slug$exe" "$out/"
|
||||
if uses ely-lok; then
|
||||
lo=${ELY_LO_DIR:-$root/engines/lo-src/instdir}
|
||||
need "$lo/program" scripts/build-libreoffice.sh
|
||||
build -p ely-lok --bin ely-lok-worker
|
||||
cp "$root/target/release/ely-lok-worker$exe" "$out/"
|
||||
# The kernel in LibreOffice's layout, beside the app.
|
||||
mkdir "$out/libreoffice"
|
||||
cp -R "$lo/program" "$lo/share" "$lo/presets" "$out/libreoffice/"
|
||||
cp "$lo/LICENSE.html" "$lo/NOTICE" "$lo/CREDITS.fodt" "$out/libreoffice/"
|
||||
# Merged-library builds leave text placeholders.
|
||||
while IFS= read -r stub; do
|
||||
if [ "$(cat "$stub")" = "invalid - merged lib" ]; then
|
||||
rm "$stub"
|
||||
fi
|
||||
done < <(find "$out/libreoffice/program" -type f -size -64c)
|
||||
if [ -n "$exe" ]; then
|
||||
# The kernel needs the VC++ runtime; it ships beside it.
|
||||
crt=$(ls -d "/c/Program Files/Microsoft Visual Studio/2022/"*/VC/Redist/MSVC/*/x64/Microsoft.VC143.CRT | tail -n 1)
|
||||
need "$crt" "the Visual Studio 2022 C++ tools"
|
||||
cp "$crt"/*.dll "$out/libreoffice/program/"
|
||||
fi
|
||||
fi
|
||||
if uses ely-pdf-engine; then
|
||||
tessdata=${ELY_TESSDATA:-$root/engines/tessdata}
|
||||
need "$tessdata/eng.traineddata" scripts/fetch-tessdata.sh
|
||||
build -p ely-pdf-engine --bin ely-pdf-worker
|
||||
cp "$root/target/release/ely-pdf-worker$exe" "$out/"
|
||||
mkdir "$out/tessdata"
|
||||
cp "$tessdata"/{eng,chi_sim,chi_tra}.traineddata "$out/tessdata/"
|
||||
fi
|
||||
if [ "$slug" = ely-tree ] || [ "$slug" = ely-mark ]; then
|
||||
need "$root/engines/git" "scripts/build-git.sh and scripts/fetch-git-lfs.sh"
|
||||
cp -R "$root/engines/git" "$out/git"
|
||||
fi
|
||||
if uses ely-web-content; then
|
||||
cef=${ELY_CEF:-$root/engines/cef}
|
||||
need "$cef/icudtl.dat" scripts/fetch-cef.sh
|
||||
# CEF's runtime sits beside the app, as cef-dll-sys has it.
|
||||
find "$cef" -maxdepth 1 -type f \( -name '*.dll' -o -name '*.so' -o -name '*.so.*' -o -name '*.pak' \
|
||||
-o -name '*.bin' -o -name '*.dat' -o -name '*.json' -o -name chrome-sandbox \) -exec cp {} "$out/" \;
|
||||
cp -R "$cef/locales" "$out/"
|
||||
content=$root/engines/content/$slug
|
||||
need "$content/index.html" "its scripts/build-*-content.sh"
|
||||
cp -R "$content" "$out/content"
|
||||
fi
|
||||
"$root/packaging/licenses.sh" "$slug" "$out/licenses"
|
||||
echo "$out"
|
||||
Reference in new issue
Block a user