minecraft-pi-reborn/scripts/package.sh

43 lines
1.4 KiB
Bash
Raw Normal View History

2020-09-27 00:48:46 +00:00
#!/bin/sh
set -e
# Prepare
NAME='minecraft-pi-reborn'
2023-11-24 23:37:08 +00:00
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
ARCH="$(echo "$2" | tr '[:upper:]' '[:lower:]')"
2021-06-17 21:32:24 +00:00
# Build
2023-11-24 23:37:08 +00:00
./scripts/setup.sh "${MODE}" "${ARCH}" -DMCPI_IS_APPIMAGE_BUILD=ON
./scripts/build.sh "${MODE}" "${ARCH}"
# Download Runtime
mkdir -p build/appimage
2023-11-24 23:37:08 +00:00
if [ ! -f "build/appimage/runtime-${ARCH}" ]; then
case "${ARCH}" in
2022-07-07 04:37:53 +00:00
'armhf') RUNTIME_ARCH='armhf';;
'arm64') RUNTIME_ARCH='aarch64';;
'i386') RUNTIME_ARCH='i686';;
'amd64') RUNTIME_ARCH='x86_64';;
esac
2023-11-24 23:37:08 +00:00
wget -O "build/appimage/runtime-${ARCH}" "https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-${RUNTIME_ARCH}"
fi
# Package
2023-11-24 23:37:08 +00:00
case "${ARCH}" in
2022-07-07 04:37:53 +00:00
'armhf') APPIMAGE_ARCH='arm';;
'arm64') APPIMAGE_ARCH='arm_aarch64';;
'i386') APPIMAGE_ARCH='i686';;
'amd64') APPIMAGE_ARCH='x86_64';;
esac
ARCH="${APPIMAGE_ARCH}" appimagetool \
--updateinformation "zsync|https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/releases/download/latest/${NAME}-${MODE}-latest-${ARCH}.AppImage.zsync" \
2023-11-24 23:37:08 +00:00
--runtime-file "build/appimage/runtime-${ARCH}" \
--comp xz \
2023-11-24 23:37:08 +00:00
"./out/${MODE}-${ARCH}" \
"./out/${NAME}-${MODE}-$(cat VERSION)-${ARCH}.AppImage"
2022-03-10 02:23:41 +00:00
# Move ZSync
2023-11-24 23:37:08 +00:00
rm -f "./out/${NAME}-${MODE}-latest-${ARCH}.AppImage.zsync"
mv "./${NAME}-${MODE}-$(cat VERSION)-${ARCH}.AppImage.zsync" "./out/${NAME}-${MODE}-latest-${ARCH}.AppImage.zsync"