From 128238251d9094178afd1082dad49e4557a5f2e6 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 16 Feb 2025 22:42:05 +1000 Subject: [PATCH] CI: Enable Wayland on AppImage/Flatpak builds Might have to revert this, we'll see how many systems it breaks on. --- .../appimage/apprun-hooks/default-to-x11.sh | 9 --------- scripts/packaging/appimage/make-appimage.sh | 9 --------- scripts/packaging/appimage/make-cross-appimage.sh | 9 --------- scripts/packaging/arch/PKGBUILD | 9 +++++---- scripts/packaging/duckstation-qt | 13 ------------- scripts/packaging/fedora/duckstation.spec | 3 ++- .../flatpak/org.duckstation.DuckStation.yaml | 6 ++---- 7 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 scripts/packaging/appimage/apprun-hooks/default-to-x11.sh delete mode 100755 scripts/packaging/duckstation-qt diff --git a/scripts/packaging/appimage/apprun-hooks/default-to-x11.sh b/scripts/packaging/appimage/apprun-hooks/default-to-x11.sh deleted file mode 100644 index fa0dafe90..000000000 --- a/scripts/packaging/appimage/apprun-hooks/default-to-x11.sh +++ /dev/null @@ -1,9 +0,0 @@ -if [[ -z "$I_WANT_A_BROKEN_WAYLAND_UI" ]]; then - echo "Forcing X11 instead of Wayland, due to various protocol limitations" - echo "and Qt issues. If you want to use Wayland, launch DuckStation with" - echo "I_WANT_A_BROKEN_WAYLAND_UI=YES set." - export QT_QPA_PLATFORM=xcb -else - echo "Wayland is not being disabled. Do not complain when things break." -fi - diff --git a/scripts/packaging/appimage/make-appimage.sh b/scripts/packaging/appimage/make-appimage.sh index 96f417150..3fc95a03a 100755 --- a/scripts/packaging/appimage/make-appimage.sh +++ b/scripts/packaging/appimage/make-appimage.sh @@ -185,15 +185,6 @@ echo "Generating AppStream metainfo..." mkdir -p "$OUTDIR/usr/share/metainfo" "$SCRIPTDIR/../generate-metainfo.sh" "$OUTDIR/usr/share/metainfo" -# Copy in AppRun hooks. -echo "Copying AppRun hooks..." -mkdir -p "$OUTDIR/apprun-hooks" -for hookpath in "$SCRIPTDIR/apprun-hooks"/*; do - hookname=$(basename "$hookpath") - cp -v "$hookpath" "$OUTDIR/apprun-hooks/$hookname" - sed -i -e 's/exec /source "$this_dir"\/apprun-hooks\/"'"$hookname"'"\nexec /' "$OUTDIR/AppRun" -done - echo "Generating AppImage..." rm -f "$NAME.AppImage" "$APPIMAGETOOL" -v --runtime-file "$APPIMAGERUNTIME" "$OUTDIR" "$NAME.AppImage" diff --git a/scripts/packaging/appimage/make-cross-appimage.sh b/scripts/packaging/appimage/make-cross-appimage.sh index f43828b9d..67262b551 100755 --- a/scripts/packaging/appimage/make-cross-appimage.sh +++ b/scripts/packaging/appimage/make-cross-appimage.sh @@ -307,15 +307,6 @@ cp "$SCRIPTDIR/apprun-cross.sh" "$OUTDIR/AppRun" chmod +x "$OUTDIR/AppRun" ln -s "usr/bin/$BINARY" "$OUTDIR/AppRun.wrapped" -# Copy in AppRun hooks. -echo "Copying AppRun hooks..." -mkdir -p "$OUTDIR/apprun-hooks" -for hookpath in "$SCRIPTDIR/apprun-hooks"/*; do - hookname=$(basename "$hookpath") - cp -v "$hookpath" "$OUTDIR/apprun-hooks/$hookname" - sed -i -e 's/exec /source "$this_dir"\/apprun-hooks\/"'"$hookname"'"\nexec /' "$OUTDIR/AppRun" -done - # Optionally inject libc if [ "$INJECT_LIBC" == true ]; then echo "Injecting libc/libc++..." diff --git a/scripts/packaging/arch/PKGBUILD b/scripts/packaging/arch/PKGBUILD index c8daaacdf..0b4f3ce3c 100644 --- a/scripts/packaging/arch/PKGBUILD +++ b/scripts/packaging/arch/PKGBUILD @@ -70,6 +70,7 @@ noextract=( # Name of the .desktop file that will be installed. _desktopname=org.duckstation.DuckStation +_destdir=/opt/duckstation # https://wiki.archlinux.org/title/VCS_package_guidelines#Git # --dirty omitted, we need to ignore changes to this script because @@ -124,7 +125,7 @@ build() { -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ -DALLOW_INSTALL=ON \ -DINSTALL_SELF_CONTAINED=ON \ - -DCMAKE_INSTALL_PREFIX="${pkgdir}/opt/duckstation" + -DCMAKE_INSTALL_PREFIX="${pkgdir}${_destdir}" ninja -C build-arch } @@ -132,8 +133,9 @@ package() { cd "${pkgname}" ninja -C build-arch install - # install wrapper script - install -Dm755 scripts/packaging/duckstation-qt "${pkgdir}/usr/bin/duckstation-qt" + # install alias + mkdir -p "${pkgdir}/usr/bin" + ln -s "${_destdir}/duckstation-qt" "${pkgdir}/usr/bin/duckstation-qt" # install desktop file and icon install -Dm644 scripts/packaging/${_desktopname}.desktop "${pkgdir}/usr/share/applications/${_desktopname}.desktop" @@ -143,4 +145,3 @@ package() { install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -Dm644 data/resources/thirdparty.html "${pkgdir}/usr/share/licenses/${pkgname}/thirdparty.html" } - diff --git a/scripts/packaging/duckstation-qt b/scripts/packaging/duckstation-qt deleted file mode 100755 index e41a2b72e..000000000 --- a/scripts/packaging/duckstation-qt +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -if [[ -z "$I_WANT_A_BROKEN_WAYLAND_UI" ]]; then - echo "Forcing X11 instead of Wayland, due to various protocol limitations" - echo "and Qt issues. If you want to use Wayland, launch DuckStation with" - echo "I_WANT_A_BROKEN_WAYLAND_UI=YES set." - export QT_QPA_PLATFORM=xcb -else - echo "Wayland is not being disabled. Do not complain when things break." -fi - -exec /opt/duckstation/duckstation-qt "$@" - diff --git a/scripts/packaging/fedora/duckstation.spec b/scripts/packaging/fedora/duckstation.spec index e40f9c43e..73ae42c1e 100644 --- a/scripts/packaging/fedora/duckstation.spec +++ b/scripts/packaging/fedora/duckstation.spec @@ -77,7 +77,8 @@ ninja -C build %{?_smp_mflags} %install rm -fr %{buildroot} ninja -C build install -install -Dm755 scripts/packaging/duckstation-qt %{buildroot}/usr/bin/duckstation-qt +mkdir -p %{buildroot}/usr/bin +ln -s /opt/duckstation/duckstation-qt %{buildroot}/usr/bin/duckstation-qt install -Dm644 scripts/packaging/org.duckstation.DuckStation.png %{buildroot}/usr/share/icons/hicolor/512x512/apps/org.duckstation.DuckStation.png install -Dm644 scripts/packaging/org.duckstation.DuckStation.desktop %{buildroot}/usr/share/applications/org.duckstation.DuckStation.desktop diff --git a/scripts/packaging/flatpak/org.duckstation.DuckStation.yaml b/scripts/packaging/flatpak/org.duckstation.DuckStation.yaml index 9b38e5ce2..3af2ba257 100644 --- a/scripts/packaging/flatpak/org.duckstation.DuckStation.yaml +++ b/scripts/packaging/flatpak/org.duckstation.DuckStation.yaml @@ -23,10 +23,8 @@ finish-args: - "--share=ipc" - "--socket=pulseaudio" - "--talk-name=org.freedesktop.ScreenSaver" - - # Wayland is disabled due to various QtWayland issues, causing broken UI. - - "--socket=x11" - - "--env=QT_QPA_PLATFORM=xcb" + - "--socket=wayland" + - "--socket=fallback-x11" modules: # Dependencies.