FFmpeg-Builds/scripts.d/50-xvid.sh

60 lines
1.2 KiB
Bash
Raw Normal View History

2020-09-06 20:59:35 +00:00
#!/bin/bash
XVID_SRC="https://downloads.xvid.com/downloads/xvidcore-1.3.7.tar.gz"
ffbuild_enabled() {
[[ $VARIANT == gpl* ]] || return -1
return 0
}
ffbuild_dockerbuild() {
mkdir xvid
cd xvid
2021-04-04 21:20:31 +00:00
wget -O xvid.tar.gz "$XVID_SRC"
tar xaf xvid.tar.gz
2020-09-06 20:59:35 +00:00
rm xvid.tar.gz
cd xvid*
cd build/generic
2021-04-25 20:40:57 +00:00
# The original code fails on a two-digit major...
sed -i\
-e 's/GCC_MAJOR=.*/GCC_MAJOR=10/' \
-e 's/GCC_MINOR=.*/GCC_MINOR=0/' \
configure.in
./bootstrap.sh
2020-09-06 20:59:35 +00:00
local myconf=(
--prefix="$FFBUILD_PREFIX"
)
if [[ $TARGET == win* || $TARGET == linux* ]]; then
2020-09-06 20:59:35 +00:00
myconf+=(
--host="$FFBUILD_TOOLCHAIN"
)
else
2020-09-06 20:59:35 +00:00
echo "Unknown target"
return -1
fi
2021-04-04 21:20:31 +00:00
./configure "${myconf[@]}"
make -j$(nproc)
make install
2020-09-06 20:59:35 +00:00
if [[ $TARGET == win* ]]; then
rm "$FFBUILD_PREFIX"/{bin/xvidcore.dll,lib/xvidcore.dll.a}
mv "$FFBUILD_PREFIX"/lib/{,lib}xvidcore.a
elif [[ $TARGET == linux* ]]; then
rm "$FFBUILD_PREFIX"/lib/libxvidcore.so*
fi
2020-09-06 20:59:35 +00:00
}
ffbuild_configure() {
echo --enable-libxvid
}
ffbuild_unconfigure() {
echo --disable-libxvid
}