FreeBSD Bugzilla – Attachment 178461 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]
USES=node
0001-Add-USES-node-args-for-specifying-a-dependency-on-Nod.diff (text/plain), 4.77 KB, created by
Bradley T. Hughes
on 2017-01-02 20:33:45 UTC
(
hide
)
Description:
USES=node
Filename:
MIME Type:
Creator:
Bradley T. Hughes
Created:
2017-01-02 20:33:45 UTC
Size:
4.77 KB
patch
obsolete
>From 259fda055d273a31c44cc098c297cf8f180b7e36 Mon Sep 17 00:00:00 2001 >From: "Bradley T. Hughes" <bradleythughes@fastmail.fm> >Date: Sun, 30 Oct 2016 21:22:35 +0000 >Subject: [PATCH 1/2] 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. A port can specify which >major version it needs. If the port does not explicitly set a version, >use a default which can be overridden by the user. Current possible >values are 4, 6, and 7, which correspond to the active LTS and Current >releases from upstream. >--- > Mk/Uses/node.mk | 98 ++++++++++++++++++++++++++++++++++++++++++++++ > Mk/bsd.default-versions.mk | 4 +- > 2 files changed, 101 insertions(+), 1 deletion(-) > create mode 100644 Mk/Uses/node.mk > >diff --git a/Mk/Uses/node.mk b/Mk/Uses/node.mk >new file mode 100644 >index 000000000000..b7f3556fd2de >--- /dev/null >+++ b/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: bradleythughes@fastmail.fm >+ >+.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 7 >+ >+.if ${node_ARGS:N[467]:Nbuild:Nrun:Ntest} >+IGNORE?= Unknown USES=node argument ${node_ARGS} >+.endif >+ >+.if ${NODE_DEFAULT:N[467]} >+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 >diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk >index 699dad3faf98..4efce26efd92 100644 >--- a/Mk/bsd.default-versions.mk >+++ b/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: 4, 6, 7 >+NODE_DEFAULT?= 7 > # Possible values: 5.20, 5.22, devel > .if !exists(${LOCALBASE}/bin/perl) || (!defined(_PORTS_ENV_CHECK) && \ > defined(PACKAGE_BUILDING)) >-- >2.11.0 >
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
Flags:
bhughes
:
maintainer-approval?
(
portmgr
)
Actions:
View
|
Diff
Attachments on
bug 213947
:
176338
|
176398
|
176879
| 178461