4
4
# by Yuchen Jin (cainmagi) / 04062022
5
5
# ---------------------------------------------------------
6
6
# This script has been tested on
7
- # `ubuntu:jammy `
7
+ # `debian:bullseye `
8
8
# docker image.
9
9
# ---------------------------------------------------------
10
10
# Currently, it is only designed for a full installation
@@ -48,16 +48,23 @@ function mcd {
48
48
cd " $1 " || fail
49
49
}
50
50
51
+ function apt_dependency {
52
+ apt-get -y install $( apt-cache depends $1 | grep Depends | sed " s/.*ends:\ //" | tr ' \n' ' ' ) || fail
53
+ }
54
+
51
55
52
56
SET_HELP=false
53
57
SET_DEBUG=false
54
58
SET_SUDOFIX=false
55
59
SET_NVCUDA=false
56
60
SET_ALL=false
57
61
SET_BASIC=false
62
+ SET_CMAKE=false
63
+ SET_SSH=false
64
+ SET_VORBIS=false
65
+ SET_OPENMPT=false
58
66
SET_KRB5=false
59
67
SET_RUSTC=false
60
- SET_CMAKE=false
61
68
SET_NASM=false
62
69
SET_YASM=false
63
70
SET_SRT=false
99
106
--all) SET_ALL=true ;;
100
107
--basic) SET_BASIC=true ;;
101
108
--nvcuda) SET_NVCUDA=true ;;
109
+ --cmake) SET_CMAKE=true ;;
110
+ --ssh) SET_SSH=true ;;
111
+ --vorbis) SET_VORBIS=true ;;
112
+ --openmpt) SET_OPENMPT=true ;;
102
113
--krb5) SET_KRB5=true ;;
103
114
--rustc) SET_RUSTC=true ;;
104
- --cmake) SET_CMAKE=true ;;
105
115
--nasm) SET_NASM=true ;;
106
116
--yasm) SET_YASM=true ;;
107
117
--srt) SET_SRT=true ;;
@@ -144,12 +154,18 @@ where the usages are:
144
154
Install the basic dependencies by apt.
145
155
${COLOR_OPT} --nvcuda${RESET} [not included by --all]:
146
156
Install NVIDA drivers and CUDA, This option will not be set by --all.
157
+ ${COLOR_OPT} --cmake${RESET} :
158
+ Install CMake.
159
+ ${COLOR_OPT} --ssh${RESET} :
160
+ Install libssh.
161
+ ${COLOR_OPT} --vorbis${RESET} :
162
+ Install Vorbis audio codec.
163
+ ${COLOR_OPT} --openmpt${RESET} :
164
+ Install OpenMPT audio codec (requiring vorbis).
147
165
${COLOR_OPT} --krb5${RESET} :
148
166
Install libkrb5, with a higher version compared to apt distribution.
149
167
${COLOR_OPT} --rustc${RESET} :
150
168
Install Rust-lang, Cargo-C and meson.
151
- ${COLOR_OPT} --cmake${RESET} :
152
- Install CMake.
153
169
${COLOR_OPT} --nasm${RESET} :
154
170
Install NASM (Netwide Assembler).
155
171
${COLOR_OPT} --yasm${RESET} :
@@ -218,9 +234,12 @@ then
218
234
SET_BASIC=true
219
235
# SET_SUDOFIX=true # should not be specified when not using root mode.
220
236
# SET_NVCUDA=true # not included, because this option may be not necessary if CUDA has been installed.
237
+ SET_CMAKE=true
238
+ SET_SSH=true
239
+ SET_VORBIS=true
240
+ SET_OPENMPT=true
221
241
SET_KRB5=true
222
242
SET_RUSTC=true
223
- SET_CMAKE=true
224
243
SET_NASM=true
225
244
SET_YASM=true
226
245
SET_SRT=true
@@ -265,12 +284,13 @@ if [ "x${SET_BASIC}" = "xtrue" ]; then
265
284
sudo apt-get -y full-upgrade || fail
266
285
sudo apt-get -y install curl autoconf automake build-essential \
267
286
cmake git-core libass-dev libfreetype6-dev libgnutls28-dev \
268
- libsdl2-dev libtool libva-dev libvdpau-dev libogg-dev \
287
+ libsdl2-dev libtool libva-dev libvdpau-dev libogg-dev libcmocka-dev \
269
288
libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev \
270
- libunistring-dev libopenmpt-dev libopencore-amrwb-dev \
271
- libc6 libc6-dev unzip python3-pip libnuma1 libnuma-dev \
272
- gcc g++ bison perl clang libomp-dev libssh-dev libssl-dev \
273
- ninja-build pkg-config texinfo wget zlib1g-dev || fail
289
+ libunistring-dev libopencore-amrwb-dev libmpg123-dev libltdl-dev \
290
+ libc6 libc6-dev unzip python3-pip libnuma1 libnuma-dev portaudio19-dev \
291
+ gcc g++ bison perl clang libomp-dev libssl-dev libpulse-dev libsndfile-dev \
292
+ ninja-build pkg-config texinfo wget zlib1g-dev libgcrypt20-dev \
293
+ software-properties-common || fail
274
294
fi
275
295
276
296
@@ -280,14 +300,73 @@ if [ "x${SET_NVCUDA}" = "xtrue" ]; then
280
300
sudo apt-get update -qq || fail
281
301
sudo apt-get -y install gcc g++ curl wget freeglut3-dev build-essential \
282
302
libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev \
283
- libfreeimage-dev || fail
284
- sudo apt-get -y install nvidia-cuda-toolkit || fail
303
+ libfreeimage-dev software-properties-common || fail
304
+ # The following line only works with Ubuntu
305
+ # sudo apt-get -y install nvidia-cuda-toolkit || fail
306
+ # The following commands are working with Debian.
307
+ sudo add-apt-repository -y " deb http://deb.debian.org/debian/ bullseye main contrib non-free" || fail
308
+ sudo apt-get update -qq || fail
309
+ sudo apt-mark hold nvidia-persistenced || fail
310
+ sudo apt-get -y install nvidia-cuda-toolkit || fail
311
+ fi
312
+
313
+
314
+ # Install dependencies: CMake
315
+ if [ " x${SET_CMAKE} " = " xtrue" ]; then
316
+ msg " ${COLOR_OPT} --cmake): ${COLOR_OPT_TEXT} Install CMake 3.23.0."
317
+ cd $SOURCE_PATH || fail
318
+ wget -O- https://cmake.org/files/v3.23/cmake-3.23.0.tar.gz | tar xz -C . || fail
319
+ cd cmake-3.23.0 || fail
320
+ ./bootstrap || fail
321
+ make -j$( nproc) || fail
322
+ sudo make install || fail
323
+ fi
324
+
325
+
326
+ # Install dependencies: libssh
327
+ if [ " x${SET_SSH} " = " xtrue" ]; then
328
+ msg " ${COLOR_OPT} --ssh): ${COLOR_OPT_TEXT} Install libssh 0.9.6."
329
+ # sudo apt-get -y install gcc g++ cmake libssl-dev libgcrypt20-dev zlib1g-dev || fail
330
+ cd $SOURCE_PATH || fail
331
+ wget -O- https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.9.6.tar.gz | tar xz -C . || fail
332
+ cd libssh-0.9.6 || fail
333
+ mkdir -p build || fail
334
+ cd build || fail
335
+ PKG_CONFIG_PATH=" $BUILD_PATH /lib/pkgconfig:$PKG_CONFIG_PATH " cmake -DUNIT_TESTING=OFF -DCMAKE_INSTALL_PREFIX=" $BUILD_PATH " -DCMAKE_BUILD_TYPE=Release .. || fail
336
+ PATH=" $BIN_PATH :$PATH " make -j$( nproc) || fail
337
+ sudo make install || fail
338
+ fi
339
+
340
+
341
+ # Install dependencies: libvorbis
342
+ if [ " x${SET_VORBIS} " = " xtrue" ]; then
343
+ msg " ${COLOR_OPT} --vorbis): ${COLOR_OPT_TEXT} Install libvorbis 1.3.7."
344
+ # sudo apt-get -y install libogg-dev libvorbis0a libvorbisenc2 libvorbisfile3 || fail
345
+ cd $SOURCE_PATH || fail
346
+ wget -O- https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.gz | tar xz -C . || fail
347
+ cd libvorbis-1.3.7 || fail
348
+ PATH=" $BIN_PATH :$PATH " ./configure --prefix=/usr --disable-static || fail
349
+ PATH=" $BIN_PATH :$PATH " make -j$( nproc) || fail
350
+ sudo make install || fail
351
+ fi
352
+
353
+
354
+
355
+ # Install dependencies: libopenmpt
356
+ if [ " x${SET_OPENMPT} " = " xtrue" ]; then
357
+ msg " ${COLOR_OPT} --openmpt): ${COLOR_OPT_TEXT} Install libopenmpt 0.6.2."
358
+ # sudo apt-get -y install libmpg123-dev libltdl-dev libogg-dev libvorbis-dev zlib1g-dev libsndfile-dev portaudio19-dev libpulse-dev || fail
359
+ cd $SOURCE_PATH || fail
360
+ wget -O- https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.6.2+release.autotools.tar.gz | tar xz -C . || fail
361
+ cd libopenmpt-0.6.2+release.autotools || fail
362
+ PATH=" $BIN_PATH :$PATH " ./configure || fail
363
+ PATH=" $BIN_PATH :$PATH " make -j$( nproc) || fail
364
+ sudo make install || fail
285
365
fi
286
366
287
367
288
368
# Install libkrb5 1.19.3 (require yacc (bison)).
289
369
if [ " x${SET_KRB5} " = " xtrue" ]; then
290
- msg_err " Not compatible with xvid, so these codes are dropped."
291
370
msg " ${COLOR_OPT} --krb5): ${COLOR_OPT_TEXT} Install libkrb5 1.19.3."
292
371
sudo apt-get update -qq || fail
293
372
sudo apt-get -y install comerr-dev bison || fail
@@ -335,18 +414,6 @@ if [ "x${SET_DEBUG}" = "xtrue" ] || [ "x${SET_BASIC}" = "xtrue" ] || [ "x${SET_R
335
414
fi
336
415
337
416
338
- # Install dependencies: CMake
339
- if [ " x${SET_CMAKE} " = " xtrue" ]; then
340
- msg " ${COLOR_OPT} --cmake): ${COLOR_OPT_TEXT} Install CMake 3.23.0."
341
- cd $SOURCE_PATH || fail
342
- wget -O- https://cmake.org/files/v3.23/cmake-3.23.0.tar.gz | tar xz -C . || fail
343
- cd cmake-3.23.0 || fail
344
- ./bootstrap || fail
345
- make -j$( nproc) || fail
346
- sudo make install || fail
347
- fi
348
-
349
-
350
417
# Install dependencies: NASM
351
418
if [ " x${SET_NASM} " = " xtrue" ]; then
352
419
msg " ${COLOR_OPT} --nasm): ${COLOR_OPT_TEXT} Install NASM 2.15.05."
0 commit comments