Added
Link Here
|
1 |
PORTNAME= mongosh |
2 |
DISTVERSION= 2.2.5 |
3 |
CATEGORIES= databases net |
4 |
|
5 |
MAINTAINER= fabien.amelinck@advens.fr |
6 |
COMMENT= MongoDB Shell CLI REPL |
7 |
WWW= https://github.com/mongodb-js/mongosh/ |
8 |
|
9 |
LICENSE= APACHE20 |
10 |
|
11 |
PATCH_DEPENDS= npm${NODEJS_SUFFIX}>0:www/npm${NODEJS_SUFFIX} |
12 |
BUILD_DEPENDS= bash>0:shells/bash \ |
13 |
git>0:devel/git \ |
14 |
brotli>=1.0.9,1:archivers/brotli \ |
15 |
c-ares>=1.17.2:dns/c-ares \ |
16 |
libnghttp2>=1.45.1:www/libnghttp2 \ |
17 |
libuv>=1.42.0:devel/libuv \ |
18 |
objdump:devel/binutils \ |
19 |
${PREFIX}/include/gssapi/gssapi_generic.h:security/krb5 |
20 |
RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss |
21 |
LIB_DEPENDS= libmongocrypt.so:databases/libmongocrypt \ |
22 |
libbrotlidec.so:archivers/brotli \ |
23 |
libcares.so:dns/c-ares \ |
24 |
libnghttp2.so:www/libnghttp2 \ |
25 |
libuv.so:devel/libuv |
26 |
|
27 |
USES= compiler:c++11-lib gmake localbase pkgconfig nodejs:20,build python:build ssl |
28 |
|
29 |
USE_GITHUB= yes |
30 |
GH_ACCOUNT= mongodb-js |
31 |
GH_PROJECT= mongosh |
32 |
GH_TAGNAME= v${DISTVERSION} |
33 |
|
34 |
MPROTECT_DISABLE= bin/mongosh |
35 |
|
36 |
CUSTOM_ENV= SEGMENT_API_KEY=dummy BUILD_TYPE=dynamic |
37 |
CONFIGURE_ENV= ${CUSTOM_ENV} |
38 |
MAKE_ENV= ${CUSTOM_ENV} BOXEDNODE_CONFIGURE_ARGS="--shared-brotli,--shared-cares,--shared-libuv,--shared-nghttp2,--shared-zlib,--shared-openssl,--openssl-use-def-ca-store,--without-npm" |
39 |
|
40 |
post-fetch: |
41 |
.if !exists(${DISTDIR}/mongodb-client-encryption-6.0.0.tgz) |
42 |
${FETCH_CMD} -o ${DISTDIR} https://registry.npmjs.org/mongodb-client-encryption/-/mongodb-client-encryption-6.0.0.tgz |
43 |
${FETCH_CMD} -o ${DISTDIR} https://registry.npmjs.org/kerberos/-/kerberos-2.1.0.tgz |
44 |
${FETCH_CMD} -o ${DISTDIR} https://registry.npmjs.org/os-dns-native/-/os-dns-native-1.2.0.tgz |
45 |
# ${MKDIR} -v /tmp/boxednode/${PORTNAME} |
46 |
# ${FETCH_CMD} -o /tmp/boxednode/${PORTNAME} https://nodejs.org/dist/v20.14.0/node-v20.14.0.tar.gz |
47 |
.endif |
48 |
|
49 |
post-extract: |
50 |
${MKDIR} -v ${WRKSRC}/node_modules/mongodb-client-encryption ${WRKSRC}/node_modules/kerberos ${WRKSRC}/node_modules/os-dns-native |
51 |
${TAR} -xzf ${DISTDIR}/mongodb-client-encryption-6.0.0.tgz -C ${WRKSRC}/node_modules/mongodb-client-encryption --strip-components 1 |
52 |
${TAR} -xzf ${DISTDIR}/kerberos-2.1.0.tgz -C ${WRKSRC}/node_modules/kerberos --strip-components 1 |
53 |
${TAR} -xzf ${DISTDIR}/os-dns-native-1.2.0.tgz -C ${WRKSRC}/node_modules/os-dns-native --strip-components 1 |
54 |
|
55 |
post-patch: |
56 |
cd ${WRKSRC} && npx cross-env PUPPETEER_SKIP_DOWNLOAD=1 npm install |
57 |
|
58 |
${PATCH} -d ${WRKSRC} < ${FILESDIR}/node-patches/node__modules_boxednode_lib_index.js |
59 |
${FIND} ${WRKSRC}/scripts/ -name "*.orig" -delete |
60 |
${CP} -vf ${FILESDIR}/node-patches/00* ${WRKSRC}/scripts/nodejs-patches |
61 |
|
62 |
do-configure: |
63 |
.for module in mongodb-client-encryption kerberos os-dns-native |
64 |
cd ${WRKSRC}/node_modules/${module} && ${CONFIGURE_ENV} node-gyp configure |
65 |
.endfor |
66 |
${RM} -r ${WRKDIR}/.cache/node-gyp/20.12.2/include/node/openssl |
67 |
|
68 |
do-build: |
69 |
.for module in mongodb-client-encryption kerberos os-dns-native |
70 |
cd ${WRKSRC}/node_modules/${module} && ${MAKE_CMD} BUILDTYPE=Release -C build -d |
71 |
.endfor |
72 |
${REINPLACE_CMD} 's/"version": "0.0.0-dev.0"/"version": "${DISTVERSION}"/g' ${WRKSRC}/packages/cli-repl/package.json |
73 |
cd ${WRKSRC} && ${MAKE_ENV} npm run compile-exec |
74 |
|
75 |
do-install: |
76 |
${INSTALL_PROGRAM} ${WRKSRC}/dist/mongosh ${STAGEDIR}${PREFIX}/bin |
77 |
|
78 |
.include <bsd.port.mk> |