summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorosa <osa@pkgsrc.org>2022-03-14 02:52:48 +0000
committerosa <osa@pkgsrc.org>2022-03-14 02:52:48 +0000
commite491b9eed1282be9aa06fb5cdb5de3c59c15e218 (patch)
tree06069b7835f881102199a14f0bbf251565990695
parent5be1b91aab9863932ab31179f14c685119769444 (diff)
downloadpkgsrc-e491b9eed1282be9aa06fb5cdb5de3c59c15e218.tar.gz
lang/njs: add new port NGINX JavaScript (njs) command line utility
NGINX JavaScript, also knows as njs, is a subset of the JavaScript language that allows extending nginx functionality. njs is created in compliance with ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later extensions. It's easy to use njs command line utility to develop and debug additional functionality. Also, it's light-weight and very useful as a shebang in some cases as the nodejs substitutor.
-rw-r--r--lang/njs/DESCR4
-rw-r--r--lang/njs/Makefile26
-rw-r--r--lang/njs/PLIST2
-rw-r--r--lang/njs/distinfo5
-rw-r--r--lang/njs/options.mk38
5 files changed, 75 insertions, 0 deletions
diff --git a/lang/njs/DESCR b/lang/njs/DESCR
new file mode 100644
index 00000000000..1142e5a42f8
--- /dev/null
+++ b/lang/njs/DESCR
@@ -0,0 +1,4 @@
+njs scripting language, or just njs, is a subset of the JavaScript language
+that allows extending nginx functionality. njs is created in compliance
+with ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later
+extensions. The compliance is still evolving.
diff --git a/lang/njs/Makefile b/lang/njs/Makefile
new file mode 100644
index 00000000000..017c3bd3aaf
--- /dev/null
+++ b/lang/njs/Makefile
@@ -0,0 +1,26 @@
+# $NetBSD: Makefile,v 1.1 2022/03/14 02:52:48 osa Exp $
+
+DISTNAME= njs-0.7.2
+CATEGORIES= lang www
+MASTER_SITES= ${MASTER_SITE_GITHUB:=nginx/}
+GITHUB_TAG= v${PKGVERSION_NOREV}
+
+MAINTAINER= osa@NetBSD.org
+HOMEPAGE= https://nginx.org/en/docs/njs
+COMMENT= NGINX JavaScript command line utility
+LICENSE= 2-clause-bsd
+
+USE_LANGUAGES= c
+
+HAS_CONFIGURE= yes
+
+INSTALLATION_DIRS+= bin
+
+do-build:
+ ${RUN} cd ${WRKSRC} && ${BUILD_MAKE_CMD} njs
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/njs ${DESTDIR}${PREFIX}/bin/njs
+
+.include "options.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lang/njs/PLIST b/lang/njs/PLIST
new file mode 100644
index 00000000000..7ade88f7043
--- /dev/null
+++ b/lang/njs/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2022/03/14 02:52:48 osa Exp $
+bin/njs
diff --git a/lang/njs/distinfo b/lang/njs/distinfo
new file mode 100644
index 00000000000..6ced4e61904
--- /dev/null
+++ b/lang/njs/distinfo
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1 2022/03/14 02:52:48 osa Exp $
+
+BLAKE2s (njs-0.7.2.tar.gz) = 6aa7f4d62a9012badde72236cd4d2d8c32a3ea7842b582a7211a4dc836835af1
+SHA512 (njs-0.7.2.tar.gz) = 7ff9c8f4e8cf1a3aeb0f2ed9f37e2b3f4966812966d1aca17dae8b454dd7fa725ccdc631b7dc1f3434f588e589f4cd419b9e087f3c745cd6ca092a683c92d82f
+Size (njs-0.7.2.tar.gz) = 584483 bytes
diff --git a/lang/njs/options.mk b/lang/njs/options.mk
new file mode 100644
index 00000000000..72f53f6707f
--- /dev/null
+++ b/lang/njs/options.mk
@@ -0,0 +1,38 @@
+# $NetBSD: options.mk,v 1.1 2022/03/14 02:52:48 osa Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.njs
+PKG_SUPPORTED_OPTIONS= pcre pcre2 ssl
+PKG_SUGGESTED_OPTIONS= pcre ssl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mpcre)
+.include "../../devel/pcre/buildlink3.mk"
+SUBST_CLASSES+= fix-pcre
+SUBST_STAGE.fix-pcre= pre-configure
+SUBST_FILES.fix-pcre= auto/pcre
+SUBST_SED.fix-pcre= -e 's,/usr/pkg,${BUILDLINK_PREFIX.pcre},g'
+SUBST_NOOP_OK.fix-pcre= yes
+.else
+CONFIGURE_ARGS+= --no-pcre2
+.endif
+
+.if !empty(PKG_OPTIONS:Mpcre2)
+.include "../../devel/pcre2/buildlink3.mk"
+SUBST_CLASSES+= fix-pcre2
+SUBST_STAGE.fix-pcre2= pre-configure
+SUBST_FILES.fix-pcre2= auto/pcre
+SUBST_SED.fix-pcre2= -e 's,/usr/pkg,${BUILDLINK_PREFIX.pcre2},g'
+SUBST_NOOP_OK.fix-pcre2=yes
+.endif
+
+.if empty(PKG_OPTIONS:Mpcre2) && empty(PKG_OPTIONS:Mpcre)
+CONFIGURE_ARGS+= --no-pcre
+CONFIGURE_ARGS+= --no-pcre2
+.endif
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --no-openssl
+.endif