-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-plugins.sh
executable file
·123 lines (103 loc) · 3.08 KB
/
build-plugins.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
#!/bin/sh
# Caution: this script is for ubuntu 16.04 or newer
set -e
s_begin=$( date "+%s")
. ./config.txt
export CFLAGS="-pipe -O3 -fno-strict-aliasing -Wno-deprecated-declarations"
export CXXFLAGS="$CFLAGS"
if [ ! -e "$my_pkg_config_path/vapoursynth.pc" -a\
! -e "$my_pkg_config_path/libavcodec.pc" ]; then
echo "error: missing a local installation of FFmpeg libraries and Vapoursynth in \`$VSPREFIX'"
echo "Have you forgotten to run \`build-vapoursynth.sh' before ?"
exit 1
fi
# gcc++-11 is required for rife
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
#if [ ! -e $stamp -x "/usr/bin/apt" ]; then
sudo apt update
sudo apt upgrade
sudo apt install --no-install-recommends \
build-essential \
cmake \
yasm \
git \
wget \
mercurial \
unzip \
meson \
p7zip-full \
python3-pip \
zlib1g-dev \
libfftw3-dev \
libopencv-dev \
ocl-icd-opencl-dev \
opencl-headers \
libboost-dev \
libboost-filesystem-dev \
libboost-system-dev \
libbluray-dev \
libpng-dev \
g++-11 \
gcc-11 \
llvm-11-dev \
libjansson-dev \
python3-testresources \
libvulkan1:i386 libvulkan1 vulkan-validationlayers \
libxxhash-dev \
libgsl-dev \
libturbojpeg0-dev
# libgsl-dev depencency for bore
# libxxhash-dev Run-time dependency libxxhash for BestSource
# libturbojpeg0-dev dependency turbojpeg for vsimagereader
#fi
rm -rf build
mkdir -p build/logs
cd build
build_pwd=$PWD
# newer nasm
if [ ! -x "$VSPREFIX/bin/nasm" ]; then
ver="2.14.02"
wget -c https://www.nasm.us/pub/nasm/releasebuilds/$ver/nasm-${ver}.tar.xz
tar xf nasm-${ver}.tar.xz
cd nasm-$ver
./configure --prefix="$VSPREFIX"
make -j$JOBS
make install
cd $build_pwd
rm -rf nasm-$ver nasm-${ver}.tar.xz
fi
# newer cmake
if [ ! -x "$VSPREFIX/bin/cmake" ]; then
# ver="3.14.6"
ver="3.19.0"
dir="cmake-${ver}-Linux-x86_64"
wget -c https://github.com/Kitware/CMake/releases/download/v$ver/${dir}.tar.gz
tar xf ${dir}.tar.gz
cp -rf $dir/bin $dir/share "$VSPREFIX"
rm -rf $dir ${dir}.tar.gz
fi
pip3 install -q -I --upgrade --user setuptools wheel # must be installed first
pip3 install -q -I --upgrade --user meson ninja
echo $PWD
plugins=$(ls -1 ../build-plugins/plugin-*.sh | sed 's|^\.\./build-plugins/plugin-||g; s|\.sh$||g')
#plugins="bore"
count=$(echo $plugins | wc -w)
n=0
echo ""
echo "Build plugins:"
# To avoid errors of inattention... but the correct VSPREFIX is in uppercase!
export vsprefix="$VSPREFIX"
for p in $plugins ; do
cat ../build-plugins/header.sh ../build-plugins/plugin-${p}.sh > build.sh # copy current build script
n=$(($n + 1)) # increace counter
printf " %s (%d/%d) ... " $p $n $count # show progress
bash ./build.sh >logs/${p}.log 2>&1 && echo "done" || echo "failed" # execute build script and send output to log file
rm -rf build build.sh # remove build folder and build script
done
unset vsprefix
pip3 uninstall -y -q setuptools wheel meson ninja
cd $build_pwd/..
rm -rf build
s_end=$( date "+%s")
s=$(($s_end - $s_begin))
printf "\nFinished after %d min %d sec\n" $(($s / 60)) $(($s % 60))