Skip to contentSkip to conversation

package/nodejs: expose capability to compile host library

PATCH New Linus Kaschulla 3 participants 5 messages May 16, 2020 – May 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/nodejs: expose capability to compile host library

To use nodejs on the host (independant of the actual system) to create some static files to place onto the target rootfs nodejs can be very helpful.

The provided nodejs package didn't show the possibility to create a host package. But upon further examination I noticed that the package does it in fact (in the .mk). It specifies dependencies for the package with the host prefix and also invokes $(host-generic-package) as well as $(generic-package) which is the only one assumed from the config.

This commit adds a Config.in.host file that uses the dependencies given from HOST_NODEJS_DEPENDENCIES in the makefile. (It also add the host config to the package overview.)

With this change other packages can require BR2_PACKAGE_HOST_NODEJS without any problems or the buildsystem not fully knowing about this. Seems that someone added the capability (as a step for the cross- compiled nodejs) and didn't notice that this is a handy package by itself.

When installing global npm packages (with -g), the parameter --prefix $(HOST_DIR) can be used to ensure that nodejs doesn't try to install it onto the real host filesystem.

I already used this change to create static web files from Angular and place onto a target that doesn't need nodejs itself.

---
 package/Config.in.host        | 1 +
 package/nodejs/Config.in.host | 5 +++++
 2 files changed, 6 insertions(+)
 create mode 100644 package/nodejs/Config.in.host
package/Config.in.host +1 -0
index f1246c708f..510249a496 100644
@@ -48,6 +48,7 @@ menu "Host utilities"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
 	source "package/mxsldr/Config.in.host"
+	source "package/nodejs/Config.in.host"
 	source "package/omap-u-boot-utils/Config.in.host"
 	source "package/openocd/Config.in.host"
 	source "package/opkg-utils/Config.in.host"
package/nodejs/Config.in.host new file +5 -0
new file mode 100644
index 0000000000..af8d7b4e44
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_NODEJS
+	bool "host nodejs"
+	select BR_PACKAGE_HOST_LIBOPENSSL
+    select BR_PACKAGE_HOST_PYTHON
+    select BR_PACKAGE_HOST_ZLIB
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/nodejs: expose capability to compile host library

Hello Linus,

Quoted 52 lines · Linus Kaschulla

To use nodejs on the host (independant of the actual system) to create some static files to place onto the target rootfs nodejs can be very helpful.

The provided nodejs package didn't show the possibility to create a host package. But upon further examination I noticed that the package does it in fact (in the .mk). It specifies dependencies for the package with the host prefix and also invokes $(host-generic-package) as well as $(generic-package) which is the only one assumed from the config.

This commit adds a Config.in.host file that uses the dependencies given from HOST_NODEJS_DEPENDENCIES in the makefile. (It also add the host config to the package overview.)

With this change other packages can require BR2_PACKAGE_HOST_NODEJS without any problems or the buildsystem not fully knowing about this. Seems that someone added the capability (as a step for the cross- compiled nodejs) and didn't notice that this is a handy package by itself.

When installing global npm packages (with -g), the parameter --prefix $(HOST_DIR) can be used to ensure that nodejs doesn't try to install it onto the real host filesystem.

I already used this change to create static web files from Angular and place onto a target that doesn't need nodejs itself.

---
 package/Config.in.host        | 1 +
 package/nodejs/Config.in.host | 5 +++++
 2 files changed, 6 insertions(+)
 create mode 100644 package/nodejs/Config.in.host
package/Config.in.host +1 -0
index f1246c708f..510249a496 100644
@@ -48,6 +48,7 @@ menu "Host utilities"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
 	source "package/mxsldr/Config.in.host"
+	source "package/nodejs/Config.in.host"
 	source "package/omap-u-boot-utils/Config.in.host"
 	source "package/openocd/Config.in.host"
 	source "package/opkg-utils/Config.in.host"
package/nodejs/Config.in.host new file +0 -0
new file mode 100644
index 0000000000..af8d7b4e44

package/nodejs/Config.in.host line 5

Quoted 5 lines
package/nodejs/Config.in.host new file +5 -0
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_NODEJS
+	bool "host nodejs"
+	select BR_PACKAGE_HOST_LIBOPENSSL
+    select BR_PACKAGE_HOST_PYTHON
+    select BR_PACKAGE_HOST_ZLIB

Indent should use tabs (instead of spaces)...

Regards,
Peter

author
#2 lore raw

PATCH 1/1 package/nodejs: expose capability to compile host library

Hi Peter,

Quoted 1 line

Indent should use tabs (instead of spaces)...

