View | Details | Raw Unified | Return to bug 283109
Collapse All | Expand All

(-)b/databases/mongosh/Makefile (-17 / +19 lines)
Lines 1-18 Link Here
1
PORTNAME=	mongosh
1
PORTNAME=	mongosh
2
DISTVERSIONPREFIX=	v
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	2.2.5
3
DISTVERSION=	2.2.5
4
PORTREVISION=	1
4
CATEGORIES=	databases shells net
5
CATEGORIES=	databases shells net
5
MASTER_SITES=	https://registry.npmjs.org/mongodb-client-encryption/-/:mongocrypt \
6
MASTER_SITES=	https://registry.npmjs.org/mongodb-client-encryption/-/:mongocrypt \
6
		https://registry.npmjs.org/kerberos/-/:kerberos \
7
		https://registry.npmjs.org/kerberos/-/:kerberos \
7
		https://registry.npmjs.org/os-dns-native/-/:dns \
8
		https://registry.npmjs.org/os-dns-native/-/:dns \
8
		https://github.com/${GH_ACCOUNT}/${PORTNAME}/releases/download/${DISTVERSIONFULL}/:modules
9
		https://github.com/${GH_ACCOUNT}/${PORTNAME}/releases/download/${DISTVERSIONFULL}/:modules
9
		# https://nodejs.org/dist/latest-v${NODEJS_VERSION}.x/:node
10
#		https://nodejs.org/dist/latest-v${NODEJS_VERSION}.x/:node
10
DISTFILES=	mongodb-client-encryption-${MONGO_CRYPT_VER}.tgz:mongocrypt \
11
DISTFILES=	mongodb-client-encryption-${MONGO_CRYPT_VER}.tgz:mongocrypt \
11
		kerberos-${KERBEROS_VER}.tgz:kerberos \
12
		kerberos-${KERBEROS_VER}.tgz:kerberos \
12
		os-dns-native-${OSDNSNATIVE_VER}.tgz:dns \
13
		os-dns-native-${OSDNSNATIVE_VER}.tgz:dns \
13
		${NODE_MODULES_TARBALL}:modules \
14
		${NODE_MODULES_TARBALL}:modules \
14
		# ${NODEJS_TARBALL}:node \
15
#		${NODEJS_TARBALL}:node \
15
		# SHASUMS256.txt:node
16
#		SHASUMS256.txt:node
16
DIST_SUBDIR=	${PORTNAME}
17
DIST_SUBDIR=	${PORTNAME}
17
EXTRACT_ONLY=	${DISTFILE_DEFAULT}
18
EXTRACT_ONLY=	${DISTFILE_DEFAULT}
18
19
Lines 22-28 WWW= https://github.com/mongodb-js/mongosh/ Link Here
22
23
23
LICENSE=	APACHE20
24
LICENSE=	APACHE20
24
25
25
BROKEN_aarch64=	fails to compile: nx/src/native/index.js:147 throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
26
#BROKEN_aarch64=	fails to compile: nx/src/native/index.js:147 throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
26
BROKEN_i386=	fails to compile: nx/src/native/index.js:147 throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
27
BROKEN_i386=	fails to compile: nx/src/native/index.js:147 throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
27
28
28
FETCH_DEPENDS=	npm${NODEJS_SUFFIX}>0:www/npm${NODEJS_SUFFIX}
29
FETCH_DEPENDS=	npm${NODEJS_SUFFIX}>0:www/npm${NODEJS_SUFFIX}
Lines 33-44 BUILD_DEPENDS= bash>0:shells/bash \ Link Here
33
		libuv>=1.42.0:devel/libuv \
34
		libuv>=1.42.0:devel/libuv \
34
		objdump:devel/binutils \
35
		objdump:devel/binutils \
35
		git>0:devel/git
36
		git>0:devel/git
36
RUN_DEPENDS=	ca_root_nss>=0:security/ca_root_nss
37
LIB_DEPENDS=	libmongocrypt.so:databases/libmongocrypt \
37
LIB_DEPENDS=	libmongocrypt.so:databases/libmongocrypt \
38
		libbrotlidec.so:archivers/brotli \
38
		libbrotlidec.so:archivers/brotli \
