All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/nginx-njs: new package
@ 2023-01-05 13:37 Martin Hundebøll
  2023-07-30 22:08 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Hundebøll @ 2023-01-05 13:37 UTC (permalink / raw)
  To: buildroot; +Cc: Martin Hundebøll

A module for extending the nginx server configuration with javascript
modules.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
---
 package/Config.in                |  1 +
 package/nginx-njs/Config.in      | 11 +++++++++++
 package/nginx-njs/nginx-njs.hash |  3 +++
 package/nginx-njs/nginx-njs.mk   | 13 +++++++++++++
 package/nginx/nginx.mk           |  5 +++++
 5 files changed, 33 insertions(+)
 create mode 100644 package/nginx-njs/Config.in
 create mode 100644 package/nginx-njs/nginx-njs.hash
 create mode 100644 package/nginx-njs/nginx-njs.mk

diff --git a/package/Config.in b/package/Config.in
index 995dae2c57..57714a2210 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2370,6 +2370,7 @@ menu "External nginx modules"
 	source "package/nginx-dav-ext/Config.in"
 	source "package/nginx-modsecurity/Config.in"
 	source "package/nginx-naxsi/Config.in"
+	source "package/nginx-njs/Config.in"
 	source "package/nginx-upload/Config.in"
 endmenu
 endif
diff --git a/package/nginx-njs/Config.in b/package/nginx-njs/Config.in
new file mode 100644
index 0000000000..f19f209481
--- /dev/null
+++ b/package/nginx-njs/Config.in
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_NGINX_NJS
+	bool "nginx-njs"
+	depends on BR2_PACKAGE_NGINX_HTTP
+	select BR2_PACKAGE_OPENSSL
+	help
+	  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.
+
+	  https://github.com/nginx/njs
diff --git a/package/nginx-njs/nginx-njs.hash b/package/nginx-njs/nginx-njs.hash
new file mode 100644
index 0000000000..d4015350a1
--- /dev/null
+++ b/package/nginx-njs/nginx-njs.hash
@@ -0,0 +1,3 @@
+# Locally Computed:
+sha256  92cc425d0b0952bb7e2e7a396cba58feb4a90fb3cb63441c201ab4d3e0cd6403  nginx-njs-0.7.9.tar.gz
+sha256  ff5c343bf6ef4447e4c9900640c7e4a0a286243375eca11c611316ff3f263559  LICENSE
diff --git a/package/nginx-njs/nginx-njs.mk b/package/nginx-njs/nginx-njs.mk
new file mode 100644
index 0000000000..62f1c13aed
--- /dev/null
+++ b/package/nginx-njs/nginx-njs.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# nginx-njs
+#
+################################################################################
+
+NGINX_NJS_VERSION = 0.7.9
+NGINX_NJS_SITE = $(call github,nginx,njs,$(NGINX_NJS_VERSION))
+NGINX_NJS_LICENSE = BSD-2-Clause
+NGINX_NJS_LICENSE_FILES = LICENSE
+NGINX_NJS_DEPENDENCIES = openssl
+
+$(eval $(generic-package))
diff --git a/package/nginx/nginx.mk b/package/nginx/nginx.mk
index 62ea379ffc..cb0c079712 100644
--- a/package/nginx/nginx.mk
+++ b/package/nginx/nginx.mk
@@ -290,6 +290,11 @@ NGINX_DEPENDENCIES += nginx-modsecurity
 NGINX_CONF_OPTS += --add-module=$(NGINX_MODSECURITY_DIR)
 endif
 
+ifeq ($(BR2_PACKAGE_NGINX_NJS),y)
+NGINX_CONF_OPTS += $(addprefix --add-module=,$(NGINX_NJS_DIR)/nginx)
+NGINX_DEPENDENCIES += nginx-njs
+endif
+
 # Debug logging
 NGINX_CONF_OPTS += $(if $(BR2_PACKAGE_NGINX_DEBUG),--with-debug)
 
-- 
2.39.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH] package/nginx-njs: new package
  2023-01-05 13:37 [Buildroot] [PATCH] package/nginx-njs: new package Martin Hundebøll
@ 2023-07-30 22:08 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-07-30 22:08 UTC (permalink / raw)
  To: Martin Hundebøll; +Cc: buildroot

Hello Martin,

On Thu,  5 Jan 2023 14:37:38 +0100
Martin Hundebøll <martin@geanix.com> wrote:

> A module for extending the nginx server configuration with javascript
> modules.
> 
> Signed-off-by: Martin Hundebøll <martin@geanix.com>

Yeah, it's been more than 6 months, but believe it not, I finally took
the time to look at your patch, and I was about to push it, but it
doesn't build. I also have a few comments, see below.

First of all, you forgot to add an entry in the DEVELOPERS file.

> diff --git a/package/nginx/nginx.mk b/package/nginx/nginx.mk
> index 62ea379ffc..cb0c079712 100644
> --- a/package/nginx/nginx.mk
> +++ b/package/nginx/nginx.mk
> @@ -290,6 +290,11 @@ NGINX_DEPENDENCIES += nginx-modsecurity
>  NGINX_CONF_OPTS += --add-module=$(NGINX_MODSECURITY_DIR)
>  endif
>  
> +ifeq ($(BR2_PACKAGE_NGINX_NJS),y)
> +NGINX_CONF_OPTS += $(addprefix --add-module=,$(NGINX_NJS_DIR)/nginx)

Why do you need this $(addprefix ...) dance ? Why don't you do it like
the other nginx external modules in nginx.mk?

> +NGINX_DEPENDENCIES += nginx-njs

Also, please put NGINX_DEPENDENCIES += nginx-njs before the
NGINX_CONF_OPTS += line, just to be consistent with the other nginx
external modules in nginx.mk.

I had fixed these minor details locally, but unfortunately it fails to
build here:

BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_NJS=y
# BR2_TARGET_ROOTFS_TAR is not set

exhibits:

configuring for Linux 6.2.9-300.fc38.x86_64 x86_64
checking for C compiler: /home/thomas/projets/buildroot/output/host/bin/arm-linux-gcc
 + using GNU C compiler
 + gcc version 12.2.0 (Buildroot 2021.11-4428-g6b6741b) 
checking for sizeof(int) ... not found
checking for sizeof(u_int) ... not found
checking for sizeof(void *) ... not found
checking for sizeof(uintptr_t) ... not found
checking for sizeof(size_t) ... not found
checking for sizeof(off_t) ... not found
checking for sizeof(time_t) ... not found
checking for system byte ordering ... not found

./configure: error: cannot detect system byte ordering

make[2]: *** [objs/Makefile:1260: /home/thomas/projets/buildroot/output/build/nginx-njs-0.7.9/nginx/../build/libnjs.a] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/thomas/projets/buildroot/output/build/nginx-1.24.0'
make[1]: *** [Makefile:10: build] Error 2
make[1]: Leaving directory '/home/thomas/projets/buildroot/output/build/nginx-1.24.0'
make: *** [package/pkg-generic.mk:293: /home/thomas/projets/buildroot/output/build/nginx-1.24.0/.stamp_built] Error 2

Could you have a look into this, and send a v2 of this patch?


-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-30 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05 13:37 [Buildroot] [PATCH] package/nginx-njs: new package Martin Hundebøll
2023-07-30 22:08 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.