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: , 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= +# +# 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 8 + +.if ${node_ARGS:N[468]:Nbuild:Nrun:Ntest} +IGNORE?= Unknown USES=node argument ${node_ARGS} +.endif + +.if ${NODE_DEFAULT:N[468]} +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 @@ -15,7 +15,7 @@ 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" @@ -56,6 +56,8 @@ LUA_DEFAULT?= 5.2 # Possible values: 5.1, 5.5, 5.6, 5.7, 8.0, 5.5m, 10.0m, 10.1m, 5.5p, 5.6p, 5.7p, 5.6w MYSQL_DEFAULT?= 5.6 +# Possible values: 4, 6, 8 +NODE_DEFAULT?= 6 # Possible values: 5.22, 5.24, 5.26, devel .if !exists(${LOCALBASE}/bin/perl) || (!defined(_PORTS_ENV_CHECK) && \ defined(PACKAGE_BUILDING)) Index: www/npm/Makefile =================================================================== --- www/npm/Makefile +++ www/npm/Makefile @@ -3,7 +3,7 @@ PORTNAME= npm PORTVERSION= 5.3.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES= LOCAL/sunpoet @@ -12,15 +12,14 @@ LICENSE= MIT -RUN_DEPENDS= gmake:devel/gmake \ - node>=0.8.0:www/node +RUN_DEPENDS= gmake:devel/gmake CONFLICTS_INSTALL= npm2 npm3 npm4 NO_ARCH= yes NO_BUILD= yes REINPLACE_ARGS= -i '' -USES= cpe python:2,run shebangfix tar:xz +USES= cpe node python:2,run shebangfix tar:xz CPE_VENDOR= npmjs CPE_PRODUCT= node_packaged_modules Index: www/yarn/Makefile =================================================================== --- www/yarn/Makefile +++ www/yarn/Makefile @@ -3,27 +3,21 @@ PORTNAME= yarn DISTVERSIONPREFIX= v DISTVERSION= 0.27.5 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://yarnpkg.com/downloads/${PORTVERSION}/ MAINTAINER= luca.pizzamiglio@gmail.com COMMENT= Package manager for node, alternative to npm +RUN_DEPENDS= gmake:devel/gmake + LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE WRKSRC= ${WRKDIR}/dist -OPTIONS_SINGLE= BACKEND -OPTIONS_SINGLE_BACKEND= NODE4 NODE6 NODE -OPTIONS_DEFAULT= NODE -NODE_DESC= Use www/node as backend -NODE6_DESC= Use www/node6 as backend -NODE4_DESC= Use www/node4 as backend - -NODE_RUN_DEPENDS= node>=0.8.0:www/node -NODE6_RUN_DEPENDS= node6>=0.8.0:www/node6 -NODE4_RUN_DEPENDS= node4>=0.8.0:www/node4 +USES= node CONFLICTS_INSTALL= hadoop-2*