Add zlib
This commit is contained in:
parent
6f3c668b22
commit
6f9cc90be4
1 changed files with 58 additions and 0 deletions
58
scripts.d/25-zlib.sh
Executable file
58
scripts.d/25-zlib.sh
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/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
|
||||
}
|
Loading…
Reference in a new issue