From 5f2807e0c59b670ccd4607284334ae4283bf74ec Mon Sep 17 00:00:00 2001 From: bol-van Date: Fri, 31 Jul 2026 09:47:56 +0300 Subject: [PATCH] builder_linux: zlib_ng optional support --- docs/compile/build_howto_unix.txt | 2 +- docs/compile/builder-linux/build_deps.sh | 16 +++++++++++----- docs/compile/builder-linux/common.inc | 2 ++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/compile/build_howto_unix.txt b/docs/compile/build_howto_unix.txt index 486c95f..c743fc5 100644 --- a/docs/compile/build_howto_unix.txt +++ b/docs/compile/build_howto_unix.txt @@ -5,7 +5,7 @@ make -C /opt/zapret2 systemd * fedora, rhel, centos, alma -dnf add make gcc zlib-devel libcap-devel libnetfilter_queue-devel libmnl-devel systemd-devel luajit-devel +dnf install make gcc zlib-ng-compat-devel libcap-devel libnetfilter_queue-devel libmnl-devel systemd-devel luajit-devel make -C /opt/zapret2 systemd * linux static : diff --git a/docs/compile/builder-linux/build_deps.sh b/docs/compile/builder-linux/build_deps.sh index ee83e49..fb6aa17 100755 --- a/docs/compile/builder-linux/build_deps.sh +++ b/docs/compile/builder-linux/build_deps.sh @@ -16,8 +16,10 @@ dl_deps() curl $CURL_OPT -Lo - https://www.netfilter.org/pub/libmnl/libmnl-1.0.5.tar.bz2 | tar -xj || exit 5 exists_dir libnetfilter_queue-* || curl $CURL_OPT -Lo - https://www.netfilter.org/pub/libnetfilter_queue/libnetfilter_queue-1.0.5.tar.bz2 | tar -xj || exit 5 - exists_dir zlib-* || - curl $CURL_OPT -Lo - https://zlib.net/fossils/zlib-1.3.2.tar.gz | tar -xz || exit 5 + exists_dir zlib-ng-${ZLIB_NG_VER} || + curl $CURL_OPT -Lo - https://github.com/zlib-ng/zlib-ng/archive/refs/tags/${ZLIB_NG_VER}.tar.gz | tar -xz || exit 5 + exists_dir zlib-${ZLIB_VER} || + curl $CURL_OPT -Lo - https://zlib.net/fossils/zlib-${ZLIB_VER}.tar.gz | tar -xz || exit 5 exists_dir luajit2-* || curl $CURL_OPT -Lo - https://github.com/openresty/luajit2/archive/refs/tags/v${LUAJIT_RELEASE}.tar.gz | tar -xz || exit 5 exists_dir lua-* || @@ -42,11 +44,15 @@ build_netlink() build_zlib() { ( -cd zlib-* +if [ "$ZLIB_NG" = 1 ]; then + cd zlib-ng-${ZLIB_NG_VER} +else + cd zlib-${ZLIB_VER} +fi [ -f "Makefile" ] && make clean CFLAGS="$OPTIMIZE $MINSIZE $CFLAGS" \ LDFLAGS="$LDMINSIZE $LDFLAGS" \ -./configure --prefix= --static +./configure --prefix= --static --zlib-compat make install -j$nproc DESTDIR=$STAGING_DIR ) } @@ -107,8 +113,8 @@ for t in $TGT; do CFLAGS="$CFLAGS $CFLAGS_PIC" pushd "$DEPS" install_h_files - build_netlink build_zlib + build_netlink build_lua build_luajit_for_target $t popd diff --git a/docs/compile/builder-linux/common.inc b/docs/compile/builder-linux/common.inc index 9277b50..6c546b2 100644 --- a/docs/compile/builder-linux/common.inc +++ b/docs/compile/builder-linux/common.inc @@ -16,6 +16,8 @@ LDFLAGS="-lgcc_eh $LDFLAGS" # PIE does not work for arm32 and all mips PIE=${PIE:-0} HOSTCC=${HOSTCC:-cc} +ZLIB_VER=${ZLIB_VER:-1.3.2} +ZLIB_NG_VER=${ZLIB_NG_VER:-2.3.3} LUA_VER=${LUA_VER:-5.5} LUA_RELEASE=${LUA_RELEASE:-5.5.0} LUAJIT_VER=${LUAJIT_VER:-2.1}