mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-24 02:51:17 -08:00
Stock WebKitGTK ships without ENABLE_WEB_RTC on most distros, so wry Linux builds cannot place calls. Bundle the portable runtime built by the webkitgtk-webrtc pipeline next to the binary instead of relying on the host. scripts/webkit mirrors scripts/cef: fetch the pinned artifact, stage it into webkit/ beside the binary, and package deb/rpm/AppImage from there. build.rs adds the matching rpath and main.rs points the helper processes and GStreamer at the bundle, all inert when it is absent. copy-libs.sh refuses a runtime built without relocatable-exec-path.patch or with a glibc floor above the host's, since both fail silently at runtime. The CI job builds and uploads wry bundles as artifacts only; CEF stays the shipped Linux path.
40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#MISE description="Stage the WebKit runtime and desktop files for packaging"
|
|
# Usage: scripts/webkit/stage.sh [stage-dir] [display-name] [profile]
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
STAGE="${1:-$ROOT/src-tauri/target/webkit-stage}"
|
|
DISPLAY_NAME="${2:-Sable}"
|
|
PROFILE="${3:-release}"
|
|
|
|
RUNTIME="$STAGE/runtime"
|
|
SHARE="$STAGE/share"
|
|
rm -rf "$STAGE"
|
|
mkdir -p "$RUNTIME" "$SHARE/applications"
|
|
|
|
bash scripts/webkit/copy-libs.sh "$PROFILE" "$RUNTIME"
|
|
|
|
cat > "$SHARE/applications/sable.desktop" <<EOF
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Name=$DISPLAY_NAME
|
|
Comment=A Matrix client
|
|
Exec=sable %U
|
|
Icon=sable
|
|
Terminal=false
|
|
Categories=Network;InstantMessaging;Chat;
|
|
StartupWMClass=sable
|
|
MimeType=x-scheme-handler/sable;x-scheme-handler/moe.sable.app;
|
|
EOF
|
|
|
|
for size in 32x32 64x64 128x128; do
|
|
mkdir -p "$SHARE/icons/hicolor/${size}/apps"
|
|
cp -f "src-tauri/icons/${size}.png" "$SHARE/icons/hicolor/${size}/apps/sable.png"
|
|
done
|
|
mkdir -p "$SHARE/icons/hicolor/256x256/apps"
|
|
cp -f "src-tauri/icons/[email protected]" "$SHARE/icons/hicolor/256x256/apps/sable.png"
|
|
|
|
echo "✅ staged $DISPLAY_NAME into $STAGE"
|