aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-10-20 18:05:18 +0200
committerJakub Jirutka <jakub@jirutka.cz>2021-10-20 18:06:41 +0200
commit7168e16a28303964be2aa53334a6015422b0a30b (patch)
tree4235131a0da08501546bb5e6507f9bc3592714a5
parentb7c0c7da4667045d2af5e20a3aa32b72887e0c18 (diff)
downloadaports-7168e16a28303964be2aa53334a6015422b0a30b.tar.gz
aports-7168e16a28303964be2aa53334a6015422b0a30b.tar.bz2
aports-7168e16a28303964be2aa53334a6015422b0a30b.tar.xz
main/nginx: enable on riscv64 (without lua modules)
-rw-r--r--main/nginx/APKBUILD31
1 files changed, 22 insertions, 9 deletions
diff --git a/main/nginx/APKBUILD b/main/nginx/APKBUILD
index aeb7668fee..d3d0ff289c 100644
--- a/main/nginx/APKBUILD
+++ b/main/nginx/APKBUILD
@@ -29,7 +29,7 @@ _tests_hgrev=feb754918372
_njs_ver=0.7.0
pkgdesc="HTTP and reverse proxy server (stable version)"
url="https://www.nginx.org/"
-arch="all !riscv64" # luajit not available on riscv64
+arch="all"
license="BSD-2-Clause"
depends=""
makedepends="
@@ -40,7 +40,6 @@ makedepends="
libxml2-dev
libxslt-dev
linux-headers
- luajit-dev
openssl1.1-compat-dev
pcre-dev
perl-dev
@@ -91,6 +90,11 @@ _modules_dir="usr/lib/$pkgname/modules"
_stream_js_depends="$pkgname-mod-stream"
case "$CARCH" in
+ riscv64) _has_luajit=false;;
+ *) _has_luajit=true; makedepends="$makedepends luajit-dev";;
+esac
+
+case "$CARCH" in
x86 | s390x | mips64 | armv7 | armhf) _njs_mods= ;; # has failing tests
*) _njs_mods="http-js stream-js";;
esac
@@ -113,7 +117,7 @@ done
# For simplicity we assume that module is hosted on GitHub.
_add_module() {
- local name="$1" ver="$2" url="$3" subdir="$4"
+ local name="$1" ver="$2" url="$3" subdir="$4" enabled="${5:-true}"
local dirname=${url##*/}-${ver#v}
local varprefix="_${name//-/_}"
@@ -123,8 +127,12 @@ _add_module() {
# modules share the same source (e.g. geoip2 that provides http-geoip2
# and stream-geoip2).
if ! printf '%s\n' $_extra_flags | grep -qFw "$srcdir/$dirname"; then
- _extra_flags="$_extra_flags --add-dynamic-module=$srcdir/$dirname/$subdir"
source="$source $dirname.tar.gz::$url/archive/$ver.tar.gz"
+ # $source must be always in-sync with $sha512sums, so we have to
+ # add there source of a module that is disabled on the current arch.
+ [ "$enabled" = false ] && return
+
+ _extra_flags="$_extra_flags --add-dynamic-module=$srcdir/$dirname/$subdir"
fi
subpackages="$subpackages $pkgname-mod-$name:_module"
}
@@ -164,11 +172,11 @@ _http_headers_more_so="ngx_http_headers_more_filter_module.so"
_add_module "http-log-zmq" "v1.0.0" "https://github.com/danifbento/nginx-log-zmq"
# luajit is required for lua-nginx-module since v0.10.14
-_add_module "http-lua" "v0.10.20" "https://github.com/openresty/lua-nginx-module"
+_add_module "http-lua" "v0.10.20" "https://github.com/openresty/lua-nginx-module" "" "$_has_luajit"
_http_lua_depends="$pkgname-mod-devel-kit lua-resty-core"
_http_lua_provides="$pkgname-lua" # for backward compatibility
-_add_module "http-lua-upstream" "v0.07" "https://github.com/openresty/lua-upstream-nginx-module"
+_add_module "http-lua-upstream" "v0.07" "https://github.com/openresty/lua-upstream-nginx-module" "" "$_has_luajit"
_http_lua_upstream_depends="$pkgname-mod-http-lua"
_add_module "http-naxsi" "1.3" "https://github.com/nbs-system/naxsi" "naxsi_src"
@@ -230,8 +238,10 @@ prepare() {
}
_build() {
- export LUAJIT_LIB="$(pkgconf --variable=libdir luajit)"
- export LUAJIT_INC="$(pkgconf --variable=includedir luajit)"
+ if $_has_luajit; then
+ export LUAJIT_LIB="$(pkgconf --variable=libdir luajit)"
+ export LUAJIT_INC="$(pkgconf --variable=includedir luajit)"
+ fi
./configure \
--prefix=/var/lib/$pkgname \
--sbin-path=/usr/sbin/$pkgname \
@@ -327,9 +337,12 @@ package() {
install -Dm644 objs/$pkgname.8 "$pkgdir"/usr/share/man/man8/$pkgname.8
- local name; for name in ngx_devel_kit lua-nginx-module nginx-rtmp-module; do
+ local name; for name in ngx_devel_kit nginx-rtmp-module; do
cp -r "$srcdir"/$name-*/doc* "$pkgdir"/usr/share/doc/$pkgname/$name
done
+ if $_has_luajit; then
+ cp -r "$srcdir"/lua-nginx-module-*/doc* "$pkgdir"/usr/share/doc/$pkgname/lua-nginx-module
+ fi
cd "$pkgdir"