Primo commit del progetto: motore Rust con parser HTML, cascata CSS, layout, raster CPU, formulari, bidi, flex, tabelle, JavaScript (Boa) con eventi e costruzione di nodi, rete HTTP/HTTPS con TLS, sotto-risorse, invio dei formulari; guscio grafico per Sailfish (QML/Silica) e per desktop (minifb, distribuito come AppImage), con 11 documenti di specifica e 91 casi di reftest.
86 lines
2.9 KiB
Bash
Executable File
86 lines
2.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# Costruisce Mosaic-desktop-x.y.z-x86_64.AppImage senza appimagetool:
|
|
# [runtime ELF estratto da un'AppImage esistente] + [squashfs dell'AppDir]
|
|
# Richiede: cargo, python3+PIL per l'icona, mksquashfs (qui, o nel container del SDK).
|
|
set -eu
|
|
|
|
# cargo può non essere nel PATH di una shell non interattiva
|
|
if ! command -v cargo >/dev/null 2>&1; then
|
|
PATH="$HOME/.cargo/bin:$PATH"
|
|
export PATH
|
|
fi
|
|
|
|
set -o pipefail
|
|
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
ROOT="$(cd "$HERE/.." && pwd)"
|
|
BUILD="$HERE/build"
|
|
APPDIR="$BUILD/AppDir"
|
|
VER="${VERSION:-0.1.0}"
|
|
OUT="$ROOT/Mosaic-desktop-$VER-x86_64.AppImage"
|
|
RUNTIME="${RUNTIME:-$HERE/runtime-x86_64}"
|
|
SRC_APPIMAGE="${SRC_APPIMAGE:-$ROOT/../../mosaic/Mosaic-1.0.0-x86_64.AppImage}"
|
|
CONTAINER="${CONTAINER:-sailfish-sdk-build-engine_kaneda}"
|
|
|
|
echo "== binario (release)"
|
|
(cd "$ROOT" && cargo build --release)
|
|
BIN="$ROOT/target/release/mosaic-desktop"
|
|
[ -x "$BIN" ] || { echo "binario non prodotto" >&2; exit 1; }
|
|
|
|
echo "== runtime AppImage"
|
|
if [ ! -f "$RUNTIME" ]; then
|
|
python3 "$HERE/extract-runtime.py" "$SRC_APPIMAGE" "$RUNTIME"
|
|
fi
|
|
chmod +x "$RUNTIME"
|
|
|
|
echo "== AppDir"
|
|
rm -rf "$APPDIR"
|
|
mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/share/mosaic/fonts" \
|
|
"$APPDIR/usr/share/applications" "$APPDIR/usr/share/icons/hicolor/256x256/apps"
|
|
install -m 755 "$BIN" "$APPDIR/usr/bin/mosaic-desktop"
|
|
install -m 644 "$ROOT/demo.html" "$APPDIR/usr/share/mosaic/"
|
|
install -m 644 "$ROOT/fonts/DejaVuSans.ttf" "$ROOT/fonts/DejaVuSerif.ttf" "$APPDIR/usr/share/mosaic/fonts/"
|
|
|
|
python3 "$HERE/make-icon.py" 256 "$APPDIR/mosaic-desktop.png"
|
|
install -m 644 "$APPDIR/mosaic-desktop.png" "$APPDIR/usr/share/icons/hicolor/256x256/apps/mosaic-desktop.png"
|
|
|
|
cat > "$APPDIR/mosaic-desktop.desktop" <<'DESKTOP'
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Name=Mosaic
|
|
GenericName=Web Browser
|
|
Comment=Browser Mosaic con motore di rendering indipendente
|
|
Exec=mosaic-desktop
|
|
Icon=mosaic-desktop
|
|
Terminal=false
|
|
Categories=Network;WebBrowser;
|
|
Keywords=web;browser;mosaic;retro;hypertext;
|
|
DESKTOP
|
|
cp "$APPDIR/mosaic-desktop.desktop" "$APPDIR/usr/share/applications/"
|
|
|
|
# AppRun: pagina demo e font interni al pacchetto, così non dipende dai font di sistema
|
|
cat > "$APPDIR/AppRun" <<'APPRUN'
|
|
#!/bin/sh
|
|
HERE="$(dirname "$(readlink -f "$0")")"
|
|
exec "$HERE/usr/bin/mosaic-desktop" \
|
|
--html "$HERE/usr/share/mosaic/demo.html" \
|
|
--font "$HERE/usr/share/mosaic/fonts/DejaVuSans.ttf" \
|
|
--zoom 1.25 "$@"
|
|
APPRUN
|
|
chmod +x "$APPDIR/AppRun"
|
|
|
|
echo "== squashfs"
|
|
if command -v mksquashfs >/dev/null 2>&1; then
|
|
mksquashfs "$APPDIR" "$BUILD/payload.squashfs" -comp gzip -b 131072 -root-owned -noappend -no-xattrs -no-progress
|
|
else
|
|
docker exec "$CONTAINER" mksquashfs "$APPDIR" "$BUILD/payload.squashfs" \
|
|
-comp gzip -b 131072 -root-owned -noappend -no-xattrs -no-progress
|
|
fi
|
|
|
|
echo "== immagine finale"
|
|
rm -f "$OUT"
|
|
cat "$RUNTIME" "$BUILD/payload.squashfs" > "$OUT"
|
|
chmod +x "$OUT"
|
|
echo "Creato: $OUT"
|
|
ls -lh "$OUT"
|