-
Notifications
You must be signed in to change notification settings - Fork 12
/
linux_build_rando.sh
executable file
·56 lines (50 loc) · 2.14 KB
/
linux_build_rando.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
compile() {
# If building manually just replace SHA with your own text.
APP_NAME=$(basename "$PWD")
BANNERTOOLAPP=bannertool
IS_GH_ACTIONS=true
if [ -n "$var" ]; then
echo "Building on Github Actions.."
else
echo "GITHUB_SHA is empty, building locally."
IS_GH_ACTIONS=false
GITHUB_SHA=$(echo $(git rev-parse --short HEAD))
fi
if ! command -v bannertoolexec &> /dev/null; then
if ! command -v bannertool &> /dev/null; then
echo "Bannertool not found in PATH. Please ensure it is in your path before continuing."
exit 1
fi
echo "Bannertoolexec not found, using bannertool..."
BANNERTOOLAPP=bannertool
else
echo "Bannertool not found, using bannertoolexec..."
BANNERTOOLAPP=bannertoolexec
fi
if ! command -v 3dstool &> /dev/null; then
echo "3dstool not found in PATH. Please ensure it is in your path before continuing."
exit 1
fi
if ! command -v makerom &> /dev/null; then
echo "makerom not found in PATH. Please ensure it is in your path before continuing."
exit 1
fi
export commitHashShort=$(echo ${GITHUB_SHA::6})
sed -i "s/develop/${commitHashShort:-develop}/" ./source/include/version.hpp
make -j debug_app=1
sed -i "s/${commitHashShort}/develop/" ./source/include/version.hpp
$BANNERTOOLAPP makebanner -i ./banner.png -a ./audio.wav -o ./banner.bnr
$BANNERTOOLAPP makesmdh -s "Majora's Mask 3D Randomizer" -l "A Randomized Majoras Mask Experience" -p "Z3DR Team" -i icon.png -o ./icon.icn
3dstool -cvtf romfs ./romfs.bin --romfs-dir ./romfs
makerom -f cia -o ${APP_NAME}.cia -DAPP_ENCRYPTED=false -target t -exefslogo -elf ./${APP_NAME}.elf -icon ./icon.icn -banner ./banner.bnr -rsf ./mmrando.rsf -romfs ./romfs.bin -major 1 -minor 0 -micro 0
if $IS_GH_ACTIONS; then
qrencode -ocia.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.cia
qrencode -o3dsx.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.3dsx
fi
}
clean_up() {
rm -rf bannertool* makerom* 3dstool* icon.icn ext_key.txt ignore_3dstool.txt banner.bnr romfs.bin
}
compile
clean_up