2021-07-13 14:52:58 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
echo "${PLATFORM}"
|
|
|
|
if [ "${PLATFORM}" == "x86" ]; then
|
|
|
|
APPARCH="i686"
|
|
|
|
ARCH="i386"
|
2021-07-17 03:46:59 +00:00
|
|
|
LIBARCH="i386-linux-gnu"
|
2021-07-13 14:52:58 +00:00
|
|
|
else
|
|
|
|
APPARCH="x86_64"
|
|
|
|
ARCH="x86_64"
|
2021-07-17 03:46:59 +00:00
|
|
|
LIBARCH="x86_64-linux-gnu"
|
2021-07-13 14:52:58 +00:00
|
|
|
fi
|
|
|
|
cd /tmp
|
|
|
|
curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage"
|
|
|
|
chmod a+x linuxdeploy*.AppImage
|
|
|
|
./linuxdeploy-"$ARCH".AppImage --appimage-extract
|
2021-07-14 20:56:10 +00:00
|
|
|
curl -sSfL "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" -o /tmp/squashfs-root/usr/bin/linuxdeploy-plugin-gtk.sh
|
|
|
|
chmod a+x /tmp/squashfs-root/usr/bin/linuxdeploy-plugin-gtk.sh
|
2021-07-13 14:52:58 +00:00
|
|
|
mv /tmp/squashfs-root/usr/bin/patchelf /tmp/squashfs-root/usr/bin/patchelf.orig
|
|
|
|
sudo cp /usr/local/bin/patchelf /tmp/squashfs-root/usr/bin/patchelf
|
|
|
|
cd "$GITHUB_WORKSPACE"
|
2021-12-12 23:05:56 +00:00
|
|
|
ninja -C build install
|
2021-07-13 14:52:58 +00:00
|
|
|
cp ./pcsx2/gui/Resources/AppIcon64.png ./squashfs-root/PCSX2.png
|
2022-11-25 22:18:20 +00:00
|
|
|
cp ./linux_various/PCSX2.desktop.in ./squashfs-root/PCSX2.desktop
|
2021-07-13 14:52:58 +00:00
|
|
|
sed -i -e 's|Categories=@PCSX2_MENU_CATEGORIES@|Categories=Game;Emulator;|g' ./squashfs-root/PCSX2.desktop
|
|
|
|
sed -i -e 's|__GL_THREADED_OPTIMIZATIONS=1|__GL_THREADED_OPTIMIZATIONS=0|g' ./squashfs-root/PCSX2.desktop
|
|
|
|
curl -sSfL "https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-$APPARCH" -o ./squashfs-root/runtime
|
|
|
|
mkdir -p squashfs-root/usr/share/applications && cp ./squashfs-root/PCSX2.desktop ./squashfs-root/usr/share/applications
|
|
|
|
mkdir -p squashfs-root/usr/share/icons && cp ./squashfs-root/PCSX2.png ./squashfs-root/usr/share/icons
|
|
|
|
mkdir -p squashfs-root/usr/share/icons/hicolor/scalable/apps && cp ./squashfs-root/PCSX2.png ./squashfs-root/usr/share/icons/hicolor/scalable/apps
|
|
|
|
mkdir -p squashfs-root/usr/share/pixmaps && cp ./squashfs-root/PCSX2.png ./squashfs-root/usr/share/pixmaps
|
|
|
|
mkdir -p squashfs-root/usr/lib/
|
2021-09-06 15:41:23 +00:00
|
|
|
mkdir -p squashfs-root/usr/optional/libstdc++
|
|
|
|
mkdir -p squashfs-root/usr/optional/libgcc_s
|
2021-07-13 14:52:58 +00:00
|
|
|
cp ./.github/workflows/scripts/linux/AppRun "$GITHUB_WORKSPACE"/squashfs-root/AppRun
|
2022-06-23 22:09:19 +00:00
|
|
|
curl -sSfL "https://github.com/PCSX2/appimage-checkrt-branch/releases/download/AppImage-checkrt/AppRun_patched" -o "$GITHUB_WORKSPACE"/squashfs-root/AppRun-patched
|
|
|
|
curl -sSfL "https://github.com/PCSX2/appimage-checkrt-branch/releases/download/AppImage-checkrt/exec.so" -o "$GITHUB_WORKSPACE"/squashfs-root/usr/optional/exec.so
|
2021-07-13 14:52:58 +00:00
|
|
|
chmod a+x ./squashfs-root/AppRun
|
|
|
|
chmod a+x ./squashfs-root/runtime
|
|
|
|
chmod a+x ./squashfs-root/AppRun-patched
|
2021-09-06 15:41:23 +00:00
|
|
|
chmod a+x ./squashfs-root/usr/optional/exec.so
|
2021-07-13 14:52:58 +00:00
|
|
|
echo "$name" > "$GITHUB_WORKSPACE"/squashfs-root/version.txt
|
2021-11-04 21:14:52 +00:00
|
|
|
mkdir -p "$GITHUB_WORKSPACE"/squashfs-root/apprun-hooks
|
2021-07-17 03:46:59 +00:00
|
|
|
cp /usr/lib/$LIBARCH/libthai.so.0 "$GITHUB_WORKSPACE"/squashfs-root/usr/lib/
|
2021-09-06 15:41:23 +00:00
|
|
|
cp --dereference /usr/lib/"$LIBARCH"/libstdc++.so.6 "$GITHUB_WORKSPACE"/squashfs-root/usr/optional/libstdc++/libstdc++.so.6
|
|
|
|
cp --dereference /lib/"$LIBARCH"/libgcc_s.so.1 "$GITHUB_WORKSPACE"/squashfs-root/usr/optional/libgcc_s/libgcc_s.so.1
|
2021-11-04 21:14:52 +00:00
|
|
|
chmod +x .github/workflows/scripts/linux/app-variables.sh
|
|
|
|
cp .github/workflows/scripts/linux/app-variables.sh "$GITHUB_WORKSPACE"/squashfs-root/apprun-hooks
|
2021-07-13 14:52:58 +00:00
|
|
|
export UPD_INFO="gh-releases-zsync|PCSX2|pcsx2|latest|$name.AppImage.zsync"
|
2022-04-18 05:22:34 +00:00
|
|
|
/tmp/squashfs-root/AppRun --appdir="$GITHUB_WORKSPACE"/squashfs-root/ --plugin gtk -d "$GITHUB_WORKSPACE"/squashfs-root/PCSX2.desktop -i "$GITHUB_WORKSPACE"/squashfs-root/PCSX2.png
|
|
|
|
# see LD_LIBRARY_PATH in app-variables.sh - the intent is to use system wayland if available but fall back to app-image provided
|
|
|
|
# a little bit hacky but should ensure maximum compatibility
|
|
|
|
mkdir -p squashfs-root/usr/lib/wayland
|
|
|
|
mv squashfs-root/usr/lib/libwayland-* squashfs-root/usr/lib/wayland
|
2022-04-23 01:05:54 +00:00
|
|
|
rm squashfs-root/usr/lib/libgmodule-2.0.so.0
|
2022-04-18 05:22:34 +00:00
|
|
|
curl -sSfL "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage" -o ./appimagetool-"$ARCH".AppImage
|
|
|
|
chmod a+x appimagetool*.AppImage
|
|
|
|
./appimagetool-"$ARCH".AppImage "$GITHUB_WORKSPACE"/squashfs-root "$name.AppImage"
|
2021-10-18 04:14:41 +00:00
|
|
|
mkdir -p "$GITHUB_WORKSPACE"/ci-artifacts/
|
2021-07-13 14:52:58 +00:00
|
|
|
ls -al .
|
2021-10-18 04:14:41 +00:00
|
|
|
mv "$name.AppImage" "$GITHUB_WORKSPACE"/ci-artifacts # && mv "$name.AppImage.zsync" "$GITHUB_WORKSPACE"/ci-artifacts
|
|
|
|
chmod -R 777 ./ci-artifacts
|
|
|
|
cd ./ci-artifacts
|
2021-07-13 14:52:58 +00:00
|
|
|
ls -al .
|