Bug 213947

Summary: Add USES=node[:args] for specifying a dependency on Node.js
Product: Ports & Packages Reporter: Bradley T. Hughes <bhughes>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Some People CC: 0mp, adamw, portmgr, ports-bugs, saper
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 213693, 213945, 214386    
Bug Blocks:    
Attachments:
Description Flags
USES=node
none
USES=node (updated)
none
Add USES=node[:args] for specifying a dependency on Node.js
none
USES=node bhughes: maintainer-approval? (portmgr)

Description Bradley T. Hughes freebsd_committer freebsd_triage 2016-10-31 12:43:17 UTC
Created attachment 176338 [details]
USES=node

This is based lightly on Mk/Uses/python.mk. Add build, run, test
dependencies based on the arguments received. If the port does not
explicitly set a version, use a default which can be overridden by the
user.
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2016-10-31 16:52:01 UTC
There still are quite a few Python references in USES=node :-)
Comment 2 Bradley T. Hughes freebsd_committer freebsd_triage 2016-11-01 20:32:15 UTC
Created attachment 176398 [details]
USES=node (updated)

Updated patch to remove the Python references. :)
Comment 3 Bradley T. Hughes freebsd_committer freebsd_triage 2016-11-10 21:59:04 UTC
Created attachment 176879 [details]
Add USES=node[:args] for specifying a dependency on Node.js

This is based lightly on Mk/Uses/python.mk. Add build, run, test
dependencies based on the arguments received. If the port does not
explicitly set a version, use a default which can be overridden by the
user.
    
Change the www/node meta-port to USES=node:run.
Comment 4 Adam Weinberger freebsd_committer freebsd_triage 2016-11-28 21:55:01 UTC
Why are the paths in dependency lines using the full paths to binaries?

  RUN_DEPENDS+=	${LOCALBASE}/bin/node:www/node${_NODE_VERSION}

There's no base utility called node. Why not this?

  RUN_DEPENDS+= node:www/node${_NODE_VERSION}
Comment 5 Bradley T. Hughes freebsd_committer freebsd_triage 2016-11-28 21:57:30 UTC
I do not have a good answer. I followed what Uses/python.mk does, since I used that as my inspiration. :)
Comment 6 Adam Weinberger freebsd_committer freebsd_triage 2016-11-28 21:59:00 UTC
It should never be used that way unless you're avoiding a binary in ex. /usr/bin by the same name.
Comment 7 Bradley T. Hughes freebsd_committer freebsd_triage 2016-11-28 22:00:26 UTC
Indeed. I was just reading bsd.port.mk and saw how it works. I will fixup the patch :)
Comment 8 Bradley T. Hughes freebsd_committer freebsd_triage 2017-01-02 20:33:45 UTC
Created attachment 178461 [details]
USES=node

Updated patch to account for recent comments and ports changes. I have omitted adding support for node.js 0.12.x here since it is now EOL.
Comment 9 Marcin Cieślak 2018-03-11 23:52:22 UTC
Do I understand correctly that further work continues in Differential?

https://reviews.freebsd.org/D11863
Comment 10 Mateusz Piotrowski freebsd_committer freebsd_triage 2021-11-26 18:30:41 UTC
There is Mk/Uses/nodejs.mk now in the ports tree.