Page MenuHomeFreeBSD

Add USE_NODEJS to nodejs.mk for specifying NodeJS packager manager
Needs ReviewPublic

Authored by tagattie on Jan 3 2022, 10:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 1:18 AM
Unknown Object (File)
Mar 5 2023, 8:02 AM
Unknown Object (File)
Feb 16 2023, 12:12 PM
F34694191: greenbone-security-assistant-21.4.3_2.log
Jan 3 2022, 10:45 AM
F34694204: write-good-1.0.8.log
Jan 3 2022, 10:45 AM
F34694193: kibana7-7.16.2.log
Jan 3 2022, 10:45 AM
F34694196: opensearch-dashboards-1.2.0.log
Jan 3 2022, 10:45 AM
Subscribers
None

Details

Summary

A NodeJS-based software often uses a NodeJS package manager (NPM or Yarn) for building and/or running the software. Currently a porter must manually specify a package manager depending on the same major version according to USES=nodejs:<version>. Something like:

USES= nodejs:14
BUILD_DEPENDS= www/npm-node14>0:www/npm-node14

This proposal adds USE_NODEJS variable to nodejs.mk for specifying the NodeJS package manager used by a port.

USES= nodejs:14
USE_NODEJS= npm

adds BUILD_DEPENDS= www/npm-node14>0:www/npm-node14

If current version of NodeJS is used:

USES= nodejs:current
USE_NODEJS= npm

adds BUILD_DEPENDS= www/npm>0:www/npm

So a porter does not have to manually ensure that NodeJS's major version and that of a package manager's are the same.

Additionally, fetch, extract, patch, build, run, and/or test can be taken as arguments to specify a specific *_DEPENDS like:

USE_NODEJS= npm:fetch,build

adds

FETCH_DEPENDS= www/npm>0:www/npm
BUILD_DEPENDS= www/npm>0:www/npm

P.S. I would like elastic (for textproc/kibana7) and opensearch (for textproc/opensearch-dashboards) teams to review this proposal. Does anybody know who I should contact?

Test Plan

There 4 ports touched by this change, namely:

security/greenbone-security-assistant
textproc/kibana7
textproc/opensearch-dashboards
textproc/write-good

All the 4 ports have built fine with poudriere.




Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

tagattie created this revision.