mirror-chatterino2/.CI/CreateAppImage.sh

63 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/sh
2019-12-28 14:54:03 +01:00
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"
2019-08-11 20:35:25 +02:00
2019-10-13 12:52:26 +02:00
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"
2019-10-13 12:52:26 +02:00
./"$linuxdeployqt_path" \
2019-08-11 20:35:25 +02:00
appdir/usr/share/applications/*.desktop \
-no-translations \
-bundle-non-qt-libs \
-unsupported-allow-new-glibc
2019-08-11 20:35:25 +02:00
rm -rf appdir/home
2019-12-28 14:54:03 +01:00
rm -f appdir/AppRun
2019-08-11 20:35:25 +02:00
echo "Run AppImageTool"
2019-08-11 20:35:25 +02:00
# 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