Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix and improve AppImage #324

Merged
merged 14 commits into from
Jan 20, 2025
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
build-linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
cmake_args: [-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON, -DDISCORD_RPC=OFF -DDRAG_DROP=OFF -DNETPLAY=OFF -DVRU=OFF -DUSE_ANGRYLION=OFF]
Expand All @@ -17,8 +17,9 @@ jobs:
key: Linux
- name: Install Packages
run: |
sudo add-apt-repository ppa:okirby/qt6-backports --yes
sudo apt-get -y install cmake ninja-build libhidapi-dev libsamplerate0-dev libspeex-dev libminizip-dev libsdl2-dev libsdl2-net-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev pkg-config zlib1g-dev binutils-dev libspeexdsp-dev qt6-base-dev libqt6svg6-dev libqt6websockets6-dev libvulkan-dev build-essential nasm git zip appstream
sudo apt-get -y install cmake ninja-build libhidapi-dev libsamplerate0-dev libspeex-dev libminizip-dev libsdl2-dev libsdl2-net-dev libfreetype6-dev \
libgl1-mesa-dev libglu1-mesa-dev pkg-config zlib1g-dev binutils-dev libspeexdsp-dev qt6-base-dev libqt6svg6-dev libqt6websockets6-dev libvulkan-dev \
build-essential nasm git zip appstream xvfb qt6ct mesa-vulkan-drivers
- name: Prepare Environment
run: |
echo "GIT_REVISION=$(git describe --tags --always)" >> $GITHUB_ENV
Expand Down
11 changes: 0 additions & 11 deletions Package/AppImage/AppRun

This file was deleted.

76 changes: 52 additions & 24 deletions Package/AppImage/Create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,65 @@ set -ex
script_dir="$(dirname "$0")"
toplvl_dir="$(realpath "$script_dir/../../")"
bin_dir="$toplvl_dir/Bin/AppImage" # RMG should be installed here
UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
APPIMAGETOOL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"

export QMAKE="$(which qmake6)"
export EXTRA_QT_PLUGINS="imageformats;iconengines;"
export ARCH="$(uname -m)"
export APPIMAGE_EXTRACT_AND_RUN=1
export VERSION="$(git describe --tags --always)"
export OUTPUT="$bin_dir/../RMG-Portable-Linux64-$VERSION.AppImage"
export LD_LIBRARY_PATH="$toplvl_dir/Build/AppImage/Source/RMG-Core" # hack

if [ ! -f "$script_dir/linuxdeploy-x86_64.AppImage" ]
then
curl -L https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \
-o "$script_dir/linuxdeploy-x86_64.AppImage"
chmod +x "$script_dir/linuxdeploy-x86_64.AppImage"
fi
cd "$bin_dir"
Samueru-sama marked this conversation as resolved.
Show resolved Hide resolved
cp ./usr/share/applications/com.github.Rosalie241.RMG.desktop ./
cp ./usr/share/icons/hicolor/scalable/apps/com.github.Rosalie241.RMG.svg ./
ln -s ./com.github.Rosalie241.RMG.svg ./.DirIcon
mv ./usr/share ./share
mv ./usr ./shared

if [ ! -f "$script_dir/linuxdeploy-plugin-qt-x86_64.AppImage" ]
then
curl -L https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage \
-o "$script_dir/linuxdeploy-plugin-qt-x86_64.AppImage"
chmod +x "$script_dir/linuxdeploy-plugin-qt-x86_64.AppImage"
if [ ! -f "./lib4bin" ]; then
wget --retry-connrefused --tries=30 "$LIB4BN" -O ./lib4bin
Samueru-sama marked this conversation as resolved.
Show resolved Hide resolved
chmod +x ./lib4bin
fi

"$script_dir/linuxdeploy-plugin-qt-x86_64.AppImage" --appimage-extract
"$script_dir/linuxdeploy-x86_64.AppImage" --appimage-extract
xvfb-run -a -- ./lib4bin -p -v -r -s -k -e \
./shared/bin/RMG \
/usr/lib/x86_64-linux-gnu/libSDL* \
/usr/lib/x86_64-linux-gnu/libGL* \
/usr/lib/x86_64-linux-gnu/libEGL* \
/usr/lib/x86_64-linux-gnu/libvulkan* \
/usr/lib/x86_64-linux-gnu/dri/* \
/usr/lib/x86_64-linux-gnu/libssl.so* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/iconengines/* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/imageformats/* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/platforms/* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/platformthemes/* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/styles/* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/xcbglintegrations/* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/tls/* \
/usr/lib/x86_64-linux-gnu/qt6/plugins/wayland-*/*

# delete appimages
rm "$script_dir/linuxdeploy-x86_64.AppImage" \
"$script_dir/linuxdeploy-plugin-qt-x86_64.AppImage"
# Prepare sharun
./sharun -g
echo '#!/usr/bin/env sh
Samueru-sama marked this conversation as resolved.
Show resolved Hide resolved
[ -f "$APPIMAGE".stylesheet ] && APPIMAGE_QT_THEME="$APPIMAGE.stylesheet"
[ -f "$APPIMAGE_QT_THEME" ] && set -- "$@" "-stylesheet" "$APPIMAGE_QT_THEME"
HERE="$(readlink -f "$(dirname "$0")")"
exec "$HERE/bin/RMG" \
--lib-path="$HERE/shared/lib/RMG" \
--core-path="$HERE/shared/lib/RMG/Core" \
--plugin-path="$HERE/shared/lib/RMG/Plugin" \
--shared-data-path="$HERE/share/RMG" \
"${@}"' > ./AppRun
chmod +x ./AppRun

"$(pwd)/squashfs-root/AppRun" \
--plugin=qt \
--appdir="$bin_dir" \
--custom-apprun="$script_dir/AppRun" \
--output=appimage \
--desktop-file="$bin_dir/usr/share/applications/com.github.Rosalie241.RMG.desktop"
# make appimage
cd ..
if [ ! -f "./appimagetool" ]; then
wget --retry-connrefused --tries=30 "$APPIMAGETOOL" -O ./appimagetool
chmod +x ./appimagetool
fi
./appimagetool --comp zstd \
--mksquashfs-opt -Xcompression-level --mksquashfs-opt 22 \
-n -u "$UPINFO" "$PWD"/AppImage "$PWD"/RMG-"$VERSION"-anylinux-"$ARCH".AppImage
Samueru-sama marked this conversation as resolved.
Show resolved Hide resolved