39
		libcares.so:dns/c-ares \
39
		libcares.so:dns/c-ares \
40
		libnghttp2.so:www/libnghttp2 \
40
		libnghttp2.so:www/libnghttp2 \
41
		libuv.so:devel/libuv
41
		libuv.so:devel/libuv
42
RUN_DEPENDS=	ca_root_nss>=0:security/ca_root_nss
42
43
43
USES=		compiler:c++11-lib gmake gssapi:mit localbase pkgconfig nodejs:20,build python:build ssl
44
USES=		compiler:c++11-lib gmake gssapi:mit localbase pkgconfig nodejs:20,build python:build ssl
44
45
Lines 46-63 USE_GITHUB= yes Link Here
46
GH_ACCOUNT=	VultureProject
47
GH_ACCOUNT=	VultureProject
47
GH_PROJECT=	mongosh
48
GH_PROJECT=	mongosh
48
49
49
MPROTECT_DISABLE=	bin/mongosh
50
51
CXXFLAGS+=	-DNODE_API_EXPERIMENTAL \
52
		-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT
53
54
CUSTOM_ENV=	SEGMENT_API_KEY=dummy BUILD_TYPE=dynamic
50
CUSTOM_ENV=	SEGMENT_API_KEY=dummy BUILD_TYPE=dynamic
55
CONFIGURE_ENV=	${CUSTOM_ENV}
51
CONFIGURE_ENV=	${CUSTOM_ENV}
56
MAKE_ENV=	${CUSTOM_ENV} \
52
MAKE_ENV=	${CUSTOM_ENV} \
57
		NODE_JS_VERSION=file://${_DISTDIR}/${NODEJS_TARBALL} \
53
		NODE_JS_VERSION=file://${_DISTDIR}/${NODEJS_TARBALL} \
58
		BOXEDNODE_CONFIGURE_ARGS="--shared-brotli,--shared-cares,--shared-libuv,--shared-nghttp2,--shared-zlib,--shared-openssl,--openssl-use-def-ca-store,--without-npm"
54
		BOXEDNODE_CONFIGURE_ARGS="--shared-brotli,--shared-cares,--shared-libuv,--shared-nghttp2,--shared-zlib,--shared-openssl,--openssl-use-def-ca-store,--without-npm"
55
CXXFLAGS+=	-DNODE_API_EXPERIMENTAL \
56
		-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT
57
59
REINPLACE_ARGS=	-i ''
58
REINPLACE_ARGS=	-i ''
60
59
60
MPROTECT_DISABLE=	bin/mongosh
61
61
MONGO_CRYPT_VER=6.0.0
62
MONGO_CRYPT_VER=6.0.0
62
KERBEROS_VER=	2.1.0
63
KERBEROS_VER=	2.1.0
63
OSDNSNATIVE_VER=1.2.0
64
OSDNSNATIVE_VER=1.2.0
Lines 104-110 do-build: Link Here
104
	cd ${NODE_MODULES_DIR}/${module} && ${MAKE_ENV} ${MAKE_CMD} BUILDTYPE=Release -C build -d
105
	cd ${NODE_MODULES_DIR}/${module} && ${MAKE_ENV} ${MAKE_CMD} BUILDTYPE=Release -C build -d
105
.endfor
106
.endfor
106
	${REINPLACE_CMD} 's/"version": "0.0.0-dev.0"/"version": "${DISTVERSION}"/g' ${WRKSRC}/packages/cli-repl/package.json
107
	${REINPLACE_CMD} 's/"version": "0.0.0-dev.0"/"version": "${DISTVERSION}"/g' ${WRKSRC}/packages/cli-repl/package.json
107
	cd ${WRKSRC} && ${MAKE_ENV} /usr/local/bin/npm run compile-exec
108
	cd ${WRKSRC} && ${MAKE_ENV} ${LOCALBASE}/bin/npm run compile-exec
108
109
109
do-install:
110
do-install:
110
	${INSTALL_PROGRAM} ${WRKSRC}/dist/mongosh ${STAGEDIR}${PREFIX}/bin
111
	${INSTALL_PROGRAM} ${WRKSRC}/dist/mongosh ${STAGEDIR}${PREFIX}/bin
