Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136611287
D11863.id39475.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D11863.id39475.diff
View Options
Index: Mk/Uses/node.mk
===================================================================
--- /dev/null
+++ Mk/Uses/node.mk
@@ -0,0 +1,98 @@
+# $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: bhughes@FreeBSD.org
+
+.if !defined(_INCLUDE_USES_NODE_MK)
+_INCLUDE_USES_NODE_MK= yes
+
+
+# Please keep this list sorted by ascending major version number. Be sure to
+# update the comment in Mk/bsd.default-versions.mk when changing this list.
+_NODE_MAJOR_VERSIONS= 4 6 8 9
+
+.if ${node_ARGS:N[4689]:Nbuild:Nrun:Ntest}
+IGNORE?= Unknown USES=node argument ${node_ARGS}
+.endif
+
+.if ${NODE_DEFAULT:N[4689]}
+IGNORE?= Invalid NODE_DEFAULT value: ${NODE_DEFAULT}, please select one of ${_NODE_MAJOR_VERSIONS}
+.endif
+
+
+# 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
+.if ${_NODE_VERSION} == ${_NODE_MAJOR_VERSIONS:[-1]}
+# The latest major version always lives in www/node
+_NODE_PORT= node:www/node
+.else
+_NODE_PORT= node:www/node${_NODE_VERSION}
+.endif
+
+
+# Add build, run, and test dependencies as required.
+.if defined(_NODE_BUILD_DEP)
+BUILD_DEPENDS+= ${_NODE_PORT}
+.endif
+.if defined(_NODE_RUN_DEP)
+RUN_DEPENDS+= ${_NODE_PORT}
+.endif
+.if defined(_NODE_TEST_DEP)
+TEST_DEPENDS+= ${_NODE_PORT}
+.endif
+
+
+.endif # _INCLUDE_USES_NODE_MK
Index: Mk/bsd.default-versions.mk
===================================================================
--- Mk/bsd.default-versions.mk
+++ Mk/bsd.default-versions.mk
@@ -16,7 +16,7 @@
LOCALBASE?= /usr/local
.for lang in APACHE BDB EMACS FIREBIRD FORTRAN FPC GCC GHOSTSCRIPT LINUX LUA \
- MYSQL PERL5 PGSQL PHP PYTHON PYTHON2 PYTHON3 RUBY SSL TCLTK
+ MYSQL NODE PERL5 PGSQL PHP PYTHON PYTHON2 PYTHON3 RUBY SSL TCLTK
.if defined(${lang}_DEFAULT)
ERROR+= "The variable ${lang}_DEFAULT is set and it should only be defined through DEFAULT_VERSIONS+=${lang:tl}=${${lang}_DEFAULT} in /etc/make.conf"
.endif
@@ -55,6 +55,8 @@
LUA_DEFAULT?= 5.2
# Possible values: 5.5, 5.6, 5.7, 8.0, 5.5m, 10.0m, 10.1m, 10.2m, 5.5p, 5.6p, 5.7p, 5.6w
MYSQL_DEFAULT?= 5.6
+# Possible values: 4, 6, 8, 9
+NODE_DEFAULT?= 9
# Possible values: 5.22, 5.24, 5.26, devel
.if !exists(${LOCALBASE}/bin/perl) || (!defined(_PORTS_ENV_CHECK) && \
defined(PACKAGE_BUILDING))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 19, 2:08 PM (11 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25583327
Default Alt Text
D11863.id39475.diff (3 KB)
Attached To
Mode
D11863: Add USES=node[:args] for specifying a dependency on Node.js
Attached
Detach File
Event Timeline
Log In to Comment