forked from m154k1/mpv-build-macOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch
More file actions
executable file
·364 lines (326 loc) · 7.51 KB
/
fetch
File metadata and controls
executable file
·364 lines (326 loc) · 7.51 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
#!/bin/bash -e
cd "$(dirname "$0")"
set -a; . .env; set +a
print_usage() {
echo "Usage:"
echo " $0 all"
echo " $0 <pkg1> <pkg2> ..."
}
fetch_tar() {
local url="$1"
local name="$2"
rm -rf src/"${name}"
curl -sL "${url}" | tar -xvC src -s ";^[^/]*;${name};"
}
fetch_brotli() {
local url="https://github.com/google/brotli.git"
rm -rf src/brotli
git -C src clone --depth 1 "${url}"
}
fetch_dav1d() {
local url="https://code.videolan.org/videolan/dav1d.git"
rm -rf src/dav1d
git -C src clone --depth 1 "${url}"
}
fetch_ffmpeg() {
local url="https://github.com/FFmpeg/FFmpeg.git"
rm -rf src/ffmpeg
git -C src clone --depth 1 "${url}" ffmpeg
}
fetch_freetype() {
local url="https://gitlab.freedesktop.org/freetype/freetype.git"
rm -rf src/freetype
git -C src clone --depth 1 "${url}"
}
fetch_fribidi() {
local url="https://github.com/fribidi/fribidi.git"
rm -rf src/fribidi
git -C src clone --depth 1 "${url}"
}
fetch_harfbuzz() {
local url="https://github.com/harfbuzz/harfbuzz.git"
rm -rf src/harfbuzz
git -C src clone --depth 1 "${url}"
}
fetch_highway() {
local url="https://github.com/google/highway.git"
rm -rf src/highway
git -C src clone --depth 1 "${url}"
}
fetch_lcms2() {
local url="https://github.com/mm2/Little-CMS.git"
rm -rf src/Little-CMS
git -C src clone --depth 1 "${url}"
}
fetch_libarchive() {
local url="https://github.com/libarchive/libarchive.git"
rm -rf src/libarchive
git -C src clone --depth 1 "${url}"
}
fetch_libass() {
local url="https://github.com/libass/libass.git"
rm -rf src/libass
git -C src clone --depth 1 "${url}"
}
fetch_libbluray() {
local url="https://code.videolan.org/videolan/libbluray.git"
rm -rf src/libbluray
git -C src clone --depth 1 --recurse-submodules "${url}"
}
fetch_libdvdnav() {
local url="https://code.videolan.org/videolan/libdvdnav.git"
git -C src clone --depth 1 "${url}"
}
fetch_libdvdread() {
local url="https://code.videolan.org/videolan/libdvdread/-/archive/master/libdvdread-master.tar.bz2"
fetch_tar "${url}" libdvdread
}
fetch_libjxl() {
local url="https://github.com/libjxl/libjxl.git"
rm -rf src/libjxl
git -C src clone --depth 1 "${url}"
}
fetch_libplacebo() {
local url="https://code.videolan.org/videolan/libplacebo.git"
rm -rf src/libplacebo
git -C src clone --depth 1 --recurse-submodules=3rdparty/{fast_float,jinja,markupsafe} "${url}"
}
fetch_libpng() {
local url="https://github.com/pnggroup/libpng.git"
rm -rf src/libpng
git -C src clone --depth 1 "${url}"
}
fetch_libunibreak() {
local version="7.0"
local url="https://github.com/adah1972/libunibreak/releases/download/libunibreak_${version//./_}/libunibreak-${version}.tar.gz"
fetch_tar "${url}" libunibreak
}
fetch_libvpx() {
local url="https://chromium.googlesource.com/webm/libvpx"
rm -rf src/libvpx
git -C src clone --depth 1 "${url}"
}
fetch_libwebp() {
local url="https://chromium.googlesource.com/webm/libwebp"
rm -rf src/libwebp
git -C src clone --depth 1 "${url}"
}
fetch_luajit() {
local url="https://github.com/LuaJIT/LuaJIT.git"
rm -rf src/LuaJIT
git -C src clone --depth 1 "${url}"
}
fetch_mesa() {
local url="https://gitlab.freedesktop.org/mesa/mesa.git"
rm -rf src/mesa
git -C src clone --depth 1 "${url}"
pip3 install --no-cache-dir -U mako packaging pyyaml
}
fetch_moltenvk() {
local url="https://github.com/KhronosGroup/MoltenVK.git"
rm -rf src/MoltenVK
git -C src clone --depth 1 "${url}"
}
fetch_mpv() {
local url="https://github.com/mpv-player/mpv.git"
rm -rf src/mpv
git -C src clone --depth 1 "${url}"
}
fetch_opus() {
local url="https://github.com/xiph/opus.git"
rm -rf src/opus
git -C src clone --single-branch "${url}"
local model
cd src/opus
model="$(sed -nE 's;^dnn/download_model\.sh "(.+)"$;\1;p' autogen.sh)"
echo "dnn model checksum: '${model}'"
./dnn/download_model.sh "${model}"
cd -
}
fetch_shaderc() {
local url="https://github.com/google/shaderc.git"
rm -rf src/shaderc
git -C src clone --depth 1 "${url}"
}
fetch_spirv-tools() {
local tools_url="https://github.com/KhronosGroup/SPIRV-Tools.git"
local headers_url="https://github.com/KhronosGroup/SPIRV-Headers.git"
rm -rf src/SPIRV-{Tools,Headers}
git -C src clone --depth 1 "${tools_url}"
git -C src clone --depth 1 "${headers_url}"
}
fetch_svt-av1() {
local url="https://gitlab.com/AOMediaCodec/SVT-AV1.git"
rm -rf src/SVT-AV1
git -C src clone --depth 1 "${url}"
}
fetch_uchardet() {
local url="https://gitlab.freedesktop.org/uchardet/uchardet.git"
rm -rf src/uchardet
git -C src clone --depth 1 "${url}"
}
fetch_vulkan() {
local loader_url="https://github.com/KhronosGroup/Vulkan-Loader.git"
local headers_url="https://github.com/KhronosGroup/Vulkan-Headers.git"
rm -rf src/Vulkan-{Loader,Headers}
git -C src clone --depth 1 "${loader_url}"
git -C src clone --depth 1 "${headers_url}"
}
fetch_whisper() {
local url="https://github.com/ggml-org/whisper.cpp.git"
rm -rf src/whisper.cpp
git -C src clone --single-branch "${url}"
}
fetch_x264() {
local url="https://code.videolan.org/videolan/x264.git"
rm -rf src/x264
git -C src clone --depth 1 "${url}"
}
fetch_x265() {
local url="https://bitbucket.org/multicoreware/x265_git/get/master.tar.bz2"
fetch_tar "${url}" x265
}
if [[ $# == 0 ]]; then
print_usage
exit 1
fi
if [[ "$*" == "all" ]]; then
fetch_brotli
fetch_dav1d
fetch_ffmpeg
fetch_freetype
fetch_fribidi
fetch_harfbuzz
fetch_highway
fetch_lcms2
fetch_libarchive
fetch_libass
fetch_libbluray
fetch_libdvdnav
fetch_libdvdread
fetch_libjxl
fetch_libplacebo
fetch_libpng
fetch_libunibreak
fetch_libvpx
fetch_libwebp
fetch_luajit
fetch_moltenvk
fetch_mpv
fetch_opus
fetch_shaderc
fetch_spirv-tools
fetch_svt-av1
fetch_uchardet
fetch_vulkan
fetch_whisper
fetch_x264
fetch_x265
else
for arg in "$@"; do
case "${arg}" in
"brotli")
fetch_brotli
;;
"dav1d")
fetch_dav1d
;;
"ffmpeg")
fetch_ffmpeg
;;
"freetype")
fetch_freetype
;;
"fribidi")
fetch_fribidi
;;
"harfbuzz")
fetch_harfbuzz
;;
"highway")
fetch_highway
;;
"lcms2")
fetch_lcms2
;;
"libarchive")
fetch_libarchive
;;
"libass")
fetch_libass
;;
"libbluray")
fetch_libbluray
;;
"libdvdnav")
fetch_libdvdnav
;;
"libdvdread")
fetch_libdvdread
;;
"libjxl")
fetch_libjxl
;;
"libplacebo")
fetch_libplacebo
;;
"libpng")
fetch_libpng
;;
"libunibreak")
fetch_libunibreak
;;
"libvpx")
fetch_libvpx
;;
"libwebp")
fetch_libwebp
;;
"luajit")
fetch_luajit
;;
"mesa")
fetch_mesa
;;
"moltenvk")
fetch_moltenvk
;;
"mpv")
fetch_mpv
;;
"opus")
fetch_opus
;;
"shaderc")
fetch_shaderc
;;
"spirv-tools")
fetch_spirv-tools
;;
"svt-av1")
fetch_svt-av1
;;
"uchardet")
fetch_uchardet
;;
"vulkan")
fetch_vulkan
;;
"whisper")
fetch_whisper
;;
"x264")
fetch_x264
;;
"x265")
fetch_x265
;;
*)
echo "Unknown argument:"
echo " ${arg}"
print_usage
exit 1
;;
esac
done
fi