Lines 120-126 npm-pkg-list: extract Link Here
120
		> ${FILESDIR}/npm-pkg.list
121
		> ${FILESDIR}/npm-pkg.list
121
122
122
.for module in mongodb-client-encryption kerberos os-dns-native mongodb-crypt-library-version glibc-version
123
.for module in mongodb-client-encryption kerberos os-dns-native mongodb-crypt-library-version glibc-version
123
	cd ${NODE_MODULES_DIR}/${module} && /usr/local/bin/npm list 2>/dev/null \
124
	cd ${NODE_MODULES_DIR}/${module} && ${LOCALBASE}/bin/npm list 2>/dev/null \
124
		| ${GREP} UNMET \
125
		| ${GREP} UNMET \
125
		| ${AWK} 'BEGIN{FS="UNMET DEPENDENCY "}{print $$2}' \
126
		| ${AWK} 'BEGIN{FS="UNMET DEPENDENCY "}{print $$2}' \
126
		> ${FILESDIR}/npm-pkg-${module}.list
127
		> ${FILESDIR}/npm-pkg-${module}.list
Lines 132-148 node-modules-archive: build Link Here
132
	${MKDIR} -v ${NODE_MODULES_DIR}/${module}
133
	${MKDIR} -v ${NODE_MODULES_DIR}/${module}
133
	${TAR} -xzf ${_DISTDIR}/${module}-*.tgz -C ${NODE_MODULES_DIR}/${module} --strip-components 1
134
	${TAR} -xzf ${_DISTDIR}/${module}-*.tgz -C ${NODE_MODULES_DIR}/${module} --strip-components 1
134
.endfor
135
.endfor
135
	for f in ${FILESDIR}/node-modules-patches/*; do patch -N -d ${WRKSRC} < $$f; done
136
	for f in ${FILESDIR}/node-modules-patches/*; do ${PATCH} -N -d ${WRKSRC} < $$f; done
136
137
137
	cd ${WRKSRC} && npx cross-env PUPPETEER_SKIP_DOWNLOAD=1 /usr/local/bin/npm install --cache ${NPM_CACHE_DIR}
138
	cd ${WRKSRC} && npx cross-env PUPPETEER_SKIP_DOWNLOAD=1 ${LOCALBASE}/bin/npm install --cache ${NPM_CACHE_DIR}
138
139
139
.for module in mongodb-client-encryption kerberos os-dns-native mongodb-crypt-library-version glibc-version
140
.for module in mongodb-client-encryption kerberos os-dns-native mongodb-crypt-library-version glibc-version
140
	/usr/local/bin/npm cache add $$(cat ${FILESDIR}/npm-pkg-${module}.list) --cache ${NPM_CACHE_DIR} || true
141
	${LOCALBASE}/bin/npm cache add $$(cat ${FILESDIR}/npm-pkg-${module}.list) --cache ${NPM_CACHE_DIR} || true
141
	cd ${NODE_MODULES_DIR}/${module} && ${CONFIGURE_ENV} /usr/local/bin/npm install --ignore-scripts --cache ${NPM_CACHE_DIR}
142
	cd ${NODE_MODULES_DIR}/${module} && ${CONFIGURE_ENV} ${LOCALBASE}/bin/npm install --ignore-scripts --cache ${NPM_CACHE_DIR}
142
.endfor
143
.endfor
143
	${FIND} ${WRKSRC} -name "*.orig" -or -name "*.bak" -delete
144
	${FIND} ${WRKSRC} -name "*.orig" -or -name "*.bak" -delete
144
145
145
	cd ${WRKSRC} && ${TAR} -cJf /tmp/${NODE_MODULES_TARBALL} node_modules
146
	cd ${WRKSRC} && ${TAR} -cJf /tmp/${NODE_MODULES_TARBALL} node_modules
146
147
147
.include <bsd.port.mk>
148
.include <bsd.port.pre.mk>
148
.include "${PORTSDIR}/www/node${NODEJS_VERSION}/Makefile.version"
149
.include "${PORTSDIR}/www/node${NODEJS_VERSION}/Makefile.version"
150
.include <bsd.port.post.mk>

Return to bug 283109