FFmpeg-Builds/scripts.d/20-zlib.sh
2020-09-04 23:30:11 +02:00

50 lines
943 B
Bash
Executable file

#!/bin/bash
ZLIB_SRC="https://zlib.net/zlib-1.2.11.tar.gz"
ffbuild_enabled() {
return 0
}
ffbuild_dockerstage() {
to_df "ADD $SELF /root/zlib.sh"
to_df "RUN bash -c 'source /root/zlib.sh && ffbuild_dockerbuild && rm /root/zlib.sh'"
}
ffbuild_dockerbuild() {
mkdir zlib
cd zlib
wget "$ZLIB_SRC" -O zlib.tar.gz || return -1
tar xaf zlib.tar.gz || return -1
rm zlib.tar.gz
cd zlib* || return -1
local myconf=(
--prefix="$FFBUILD_PREFIX"
--static
)
if [[ $TARGET == win* ]]; then
export CC="${FFBUILD_CROSS_PREFIX}gcc"
export AR="${FFBUILD_CROSS_PREFIX}ar"
else
echo "Unknown target"
return -1
fi
./configure "${myconf[@]}" || return -1
make -j$(nproc) || return -1
make install || return -1
cd ../..
rm -rf zlib
}
ffbuild_configure() {
echo --enable-zlib
}
ffbuild_unconfigure() {
echo --disable-zlib
}