FFmpeg-Builds/scripts.d/25-zlib.sh
2020-09-04 16:16:28 +02:00

58 lines
1,014 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
}
ffbuild_cflags() {
return 0
}
ffbuild_ldflags() {
return 0
}