Index: head/www/Makefile =================================================================== --- head/www/Makefile +++ head/www/Makefile @@ -546,6 +546,7 @@ SUBDIR += node SUBDIR += node4 SUBDIR += node6 + SUBDIR += node8 SUBDIR += nostromo SUBDIR += novnc SUBDIR += novnc-websockify Index: head/www/node/Makefile =================================================================== --- head/www/node/Makefile +++ head/www/node/Makefile @@ -42,7 +42,7 @@ HAS_CONFIGURE= yes USE_LDCONFIG= yes -CONFLICTS_INSTALL= node[456]-[0-9]* node01[02]-[0-9]* node-devel-[0-9]* iojs-[0-9]* +CONFLICTS_INSTALL= node[4568]-[0-9]* ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 Index: head/www/node4/Makefile =================================================================== --- head/www/node4/Makefile +++ head/www/node4/Makefile @@ -32,7 +32,7 @@ HAS_CONFIGURE= yes USE_LDCONFIG= yes -CONFLICTS_INSTALL= node[56]-[0-9]* node01[02]-[0-9]* node-[0-9]* node-devel-[0-9]* iojs-[0-9]* +CONFLICTS_INSTALL= node[568]-[0-9]* node-[0-9]* ONLY_FOR_ARCHS= amd64 i386 CONFIGURE_ARGS= --prefix=${PREFIX_RELDEST} \ Index: head/www/node6/Makefile =================================================================== --- head/www/node6/Makefile +++ head/www/node6/Makefile @@ -8,7 +8,7 @@ PKGNAMESUFFIX= 6 MAINTAINER= bhughes@FreeBSD.org -COMMENT= V8 JavaScript for client and server (6.x) +COMMENT= V8 JavaScript for client and server (6.x LTS) LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE @@ -41,7 +41,7 @@ HAS_CONFIGURE= yes USE_LDCONFIG= yes -CONFLICTS_INSTALL= node[45]-[0-9]* node01[02]-[0-9]* node-[0-9]* node-devel-[0-9]* iojs-[0-9]* +CONFLICTS_INSTALL= node[458]-[0-9]* node-[0-9]* ONLY_FOR_ARCHS= amd64 armv6 armv7 i386 Index: head/www/node8/Makefile =================================================================== --- head/www/node8/Makefile +++ head/www/node8/Makefile @@ -0,0 +1,107 @@ +# $FreeBSD$ + +PORTNAME= node +PORTVERSION= 8.9.0 +DISTVERSIONPREFIX= v +CATEGORIES= www +MASTER_SITES= http://nodejs.org/dist/v${PORTVERSION}/ +PKGNAMESUFFIX= 8 + +MAINTAINER= bhughes@FreeBSD.org +COMMENT= V8 JavaScript for client and server (8.x LTS) + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +OPTIONS_DEFINE= BUNDLED_SSL DOCS NLS DTRACE +OPTIONS_DEFAULT=DTRACE +OPTIONS_SUB= yes + +OPTIONS_DEFAULT_FreeBSD_10= BUNDLED_SSL +OPTIONS_DEFAULT+= ${OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}} + +.if !exists(/usr/sbin/dtrace) +OPTIONS_EXCLUDE+= DTRACE +.endif + +OPTIONS_EXCLUDE_FreeBSD_10= DTRACE +OPTIONS_EXCLUDE_aarch64= DTRACE + +BUNDLED_SSL_DESC= Use node.js's bundled OpenSSL implementation +BUNDLED_SSL_USES_OFF= ssl +BUNDLED_SSL_CONFIGURE_OFF= --shared-openssl --openssl-use-def-ca-store +BUNDLED_SSL_RUN_DEPENDS_OFF= ca_root_nss>=0:security/ca_root_nss + +NLS_CONFIGURE_ON= --with-intl=system-icu +NLS_LIB_DEPENDS= libicui18n.so:devel/icu + +DTRACE_CONFIGURE_ON= --with-dtrace + +USES= compiler:c++11-lib gmake python:2,build pkgconfig \ + localbase shebangfix + +HAS_CONFIGURE= yes +USE_LDCONFIG= yes + +CONFLICTS_INSTALL= node[456]-[0-9]* node-[0-9]* + +ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 + +CONFIGURE_ARGS= --prefix=${PREFIX_RELDEST} \ + --without-npm \ + --shared-cares \ + --shared-libuv \ + --shared-zlib + +SHEBANG_FILES= tools/specialize_node_d.py tools/genv8constants.py + +PREFIX_RELDEST= ${PREFIX:S,^${DESTDIR},,} +REINPLACE_ARGS= -i '' +MAKE_ENV+= CC.host=${CC} CXX.host=${CXX} LINK.host=${CXX} LINK.target=${CXX} + +LIB_DEPENDS+= libcares.so:dns/c-ares\ + libuv.so:devel/libuv + +.include + +.if empty(PORT_OPTIONS:MBUNDLED_SSL) + +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100085 && ${SSL_DEFAULT} == base +IGNORE= node.js requires openssl 1.0.2, add DEFAULT_VERSIONS+=ssl=openssl to /etc/make.conf or enable BUNDLED_SSL option +.endif + +.if !empty(SSL_DEFAULT:Mlibressl*) +IGNORE= cannot build node.js with LibreSSL. You must enable BUNDLED_SSL +.endif + +.endif + +.include + +.if ${ARCH} == armv6 || ${ARCH} == armv7 +CONFIGURE_ARGS+=--openssl-no-asm +.endif + +.if ${COMPILER_TYPE} == gcc +# GCC does not expose std::snprintf() without this define +CXXFLAGS+= -D_GLIBCXX_USE_C99 +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \ + ${WRKSRC}/deps/v8/src/v8.gyp + +post-configure: + # Post-process Makefile and *.mk files created by node-gyp and remove + # all occurrences of -I${LOCALBASE}/include. C*FLAGS include this + # before all -I../deps/* for bundled code. This can cause build + # breakages if the dependency is installed in ${LOCALBASE}. The + # USES+=localbase # above will ensure that we pick up includes for real + # external dependencies. + ${FIND} ${WRKSRC}/out -type f -print0 \ + | ${XARGS} -0 ${REINPLACE_CMD} -e "s|-I${LOCALBASE}/include||g" + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/node + +.include Index: head/www/node8/distinfo =================================================================== --- head/www/node8/distinfo +++ head/www/node8/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1509724139 +SHA256 (node-v8.9.0.tar.gz) = 00b422827f37913576f8e5059c84acab364375cfbfcc083652191165f709de6c +SIZE (node-v8.9.0.tar.gz) = 31094211 Index: head/www/node8/files/patch-deps_v8_src_arm_cpu-arm.cc =================================================================== --- head/www/node8/files/patch-deps_v8_src_arm_cpu-arm.cc +++ head/www/node8/files/patch-deps_v8_src_arm_cpu-arm.cc @@ -0,0 +1,22 @@ +--- deps/v8/src/arm/cpu-arm.cc.orig 2017-06-15 11:55:20 UTC ++++ deps/v8/src/arm/cpu-arm.cc +@@ -7,6 +7,9 @@ + #ifdef __QNXNTO__ + #include // for cache flushing. + #undef MAP_TYPE ++#elif defined(__FreeBSD__) ++#include ++#include // for cache flushing. + #else + #include // for cache flushing. + #endif +@@ -24,6 +27,9 @@ void CpuFeatures::FlushICache(void* start, size_t size + #if !defined(USE_SIMULATOR) + #if V8_OS_QNX + msync(start, size, MS_SYNC | MS_INVALIDATE_ICACHE); ++#elif defined(__FreeBSD__) ++ struct arm_sync_icache_args args = { .addr = (uintptr_t)start, .len = size }; ++ sysarch(ARM_SYNC_ICACHE, (void *)&args); + #else + register uint32_t beg asm("r0") = reinterpret_cast(start); + register uint32_t end asm("r1") = beg + size; Index: head/www/node8/files/patch-deps_v8_src_base_cpu.cc =================================================================== --- head/www/node8/files/patch-deps_v8_src_base_cpu.cc +++ head/www/node8/files/patch-deps_v8_src_base_cpu.cc @@ -0,0 +1,19 @@ +--- deps/v8/src/base/cpu.cc.orig 2017-08-09 18:48:10 UTC ++++ deps/v8/src/base/cpu.cc +@@ -607,6 +607,7 @@ CPU::CPU() + + #elif V8_HOST_ARCH_ARM64 + ++#if V8_OS_LINUX + CPUInfo cpu_info; + + // Extract implementor from the "CPU implementer" field. +@@ -640,6 +641,8 @@ CPU::CPU() + } + delete[] part; + } ++ ++#endif // V8_OS_LINUX + + #elif V8_HOST_ARCH_PPC + Index: head/www/node8/files/patch-deps_v8_src_base_platform_platform-freebsd.cc =================================================================== --- head/www/node8/files/patch-deps_v8_src_base_platform_platform-freebsd.cc +++ head/www/node8/files/patch-deps_v8_src_base_platform_platform-freebsd.cc @@ -0,0 +1,51 @@ +--- deps/v8/src/base/platform/platform-freebsd.cc.orig 2017-10-24 19:40:14 UTC ++++ deps/v8/src/base/platform/platform-freebsd.cc +@@ -51,6 +51,48 @@ void* OS::Allocate(const size_t requested, size_t* all + return mbase; + } + ++#ifdef __arm__ ++ ++bool OS::ArmUsingHardFloat() { ++ // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify ++ // the Floating Point ABI used (PCS stands for Procedure Call Standard). ++ // We use these as well as a couple of other defines to statically determine ++ // what FP ABI used. ++ // GCC versions 4.4 and below don't support hard-fp. ++ // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or ++ // __ARM_PCS_VFP. ++ ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) ++#if GCC_VERSION >= 40600 ++#if defined(__ARM_PCS_VFP) ++ return true; ++#else ++ return false; ++#endif ++ ++#elif GCC_VERSION < 40500 ++ return false; ++ ++#else ++#if defined(__ARM_PCS_VFP) ++ return true; ++#elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \ ++ !defined(__VFP_FP__) ++ return false; ++#else ++#error "Your version of GCC does not report the FP ABI compiled for." \ ++ "Please report it on this issue" \ ++ "http://code.google.com/p/v8/issues/detail?id=2140" ++ ++#endif ++#endif ++#undef GCC_VERSION ++} ++ ++#endif // def __arm__ ++ + + static unsigned StringToLong(char* buffer) { + return static_cast(strtol(buffer, NULL, 16)); // NOLINT Index: head/www/node8/files/patch-deps_v8_src_libsampler_sampler.cc =================================================================== --- head/www/node8/files/patch-deps_v8_src_libsampler_sampler.cc +++ head/www/node8/files/patch-deps_v8_src_libsampler_sampler.cc @@ -0,0 +1,15 @@ +--- deps/v8/src/libsampler/sampler.cc.orig 2017-10-24 19:40:19 UTC ++++ deps/v8/src/libsampler/sampler.cc +@@ -506,9 +506,9 @@ void SignalHandler::FillRegisterState(void* context, R + state->sp = reinterpret_cast(mcontext.mc_rsp); + state->fp = reinterpret_cast(mcontext.mc_rbp); + #elif V8_HOST_ARCH_ARM +- state->pc = reinterpret_cast(mcontext.mc_r15); +- state->sp = reinterpret_cast(mcontext.mc_r13); +- state->fp = reinterpret_cast(mcontext.mc_r11); ++ state->pc = reinterpret_cast(mcontext.__gregs[_REG_PC]); ++ state->sp = reinterpret_cast(mcontext.__gregs[_REG_SP]); ++ state->fp = reinterpret_cast(mcontext.__gregs[_REG_FP]); + #endif // V8_HOST_ARCH_* + #elif V8_OS_NETBSD + #if V8_HOST_ARCH_IA32 Index: head/www/node8/pkg-descr =================================================================== --- head/www/node8/pkg-descr +++ head/www/node8/pkg-descr @@ -0,0 +1,6 @@ +Node.js is a JavaScript runtime built on Chrome's V8 JavaScript +engine. Node.js uses an event-driven, non-blocking I/O model that +makes it lightweight and efficient. Node.js' package ecosystem, +npm, is the largest ecosystem of open source libraries in the world. + +WWW: http://nodejs.org/ Index: head/www/node8/pkg-message =================================================================== --- head/www/node8/pkg-message +++ head/www/node8/pkg-message @@ -0,0 +1 @@ +Note: If you need npm (Node Package Manager), please install www/npm. Index: head/www/node8/pkg-plist =================================================================== --- head/www/node8/pkg-plist +++ head/www/node8/pkg-plist @@ -0,0 +1,124 @@ +bin/node +include/node/common.gypi +include/node/config.gypi +include/node/libplatform/libplatform.h +include/node/libplatform/libplatform-export.h +include/node/libplatform/v8-tracing.h +include/node/node.h +include/node/node_api.h +include/node/node_api_types.h +include/node/node_buffer.h +include/node/node_object_wrap.h +include/node/node_version.h +%%BUNDLED_SSL%%include/node/openssl/aes.h +%%BUNDLED_SSL%%include/node/openssl/archs/BSD-x86/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/BSD-x86_64/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/VC-WIN32/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/VC-WIN64A/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/aix-gcc/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/aix64-gcc/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/darwin-i386-cc/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/darwin64-x86_64-cc/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux-aarch64/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux-armv4/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux-elf/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux-ppc/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux-ppc64/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux-x32/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux-x86_64/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux32-s390x/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/linux64-s390x/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/solaris-x86-gcc/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/archs/solaris64-x86_64-gcc/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/asn1.h +%%BUNDLED_SSL%%include/node/openssl/asn1_mac.h +%%BUNDLED_SSL%%include/node/openssl/asn1t.h +%%BUNDLED_SSL%%include/node/openssl/bio.h +%%BUNDLED_SSL%%include/node/openssl/blowfish.h +%%BUNDLED_SSL%%include/node/openssl/bn.h +%%BUNDLED_SSL%%include/node/openssl/buffer.h +%%BUNDLED_SSL%%include/node/openssl/camellia.h +%%BUNDLED_SSL%%include/node/openssl/cast.h +%%BUNDLED_SSL%%include/node/openssl/cmac.h +%%BUNDLED_SSL%%include/node/openssl/cms.h +%%BUNDLED_SSL%%include/node/openssl/comp.h +%%BUNDLED_SSL%%include/node/openssl/conf.h +%%BUNDLED_SSL%%include/node/openssl/conf_api.h +%%BUNDLED_SSL%%include/node/openssl/crypto.h +%%BUNDLED_SSL%%include/node/openssl/des.h +%%BUNDLED_SSL%%include/node/openssl/des_old.h +%%BUNDLED_SSL%%include/node/openssl/dh.h +%%BUNDLED_SSL%%include/node/openssl/dsa.h +%%BUNDLED_SSL%%include/node/openssl/dso.h +%%BUNDLED_SSL%%include/node/openssl/dtls1.h +%%BUNDLED_SSL%%include/node/openssl/e_os2.h +%%BUNDLED_SSL%%include/node/openssl/ebcdic.h +%%BUNDLED_SSL%%include/node/openssl/ec.h +%%BUNDLED_SSL%%include/node/openssl/ecdh.h +%%BUNDLED_SSL%%include/node/openssl/ecdsa.h +%%BUNDLED_SSL%%include/node/openssl/engine.h +%%BUNDLED_SSL%%include/node/openssl/err.h +%%BUNDLED_SSL%%include/node/openssl/evp.h +%%BUNDLED_SSL%%include/node/openssl/hmac.h +%%BUNDLED_SSL%%include/node/openssl/idea.h +%%BUNDLED_SSL%%include/node/openssl/krb5_asn.h +%%BUNDLED_SSL%%include/node/openssl/kssl.h +%%BUNDLED_SSL%%include/node/openssl/lhash.h +%%BUNDLED_SSL%%include/node/openssl/md4.h +%%BUNDLED_SSL%%include/node/openssl/md5.h +%%BUNDLED_SSL%%include/node/openssl/mdc2.h +%%BUNDLED_SSL%%include/node/openssl/modes.h +%%BUNDLED_SSL%%include/node/openssl/obj_mac.h +%%BUNDLED_SSL%%include/node/openssl/objects.h +%%BUNDLED_SSL%%include/node/openssl/ocsp.h +%%BUNDLED_SSL%%include/node/openssl/opensslconf.h +%%BUNDLED_SSL%%include/node/openssl/opensslv.h +%%BUNDLED_SSL%%include/node/openssl/ossl_typ.h +%%BUNDLED_SSL%%include/node/openssl/pem.h +%%BUNDLED_SSL%%include/node/openssl/pem2.h +%%BUNDLED_SSL%%include/node/openssl/pkcs12.h +%%BUNDLED_SSL%%include/node/openssl/pkcs7.h +%%BUNDLED_SSL%%include/node/openssl/pqueue.h +%%BUNDLED_SSL%%include/node/openssl/rand.h +%%BUNDLED_SSL%%include/node/openssl/rc2.h +%%BUNDLED_SSL%%include/node/openssl/rc4.h +%%BUNDLED_SSL%%include/node/openssl/ripemd.h +%%BUNDLED_SSL%%include/node/openssl/rsa.h +%%BUNDLED_SSL%%include/node/openssl/safestack.h +%%BUNDLED_SSL%%include/node/openssl/seed.h +%%BUNDLED_SSL%%include/node/openssl/sha.h +%%BUNDLED_SSL%%include/node/openssl/srp.h +%%BUNDLED_SSL%%include/node/openssl/srtp.h +%%BUNDLED_SSL%%include/node/openssl/ssl.h +%%BUNDLED_SSL%%include/node/openssl/ssl2.h +%%BUNDLED_SSL%%include/node/openssl/ssl23.h +%%BUNDLED_SSL%%include/node/openssl/ssl3.h +%%BUNDLED_SSL%%include/node/openssl/stack.h +%%BUNDLED_SSL%%include/node/openssl/symhacks.h +%%BUNDLED_SSL%%include/node/openssl/tls1.h +%%BUNDLED_SSL%%include/node/openssl/ts.h +%%BUNDLED_SSL%%include/node/openssl/txt_db.h +%%BUNDLED_SSL%%include/node/openssl/ui.h +%%BUNDLED_SSL%%include/node/openssl/ui_compat.h +%%BUNDLED_SSL%%include/node/openssl/whrlpool.h +%%BUNDLED_SSL%%include/node/openssl/x509.h +%%BUNDLED_SSL%%include/node/openssl/x509_vfy.h +%%BUNDLED_SSL%%include/node/openssl/x509v3.h +include/node/v8-debug.h +include/node/v8-inspector-protocol.h +include/node/v8-inspector.h +include/node/v8-platform.h +include/node/v8-profiler.h +include/node/v8-testing.h +include/node/v8-util.h +include/node/v8-value-serializer-version.h +include/node/v8-version.h +include/node/v8-version-string.h +include/node/v8.h +include/node/v8config.h +%%DTRACE%%lib/dtrace/node.d +@(,,444) man/man1/node.1.gz +%%PORTDOCS%%%%DOCSDIR%%/gdbinit +%%PORTDOCS%%%%DOCSDIR%%/lldb_commands.py +%%PORTDOCS%%%%DOCSDIR%%/lldbinit +share/systemtap/tapset/node.stp