diff options
author | pi <pi@FreeBSD.org> | 2016-06-29 20:00:47 +0000 |
---|---|---|
committer | pi <pi@FreeBSD.org> | 2016-06-29 20:00:47 +0000 |
commit | 9015f7119edac6026cc527833e9cfbd0354e6c16 (patch) | |
tree | 02990f1bb916436b65b91ced259ab14355ced166 | |
parent | cccb569d8056940ad44f31b1fa29c5e9aea458a3 (diff) | |
download | FreeBSD-ports-9015f7119edac6026cc527833e9cfbd0354e6c16.zip FreeBSD-ports-9015f7119edac6026cc527833e9cfbd0354e6c16.tar.gz |
www/node[45]: work around build breakages due to include path ordering
Add a post-configure step to strip out all occurrences of
-I${LOCALBASE}/include. Rely instead on USES+=localbase to tell the
compiler where to find includes from external dependencies.
After r416894, node.js builds will use external dependencies instead of
bundled ones. Fallout from this changes includes several build
breakages. All come from the fact that the node-gyp build process adds
-I${LOCALBASE}/include to CFLAGS before all others, including its own
bundled dependencies. This causes the build to incorrectly pick up
include files from any packages in ${LOCALBASE}, rather than the bundled
libraries as intended.
PR: 210618
Submitted by: Bradley T. Hughes <bradleythughes@fastmail.fm> (maintainer)
-rw-r--r-- | www/node/Makefile | 12 | ||||
-rw-r--r-- | www/node4/Makefile | 12 | ||||
-rw-r--r-- | www/node5/Makefile | 12 |
3 files changed, 33 insertions, 3 deletions
diff --git a/www/node/Makefile b/www/node/Makefile index a831f16..5282284 100644 --- a/www/node/Makefile +++ b/www/node/Makefile @@ -19,7 +19,7 @@ OPTIONS_SUB= yes BUNDLED_SSL_DESC= Use node.js's bundled OpenSSL implementation BUNDLED_SSL_USE_OFF= OPENSSL=yes -USES= compiler execinfo gmake python:2,build pkgconfig +USES= compiler execinfo gmake python:2,build pkgconfig localbase HAS_CONFIGURE= yes USE_LDCONFIG= yes @@ -94,6 +94,16 @@ post-patch: ${WRKSRC}/deps/v8/src/d8.gyp \ ${WRKSRC}/node.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 diff --git a/www/node4/Makefile b/www/node4/Makefile index 2b9d4d7..7e11676 100644 --- a/www/node4/Makefile +++ b/www/node4/Makefile @@ -21,7 +21,7 @@ OPTIONS_SUB= yes BUNDLED_SSL_DESC= Use node.js's bundled OpenSSL implementation BUNDLED_SSL_USE_OFF= OPENSSL=yes -USES= compiler execinfo gmake python:2 pkgconfig +USES= compiler execinfo gmake python:2 pkgconfig localbase HAS_CONFIGURE= yes USE_LDCONFIG= yes @@ -91,6 +91,16 @@ post-patch: ${WRKSRC}/node.gyp \ ${WRKSRC}/tools/icu/icu-generic.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 diff --git a/www/node5/Makefile b/www/node5/Makefile index 76ff15e..a89e37f 100644 --- a/www/node5/Makefile +++ b/www/node5/Makefile @@ -23,7 +23,7 @@ OPTIONS_SUB= yes BUNDLED_SSL_DESC= Use node.js's bundled OpenSSL implementation BUNDLED_SSL_USE_OFF= OPENSSL=yes -USES= compiler execinfo gmake python:2 pkgconfig +USES= compiler execinfo gmake python:2 pkgconfig localbase HAS_CONFIGURE= yes USE_LDCONFIG= yes @@ -91,6 +91,16 @@ post-patch: ${WRKSRC}/deps/v8/src/d8.gyp \ ${WRKSRC}/node.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 |