ngx-awesomeindex/t/build-and-run
Adrian Perez de Castro 1494521744 build-and-run: disable HTTP rewrite module
The HTTP rewrite module needs PCRE, which is not available in the GHA
MacOS runners. It is unused by the tests, so it's safe to disable
building it.
2023-01-20 13:59:17 +02:00

36 lines
612 B
Bash
Executable file

#! /bin/bash
set -e
if [[ $# -lt 1 || $# -gt 2 ]] ; then
echo "Usage: $0 <nginx-version> [1]" 1>&2
exit 1
fi
readonly NGINX=$1
if [[ $2 -eq 1 ]] ; then
readonly DYNAMIC=$2
fi
case $(uname -s) in
Darwin)
JOBS=$(sysctl -n hw.activecpu)
;;
*)
JOBS=1
;;
esac
cd "$(dirname "$0")/.."
wget -O - http://nginx.org/download/nginx-${NGINX}.tar.gz | tar -xzf -
rm -rf prefix/
cd nginx-${NGINX}
./configure \
--add-${DYNAMIC:+dynamic-}module=.. \
--with-http_addition_module \
--without-http_rewrite_module \
--prefix="$(pwd)/../prefix"
make -j"$JOBS"
make install
cd ..
exec ./t/run prefix ${DYNAMIC}