View | Details | Raw Unified | Return to bug 213947 | Differences between
and this patch

Collapse All | Expand All

(-)b/Mk/Uses/node.mk (+98 lines)
Added Link Here
1
# $FreeBSD$
2
#
3
# Provide support for Node.js
4
#
5
# Feature:      node
6
# Usage:        USES=node, or USES=node:args
7
# Valid ARGS:   <version>, build, run, test
8
#
9
# version	The major version of Node.js required by your port. If omitted,
10
#		the default version is used. The user can choose which Node.js
11
#		version to use as the default using:
12
#
13
# DEFAULT_VERSIONS+=	node=<major version>
14
#
15
# build		Indicates that Node.js is needed at build time and adds
16
#		it to BUILD_DEPENDS.
17
# run		Indicates that Node.js is needed at run time and adds
18
#		it to RUN_DEPENDS.
19
# test		Indicates that Node.js is needed at test time and adds
20
#		it to TEST_DEPENDS.
21
#
22
# If build, run and test are omitted, Node.js will be added as BUILD_DEPENDS,
23
# RUN_DEPENDS and TEST_DEPENDS.
24
#
25
# MAINTAINER:	bradleythughes@fastmail.fm
26
27
.if !defined(_INCLUDE_USES_NODE_MK)
28
_INCLUDE_USES_NODE_MK=    yes
29
30
31
# Please keep this list sorted by ascending major version number. Be sure to
32
# update the comment in Mk/bsd.default-versions.mk when changing this list.
33
_NODE_MAJOR_VERSIONS=	4 6 7
34
35
.if ${node_ARGS:N[467]:Nbuild:Nrun:Ntest}
36
IGNORE?=        Unknown USES=node argument ${node_ARGS}
37
.endif
38
39
.if ${NODE_DEFAULT:N[467]}
40
IGNORE?=        Invalid NODE_DEFAULT value: ${NODE_DEFAULT}, please select one of ${_NODE_MAJOR_VERSIONS}
41
.endif
42
43
44
# Make sure that no dependency or some other environment variable
45
# pollutes the build/run dependency detection
46
.undef _NODE_BUILD_DEP
47
.undef _NODE_RUN_DEP
48
.undef _NODE_TEST_DEP
49
_NODE_ARGS=           ${node_ARGS:S/,/ /g}
50
.if ${_NODE_ARGS:Mbuild}
51
_NODE_BUILD_DEP=      yes
52
_NODE_ARGS:=          ${_NODE_ARGS:Nbuild}
53
.endif
54
.if ${_NODE_ARGS:Mrun}
55
_NODE_RUN_DEP=        yes
56
_NODE_ARGS:=          ${_NODE_ARGS:Nrun}
57
.endif
58
.if ${_NODE_ARGS:Mtest}
59
_NODE_TEST_DEP=       yes
60
_NODE_ARGS:=          ${_NODE_ARGS:Ntest}
61
.endif
62
63
# The port does not specify a build, run or test dependency, assume all are
64
# required.
65
.if !defined(_NODE_BUILD_DEP) && !defined(_NODE_RUN_DEP) && \
66
    !defined(_NODE_TEST_DEP) && !defined(NODE_NO_DEPENDS)
67
_NODE_BUILD_DEP=      yes
68
_NODE_RUN_DEP=        yes
69
_NODE_TEST_DEP=       yes
70
.endif
71
72
73
# The remaining argument, if any, is the Node.js major version to use.
74
_NODE_VERSION=	${_NODE_ARGS:S/.//g}
75
.if empty(_NODE_VERSION)
76
_NODE_VERSION=	${NODE_DEFAULT}
77
.endif
78
.if ${_NODE_VERSION} == ${_NODE_MAJOR_VERSIONS:[-1]}
79
# The latest major version always lives in www/node
80
_NODE_PORT=	node:www/node
81
.else
82
_NODE_PORT=	node:www/node${_NODE_VERSION}
83
.endif
84
85
86
# Add build, run, and test dependencies as required.
87
.if defined(_NODE_BUILD_DEP)
88
BUILD_DEPENDS+=	${_NODE_PORT}
89
.endif
90
.if defined(_NODE_RUN_DEP)
91
RUN_DEPENDS+=	${_NODE_PORT}
92
.endif
93
.if defined(_NODE_TEST_DEP)
94
TEST_DEPENDS+=	${_NODE_PORT}
95
.endif
96
97
98
.endif # _INCLUDE_USES_NODE_MK
(-)b/Mk/bsd.default-versions.mk (-2 / +3 lines)
Lines 15-21 _INCLUDE_BSD_DEFAULT_VERSIONS_MK= yes Link Here
15
15
16
LOCALBASE?=	/usr/local
16
LOCALBASE?=	/usr/local
17
17
18
.for lang in APACHE BDB FIREBIRD FPC GCC GHOSTSCRIPT LINUX LUA MYSQL PERL5 \
18
.for lang in APACHE BDB FIREBIRD FPC GCC GHOSTSCRIPT LINUX LUA MYSQL NODE PERL5 \
19
	PGSQL PHP PYTHON PYTHON2 PYTHON3 RUBY SSL TCLTK
19
	PGSQL PHP PYTHON PYTHON2 PYTHON3 RUBY SSL TCLTK
20
.if defined(${lang}_DEFAULT)
20
.if defined(${lang}_DEFAULT)
21
WARNING+=	"The variable ${lang}_DEFAULT is set and it should only be defined through DEFAULT_VERSIONS+=${lang:tl}=${${lang}_DEFAULT} in /etc/make.conf"
21
WARNING+=	"The variable ${lang}_DEFAULT is set and it should only be defined through DEFAULT_VERSIONS+=${lang:tl}=${${lang}_DEFAULT} in /etc/make.conf"
Lines 51-56 WARNING+= "OVERRIDE_LINUX_BASE_PORT is deprecated, please use DEFAULT_VERSIONS+ Link Here
51
LUA_DEFAULT?=		5.2
51
LUA_DEFAULT?=		5.2
52
# Possible values: 5.1, 5.5, 5.6, 5.7, 5.5m, 10.0m, 10.1m, 5.5p, 5.6p
52
# Possible values: 5.1, 5.5, 5.6, 5.7, 5.5m, 10.0m, 10.1m, 5.5p, 5.6p
53
MYSQL_DEFAULT?=		5.6
53
MYSQL_DEFAULT?=		5.6
54
# Possible values: 4, 6, 7
55
NODE_DEFAULT?=		7
54
# Possible values: 5.20, 5.22, devel
56
# Possible values: 5.20, 5.22, devel
55
.if !exists(${LOCALBASE}/bin/perl) || (!defined(_PORTS_ENV_CHECK) && \
57
.if !exists(${LOCALBASE}/bin/perl) || (!defined(_PORTS_ENV_CHECK) && \
56
    defined(PACKAGE_BUILDING))
58
    defined(PACKAGE_BUILDING))
57
- 

Return to bug 213947