mirror-chatterino2/.CI/CreateAppImage.sh
Wissididom 98c2ff5607
Separate Ubuntu .deb packages per Ubuntu release (#4357)
Our .deb packages are now very Ubuntu-specific and are packages based on our CI builds.
2023-02-11 22:50:01 +00:00

62 lines
1.7 KiB
Bash
Executable file

#!/bin/sh
set -e
if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then
echo "ERROR: No chatterino binary file found. This script must be run in the build folder, and chatterino must be built first."
exit 1
fi
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt512/lib/"
export PATH="/opt/qt512/bin:$PATH"
script_path=$(readlink -f "$0")
script_dir=$(dirname "$script_path")
chatterino_dir=$(dirname "$script_dir")
echo "Running LDD on chatterino binary:"
ldd ./bin/chatterino
echo ""
echo "Running make install in the appdir"
make INSTALL_ROOT=appdir -j"$(nproc)" install ; find appdir/
echo ""
cp "$chatterino_dir"/resources/icon.png ./appdir/chatterino.png
linuxdeployqt_path="linuxdeployqt-6-x86_64.AppImage"
linuxdeployqt_url="https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage"
if [ ! -f "$linuxdeployqt_path" ]; then
wget -nv "$linuxdeployqt_url"
chmod a+x "$linuxdeployqt_path"
fi
if [ ! -f appimagetool-x86_64.AppImage ]; then
wget -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
fi
echo "Run LinuxDeployQT"
./"$linuxdeployqt_path" \
appdir/usr/share/applications/*.desktop \
-no-translations \
-bundle-non-qt-libs \
-unsupported-allow-new-glibc
rm -rf appdir/home
rm -f appdir/AppRun
echo "Run AppImageTool"
# shellcheck disable=SC2016
echo '#!/bin/sh
here="$(dirname "$(readlink -f "${0}")")"
export QT_QPA_PLATFORM_PLUGIN_PATH="$here/usr/plugins"
cd "$here/usr"
exec "$here/usr/bin/chatterino" "$@"' > appdir/AppRun
chmod a+x appdir/AppRun
./appimagetool-x86_64.AppImage appdir
# TODO: Create appimage in a unique directory instead maybe idk?
rm -rf appdir