Update sysutils/bacula9-docs to version 9.2.2
[dports.git] / www / node / Makefile
1 # $FreeBSD$
2
3 PORTNAME=       node
4 PORTVERSION=    11.2.0
5 DISTVERSIONPREFIX=      v
6 CATEGORIES=     www
7 MASTER_SITES=   http://nodejs.org/dist/v${PORTVERSION}/
8
9 MAINTAINER=     bhughes@FreeBSD.org
10 COMMENT=        V8 JavaScript for client and server
11
12 LICENSE=        MIT
13 LICENSE_FILE=   ${WRKSRC}/LICENSE
14
15 BROKEN_powerpc64=       fails to build: KeyError: 'action'
16 ONLY_FOR_ARCHS=         aarch64 amd64 armv6 armv7 i386 powerpc64
17
18 OPTIONS_DEFINE=         BUNDLED_SSL DOCS NLS DTRACE
19 OPTIONS_DEFAULT=        BUNDLED_SSL DTRACE
20 OPTIONS_SUB=            yes
21
22 .if !exists(/usr/sbin/dtrace)
23 OPTIONS_EXCLUDE+=       DTRACE
24 .endif
25
26 OPTIONS_EXCLUDE_aarch64=        DTRACE
27 # dt_modtext:/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c(820): arm not implemented
28 OPTIONS_EXCLUDE_armv6=          DTRACE
29 OPTIONS_EXCLUDE_armv7=          DTRACE
30
31 BUNDLED_SSL_DESC=               Use node.js's bundled OpenSSL implementation
32 BUNDLED_SSL_USES_OFF=           ssl
33 BUNDLED_SSL_CONFIGURE_OFF=      --shared-openssl --openssl-use-def-ca-store
34 BUNDLED_SSL_RUN_DEPENDS_OFF=    ca_root_nss>=0:security/ca_root_nss
35
36 NLS_CONFIGURE_ON=       --with-intl=system-icu
37 NLS_LIB_DEPENDS=        libicui18n.so:devel/icu
38
39 DTRACE_CONFIGURE_ON=    --with-dtrace
40
41 USES=           compiler:c++11-lib gmake python:2.7,build pkgconfig \
42                 localbase shebangfix
43
44 HAS_CONFIGURE=  yes
45
46 CONFLICTS_INSTALL=      node[68]-[0-9]* node10-[0-9]*
47
48 CONFIGURE_ARGS= --prefix=${PREFIX_RELDEST} \
49                 --without-npm \
50                 --shared-cares \
51                 --shared-libuv \
52                 --shared-nghttp2 \
53                 --shared-zlib
54
55 SHEBANG_FILES=  tools/specialize_node_d.py tools/genv8constants.py
56
57 PREFIX_RELDEST= ${PREFIX:S,^${DESTDIR},,}
58 REINPLACE_ARGS= -i ''
59 MAKE_ENV+=      CC.host=${CC} CXX.host=${CXX} LINK.host=${CXX} LINK.target=${CXX}
60
61 LIB_DEPENDS+=   libcares.so:dns/c-ares\
62                 libuv.so:devel/libuv \
63                 libnghttp2.so:www/libnghttp2
64
65 .include <bsd.port.options.mk>
66
67 .if empty(PORT_OPTIONS:MBUNDLED_SSL)
68
69 .if ${OPSYS} == FreeBSD && ${SSL_DEFAULT} != openssl111
70 IGNORE=         node.js requires openssl 1.1.0, add DEFAULT_VERSIONS+=ssl=openssl111 to /etc/make.conf or enable BUNDLED_SSL option
71 .endif
72
73 .if !empty(SSL_DEFAULT:Mlibressl*)
74 IGNORE=         cannot build node.js with LibreSSL. You must enable BUNDLED_SSL
75 .endif
76
77 .endif
78
79 .include <bsd.port.pre.mk>
80
81 CONFIGURE_ARGS+=--openssl-no-asm
82
83 .if ${COMPILER_TYPE} == gcc
84 # GCC does not expose std::snprintf() without this define
85 CXXFLAGS+=      -D_GLIBCXX_USE_C99
86 .endif
87
88 post-patch:
89         @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
90                 ${WRKSRC}/deps/v8/gypfiles/v8.gyp
91
92 post-configure:
93         # Post-process Makefile and *.mk files created by node-gyp and remove
94         # all occurrences of -I${LOCALBASE}/include. C*FLAGS include this
95         # before all -I../deps/* for bundled code. This can cause build
96         # breakages if the dependency is installed in ${LOCALBASE}. The
97         # USES+=localbase # above will ensure that we pick up includes for real
98         # external dependencies.
99         ${FIND} ${WRKSRC}/out -type f -print0 \
100                 | ${XARGS} -0 ${REINPLACE_CMD} -e "s|-I${LOCALBASE}/include||g"
101
102 post-install:
103         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/node
104
105 .include <bsd.port.post.mk>