From 8b73ab75ab3b570f50b232ec3ad62e85747ff5fc Mon Sep 17 00:00:00 2001 From: yuzubot Date: Tue, 20 Sep 2022 12:02:37 +0000 Subject: [PATCH] "Merge Tagged PR 8871" --- .ci/scripts/linux/docker.sh | 27 ++++++++++++++++++--------- dist/AppRun | 28 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 9 deletions(-) create mode 100755 dist/AppRun diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh index b9862d1c2..cbcb833a7 100755 --- a/.ci/scripts/linux/docker.sh +++ b/.ci/scripts/linux/docker.sh @@ -35,11 +35,13 @@ rm -vf AppDir/usr/bin/yuzu-cmd AppDir/usr/bin/yuzu-tester # Download tools needed to build an AppImage wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/linuxdeploy-x86_64.AppImage wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/linuxdeploy-plugin-qt-x86_64.AppImage -wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/AppRun-patched-x86_64 wget -nc https://github.com/yuzu-emu/ext-linux-bin/raw/main/appimage/exec-x86_64.so +# TODO: get this accepted into proper repo +wget -nc https://github.com/Docteh/ext-linux-bin/raw/butts/appimage/checkrt-x86_64 + # Set executable bit chmod 755 \ - AppRun-patched-x86_64 \ + checkrt-x86_64 \ exec-x86_64.so \ linuxdeploy-x86_64.AppImage \ linuxdeploy-plugin-qt-x86_64.AppImage @@ -47,10 +49,6 @@ chmod 755 \ # Workaround for https://github.com/AppImage/AppImageKit/issues/828 export APPIMAGE_EXTRACT_AND_RUN=1 -mkdir -p AppDir/usr/optional -mkdir -p AppDir/usr/optional/libstdc++ -mkdir -p AppDir/usr/optional/libgcc_s - # Deploy yuzu's needed dependencies ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt @@ -59,7 +57,18 @@ find AppDir -type f -regex '.*libwayland-client\.so.*' -delete -print # Workaround for building yuzu with GCC 10 but also trying to distribute it to Ubuntu 18.04 et al. # See https://github.com/darealshinji/AppImageKit-checkrt +mkdir -p AppDir/usr/optional +mkdir -p AppDir/usr/optional/cxx +mkdir -p AppDir/usr/optional/gcc cp exec-x86_64.so AppDir/usr/optional/exec.so -cp AppRun-patched-x86_64 AppDir/AppRun -cp --dereference /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6 -cp --dereference /lib/x86_64-linux-gnu/libgcc_s.so.1 AppDir/usr/optional/libgcc_s/libgcc_s.so.1 +cp checkrt-x86_64 AppDir/usr/optional/checkrt +cp --dereference /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/cxx/libstdc++.so.6 +cp --dereference /lib/x86_64-linux-gnu/libgcc_s.so.1 AppDir/usr/optional/gcc/libgcc_s.so.1 + +# Workaround for different distros putting the ca-certificate bundles in different locations +# Location correct for Ubuntu 18.04 (currently used Docker image is based on this +cp --dereference /etc/ssl/certs/ca-certificates.crt AppDir/ca-certificates.pem + +# Customized AppRun script executes above workarounds +cp ../dist/AppRun AppDir/AppRun +chmod 755 AppDir/AppRun diff --git a/dist/AppRun b/dist/AppRun new file mode 100755 index 000000000..9046d0185 --- /dev/null +++ b/dist/AppRun @@ -0,0 +1,28 @@ +#!/bin/sh -e +# SPDX-FileCopyrightText: 2022 +# SPDX-License-Identifier: MIT +# From: https://github.com/darealshinji/AppImageKit-checkrt + +# add your command to execute here +exec=yuzu + +cd "$(dirname "$0")" +if [ "x$exec" = "x" ]; then + exec="$(sed -n 's|^Exec=||p' *.desktop | head -1)" +fi +if [ -x "./usr/optional/checkrt" ]; then + extra_libs="$(./usr/optional/checkrt)" +fi +if [ -n "$extra_libs" ]; then + export LD_LIBRARY_PATH="${extra_libs}${LD_LIBRARY_PATH}" + if [ -e "$PWD/usr/optional/exec.so" ]; then + export LD_PRELOAD="$PWD/usr/optional/exec.so:${LD_PRELOAD}" + fi +fi + +export SSL_CERT_FILE="$PWD/ca-certificates.pem" +#echo ">>>>> LD_LIBRARY_PATH $LD_LIBRARY_PATH" +#echo ">>>>> LD_PRELOAD $LD_PRELOAD" + +exec ./usr/bin/yuzu "$@" +