ports/lang/node/Makefile

113 lines
2.8 KiB
Makefile
Raw Normal View History

2023-08-17 00:26:55 +02:00
ONLY_FOR_ARCHS = amd64 aarch64 i386 powerpc64 riscv64
DPB_PROPERTIES = parallel
USE_WXNEEDED = Yes
COMMENT = JavaScript runtime built on Chrome's V8 JavaScript engine
2024-09-19 09:08:57 +02:00
NODE_VERSION = v20.17.0
2023-08-17 00:26:55 +02:00
PLEDGE_VER = 1.1.3
2023-09-26 19:06:53 +02:00
DISTFILES = ${DISTNAME}-headers.tar.gz \
2023-08-17 00:26:55 +02:00
${DISTNAME}.tar.xz
2023-09-26 19:06:53 +02:00
DISTFILES.pledge = node-pledge-{}${PLEDGE_VER}.tar.gz
2023-08-17 00:26:55 +02:00
DISTNAME = node-${NODE_VERSION}
PKGNAME = ${DISTNAME:S/v//g}
EPOCH = 0
2023-09-26 19:06:53 +02:00
SITES.pledge = https://github.com/qbit/node-pledge/archive/
2023-08-17 00:26:55 +02:00
CATEGORIES = lang devel
HOMEPAGE = https://nodejs.org/
MAINTAINER = Volker Schlecht <openbsd-ports@schlecht.dev>
# MIT
PERMIT_PACKAGE = Yes
2023-09-26 19:06:53 +02:00
SITES = ${HOMEPAGE}dist/${NODE_VERSION}/
2023-08-17 00:26:55 +02:00
MODULES = lang/python
WANTLIB += c execinfo m pthread ${COMPILER_LIBCXX}
WANTLIB += z brotlienc brotlidec
WANTLIB += icudata icui18n icuuc cares nghttp2 uv
2024-09-19 09:08:57 +02:00
WANTLIB += lib/eopenssl32/ssl lib/eopenssl32/crypto
2023-08-17 00:26:55 +02:00
COMPILER = base-clang ports-gcc
USE_GMAKE = Yes
CXXFLAGS += -I${WRKSRC}/deps/googletest/include
MAKE_ENV += CXXFLAGS="${CXXFLAGS}"
BUILD_DEPENDS = sysutils/flock
RUN_DEPENDS = devel/gmake \
sysutils/flock
# Needed to build js_native_api_v8_internals.h
TEST_DEPENDS = devel/gtest
TEST_TARGET = check
2023-08-17 00:26:55 +02:00
CONFIGURE_STYLE = simple
CONFIGURE_SCRIPT = configure
CONFIGURE_ARGS = --prefix=${PREFIX} \
--with-intl=system-icu \
--shared-brotli \
--shared-cares \
--shared-libuv \
--shared-nghttp2 \
--shared-zlib \
--shared-openssl \
--shared-openssl-libpath=${EOPENSSL_LIB} \
--shared-openssl-includes=${EOPENSSL_INC}
SUBST_VARS += DISTNAME
SUBST_VARS += WRKDIST
SUBST_VARS += NODE_VERSION
SUBST_VARS += EOPENSSL_LIB
# uses a wide range of OpenSSL API and only really supports boring/openssl
LIB_DEPENDS += archivers/brotli \
net/libcares \
devel/libuv \
2023-08-17 00:26:55 +02:00
textproc/icu4c \
www/nghttp2 \
2024-09-19 09:08:57 +02:00
security/openssl/3.2
2023-08-17 00:26:55 +02:00
2024-09-19 09:08:57 +02:00
EOPENSSL_LIB = ${LOCALBASE}/lib/eopenssl32
EOPENSSL_INC = ${LOCALBASE}/include/eopenssl32
2023-08-17 00:26:55 +02:00
post-extract:
mv ${WRKDIR}/node-pledge-${PLEDGE_VER} \
${WRKSRC}/deps/npm/node_modules/node-pledge
pre-configure:
${SUBST_CMD} ${WRKDIST}/common.gypi \
${WRKDIST}/deps/npm/node_modules/node-gyp/lib/install.js \
${WRKDIST}/src/env.cc \
${WRKDIST}/tools/test.py
post-install:
2024-09-19 09:08:57 +02:00
${MODPY_COMPILEALL} \
${PREFIX}/lib/node_modules/npm/node_modules/node-gyp
2023-08-17 00:26:55 +02:00
${INSTALL_DATA_DIR} ${PREFIX}/share/node
${INSTALL_DATA} ${FULLDISTDIR}/${DISTNAME}-headers.tar.gz \
${PREFIX}/share/node/${DISTNAME}-headers.tar.gz
cd ${PREFIX}/lib/node_modules/npm/node_modules && for x in *; do \
mv $$x ../..; \
ln -s ../../$$x $$x; \
done
# Includes a lot of networking tests that will fail when running as _pbuild
do-test:
cd ${WRKSRC} && \
export HOME=${WRKSRC} && \
ulimit -n $$(ulimit -Hn) && \
ulimit -d $$(ulimit -Hd) && \
${MAKE_PROGRAM} ${TEST_TARGET}
.include <bsd.port.mk>