love-loader/build.sh

62 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
echo General packaging
rm -r build
mkdir build
cd build
mv ../dev ../deva
lua ~/proj/luapack/main.lua ../luapack.lua
mv ../deva ../dev
#cp -r lib skins ll-min.lua build/
zip -9 -r ../game.love .
rm *
mv ../game.love .
echo Windows packaging
VER=11.4
BITS=64
ARCH=x86_64
if [ ! -d ../.cache/love-$VER-win$BITS ]; then
mkdir -p ../.cache/love-$VER-win$BITS
cd ../.cache
wget https://github.com/love2d/love/releases/download/$VER/love-$VER-win$BITS.zip
unzip love-$VER-win$BITS.zip
cd -
fi
mkdir win && cd win
cp -r ../../.cache/love-$VER-win$BITS/* .
cat love.exe ../game.love > game.exe
rm love.exe lovec.exe *.ico *.txt
zip -r ../win.zip *
cd ..
rm -r win
echo Linux packaging
if [ ! -e ../.cache/love-$VER-$ARCH.AppImage ]; then
cd ../.cache
wget https://github.com/love2d/love/releases/download/$VER/love-$VER-$ARCH.AppImage
chmod a+x love-$VER-$ARCH.AppImage
cd -
fi
if [ ! -e ../.cache/appimagetool-$ARCH.AppImage ]; then
cd ../.cache
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-$ARCH.AppImage
chmod a+x appimagetool-$ARCH.AppImage
cd -
fi
mkdir lin && cd lin
../../.cache/love-$VER-$ARCH.AppImage --appimage-extract > /dev/null
cd squashfs-root
cat ../../game.love >> bin/love
chmod a+x bin/love
cd ..
../../.cache/appimagetool-$ARCH.AppImage squashfs-root ../linux.AppImage > /dev/null
rm -r squashfs-root
chmod a+x ../linux.AppImage
cd ..
rm -r lin