love-linux-builder/docker/build.sh

95 lines
1.2 KiB
Bash
Raw Normal View History

2017-08-30 15:00:57 +00:00
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 <version>"
exit 0
fi
VERSION="$1"
2017-09-06 16:01:36 +00:00
ARCH="$(uname -m)"
2017-08-30 15:00:57 +00:00
cd /build/love-linux-builder
msg() {
printf "\033[1m· %s\033[0m\n" "$1"
}
buildlove() {
pushd ../love
if ! test -d ./src; then
msg "Source not found, checking out from repo"
hg clone https://bitbucket.org/rude/love .
hg update "${VERSION}"
fi
if ! test -f ./configure; then
msg "Running automagic"
./platform/unix/automagic
fi
msg "Running configure"
./configure --prefix=/usr
msg "Running make"
make all install
popd
}
buildtarball() {
pushd tarball
./build.sh
tar czf "love-${VERSION}-${ARCH}.tar.gz" dest
popd
}
buildsnap() {
pushd snap
./build.sh "${VERSION}"
popd
}
buildappimage() {
pushd appimage
./build.sh "${VERSION}"
popd
}
buildflatpak() {
pushd flatpak
./build.sh "${VERSION}"
msg "Flatpak is not supported at the moment (oops)"
msg " It does not build on this old version of debian"
2017-08-30 15:00:57 +00:00
popd
}
2017-09-06 15:27:46 +00:00
if ! test -f "tarball/love-${VERSION}-${ARCH}.tar.gz"; then
2017-08-30 15:00:57 +00:00
msg "Building love"
buildlove
buildtarball
else
msg "Binaries found, skipping love build"
fi
msg "Building snap"
buildsnap
msg "Building appimage"
buildappimage
msg "Building flatpak"
buildflatpak