This repository has been archived by the owner on Feb 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
shigure
96 lines (82 loc) · 1.66 KB
/
shigure
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# Script to download essential files and setup environment
echo "Shigure | Simple build script for A2"
base_dir=$(dirname "$0")
if ! test $1
then
echo "What do you want to do?"
exit
fi
if [[ $1 == "setup" ]]
then
assets_file=$base_dir/shigure.assets
echo "Checking required tools..."
command -v curl 1>/dev/null && dlt=curl && dlf='--output'
command -v wget 1>/dev/null && dlt=wget && dlf='-O'
if ! test $dlt
then
echo "Missing curl and wget, at least one need to be present."
exit
fi
while read -r line; do
larr=($line)
fname=${larr[0]}
furl=${larr[1]}
msysonly=${larr[2]}
if [[ $msysonly == 'msys-only' ]]
then
if [[ -z $MSYSTEM ]]
then
continue
fi
fi
echo
echo "Downloading asset $fname from $furl"
echo
mkdir -p `dirname "$base_dir/$fname"`
$dlt $furl $dlf $base_dir/$fname
done <$assets_file
fi
if [[ $1 == "build" ]]
then
cd $base_dir
echo
echo "WARNING!"
echo "Shigure build is ONLY an automation of the build instructions in README.md"
echo "I won't check all required tools. Please make sure you've installed them."
echo "If there is any error, consider manually build instead."
echo
echo "Press Enter to continue."
read a
vmake='make'
mkdir -p build
if [[ $OSTYPE == 'darwin'* ]]; then
command -v 'gmake' && vmake='gmake'
fi
autoreconf --install
chmod +x ./configure
chmod +x ./scansrc
sh ./scansrc
cd build
sh ../configure
cpunum=$(grep -c ^processor /proc/cpuinfo)
$vmake -j $cpunum
$vmake check
if test $MSYSTEM
then
sh ../winfix
fi
cd ..
yarn install
chmod +x ./jsbuild
./jsbuild
cd build
cp -f ../dist/* ./
cp -rf ../assets/* ./
fi
if [[ $1 == "test" ]]
then
cd build
./Ari
fi
echo "Finished."