Make build scripts more architecture-aware

This commit is contained in:
Noah 2022-01-03 20:23:49 -08:00
parent 9a51ac39f9
commit a6297f6cb6
4 changed files with 52 additions and 6 deletions

14
go.mod
View File

@ -5,7 +5,7 @@ go 1.16
require ( require (
git.kirsle.net/go/audio v0.0.0-20200429055451-ae3b0695ba6f git.kirsle.net/go/audio v0.0.0-20200429055451-ae3b0695ba6f
git.kirsle.net/go/log v0.0.0-20200902035305-70ac2848949b git.kirsle.net/go/log v0.0.0-20200902035305-70ac2848949b
git.kirsle.net/go/render v0.0.0-20210614025954-d77f5056b782 git.kirsle.net/go/render v0.0.0-20211231003948-9e640ab5c3da
git.kirsle.net/go/ui v0.0.0-20200710023146-e2a561fbd04c git.kirsle.net/go/ui v0.0.0-20200710023146-e2a561fbd04c
github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fsnotify/fsnotify v1.4.9 github.com/fsnotify/fsnotify v1.4.9
@ -18,8 +18,18 @@ require (
github.com/urfave/cli/v2 v2.3.0 github.com/urfave/cli/v2 v2.3.0
github.com/veandco/go-sdl2 v0.4.10 github.com/veandco/go-sdl2 v0.4.10
github.com/vmihailenco/msgpack v3.3.3+incompatible github.com/vmihailenco/msgpack v3.3.3+incompatible
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d golang.org/x/image v0.0.0-20211028202545-6944b10bf410
google.golang.org/appengine v1.6.7 // indirect google.golang.org/appengine v1.6.7 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect
) )
replace git.kirsle.net/go/render => /home/kirsle/SketchyMaze/deps/render
replace git.kirsle.net/go/ui => /home/kirsle/SketchyMaze/deps/ui
replace git.kirsle.net/go/audio => /home/kirsle/SketchyMaze/deps/audio
//replace git.kirsle.net/go/render => /run/build/sketchymaze/deps/render
//replace git.kirsle.net/go/ui => /run/build/sketchymaze/deps/ui
//replace git.kirsle.net/go/audio => /run/build/sketchymaze/deps/audio

3
go.sum
View File

@ -224,6 +224,8 @@ golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs= golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@ -232,6 +234,7 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=

View File

@ -69,9 +69,23 @@ echo =====================
echo Starting fpm package build. echo Starting fpm package build.
echo ===================== echo =====================
# Handle all architectures! Default x86_64
RPM_ARCH="x86_64"
DEB_ARCH="x86_64"
case "$archs" in
i?86)
RPM_ARCH="i386"
DEB_ARCH="i386"
;;
aarch64)
RPM_ARCH="aarch64"
DEB_ARCH="arm64"
;;
esac
# RPM Package # RPM Package
fpm -C ./root -s dir -t rpm \ fpm -C ./root -s dir -t rpm \
-d SDL2 -d SDL2_ttf -a x86_64 \ -d SDL2 -d SDL2_ttf -a $RPM_ARCH \
-n sketchy-maze -v ${VERSION} \ -n sketchy-maze -v ${VERSION} \
--license="Copyright" \ --license="Copyright" \
--maintainer=noah@kirsle.net \ --maintainer=noah@kirsle.net \
@ -80,7 +94,8 @@ fpm -C ./root -s dir -t rpm \
# Debian Package # Debian Package
fpm -C ./root -s dir -t deb \ fpm -C ./root -s dir -t deb \
-d libsdl2 -d libsdl2-ttf -a x86_64 \ -d libsdl2-2.0 -d libsdl2-ttf-2.0 -d libsdl2-mixer-2.0 \
-a $DEB_ARCH \
-n sketchy-maze -v ${VERSION} \ -n sketchy-maze -v ${VERSION} \
--license="Copyright" \ --license="Copyright" \
--maintainer=noah@kirsle.net \ --maintainer=noah@kirsle.net \

View File

@ -18,6 +18,14 @@ DIST_PATH="$(pwd)/dist/sketchymaze-${VERSION}"
RELEASE_PATH="$(pwd)/dist/release/${VERSION}" RELEASE_PATH="$(pwd)/dist/release/${VERSION}"
STAGE_PATH="$(pwd)/dist/stage/${VERSION}" 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
if [[ ! -d $DIST_PATH ]]; then if [[ ! -d $DIST_PATH ]]; then
echo Run this script from the root of the game repository, such that echo Run this script from the root of the game repository, such that
echo ./dist/sketchymaze-${VERSION} exists. Run 'make mingw' and/or echo ./dist/sketchymaze-${VERSION} exists. Run 'make mingw' and/or
@ -33,6 +41,16 @@ if [[ -d $STAGE_PATH ]]; then
rm -rf $STAGE_PATH rm -rf $STAGE_PATH
fi fi
# Check that we will bundle the Guidebook with the release.
if [[ ! -d "./guidebook" ]]; then
echo Guidebook not found locally! Should I download the latest or proceed without it?
echo Type 'y' to download the guidebook or press enter to skip.
read ANSWER
if [[ "$ANSWER" == "y" ]]; then
wget https://download.sketchymaze.com/guidebook.tar.gz && tar -xzvf guidebook.tar.gz
fi
fi
# Release scripts by operating system. # Release scripts by operating system.
linux() { linux() {
# Check for Linux binaries in the dist folder. # Check for Linux binaries in the dist folder.
@ -50,7 +68,7 @@ linux() {
rm *.exe *.dll rm *.exe *.dll
# Tar it. # Tar it.
tar -czvf "${RELEASE_PATH}/linux/sketchymaze-${VERSION}-linux-64bit.tar.gz" . tar -czvf "${RELEASE_PATH}/linux/sketchymaze-${VERSION}-linux-${ARCH_LABEL}.tar.gz" .
# fpm it. # fpm it.
../../../../scripts/fpm-bundle.sh ../../../../scripts/fpm-bundle.sh
@ -75,7 +93,7 @@ windows() {
rm sketchymaze doodad rm sketchymaze doodad
# Zip it. # Zip it.
zip -r "${RELEASE_PATH}/windows/sketchymaze-${VERSION}-windows-64bit.zip" . zip -r "${RELEASE_PATH}/windows/sketchymaze-${VERSION}-windows-${ARCH_LABEL}.zip" .
cd - cd -
} }
macos() { macos() {