# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=njs # Keep it in sync with njs in main/nginx. pkgver=0.8.0 pkgrel=0 pkgdesc="njs scripting language CLI utility" url="https://nginx.org/en/docs/njs/" arch="all" license="BSD-2-Clause" # Note: njs is compatible with pcre2, but better to use the same PCRE library # as for njs module in nginx. makedepends="libedit-dev libxml2-dev openssl-dev>3 pcre-dev" checkdepends="expect" subpackages="$pkgname-debug $pkgname-libs-static" source="$pkgname-$pkgver.tar.gz::https://hg.nginx.org/njs/archive/$pkgver.tar.gz mktemp-busybox-compat.patch no-werror.patch " case "$CARCH" in x86) options="!check";; # one test fails esac # secfixes: # 0.7.3-r0: # - CVE-2021-46462 # - CVE-2021-46463 # - CVE-2022-25139 # 0.7.1-r0: # - CVE-2021-46461 build() { ./configure \ --build-dir='build-debug' \ --debug=YES make njs ./configure --cc-opt='-Os' --ld-opt='-Os' make njs } check() { make test } package() { install -m 755 -D build/njs "$pkgdir"/usr/bin/njs install -m 644 -D build/libnjs.a "$pkgdir"/usr/lib/libnjs.a install -m 644 -D build-debug/libnjs.a "$pkgdir"/usr/lib/libnjs-debug.a } debug() { pkgdesc="njs built with additional runtime checks and debug symbols" options="!strip" install -m 755 -D "$builddir"/build-debug/njs "$subpkgdir"/usr/bin/njs-debug } sha512sums=" 200f3ae1e1909f0d8086e2fbfbd6b8654e596f3ad2e4cf4d863e201cfcb2f86a419fa9061067cbededf6a8c792c1a5ecf60c3a4c983af044c179bb9fe619eea5 njs-0.8.0.tar.gz 4db527d663dbe9e8b503c3cbaa4eae34b45990a5359b3bb98ce970c705faefcac98de49439f2557756a2be8e2e06acc67f98942de01674c498832d80c3cb90c3 mktemp-busybox-compat.patch b8ed822bf0d2ac99682cdecde5ce0136ac46cc9e6077be1369c631ac4caf22f22750f39fced061233f44e3e290e8ca6135da5d121bd53551cbd460419bc90662 no-werror.patch "