I'm sorry for that. I've overlooked that change (ported it from the repository I'm working with).
I git fixuped it. The fixed patch is below.

Regards,
Linus

To use nodejs on the host (independant of the actual system) to create some static files to place onto the target rootfs nodejs can be very helpful.

The provided nodejs package didn't show the possibility to create a host package. But upon further examination I noticed that the package does it in fact (in the .mk). It specifies dependencies for the package with the host prefix and also invokes $(host-generic-package) as well as $(generic-package) which is the only one assumed from the config.

This commit adds a Config.in.host file that uses the dependencies given from HOST_NODEJS_DEPENDENCIES in the makefile. (It also add the host config to the package overview.)

With this change other packages can require BR2_PACKAGE_HOST_NODEJS without any problems or the buildsystem not fully knowing about this. Seems that someone added the capability (as a step for the cross- compiled nodejs) and didn't notice that this is a handy package by itself.

When installing global npm packages (with -g), the parameter --prefix $(HOST_DIR) can be used to ensure that nodejs doesn't try to install it onto the real host filesystem.

I already used this change to create static web files from Angular and place onto a target that doesn't need nodejs itself.

---
?package/Config.in.host??????? | 1 +
?package/nodejs/Config.in.host | 5 +++++
?2 files changed, 6 insertions(+)
?create mode 100644 package/nodejs/Config.in.host

package/Config.in.host +0 -0
index f1246c708f..510249a496 100644
@@ -48,6 +48,7 @@ menu "Host utilities"

???? source "package/mtd/Config.in.host"
???? source "package/mtools/Config.in.host" ???? source "package/mxsldr/Config.in.host" +??? source "package/nodejs/Config.in.host" ???? source "package/omap-u-boot-utils/Config.in.host" ???? source "package/openocd/Config.in.host" ???? source "package/opkg-utils/Config.in.host"

package/nodejs/Config.in.host new file +5 -0
new file mode 100644
index 0000000000..2169762b1b
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_NODEJS
+??? bool "host nodejs"
+??? select BR_PACKAGE_HOST_LIBOPENSSL
+??? select BR_PACKAGE_HOST_PYTHON
+??? select BR_PACKAGE_HOST_ZLIB
Signature · 4 lines
2.26.2


Am 17.05.20 um 09:35 schrieb Peter Seiderer:
Quoted 63 lines

Hello Linus,

Quoted 52 lines · Linus Kaschulla

To use nodejs on the host (independant of the actual system) to create some static files to place onto the target rootfs nodejs can be very helpful.

The provided nodejs package didn't show the possibility to create a host package. But upon further examination I noticed that the package does it in fact (in the .mk). It specifies dependencies for the package with the host prefix and also invokes $(host-generic-package) as well as $(generic-package) which is the only one assumed from the config.

This commit adds a Config.in.host file that uses the dependencies given from HOST_NODEJS_DEPENDENCIES in the makefile. (It also add the host config to the package overview.)

With this change other packages can require BR2_PACKAGE_HOST_NODEJS without any problems or the buildsystem not fully knowing about this. Seems that someone added the capability (as a step for the cross- compiled nodejs) and didn't notice that this is a handy package by itself.

When installing global npm packages (with -g), the parameter --prefix $(HOST_DIR) can be used to ensure that nodejs doesn't try to install it onto the real host filesystem.

I already used this change to create static web files from Angular and place onto a target that doesn't need nodejs itself.

---
 package/Config.in.host        | 1 +
 package/nodejs/Config.in.host | 5 +++++
 2 files changed, 6 insertions(+)
 create mode 100644 package/nodejs/Config.in.host
package/Config.in.host +1 -0
index f1246c708f..510249a496 100644
@@ -48,6 +48,7 @@ menu "Host utilities"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
 	source "package/mxsldr/Config.in.host"
+	source "package/nodejs/Config.in.host"
 	source "package/omap-u-boot-utils/Config.in.host"
 	source "package/openocd/Config.in.host"
 	source "package/opkg-utils/Config.in.host"
package/nodejs/Config.in.host new file +0 -0
new file mode 100644
index 0000000000..af8d7b4e44

package/nodejs/Config.in.host line 5

Quoted 5 lines
package/nodejs/Config.in.host new file +5 -0
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_NODEJS
+	bool "host nodejs"
+	select BR_PACKAGE_HOST_LIBOPENSSL
+    select BR_PACKAGE_HOST_PYTHON
+    select BR_PACKAGE_HOST_ZLIB

Indent should use tabs (instead of spaces)...

Quoted 6 lines

Regards,
Peter
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200517/908a07d6/attachment.asc>

#3 lore raw

PATCH 1/1 package/nodejs: expose capability to compile host library

Linux, All,

On 2020-05-17 13:31 +0200, Linus spake thusly:

Quoted 7 lines

Hi Peter,

Quoted 1 line

Indent should use tabs (instead of spaces)...

I'm sorry for that. I've overlooked that change (ported it from the repository I'm working with).
I git fixuped it. The fixed patch is below.

Please use git send-email to send patches; the way you sent this new iteration is not a proper patch, and did not get picked up by patchwork:
https://patchwork.ozlabs.org/project/buildroot/list/

Besides, there are still issues, see below...

[--SNIP--]

package/nodejs/Config.in.host line 5

Quoted 11 lines
package/nodejs/Config.in.host new file +5 -0
new file mode 100644
index 0000000000..2169762b1b
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_NODEJS
+??? bool "host nodejs"
+??? select BR_PACKAGE_HOST_LIBOPENSSL
+??? select BR_PACKAGE_HOST_PYTHON
+??? select BR_PACKAGE_HOST_ZLIB

You used 4 spaces here, when Peter explicitly stated that TABs should be used. Run "make check-pacakge" to check for these kind of issues.

Also, those three options, BR_PACKAGE_HOST_LIBOPENSSL, BR_PACKAGE_HOST_ZLIB, and BR_PACKAGE_HOST_PYTHON, do not exist. For host packages, the options do not exist, unless they have to be visible in the menuconfig, which is not the case for those three.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
author
#4 lore raw

PATCH 1/1 package/nodejs: expose capability to compile host library

Hi Yann,

Thank you for your feedback.

Quoted 3 lines

Please use git send-email to send patches; the way you sent this new iteration is not a proper patch, and did not get picked up by patchwork:
https://patchwork.ozlabs.org/project/buildroot/list/

I had hoped that I could provide the patch as well as the answer in one email.
I had hoped that retaining the format of the patch as generated by git would not be a problem.
I'll send the fixed patch in the next mail.

Quoted 2 lines

You used 4 spaces here, when Peter explicitly stated that TABs should be used. Run "make check-pacakge" to check for these kind of issues.

See previous answer. Due to me copying it from the terminal into my email client the terminal converted the tabs to spaces which I didn't notice.

Quoted 4 lines

Also, those three options, BR_PACKAGE_HOST_LIBOPENSSL, BR_PACKAGE_HOST_ZLIB, and BR_PACKAGE_HOST_PYTHON, do not exist. For host packages, the options do not exist, unless they have to be visible in the menuconfig, which is not the case for those three.

I in fact, missed to check whether those exist. I had previously noticed, that
when saving the config from make menuconfig, it would be checked whether there
is an error in the select statement(s).
I assumed that, in case of failure, it would happen there, too. But I have to
admit, that I didn't go out of the way to check it.

I removed the checks for host zlib and libopenssl and fixed the BR-Prefix for host python (2).

Regards,
Linus Kaschulla

Am 17.05.20 um 21:48 schrieb Yann E. MORIN:

Quoted 30 lines

Linux, All,

On 2020-05-17 13:31 +0200, Linus spake thusly:

Quoted 6 lines

Hi Peter,

Quoted 1 line

Indent should use tabs (instead of spaces)...

I'm sorry for that. I've overlooked that change (ported it from the repository I'm working with).
I git fixuped it. The fixed patch is below.

Please use git send-email to send patches; the way you sent this new iteration is not a proper patch, and did not get picked up by patchwork:
https://patchwork.ozlabs.org/project/buildroot/list/

Besides, there are still issues, see below...

[--SNIP--]

package/nodejs/Config.in.host line 5

Quoted 11 lines
package/nodejs/Config.in.host new file +5 -0
new file mode 100644
index 0000000000..2169762b1b
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_NODEJS
+??? bool "host nodejs"
+??? select BR_PACKAGE_HOST_LIBOPENSSL
+??? select BR_PACKAGE_HOST_PYTHON
+??? select BR_PACKAGE_HOST_ZLIB

You used 4 spaces here, when Peter explicitly stated that TABs should be used. Run "make check-pacakge" to check for these kind of issues.

Quoted 8 lines

Also, those three options, BR_PACKAGE_HOST_LIBOPENSSL, BR_PACKAGE_HOST_ZLIB, and BR_PACKAGE_HOST_PYTHON, do not exist. For host packages, the options do not exist, unless they have to be visible in the menuconfig, which is not the case for those three.

Regards,
Yann E. MORIN.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200518/53404ae0/attachment-0001.asc>