diff --git a/.github/workflows/linux-cross-appimage-build.yml b/.github/workflows/linux-cross-appimage-build.yml index 864af9b02..f43cc18a8 100644 --- a/.github/workflows/linux-cross-appimage-build.yml +++ b/.github/workflows/linux-cross-appimage-build.yml @@ -91,7 +91,7 @@ jobs: run: | cmake --build build --parallel scripts/appimage/make-cross-appimage.sh duckstation-qt ${{ matrix.arch }} "$(realpath build)" "/${{ matrix.arch }}-chroot" - scripts/appimage/make-cross-appimage.sh -inject-libc duckstation-mini ${{ matrix.arch }} "$(realpath build)" "/${{ matrix.arch }}-chroot" + scripts/appimage/make-cross-appimage.sh duckstation-mini ${{ matrix.arch }} "$(realpath build)" "/${{ matrix.arch }}-chroot" - name: Upload AppImages uses: actions/upload-artifact@v6 diff --git a/scripts/appimage/inject-libc-apprun.sh b/scripts/appimage/inject-libc-apprun.sh deleted file mode 100755 index 606ed1c8f..000000000 --- a/scripts/appimage/inject-libc-apprun.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -REQUIRED_GLIBC_VERSION="__REQ_GLIBC_VERSION__" - -this_dir="$(readlink -f "$(dirname "$0")")" - -APPBIN="${this_dir}/usr/bin/__APPNAME__" -RUNTIME_DIR="${this_dir}/libc-runtime" -LOADER_BIN="${this_dir}/usr/bin/ld-linux" - -GLIBC_VERSION=$(ldd --version | head -1 | sed -e 's/.* \([0-9.]\)/\1/') - -echo "Detected glibc version ${GLIBC_VERSION}." - -if [[ -z "${GLIBC_VERSION}" || ! "${GLIBC_VERSION}" < "${REQUIRED_GLIBC_VERSION}" ]]; then - echo "Using system libc/libstdc++." - exec "${APPBIN}" "$@" -fi - - -echo "Using bundled libc/libstdc++ from ${RUNTIME_DIR}." -if [ -z "$LD_LIBRARY_PATH" ]; then - export LD_LIBRARY_PATH="${RUNTIME_DIR}" -else - export LD_LIBRARY_PATH="${RUNTIME_DIR}:${LD_LIBRARY_PATH}" -fi - -exec "${LOADER_BIN}" "${APPBIN}" "$@" - diff --git a/scripts/appimage/inject-libc.sh b/scripts/appimage/inject-libc.sh deleted file mode 100755 index 82baecef9..000000000 --- a/scripts/appimage/inject-libc.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash - -set -e - -function retry_command { - # Package servers tend to be unreliable at times.. - # Retry a bunch of times. - local RETRIES=10 - - for i in $(seq 1 "$RETRIES"); do - "$@" && break - if [ "$i" == "$RETRIES" ]; then - echo "Command \"$@\" failed after ${RETRIES} retries." - exit 1 - fi - done -} - -this_dir="$(readlink -f "$(dirname "$0")")" - -if [ "$#" -ne 4 ]; then - echo "Syntax: $0 <.deb arch> " - echo "e.g. $0 DuckStation.AppDir amd64 x86_64-linux-gnu duckstation-qt" - exit 1 -fi - - -APPDIR=$1 -DEBARCH=$2 -TRIPLE=$3 -APPNAME=$4 - -GLIBC_VERSION=2.35 - -if [ ! -f "libc.deb" ]; then - retry_command wget -O "libc.deb" "https://github.com/stenzek/duckstation-ext-qt-minimal/releases/download/linux/libc6_2.35-0ubuntu3.9_${DEBARCH}.deb" -fi -if [ ! -f "libgccs.deb" ]; then - retry_command wget -O "libgccs.deb" "https://github.com/stenzek/duckstation-ext-qt-minimal/releases/download/linux/libgcc-s1_12.3.0-1ubuntu1.22.04_${DEBARCH}.deb" -fi -if [ ! -f "libstdc++.deb" ]; then - retry_command wget -O "libstdc++.deb" "https://github.com/stenzek/duckstation-ext-qt-minimal/releases/download/linux/libstdc++6_12.3.0-1ubuntu1.22.04_${DEBARCH}.deb" -fi - -rm -fr "temp" -mkdir "temp" -cd "temp" -dpkg -x "../libc.deb" . -dpkg -x "../libgccs.deb" . -dpkg -x "../libstdc++.deb" . - -# Copy everything into AppDir -RUNTIME="${APPDIR}/libc-runtime" -mkdir -p "${RUNTIME}" - -# libc.so.6 and friends -cd "lib/${TRIPLE}" -cp -v * "${RUNTIME}" -cd ../../ - -# libstdc++ -cd "usr/lib/${TRIPLE}" -cp -v * "${RUNTIME}" || true -cd ../../.. - -# done with temps now -cd .. -rm -fr temp - -# Not risking mixing resolvers... -cd "${RUNTIME}" -rm -vf libnss_* - -# Move ld-linux.so.2 into the binary directory so we can preserve arg0's directory -mv -v "ld-linux-"*.so.* "${APPDIR}/usr/bin/ld-linux" - -# Set up the replacement apprun script -cd "${APPDIR}" -rm -f AppRun.wrapped -cp "${this_dir}/inject-libc-apprun.sh" AppRun.wrapped -sed -i -e "s/__APPNAME__/${APPNAME}/" AppRun.wrapped -sed -i -e "s/__REQ_GLIBC_VERSION__/${GLIBC_VERSION}/" AppRun.wrapped - -echo Done. - diff --git a/scripts/appimage/make-cross-appimage.sh b/scripts/appimage/make-cross-appimage.sh index e23fd9c44..4ff48a9d4 100755 --- a/scripts/appimage/make-cross-appimage.sh +++ b/scripts/appimage/make-cross-appimage.sh @@ -19,14 +19,8 @@ function retry_command { done } -if [ "$1" == "-inject-libc" ]; then - echo "Injecting libc/libstdc++" - INJECT_LIBC=true - shift -fi - if [ "$#" -ne 4 ]; then - echo "Syntax: $0 [-inject-libc] " + echo "Syntax: $0 " exit 1 fi @@ -336,12 +330,6 @@ cp "$SCRIPTDIR/apprun-cross.sh" "$OUTDIR/AppRun" chmod +x "$OUTDIR/AppRun" ln -s "usr/bin/$BINARY" "$OUTDIR/AppRun.wrapped" -# Optionally inject libc -if [ "$INJECT_LIBC" == true ]; then - echo "Injecting libc/libc++..." - "$SCRIPTDIR/inject-libc.sh" "$OUTDIR" "$DEBARCH" "$TRIPLE" "$BINARY" -fi - echo "Generating AppImage..." rm -f "$APPIMAGENAME.AppImage"