Cemu/dist/linux/appimage.sh

56 lines
2.2 KiB
Bash
Raw Normal View History

2022-11-04 15:07:17 +01:00
#!/bin/bash
2022-12-12 09:46:20 +01:00
if [[ -z "${GITHUB_WORKSPACE}" ]]; then
export GITHUB_WORKSPACE="."
2022-11-04 15:07:17 +01:00
fi
2022-12-12 09:46:20 +01:00
2022-11-04 15:07:17 +01:00
curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod a+x linuxdeploy*.AppImage
2022-12-12 09:46:20 +01:00
curl -sSfL https://github.com"$(curl https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous | grep "mkappimage-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)" -o mkappimage.AppImage
2022-11-04 15:07:17 +01:00
chmod a+x mkappimage.AppImage
curl -sSfLO "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
chmod a+x linuxdeploy-plugin-gtk.sh
if [[ ! -e /usr/lib/x86_64-linux-gnu ]]; then
sed -i 's#lib\/x86_64-linux-gnu#lib64#g' linuxdeploy-plugin-gtk.sh
fi
mkdir -p AppDir/usr/bin
2022-12-12 09:46:20 +01:00
mkdir -p AppDir/usr/share/Cemu
mkdir -p AppDir/usr/share/applications
mkdir -p AppDir/usr/share/icons/hicolor/128x128/apps
mkdir -p AppDir/usr/share/metainfo
2022-11-04 15:07:17 +01:00
mkdir -p AppDir/usr/lib
2022-12-12 09:46:20 +01:00
cp dist/linux/info.cemu.Cemu.{desktop,png} AppDir/
cp dist/linux/info.cemu.Cemu.metainfo.xml AppDir/usr/share/metainfo/info.cemu.Cemu.appdata.xml
cp -r bin/* AppDir/usr/share/Cemu
2022-11-04 15:07:17 +01:00
mv AppDir/usr/share/Cemu/Cemu AppDir/usr/bin/
2022-11-04 15:07:17 +01:00
chmod +x AppDir/usr/bin/Cemu
2022-12-12 09:46:20 +01:00
cp /usr/lib/x86_64-linux-gnu/{libsepol.so.1,libffi.so.7,libpcre.so.3,libGLU.so.1,libthai.so.0} AppDir/usr/lib
2022-11-04 15:07:17 +01:00
export UPD_INFO="gh-releases-zsync|cemu-project|Cemu|ci|Cemu.AppImage.zsync"
export NO_STRIP=1
2022-12-12 09:46:20 +01:00
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run \
--appdir="${GITHUB_WORKSPACE}"/AppDir/ \
-d "${GITHUB_WORKSPACE}"/AppDir/info.cemu.Cemu.desktop \
-i "${GITHUB_WORKSPACE}"/AppDir/info.cemu.Cemu.png \
-e "${GITHUB_WORKSPACE}"/AppDir/usr/bin/Cemu \
2022-11-04 15:07:17 +01:00
--plugin gtk
2022-12-12 09:46:20 +01:00
if ! GITVERSION="$(git rev-parse --short HEAD 2>/dev/null)"; then
2022-11-04 15:07:17 +01:00
GITVERSION=experimental
fi
echo "Cemu Version Cemu-${GITVERSION}"
2022-12-12 09:46:20 +01:00
2022-11-04 15:07:17 +01:00
rm AppDir/usr/lib/libwayland-client.so.0
2023-12-07 02:07:50 +01:00
cp /lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/lib/
echo -e "export LC_ALL=C\nexport FONTCONFIG_PATH=/etc/fonts" >> AppDir/apprun-hooks/linuxdeploy-plugin-gtk.sh
2022-12-12 09:46:20 +01:00
VERSION="${GITVERSION}" ./mkappimage.AppImage --appimage-extract-and-run "${GITHUB_WORKSPACE}"/AppDir
2022-11-04 15:07:17 +01:00
2022-12-12 09:46:20 +01:00
mkdir -p "${GITHUB_WORKSPACE}"/artifacts/
mv Cemu-"${GITVERSION}"-x86_64.AppImage "${GITHUB_WORKSPACE}"/artifacts/