-
Notifications
You must be signed in to change notification settings - Fork 2
/
fetch
executable file
·331 lines (298 loc) · 6.97 KB
/
fetch
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
#!/usr/bin/env bash -e
cd "$(dirname "$0")"
print_usage() {
echo "Usage:"
echo " $0 all"
echo " $0 <pkg1> <pkg2> ..."
}
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 version="1.3.4"
local url="https://download.videolan.org/pub/videolan/libbluray/${version}/libbluray-${version}.tar.bz2"
rm -rf src/libbluray
curl -sL "${url}" | tar -xvC src -
mv -v src/libbluray-"${version}" src/libbluray
}
fetch_libdvdnav() {
local version="6.1.1"
local url="https://download.videolan.org/pub/videolan/libdvdnav/${version}/libdvdnav-${version}.tar.bz2"
rm -rf src/libdvdnav
curl -sL "${url}" | tar -xvC src -
mv -v src/libdvdnav-"${version}" src/libdvdnav
}
fetch_libdvdread() {
local version="6.1.3"
local url="https://download.videolan.org/pub/videolan/libdvdread/${version}/libdvdread-${version}.tar.bz2"
rm -rf src/libdvdread
curl -sL "${url}" | tar -xvC src -
mv -v src/libdvdread-"${version}" src/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 --single-branch --no-tags "${url}"
git -C src/libplacebo submodule update --init 3rdparty/{fast_float,jinja,markupsafe}
}
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="6.1"
local url="https://github.com/adah1972/libunibreak/releases/download/libunibreak_${version//./_}/libunibreak-${version}.tar.gz"
rm -rf src/libunibreak
curl -sL "${url}" | tar -xvC src -
mv -v src/libunibreak-"${version}" src/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_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 --single-branch --no-tags "${url}"
}
fetch_opus() {
local version="1.5.2"
local url="https://downloads.xiph.org/releases/opus/opus-${version}.tar.gz"
rm -rf src/opus
curl -sL "${url}" | tar -xvC src -
mv -v src/opus-"${version}" src/opus
}
fetch_shaderc() {
local url="https://github.com/google/shaderc.git"
rm -rf src/shaderc
git -C src clone --depth 1 "${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 loaderurl="https://github.com/KhronosGroup/Vulkan-Loader.git"
local headersurl="https://github.com/KhronosGroup/Vulkan-Headers.git"
rm -rf src/Vulkan-{Loader,Headers}
git -C src clone --depth 1 "${loaderurl}"
git -C src clone --depth 1 "${headersurl}"
}
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.git"
rm -rf src/x265_git
git -C src clone --single-branch "${url}"
}
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_svt-av1
fetch_uchardet
fetch_vulkan
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
;;
"moltenvk")
fetch_moltenvk
;;
"mpv")
fetch_mpv
;;
"opus")
fetch_opus
;;
"shaderc")
fetch_shaderc
;;
"svt-av1")
fetch_svt-av1
;;
"uchardet")
fetch_uchardet
;;
"vulkan")
fetch_vulkan
;;
"x264")
fetch_x264
;;
"x265")
fetch_x265
;;
*)
echo "Unknown argument:"
echo " ${arg}"
print_usage
exit 1
;;
esac
done
fi