76
76
mkdir -p dep-build
77
77
cd dep-build
78
78
79
+ download_file () {
80
+ local url=" $1 "
81
+ local filename=" $2 "
82
+ for i in {1..5}; do
83
+ curl -L " $url " -o " $filename " && return 0 || sleep 5
84
+ done
85
+ echo " Failed to download '$url ' to '$filename ' after 5 retries."
86
+ return 1
87
+ }
88
+
79
89
if [ ! -d ncurses-6.4 ]; then
80
- curl https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz -o ncurses.tar.gz
90
+ download_file https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz ncurses.tar.gz
81
91
tar -xf ncurses.tar.gz
82
92
cd ncurses-6.4
83
93
./configure --prefix=${PREFIX} --disable-shared --enable-termcap --enable-widec --enable-getcap
90
100
fi
91
101
92
102
if [ ! -d editline-1.17.1 ]; then
93
- curl -L https://github.com/troglobit/editline/releases/download/1.17.1/editline-1.17.1.tar.gz -o editline.tar.gz
103
+ download_file https://github.com/troglobit/editline/releases/download/1.17.1/editline-1.17.1.tar.gz editline.tar.gz
94
104
tar -xf editline.tar.gz
95
105
cd editline-1.17.1
96
106
./configure --prefix=${PREFIX} --disable-shared
@@ -100,7 +110,7 @@ cd ..
100
110
fi
101
111
102
112
if [ ! -d sqlite-autoconf-3440000 ]; then
103
- curl https://sqlite.org/2023/sqlite-autoconf-3440000.tar.gz -o sqlite.tar.gz
113
+ download_file https://sqlite.org/2023/sqlite-autoconf-3440000.tar.gz sqlite.tar.gz
104
114
tar -xf sqlite.tar.gz
105
115
cd sqlite-autoconf-3440000
106
116
./configure --prefix=${PREFIX} --disable-shared
@@ -110,7 +120,7 @@ cd ..
110
120
fi
111
121
112
122
if [ ! -d openssl-3.1.8 ]; then
113
- curl -L https://www.openssl.org/source/openssl-3.1.8.tar.gz -o openssl.tar.gz
123
+ download_file https://www.openssl.org/source/openssl-3.1.8.tar.gz openssl.tar.gz
114
124
tar -xf openssl.tar.gz
115
125
cd openssl-3.1.8
116
126
export " CPPINCLUDES=$PYTHON_BASE /Include"
@@ -127,15 +137,15 @@ cd ..
127
137
fi
128
138
129
139
if [ ! -d bzip2-1.0.8 ]; then
130
- curl -L https://gitlab.com/bzip2/bzip2/-/archive/bzip2-1.0.8/bzip2-bzip2-1.0.8.tar.gz -o bzip2.tar.gz
140
+ download_file https://gitlab.com/bzip2/bzip2/-/archive/bzip2-1.0.8/bzip2-bzip2-1.0.8.tar.gz bzip2.tar.gz
131
141
tar -xf bzip2.tar.gz
132
142
cd bzip2-bzip2-1.0.8
133
143
make install " PREFIX=$PREFIX " -j$( sysctl -n hw.ncpu)
134
144
cd ..
135
145
fi
136
146
137
147
if [ ! -d xz-5.4.5 ]; then
138
- curl -L https://downloads.sourceforge.net/project/lzmautils/xz-5.4.5.tar.gz -o xz.tar.gz
148
+ download_file https://downloads.sourceforge.net/project/lzmautils/xz-5.4.5.tar.gz xz.tar.gz
139
149
tar -xf xz.tar.gz
140
150
cd xz-5.4.5
141
151
./configure --prefix=${PREFIX} --disable-shared
@@ -145,7 +155,7 @@ cd ..
145
155
fi
146
156
147
157
if [ ! -d libffi-3.4.6 ]; then
148
- curl -L https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz -o libffi.tar.gz
158
+ download_file https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz libffi.tar.gz
149
159
tar -xf libffi.tar.gz
150
160
cd libffi-3.4.6
151
161
./configure --prefix=${PREFIX} --disable-shared
@@ -155,7 +165,7 @@ cd ..
155
165
fi
156
166
157
167
if [ ! -d zlib-latest ]; then
158
- curl -L https://www.zlib.net/current/zlib.tar.gz -o zlib.tar.gz
168
+ download_file https://www.zlib.net/current/zlib.tar.gz zlib.tar.gz
159
169
tar -xf zlib.tar.gz
160
170
mv zlib-* zlib-latest
161
171
cd zlib-latest
@@ -166,7 +176,7 @@ cd ..
166
176
fi
167
177
168
178
if [ ! -d libxcrypt-4.4.36 ]; then
169
- curl -L https://github.com/besser82/libxcrypt/releases/download/v4.4.36/libxcrypt-4.4.36.tar.xz -o libxcrypt.tar.xz
179
+ download_file https://github.com/besser82/libxcrypt/releases/download/v4.4.36/libxcrypt-4.4.36.tar.xz libxcrypt.tar.xz
170
180
tar -xf libxcrypt.tar.xz
171
181
cd libxcrypt-4.4.36
172
182
./configure --prefix=${PREFIX} --disable-shared
@@ -176,7 +186,7 @@ cd ..
176
186
fi
177
187
178
188
if [ ! -d libpng-1.6.39 ]; then
179
- curl -L http://downloads.sourceforge.net/project/libpng/libpng16/1.6.39/libpng-1.6.39.tar.xz -o libpng.tar.gz
189
+ download_file http://downloads.sourceforge.net/project/libpng/libpng16/1.6.39/libpng-1.6.39.tar.xz libpng.tar.gz
180
190
tar -xf libpng.tar.gz
181
191
cd libpng-1.6.39
182
192
./configure --prefix=${PREFIX} --disable-shared --with-zlib-prefix=${PREFIX}
@@ -188,7 +198,7 @@ cd ..
188
198
fi
189
199
190
200
if [ ! -d harfbuzz-8.3.0 ]; then
191
- curl -L https://github.com/harfbuzz/harfbuzz/releases/download/8.3.0/harfbuzz-8.3.0.tar.xz -o harfbuzz.tar.gz
201
+ download_file https://github.com/harfbuzz/harfbuzz/releases/download/8.3.0/harfbuzz-8.3.0.tar.xz harfbuzz.tar.gz
192
202
tar -xf harfbuzz.tar.gz
193
203
cd harfbuzz-8.3.0
194
204
./configure --prefix=${PREFIX} --disable-shared
@@ -198,7 +208,7 @@ cd ..
198
208
fi
199
209
200
210
if [ ! -d freetype-2.13.2 ]; then
201
- curl -L https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.gz -o freetype.tar.gz
211
+ download_file https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.gz freetype.tar.gz
202
212
tar -xf freetype.tar.gz
203
213
cd freetype-2.13.2
204
214
./configure --prefix=${PREFIX} --disable-shared --with-brotli=no
@@ -216,7 +226,7 @@ cd ..
216
226
fi
217
227
218
228
if [ ! -d tcl8.6.15 ]; then
219
- curl -L http://downloads.sourceforge.net/project/tcl/Tcl/8.6.15/tcl8.6.15-src.tar.gz -o tcl.tar.gz
229
+ download_file http://downloads.sourceforge.net/project/tcl/Tcl/8.6.15/tcl8.6.15-src.tar.gz tcl.tar.gz
220
230
tar -xf tcl.tar.gz
221
231
cd tcl8.6.15/unix
222
232
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads
@@ -226,7 +236,7 @@ cd ../..
226
236
fi
227
237
228
238
if [ ! -d expat-2.5.0 ]; then
229
- curl -L https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.gz -o expat.tar.gz
239
+ download_file https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.gz expat.tar.gz
230
240
tar -xf expat.tar.gz
231
241
cd expat-2.5.0
232
242
./configure --prefix=${PREFIX} --disable-shared
@@ -236,7 +246,7 @@ cd ..
236
246
fi
237
247
238
248
if [ ! -d tk8.6.15 ]; then
239
- curl -L http://downloads.sourceforge.net/project/tcl/Tcl/8.6.15/tk8.6.15-src.tar.gz -o tk.tar.gz
249
+ download_file http://downloads.sourceforge.net/project/tcl/Tcl/8.6.15/tk8.6.15-src.tar.gz tk.tar.gz
240
250
tar -xf tk.tar.gz
241
251
cd tk8.6.15/unix
242
252
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads --with-tcl=${PREFIX} /lib --enable-aqua
@@ -246,7 +256,7 @@ cd ../..
246
256
fi
247
257
248
258
if [ ! -d mpdecimal-4.0.0 ]; then
249
- curl -L https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.0.tar.gz -o mpdecimal.tar.gz
259
+ download_file https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.0.tar.gz mpdecimal.tar.gz
250
260
tar -xf mpdecimal.tar.gz
251
261
cd mpdecimal-4.0.0
252
262
./configure --prefix=${PREFIX} --disable-shared
@@ -256,7 +266,7 @@ cd ..
256
266
fi
257
267
258
268
if [ ! -d libb2-0.98.1 ]; then
259
- curl -L https://github.com/BLAKE2/libb2/releases/download/v0.98.1/libb2-0.98.1.tar.gz -o libb2.tar.gz
269
+ download_file https://github.com/BLAKE2/libb2/releases/download/v0.98.1/libb2-0.98.1.tar.gz libb2.tar.gz
260
270
tar -xf libb2.tar.gz
261
271
cd libb2-0.98.1
262
272
./configure --prefix=${PREFIX} --disable-shared
0 commit comments