Skip to content
Permalink
Browse files

nodejs6: fix build on older systems

allows build on < 10.7
  • Loading branch information
kencu committed Apr 22, 2019
1 parent 2c705e7 commit 885e9674b88647ab441c6bfb71e28a45549e1fcf
Showing with 30 additions and 7 deletions.
  1. +11 −7 devel/nodejs6/Portfile
  2. +19 −0 devel/nodejs6/files/patch-nodejs6-old-tr1-calls.diff
@@ -49,6 +49,11 @@ configure.python ${prefix}/bin/python2.7
patchfiles patch-common.gypi.diff \
patch-tools-gyp-pylib-gyp-generator-make.py.diff

if { ${configure.cxx_stdlib} eq "libc++" } {
# libc++ headers don't put this in <tr1/>
patchfiles-append patch-nodejs6-old-tr1-calls.diff
}

post-patch {
foreach f [concat ${worksrcpath}/configure \
${worksrcpath}/tools/gyp/gyp \
@@ -65,6 +70,12 @@ post-patch {
reinplace "s|/usr/bin/env node|${prefix}/bin/node|" ${worksrcpath}/tools/doc/node_modules/marked/bin/marked
}

# We'll use the system libuv instead, as it is fixed for older systems
if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
depends_lib-append path:lib/libuv.dylib:libuv
configure.args-append --shared-libuv
}

configure.args-append --without-npm
configure.args-append --with-intl=system-icu
configure.args-append --shared-openssl
@@ -205,13 +216,6 @@ destroot {
${docdir}
}

if {${os.major} < 11} {
pre-fetch {
ui_error "${name} ${version} requires Mac OS X 10.7 or greater."
return -code error "incompatible Mac OS X version"
}
}

livecheck.url ${homepage}dist/
livecheck.type regex
livecheck.regex {v(6\.\d+\.\d+)}
@@ -0,0 +1,19 @@
--- src/util.h.orig 2019-04-21 18:08:50.000000000 -0700
+++ src/util.h 2019-04-21 18:10:53.000000000 -0700
@@ -12,16 +12,7 @@
#include <stdlib.h>
#include <string.h>

-// OSX 10.9 defaults to libc++ which provides a C++11 <type_traits> header.
-#if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090
-#define USE_TR1_TYPE_TRAITS
-#endif
-
-#ifdef USE_TR1_TYPE_TRAITS
-#include <tr1/type_traits> // NOLINT(build/c++tr1)
-#else
#include <type_traits> // std::remove_reference
-#endif

namespace node {

0 comments on commit 885e967

Please sign in to comment.
You can’t perform that action at this time.