diff options
author | pi <pi@FreeBSD.org> | 2016-06-30 04:00:47 +0800 |
---|---|---|
committer | pi <pi@FreeBSD.org> | 2016-06-30 04:00:47 +0800 |
commit | 028876bb628ced3ce3ad82a7e04439d08ac38cf2 (patch) | |
tree | 02990f1bb916436b65b91ced259ab14355ced166 /www | |
parent | cdffa548897859dbdc4154e2d0f2249522aecd57 (diff) | |
download | freebsd-ports-graphics-028876bb628ced3ce3ad82a7e04439d08ac38cf2.tar.gz freebsd-ports-graphics-028876bb628ced3ce3ad82a7e04439d08ac38cf2.tar.zst freebsd-ports-graphics-028876bb628ced3ce3ad82a7e04439d08ac38cf2.zip |
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)
Diffstat (limited to 'www')
-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 a831f1647a0..5282284bfcb 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 2b9d4d7cb05..7e11676b29c 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 76ff15efb5f..a89e37f012b 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 |