generate a wayland appimage (#2625)

* generate a wayland appimage

- update patchelf to 0.12
- integrate qt5-wayland plugins
- check for wayland display environment

* duckstation wayland

- update packages to include qt5-wayland
- upload wayland packages
- add wayland packages to release

* Generate single Qt appimage with wayland

- combine x11 and wayland into one appimage

* One Qt appimage
This commit is contained in:
qurious-pixel 2021-09-25 16:56:56 -07:00 committed by GitHub
parent c0a29f7bfd
commit 11be9c1498
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 6 deletions

View file

@ -242,7 +242,7 @@ jobs:
shell: bash
run: |
sudo apt-get update
sudo apt-get -y install cmake ninja-build ccache libsdl2-dev libgtk-3-dev qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qt5-default qttools5-dev libegl1-mesa-dev libevdev-dev libgbm-dev libdrm-dev libwayland-dev libwayland-egl-backend-dev extra-cmake-modules libcurl4-gnutls-dev libxrandr-dev
sudo apt-get -y install cmake ninja-build ccache libsdl2-dev libgtk-3-dev qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qt5-default qttools5-dev qtwayland5 libegl1-mesa-dev libevdev-dev libgbm-dev libdrm-dev libqt5waylandclient5-dev libqt5waylandcompositor5-dev libwayland-dev libwayland-egl-backend-dev extra-cmake-modules libcurl4-gnutls-dev libxrandr-dev
- name: Compile build
shell: bash
@ -392,3 +392,4 @@ jobs:
linux-x64-appimage-nogui-zsync/duckstation-nogui-x64.AppImage.zsync
linux-x64-appimage-qt/duckstation-qt-x64.AppImage
linux-x64-appimage-qt-zsync/duckstation-qt-x64.AppImage.zsync

View file

@ -62,10 +62,22 @@ for frontend in ${FRONTENDS[@]}; do
cp -av ${TRANSLATIONS_DIR} ${CURRENT_APPDIR}/usr/bin
done
# Replace Patchelf
curl -sSfLO https://github.com/NixOS/patchelf/releases/download/0.12/patchelf-0.12.tar.bz2
tar xvf patchelf-0.12.tar.bz2
cd patchelf-0.12*/
./configure
make && sudo make install
cd ${BUILD_DIR}
# Pass UPDATE_INFORMATION and OUTPUT variables (used by linuxdeploy-plugin-appimage)
# to the environment of the linuxdeploy commands
${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
${BUILD_DIR}/linuxdeploy-x86_64.AppImage --appimage-extract
mv ${BUILD_DIR}/squashfs-root/usr/bin/patchelf ${BUILD_DIR}/squashfs-root/usr/bin/patchelf.orig
sudo cp /usr/local/bin/patchelf ${BUILD_DIR}/squashfs-root/usr/bin/patchelf
${BUILD_DIR}/squashfs-root/AppRun \
--appdir=${BUILD_DIR}/duckstation-qt.AppDir \
--executable=${BUILD_DIR}/bin/duckstation-qt \
--desktop-file=${APPIMAGE_RESOURCES_DIR}/linux-desktop-files/duckstation-qt.desktop \
@ -76,6 +88,20 @@ ${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
sed -i 's|exec "$this_dir"/AppRun.wrapped "$@"|exec env LD_LIBRARY_PATH="$this_dir"/usr/lib:$LD_LIBRARY_PATH "$this_dir"/AppRun.wrapped "$@"|' \
${BUILD_DIR}/duckstation-qt.AppDir/AppRun
mkdir -p ${BUILD_DIR}/duckstation-qt.AppDir/usr/plugins
mkdir -p ${BUILD_DIR}/duckstation-qt.AppDir/usr/lib/dri
cp /usr/lib/x86_64-linux-gnu/{libQt5WaylandClient.so.5,libEGL_mesa.so.0} ${BUILD_DIR}/duckstation-qt.AppDir/usr/lib
cp /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so ${BUILD_DIR}/duckstation-qt.AppDir/usr/lib/dri
cp -r /usr/lib/x86_64-linux-gnu/qt5/plugins/{xcbglintegrations,platforms,wayland-graphics-integration-client,wayland-decoration-client,wayland-shell-integration} ${BUILD_DIR}/duckstation-qt.AppDir/usr/plugins
cat <<'EOF'>> ${BUILD_DIR}/duckstation-qt.AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh
case "${WAYLAND_DISPLAY}" in
*wayland*)
export QT_QPA_PLATFORM=wayland
;;
esac
EOF
UPDATE_INFORMATION="zsync|https://github.com/stenzek/duckstation/releases/download/latest/duckstation-qt-x64.AppImage.zsync" \
OUTPUT="duckstation-qt-x64.AppImage" \
${BUILD_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage \
@ -83,7 +109,7 @@ ${BUILD_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage \
UPDATE_INFORMATION="zsync|https://github.com/stenzek/duckstation/releases/download/latest/duckstation-nogui-x64.AppImage.zsync" \
OUTPUT="duckstation-nogui-x64.AppImage" \
${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
${BUILD_DIR}/squashfs-root/AppRun \
--appdir=${BUILD_DIR}/duckstation-nogui.AppDir \
--executable=${BUILD_DIR}/bin/duckstation-nogui \
--desktop-file=${APPIMAGE_RESOURCES_DIR}/linux-desktop-files/duckstation-nogui.desktop \