-
Notifications
You must be signed in to change notification settings - Fork 16
/
1_download_library.sh
executable file
·151 lines (113 loc) · 2.82 KB
/
1_download_library.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/bash
# abort on errors
set -e
export WORKSPACE=$PWD
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/../shared/import.sh
os=`uname`
if [ $os = "Darwin" ] ; then
echo "#############################################################"
echo "#"
echo "# macOS / Darwin detected. Please make sure the needed"
echo "# tools are installed. See the README.md file for reference."
echo "#"
echo "#############################################################"
fi
msg " [1] Checking Emscripten"
if hash emcc >/dev/null 2>&1; then
echo "Using pre-installed version"
else
echo "Preparing portable SDK"
if [ $os = "Darwin" ] ; then
if [ "$(uname -m)" = "arm64" ] ; then
echo "macOS arm64 requires a preinstalled emscripten."
echo "Run 'brew install emscripten' to install it."
exit 1
fi
fi
rm -rf emsdk-portable
git_clone https://github.com/emscripten-core/emsdk.git emsdk-portable
cd emsdk-portable
# This empty config file is populated by "emsdk activate".
# Prevents usage of the global config file in the home directory.
touch .emscripten
# Download and install the latest SDK tools and set up the compiler configuration to point to it.
./emsdk install 3.1.49
./emsdk activate 3.1.49
# Set the current Emscripten path
source ./emsdk_env.sh
fi
cd "$WORKSPACE"
msg " [2] Preparing libraries"
# zlib
rm -rf $ZLIB_DIR
download_and_extract $ZLIB_URL
# libpng
rm -rf $LIBPNG_DIR
download_and_extract $LIBPNG_URL
# freetype
rm -rf $FREETYPE_DIR
download_and_extract $FREETYPE_URL
# harfbuzz
rm -rf $HARFBUZZ_DIR
download_and_extract $HARFBUZZ_URL
# pixman
rm -rf $PIXMAN_DIR
download_and_extract $PIXMAN_URL
# expat
rm -rf $EXPAT_DIR
download_and_extract $EXPAT_URL
# libogg
rm -rf $LIBOGG_DIR
download_and_extract $LIBOGG_URL
# libvorbis
rm -rf $LIBVORBIS_DIR
download_and_extract $LIBVORBIS_URL
# mpg123
rm -rf $MPG123_DIR
download_and_extract $MPG123_URL
# libsndfile
rm -rf $LIBSNDFILE_DIR
download_and_extract $LIBSNDFILE_URL
# libxmp-lite
rm -rf $LIBXMP_LITE_DIR
download_and_extract $LIBXMP_LITE_URL
# speexdsp
rm -rf $SPEEXDSP_DIR
download_and_extract $SPEEXDSP_URL
# wildmidi
#rm -rf $WILDMIDI_DIR
#download_and_extract $WILDMIDI_URL
# opus
rm -rf $OPUS_DIR
download_and_extract $OPUS_URL
# opusfile
rm -rf $OPUSFILE_DIR
download_and_extract $OPUSFILE_URL
# FluidSynth
rm -rf $FLUIDSYNTH_DIR
download_and_extract $FLUIDSYNTH_URL
# nlohmann-json
rm -rf $NLOHMANNJSON_DIR
download_and_extract $NLOHMANNJSON_URL
# inih
rm -rf $INIH_DIR
download_and_extract $INIH_URL
# lhasa
rm -rf $LHASA_DIR
download_and_extract $LHASA_URL
# fmt
rm -rf $FMT_DIR
download_and_extract $FMT_URL
# ICU
rm -rf $ICU_DIR
download_and_extract $ICU_URL
# icudata
rm -f $ICUDATA_FILES
download_and_extract $ICUDATA_URL
# SDL2
rm -rf $SDL2_DIR
download_and_extract $SDL2_URL
# liblcf
rm -rf liblcf
download_liblcf