mirror of
https://github.com/NginxProxyManager/docker-nginx-full.git
synced 2024-12-06 19:26:20 +01:00
Skip brotli module entirely for non-64bit archs
This commit is contained in:
+13
-13
@@ -11,17 +11,17 @@ echo -e "${BLUE}❯ ${CYAN}Building brotli ${YELLOW}${LUA_VERSION}...${RESET}"
|
||||
# Determine the correct binary file for the architecture given
|
||||
M64="-m64"
|
||||
if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then
|
||||
M64=
|
||||
echo -e "${BLUE}❯ ${YELLOW}Skipping brotli for non-64bit arch${RESET}"
|
||||
else
|
||||
cd /tmp
|
||||
git clone --recurse-submodules -j8 "https://github.com/google/ngx_brotli"
|
||||
cd /tmp/ngx_brotli/deps/brotli
|
||||
|
||||
mkdir -p /tmp/ngx_brotli/deps/brotli/out
|
||||
cd /tmp/ngx_brotli/deps/brotli/out
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
|
||||
cmake --build . --config Release --target brotlienc
|
||||
|
||||
echo -e "${BLUE}❯ ${GREEN}brotli build completed${RESET}"
|
||||
fi
|
||||
|
||||
cd /tmp
|
||||
git clone --recurse-submodules -j8 "https://github.com/google/ngx_brotli"
|
||||
cd /tmp/ngx_brotli/deps/brotli
|
||||
|
||||
mkdir -p /tmp/ngx_brotli/deps/brotli/out
|
||||
cd /tmp/ngx_brotli/deps/brotli/out
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast $M64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
|
||||
cmake --build . --config Release --target brotlienc
|
||||
|
||||
echo -e "${BLUE}❯ ${GREEN}brotli build completed${RESET}"
|
||||
|
||||
@@ -17,6 +17,11 @@ git clone https://github.com/leev/ngx_http_geoip2_module.git
|
||||
mv /tmp/ngx_http_geoip2_module /tmp/openresty/ngx_http_geoip2_module
|
||||
cd /tmp/openresty
|
||||
|
||||
BROTI_MODULE="--add-module=/tmp/ngx_brotli"
|
||||
if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then
|
||||
BROTI_MODULE=
|
||||
fi
|
||||
|
||||
./configure \
|
||||
--prefix=/etc/nginx \
|
||||
--sbin-path=/usr/sbin/nginx \
|
||||
@@ -57,7 +62,7 @@ cd /tmp/openresty
|
||||
--with-stream_ssl_module \
|
||||
--with-stream_ssl_preread_module \
|
||||
--add-dynamic-module=/tmp/openresty/ngx_http_geoip2_module \
|
||||
--add-module=/tmp/ngx_brotli
|
||||
${BROTI_MODULE}
|
||||
|
||||
make -j2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user