- Gate MPRIS, tray (zbus/ksni) and the unix-socket single instance to unix; Windows gets stub modules and a loopback-TCP single instance - Use %APPDATA%/%LOCALAPPDATA% on Windows, hide the console window - build.rs embeds the icon and version resource on Windows targets - packaging/appimage.sh builds the AppImage with the libmpv library closure - packaging/mulberry.iss: per-user Inno Setup installer Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
43 lines
2.3 KiB
Shell
43 lines
2.3 KiB
Shell
#!/usr/bin/env bash
|
|
# Pack the release binary and its libmpv library closure into dist/Mulberry-<version>-x86_64.AppImage.
|
|
# packaging/appimage.sh <version> (run from anywhere after `cargo build --release`)
|
|
# glibc, graphics/windowing and other libraries every desktop already has are left to the host.
|
|
set -euo pipefail
|
|
version=$1
|
|
root=$(cd "$(dirname "$0")/.." && pwd)
|
|
dist="$root/dist"
|
|
app="$dist/AppDir"
|
|
bin="$root/target/release/mulberry"
|
|
rm -rf "$app"
|
|
mkdir -p "$app/usr/bin" "$app/usr/lib" "$app/usr/share/applications" "$app/usr/share/icons/hicolor/scalable/apps"
|
|
cp "$bin" "$app/usr/bin/mulberry"
|
|
|
|
skip='^(linux-vdso|ld-linux|libc|libm|libdl|libpthread|librt|libutil|libresolv|libnsl|libgcc_s|libstdc\+\+|libGL|libGLX|libGLdispatch|libEGL|libOpenGL|libGLESv2|libgbm|libdrm|libvulkan|libX11|libX11-xcb|libxcb.*|libXau|libXdmcp|libXext|libXfixes|libXrandr|libXrender|libXi|libXcursor|libXss|libXv|libXxf86vm|libXinerama|libwayland-.*|libxkbcommon.*|libfontconfig|libfreetype|libharfbuzz|libglib-2.0|libgobject-2.0|libgio-2.0|libgmodule-2.0|libdbus-1|libsystemd|libudev|libasound|libpulse.*|libpipewire-0.3|libjack|libsndio|libcap|libselinux|libpcre2-8|libffi|libz|libexpat|libnss.*)\.so'
|
|
ldd "$bin" | awk '/=> \//{print $3}' | while read -r lib; do
|
|
name=$(basename "$lib")
|
|
[[ $name =~ $skip ]] && continue
|
|
cp -L "$lib" "$app/usr/lib/$name"
|
|
done
|
|
# the mujs script engine shows up in ldd without a soname arrow
|
|
for lib in $(ldd "$bin" | awk '$1 ~ /^\// {print $1}'); do
|
|
cp -L "$lib" "$app/usr/lib/$(basename "$lib")"
|
|
done
|
|
|
|
cp "$root/packaging/mulberry.svg" "$app/mulberry.svg"
|
|
cp "$root/packaging/mulberry.svg" "$app/usr/share/icons/hicolor/scalable/apps/mulberry.svg"
|
|
{ sed 's/^Exec=mulberry %U/Exec=mulberry %U/' "$root/packaging/mulberry.desktop"; echo "X-AppImage-Version=$version"; } > "$app/mulberry.desktop"
|
|
cp "$app/mulberry.desktop" "$app/usr/share/applications/"
|
|
cat > "$app/AppRun" <<'EOF'
|
|
#!/bin/sh
|
|
here=$(dirname "$(readlink -f "$0")")
|
|
export LD_LIBRARY_PATH="$here/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
exec "$here/usr/bin/mulberry" "$@"
|
|
EOF
|
|
chmod +x "$app/AppRun"
|
|
|
|
tool="$dist/appimagetool"
|
|
if [ ! -x "$tool" ]; then
|
|
cp "$HOME/Projects/Nacre/dist/appimagetool" "$tool"
|
|
fi
|
|
ARCH=x86_64 APPIMAGE_EXTRACT_AND_RUN=1 "$tool" --no-appstream "$app" "$dist/Mulberry-$version-x86_64.AppImage"
|
|
ls -lh "$dist"/*.AppImage
|