FreeBSD Bugzilla – Attachment 176879 Details for
Bug 213947
Add USES=node[:args] for specifying a dependency on Node.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add USES=node[:args] for specifying a dependency on Node.js
nodejs-USES-node-3.diff (text/plain), 4.35 KB, created by
Bradley T. Hughes
on 2016-11-10 21:59:04 UTC
(
hide
)
Description:
Add USES=node[:args] for specifying a dependency on Node.js
Filename:
MIME Type:
Creator:
Bradley T. Hughes
Created:
2016-11-10 21:59:04 UTC
Size:
4.35 KB
patch
obsolete
>commit b7e9477fa9c8a540badab1913feff0c97b394b02 >Author: Bradley T. Hughes <bradleythughes@fastmail.fm> >Date: Sun Oct 30 21:22:35 2016 +0000 > > 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. > >diff --git Mk/Uses/node.mk Mk/Uses/node.mk >new file mode 100644 >index 0000000..a167a15 >--- /dev/null >+++ Mk/Uses/node.mk >@@ -0,0 +1,79 @@ >+# $FreeBSD$ >+# >+# Provide support for Node.js >+# >+# Feature: node >+# Usage: USES=node, or USES=node:args >+# Valid ARGS: <version>, build, run, test >+# >+# version The major version of Node.js required by your port. If omitted, >+# the default version is used. The user can choose which Node.js >+# version to use as the default using: >+# >+# DEFAULT_VERSIONS+= node=<major version> >+# >+# build Indicates that Node.js is needed at build time and adds >+# it to BUILD_DEPENDS. >+# run Indicates that Node.js is needed at run time and adds >+# it to RUN_DEPENDS. >+# test Indicates that Node.js is needed at test time and adds >+# it to TEST_DEPENDS. >+# >+# If build, run and test are omitted, Node.js will be added as BUILD_DEPENDS, >+# RUN_DEPENDS and TEST_DEPENDS. >+# >+# MAINTAINER: bradleythughes@fastmail.fm >+ >+.if !defined(_INCLUDE_USES_NODE_MK) >+_INCLUDE_USES_NODE_MK= yes >+ >+ >+# Make sure that no dependency or some other environment variable >+# pollutes the build/run dependency detection >+.undef _NODE_BUILD_DEP >+.undef _NODE_RUN_DEP >+.undef _NODE_TEST_DEP >+_NODE_ARGS= ${node_ARGS:S/,/ /g} >+.if ${_NODE_ARGS:Mbuild} >+_NODE_BUILD_DEP= yes >+_NODE_ARGS:= ${_NODE_ARGS:Nbuild} >+.endif >+.if ${_NODE_ARGS:Mrun} >+_NODE_RUN_DEP= yes >+_NODE_ARGS:= ${_NODE_ARGS:Nrun} >+.endif >+.if ${_NODE_ARGS:Mtest} >+_NODE_TEST_DEP= yes >+_NODE_ARGS:= ${_NODE_ARGS:Ntest} >+.endif >+ >+# The port does not specify a build, run or test dependency, assume all are >+# required. >+.if !defined(_NODE_BUILD_DEP) && !defined(_NODE_RUN_DEP) && \ >+ !defined(_NODE_TEST_DEP) && !defined(NODE_NO_DEPENDS) >+_NODE_BUILD_DEP= yes >+_NODE_RUN_DEP= yes >+_NODE_TEST_DEP= yes >+.endif >+ >+ >+# The remaining argument, if any, is the Node.js major version to use. >+_NODE_VERSION= ${_NODE_ARGS:S/.//g} >+.if empty(_NODE_VERSION) >+_NODE_VERSION= ${NODE_DEFAULT} >+.endif >+ >+ >+# Add build, run, and test dependencies as required. >+.if defined(_NODE_BUILD_DEP) >+BUILD_DEPENDS+= ${LOCALBASE}/bin/node:www/node${_NODE_VERSION} >+.endif >+.if defined(_NODE_RUN_DEP) >+RUN_DEPENDS+= ${LOCALBASE}/bin/node:www/node${_NODE_VERSION} >+.endif >+.if defined(_NODE_TEST_DEP) >+TEST_DEPENDS+= ${LOCALBASE}/bin/node:www/node${_NODE_VERSION} >+.endif >+ >+ >+.endif # _INCLUDE_USES_NODE_MK >diff --git Mk/bsd.default-versions.mk Mk/bsd.default-versions.mk >index 6519b80..a65f439 100644 >--- Mk/bsd.default-versions.mk >+++ Mk/bsd.default-versions.mk >@@ -15,7 +15,7 @@ _INCLUDE_BSD_DEFAULT_VERSIONS_MK= yes > > LOCALBASE?= /usr/local > >-.for lang in APACHE BDB FIREBIRD FPC GCC GHOSTSCRIPT LINUX LUA MYSQL PERL5 \ >+.for lang in APACHE BDB FIREBIRD FPC GCC GHOSTSCRIPT LINUX LUA MYSQL NODE PERL5 \ > PGSQL PHP PYTHON PYTHON2 PYTHON3 RUBY SSL TCLTK > .if defined(${lang}_DEFAULT) > WARNING+= "The variable ${lang}_DEFAULT is set and it should only be defined through DEFAULT_VERSIONS+=${lang:tl}=${${lang}_DEFAULT} in /etc/make.conf" >@@ -51,6 +51,8 @@ WARNING+= "OVERRIDE_LINUX_BASE_PORT is deprecated, please use DEFAULT_VERSIONS+ > LUA_DEFAULT?= 5.2 > # Possible values: 5.1, 5.5, 5.6, 5.7, 5.5m, 10.0m, 10.1m, 5.5p, 5.6p > MYSQL_DEFAULT?= 5.6 >+# Possible values: 0.12, 4, 6, 7 >+NODE_DEFAULT?= 7 > # Possible values: 5.18, 5.20, 5.22, devel > .if !exists(${LOCALBASE}/bin/perl) || (!defined(_PORTS_ENV_CHECK) && \ > defined(PACKAGE_BUILDING)) >diff --git www/node/Makefile www/node/Makefile >index 6faba5c..fa65b09 100644 >--- www/node/Makefile >+++ www/node/Makefile >@@ -1,7 +1,7 @@ > # $FreeBSD$ > > PORTNAME= node >-PORTVERSION= 7 >+PORTVERSION= ${NODE_DEFAULT} > CATEGORIES= www > > MAINTAINER= bradleythughes@fastmail.fm >@@ -9,7 +9,6 @@ COMMENT= Meta-port for node.js > > LICENSE= NONE > >-USES= metaport >-RUN_DEPENDS= ${LOCALBASE}/bin/node:www/node${PORTVERSION} >+USES= metaport node:run > > .include <bsd.port.mk>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 213947
:
176338
|
176398
|
176879
|
178461