Fix build scripts around architecture info

pull/84/head
Noah 2022-01-08 17:07:24 -08:00
parent 96314a852d
commit 51e585b2f8
3 changed files with 40 additions and 9 deletions

View File

@ -67,7 +67,7 @@ install:
# `make doodads` to build the doodads from the dev-assets folder.
.PHONY: doodads
doodads:
cd dev-assets/doodads && ./build.sh
cd dev-assets/doodads && ./build.sh > /dev/null
# `make mingw` to cross-compile a Windows binary with mingw.
.PHONY: mingw
@ -105,13 +105,20 @@ mingw-free: doodads
release:
./scripts/release.sh
# `make release32` runs release with ARCH_LABEL=32bit to product
# artifacts targeting an i386 architecture (e.g. in rpm and deb packages
# metadata about the release)
.PHONY: release32
release32:
env ARCH_LABEL=32bit ./scripts/release.sh
# `make mingw-release` runs a FULL end-to-end release of Linux and Windows
# binaries of the game, zipped and tagged and ready to go.
.PHONY: mingw-release
mingw-release: doodads build mingw __dist-common release
.PHONY: mingw32-release
mingw32-release: doodads build mingw32 __dist-common release
mingw32-release: doodads build mingw32 __dist-common release32
# `make osx` to cross-compile a Mac OS binary with osxcross.
# .PHONY: osx

View File

@ -69,11 +69,29 @@ echo =====================
echo Starting fpm package build.
echo =====================
# Get the architecture we're building for, can be provided by
# the user with ARCH_LABEL env variable, it'd be one of:
# x86_64
# i386
# aarch64
if [[ "$ARCH_LABEL" == "" ]]; then
ARCH_LABEL="64bit"
case "$archs" in
i?86) ARCH_LABEL="32bit" ;;
aarch64) ARCH_LABEL="aarch64" ;;
esac
fi
echo "Building packages for architecture $ARCH_LABEL"
# Handle all architectures! Default x86_64
RPM_ARCH="x86_64"
DEB_ARCH="x86_64"
case "$archs" in
i?86)
case "$ARCH_LABEL" in
64bit)
RPM_ARCH="x86_64"
DEB_ARCH="x86_64"
;;
32bit)
RPM_ARCH="i386"
DEB_ARCH="i386"
;;

View File

@ -20,11 +20,17 @@ STAGE_PATH="$(pwd)/dist/stage/${VERSION}"
# Handle all architectures! Default x86_64
# Used in zipfiles for Linux and Windows (fpm-bundle.sh has its own logic)
ARCH_LABEL="64bit"
case "$archs" in
i?86) ARCH_LABEL="32bit" ;;
aarch64) ARCH_LABEL="aarch64" ;;
esac
# User can provide ARCH_LABEL environ variable too.
# One of: 32bit, 64bit, aarch64
if [[ "$ARCH_LABEL" == "" ]]; then
# Reasonable default
ARCH_LABEL="64bit"
case "$archs" in
i?86) ARCH_LABEL="32bit" ;;
aarch64) ARCH_LABEL="aarch64" ;;
esac
fi
echo "Building packages for architecture $ARCH_LABEL"
if [[ ! -d $DIST_PATH ]]; then
echo Run this script from the root of the game repository, such that