Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jul 2024 11:45:57 GMT
From:      Ronald Klop <ronald@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 500a61f19f42 - main - databases/compass: Powerful GUI for MongoDB (v1.43.0)
Message-ID:  <202407231145.46NBjv6I050330@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by ronald:

URL: https://cgit.FreeBSD.org/ports/commit/?id=500a61f19f4294c12faac37a0c8ca4a4e544c9db

commit 500a61f19f4294c12faac37a0c8ca4a4e544c9db
Author:     Hiroo Ono <hiroo.ono+freebsd@gmail.com>
AuthorDate: 2024-07-23 08:09:30 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2024-07-23 11:45:10 +0000

    databases/compass: Powerful GUI for MongoDB (v1.43.0)
    
    New port.
    
    https://www.mongodb.com/products/tools/compass
    https://github.com/mongodb-js/compass
    
    PR: 272180
---
 databases/Makefile                                 |    1 +
 databases/compass/Makefile                         |  514 +++++
 databases/compass/distinfo                         |   41 +
 databases/compass/files/electron-packager.patch    |   57 +
 databases/compass/files/fs-xattr.patch             |  157 ++
 databases/compass/files/kerberos-heimdal.patch     |   82 +
 databases/compass/files/kerberos.patch             |   54 +
 .../compass/files/mongodb-client-encryption.patch  |   11 +
 databases/compass/files/mongodb-compass.desktop    |   12 +
 databases/compass/files/mongodb-js-zstd.patch      |  133 ++
 databases/compass/files/napi-cli.patch             |  129 ++
 databases/compass/files/os-dns-native.patch        |   12 +
 databases/compass/files/package-additional.list    |    2 +
 databases/compass/files/package-compass.list       | 2260 ++++++++++++++++++++
 databases/compass/files/package-confecc.list       |    2 +
 databases/compass/files/package-confwcc.list       |   25 +
 databases/compass/files/package-fsxattr.list       |  104 +
 databases/compass/files/package-gypcache.list      |   15 +
 databases/compass/files/package-kerberos.list      |  608 ++++++
 databases/compass/files/package-mongoclienc.list   |   42 +
 databases/compass/files/package-osdnsnative.list   |   13 +
 databases/compass/files/package-prebuild.list      |   36 +
 ...h-configs_webpack-config-compass_src_loaders.ts |   26 +
 databases/compass/files/patch-package-lock.json    |  476 +++++
 .../patch-packages_compass-e2e-tests_package.json  |   20 +
 .../files/patch-packages_compass_package.json      |   19 +
 .../files/patch-packages_hadron-build_cli.js       |   12 +
 ...patch-packages_hadron-build_commands_release.js |   32 +
 .../patch-packages_hadron-build_lib_target.js      |   26 +
 .../files/patch-packages_hadron-build_lib_zip.js   |   14 +
 .../compass/files/patch-scripts_check-docs-link.js |   13 +
 databases/compass/files/xattr.h                    |   40 +
 databases/compass/files/xattr_api.c                |  229 ++
 databases/compass/pkg-descr                        |    4 +
 databases/compass/pkg-plist                        |  176 ++
 35 files changed, 5397 insertions(+)

diff --git a/databases/Makefile b/databases/Makefile
index a48c28daf7f0..f45f98b58c94 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -35,6 +35,7 @@
     SUBDIR += closql
     SUBDIR += closql-devel
     SUBDIR += cockroach
+    SUBDIR += compass
     SUBDIR += couchdb3
     SUBDIR += courier-authlib-mysql
     SUBDIR += courier-authlib-pgsql
diff --git a/databases/compass/Makefile b/databases/compass/Makefile
new file mode 100644
index 000000000000..7751a79644e6
--- /dev/null
+++ b/databases/compass/Makefile
@@ -0,0 +1,514 @@
+PORTNAME=	compass
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.43.0
+CATEGORIES=	databases
+MASTER_SITES=	https://cloud.mongodb.com/static/font/:fonts \
+		https://registry.npmjs.org/fs-xattr/-/:fs_xattr \
+		https://registry.npmjs.org/kerberos/-/:kerberos \
+		https://registry.npmjs.org/mongodb-client-encryption/-/:mongoclienc \
+		https://registry.npmjs.org/os-dns-native/-/:dns
+DISTFILES=	EuclidCircularA-Semibold-WebXL.woff2:fonts \
+		EuclidCircularA-Semibold-WebXL.woff:fonts \
+		EuclidCircularA-SemiboldItalic-WebXL.woff2:fonts \
+		EuclidCircularA-SemiboldItalic-WebXL.woff:fonts \
+		EuclidCircularA-Medium-WebXL.woff2:fonts \
+		EuclidCircularA-Medium-WebXL.woff:fonts \
+		EuclidCircularA-MediumItalic-WebXL.woff2:fonts \
+		EuclidCircularA-MediumItalic-WebXL.woff:fonts \
+		EuclidCircularA-Regular-WebXL.woff2:fonts \
+		EuclidCircularA-Regular-WebXL.woff:fonts \
+		EuclidCircularA-RegularItalic-WebXL.woff2:fonts \
+		EuclidCircularA-RegularItalic-WebXL.woff:fonts \
+		fs-xattr-${NPM_FSXATTR_VER}.tgz:fs_xattr \
+		kerberos-${NPM_KERBEROS_VER}.tgz:kerberos \
+		mongodb-client-encryption-${MONGO_CLIENC_VER}.tgz:mongoclienc \
+		os-dns-native-${NPM_OSDNSNATIVE_VER}.tgz:dns
+DIST_SUBDIR=	${PORTNAME}
+EXTRACT_ONLY=	${DISTFILE_DEFAULT}
+
+MAINTAINER=	hiroo.ono+freebsd@gmail.com
+COMMENT=	The GUI for MongoDB
+WWW=		https://www.mongodb.com/products/compass/
+
+LICENSE=	SSPLv1
+LICENSE_NAME=	Server Side Public License
+LICENSE_FILE=	${WRKSRC}/LICENSE
+LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+DISTCACHEFILES=	${DISTCACHEFILE_npm} \
+		${DISTCACHEFILE_gyp} \
+		${DISTCACHEFILE_yarn} \
+		${DISTCACHEFILE_cargo}
+DISTCACHEFILE_npm=	${DISTDIR}/${DIST_SUBDIR}/dotnpm-${DISTVERSION}.tar.xz
+DISTCACHEFILE_gyp=	${DISTDIR}/${DIST_SUBDIR}/dotgyp-${DISTVERSION}.tar.xz
+DISTCACHEFILE_yarn=	${DISTDIR}/${DIST_SUBDIR}/dotyarn-${DISTVERSION}.tar.xz
+DISTCACHEFILE_cargo=	${DISTDIR}/${DIST_SUBDIR}/dotcargo-${DISTVERSION}.tar.xz
+APPMODFILE=	${WRKDIR}/compass_node_modules.tar
+
+ONLY_FOR_ARCHS=	aarch64 amd64
+USES=		gettext-runtime gl gnome iconv jpeg nodejs:env python:build \
+		xorg
+USE_GL=		gbm gl
+USE_GNOME=	atk cairo gdkpixbuf2 glib20 gtk30 libxml2 libxslt pango
+USE_XORG=	x11 xcb xcomposite xdamage xext xfixes xi xrandr xrender xtst
+USE_LDCONFIG=	${DATADIR}
+
+USE_GITHUB=	yes
+GH_TUPLE=	mongodb-js:compass:${DISTVERSIONPREFIX}${DISTVERSION} \
+		mongodb-js:reflux-state-mixin:e050454cb3be029c3e7fd2ee6a08111e4d15161f:reflux \
+		mongodb-js:zstd:${DISTVERSIONPREFIX}${MONGO_ZSTD_VER}:zstd \
+		napi-rs:napi-rs:@napi-rs/cli@${NPM_NAPI_VER}:napi
+
+FETCH_DEPENDS=	npm-node${NODEJS_VERSION}>0:www/npm-node${NODEJS_VERSION} \
+		yarn-node${NODEJS_VERSION}>0:www/yarn-node${NODEJS_VERSION} \
+		cargo:lang/rust
+# Do not use USES=cmake, because compass itself does not build with cmake.
+# The npm module it depends on uses cmake to build.
+BUILD_DEPENDS=	electron${ELECTRON_VER_MAJOR}:devel/electron${ELECTRON_VER_MAJOR} \
+		npm-node${NODEJS_VERSION}>0:www/npm-node${NODEJS_VERSION} \
+		yarn-node${NODEJS_VERSION}>0:www/yarn-node${NODEJS_VERSION} \
+		cmake:devel/cmake-core \
+		cargo:lang/rust \
+		pkg-config:devel/pkgconf \
+		zip:archivers/zip
+LIB_DEPENDS=	libmongocrypt.so:databases/libmongocrypt \
+		libatk-bridge-2.0.so:accessibility/at-spi2-core \
+		libatspi.so:accessibility/at-spi2-core \
+		libFLAC.so:audio/flac \
+		libopus.so:audio/opus \
+		libdbus-1.so:devel/dbus \
+		libicuuc.so:devel/icu \
+		libepoll-shim.so:devel/libepoll-shim \
+		libevent.so:devel/libevent \
+		libffi.so:devel/libffi \
+		libnotify.so:devel/libnotify \
+		libpci.so:devel/libpci \
+		libnspr4.so:devel/nspr \
+		libre2.so:devel/re2 \
+		libdrm.so:graphics/libdrm \
+		libpng.so:graphics/png \
+		libwayland-client.so:graphics/wayland \
+		libwebp.so:graphics/webp \
+		libdav1d.so:multimedia/dav1d \
+		libva.so:multimedia/libva \
+		libopenh264.so:multimedia/openh264 \
+		libharfbuzz.so:print/harfbuzz \
+		libsecret-1.so:security/libsecret \
+		libnss3.so:security/nss \
+		libexpat.so:textproc/expat2 \
+		libxkbcommon.so:x11/libxkbcommon \
+		libxshmfence.so:x11/libxshmfence \
+		libfontconfig.so:x11-fonts/fontconfig
+TEST_DEPENDS=	Xvfb:x11-servers/xorg-server@xvfb
+ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
+CUPS_LIB_DEPENDS=	libcups.so:print/cups
+PIPEWIRE_LIB_DEPENDS=	libpipewire-0.3.so:multimedia/pipewire
+PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
+SNDIO_PREVENTS=		ALSA PULSEAUDIO
+SNDIO_LIB_DEPENDS=	libsndio.so:audio/sndio
+
+PORTDOCS=	AUTHORS \
+		CODE_OF_CONDUCT.md \
+		CONTRIBUTING.md \
+		README.md \
+		THIRD-PARTY-NOTICES.md
+
+# Options have to be in accord with electron29.
+OPTIONS_DEFINE=		DOCS CUPS PIPEWIRE
+OPTIONS_DEFAULT=	DOCS CUPS PIPEWIRE SNDIO GSSAPI_BASE
+OPTIONS_GROUP=		AUDIO
+OPTIONS_GROUP_AUDIO=	ALSA PULSEAUDIO SNDIO
+OPTIONS_SINGLE=		GSSAPI
+OPTIONS_SINGLE_GSSAPI=	GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT
+GSSAPI_BASE_USES=	gssapi
+GSSAPI_HEIMDAL_USES=	gssapi:heimdal
+GSSAPI_MIT_USES=	gssapi:mit
+
+PATCH_STRIP=	-p1
+
+CXXFLAGS+=	-DNODE_API_EXPERIMENTAL \
+		-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT
+MAKE_ENV+=	${PATH_ENV}
+MAKE_ENV+=	HOME=${WRKDIR}
+MAKE_ENV+=	ELECTRON_SKIP_BINARY_DOWNLOAD=1
+.if defined(QUIET)
+MAKE_ENV+=	QUIET=yes
+.else
+MAKE_ENV+=	DEBUG=true
+.endif
+PATH_ENV=	PATH=$${PATH}:${WRKSRC}/node_modules/.bin
+PATH_ENV_zstd=	PATH=$${PATH}:${MONGO_ZSTD_DIR}/node_modules/.bin
+TEST_ENV+=	HOME=${WRKDIR}
+TEST_ENV+=	PATH=$${PATH}:${WRKSRC}/node_modules/.bin
+HADRON_ENV+=	PATH=$${PATH}:${WRKSRC}/node_modules/.bin
+HADRON_ENV+=	HADRON_SKIP_INSTALLER=true
+HADRON_ENV+=	ELECTRON_SKIP_BINARY_DOWNLOAD=1
+HADRON_ENV+=	APPMOD=${APPMODFILE}
+HADRON_ENV+=	DEBUG=hadron*
+
+ELECTRON_DIR=	${.CURDIR}/../../devel/electron29
+.include	"${ELECTRON_DIR}/Makefile.version"
+ELECTRON_DOWNLOAD_URL=	https://github.com/electron/electron/releases/download/v${ELECTRON_VER}
+ELECTRON_DOWNLOAD_URL_HASH!=	/sbin/sha256 -q -s ${ELECTRON_DOWNLOAD_URL}
+.if defined(ARCH) && ${ARCH} == amd64
+ELECTRON_ARCH=	x64
+NAPI_TARGET=	x86_64-unknown-freebsd
+.elif defined(ARCH) && ${ARCH} == arm64
+ELECTRON_ARCH=	arm64
+NAPI_TARGET=	aarch64-unknown-freebsd
+.endif
+
+MONGO_CLIENC_VER=	6.0.0
+MONGO_ZSTD_VER=		1.0.0
+NPM_FSXATTR_VER=	0.3.1
+NPM_KERBEROS_VER=	2.1.0
+NPM_NAPI_VER=		2.9.0
+COMPASS_DIR=		${WRKSRC}/packages/compass
+MONGO_ZSTD_DIR=		${WRKDIR}/zstd-${MONGO_ZSTD_VER}
+NODE_MODULES_DIR=       ${WRKSRC}/node_modules
+NPM_NAPI_DIR=	${WRKDIR}/napi-rs--napi-rs-cli-${NPM_NAPI_VER}
+DISTTMP_DIR=		${WRKDIR}/dist-tmp
+
+NPM_OSDNSNATIVE_VER=	1.2.1
+
+post-fetch: ${DISTCACHEFILES}
+
+${DISTCACHEFILE_npm}:
+	# Cache npm modules to avoid network connection at later stages
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm cache add \
+		$$(cat ${FILESDIR}/package-*.list)
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_DEFAULT} -C ${WRKDIR}
+	${MKDIR} ${NODE_MODULES_DIR}
+	${REINPLACE_CMD} -E ' \
+		s,^( *"electron"): *"[0-9~^].*"(.*)$$,\1: "${ELECTRON_VER}"\2,; \
+		' ${WRKSRC}/package-lock.json
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm --ignore-scripts -- install
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm cache add \
+		electron@${ELECTRON_VER} \
+		$$(npm view electron@${ELECTRON_VER:C/\.[^\.]*$//} version | \
+		${TAIL} -1 | ${SED} -E 's, .*,,')
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm --ignore-scripts -- install \
+		electron@~${ELECTRON_VER}
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/fs-xattr-${NPM_FSXATTR_VER}.tgz \
+		-C ${WRKDIR}
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm --ignore-scripts install node-gyp-cache@0.2.1
+	${RM} -rd ${WRKDIR}/package
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/mongodb-client-encryption-${MONGO_CLIENC_VER}.tgz \
+		-C ${WRKDIR}
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm --ignore-scripts install
+	${RM} -rd ${WRKDIR}/package
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/os-dns-native-${NPM_OSDNSNATIVE_VER}.tgz \
+		-C ${WRKDIR}
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm --ignore-scripts install
+	${RM} -rd ${WRKDIR}/package
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_zstd} -C ${WRKDIR}
+	${MKDIR} ${MONGO_ZSTD_DIR}/node_modules
+	cd ${MONGO_ZSTD_DIR} && \
+		${PATCH} -p1 < ${FILESDIR}/mongodb-js-zstd.patch
+	cd ${MONGO_ZSTD_DIR} && \
+		${SETENV} ${MAKE_ENV} ${PATH_ENV_zstd} \
+		npm --ignore-scripts -- install
+	${RM} -rd ${MONGO_ZSTD_DIR}
+
+	# Without npm cache verify, installing
+	# mongodb-tools@https://codeload... fails.
+	# if npm cache verify fails by 'too many open files',
+	# set MAX_FILES_compass=16384 in poudriere.conf.
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm cache verify
+
+	# Back up npm cache
+	cd ${WRKDIR} && ${TAR} cJf ${DISTCACHEFILE_npm} .npm
+
+${DISTCACHEFILE_gyp}:
+	# To prepare cache cached by node-gyp-cache when rebuilding
+	# fs-xattr, mongodb-client-encryption and os-dns-native,
+	# install node-gyp-cache and do
+	# npm exec node-gyp-cache rebuild for fs-xattr,
+	# npm run install for mongodb-client-encryption and
+	# npm run install for os-dns-native
+	# which is OK to fail here (because of python absent).
+	${ECHO} "node_gyp = node-gyp-cache" >> ${WRKDIR}/.npmrc
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/fs-xattr-${NPM_FSXATTR_VER}.tgz \
+		-C ${WRKDIR}
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm install node-gyp-cache@0.2.1
+	-cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm exec node-gyp-cache rebuild
+	${RM} -rd ${WRKDIR}/package /tmp/work
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/mongodb-client-encryption-${MONGO_CLIENC_VER}.tgz \
+		-C ${WRKDIR}
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm install node-gyp-cache@0.2.1
+	-cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm run install
+	${RM} -rd ${WRKDIR}/package /tmp/work
+
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/os-dns-native-${NPM_OSDNSNATIVE_VER}.tgz \
+		-C ${WRKDIR}
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm install node-gyp-cache@0.2.1
+	-cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm run install
+
+	# Back up node-gyp-cache cache
+	cd ${WRKDIR} && ${TAR} cJf ${DISTCACHEFILE_gyp} .cache
+
+${DISTCACHEFILE_yarn}:
+	# Do yarn install to cache node modules for napi-rs-cli.
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_napi} -C ${WRKDIR}
+	${MKDIR} ${NPM_NAPI_DIR}/node_modules
+	cd ${NPM_NAPI_DIR} && ${PATCH} -p1 < ${FILESDIR}/napi-cli.patch
+	cd ${NPM_NAPI_DIR} && ${SETENV} ${MAKE_ENV} yarn install
+
+	# Back up yarn cache
+	cd ${NPM_NAPI_DIR} && ${TAR} cJf ${DISTCACHEFILE_yarn} .yarn
+
+${DISTCACHEFILE_cargo}:
+	# Cache cargo crates for zstd.
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_zstd} -C ${WRKDIR}
+	cd ${MONGO_ZSTD_DIR} && ${SETENV} ${MAKE_ENV} \
+		cargo fetch
+	# Back up cargo cache
+	cd ${WRKDIR} && ${TAR} cJf ${DISTCACHEFILE_cargo} .cargo
+
+post-extract:
+	# Restore npm and node-gyp-cache cache
+	${TAR} xf ${DISTCACHEFILE_npm} -C ${WRKDIR}
+	${TAR} xf ${DISTCACHEFILE_gyp} -C ${WRKDIR}
+	${TAR} xf ${DISTCACHEFILE_cargo} -C ${WRKDIR}
+
+	# Fonts
+	-${MKDIR} ${WRKSRC}/packages/compass/src/app/fonts
+	for font in ${DISTDIR}/${DIST_SUBDIR}/*.woff*; do \
+		${INSTALL_DATA} $${font} \
+			${WRKSRC}/packages/compass/src/app/fonts; \
+	done
+
+pre-build:
+	# Prepare kerberos
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/kerberos-${NPM_KERBEROS_VER}.tgz \
+		-C ${WRKDIR}
+	cd ${WRKDIR}/package && ${PATCH} -p1 < ${FILESDIR}/kerberos.patch
+.  if empty(PORT_OPTIONS:MGSSAPI_MIT)
+	cd ${WRKDIR}/package && ${PATCH} -p1 < ${FILESDIR}/kerberos-heimdal.patch
+.  endif
+	${FIND} ${WRKDIR}/package -name \*.orig -or -name \*.bak -delete
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm pack file:${WRKDIR}/package
+	${RM} -rd ${WRKDIR}/package
+
+	# Prepare mongodb-client-encryption
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/mongodb-client-encryption-${MONGO_CLIENC_VER}.tgz \
+		-C ${WRKDIR}
+	cd ${WRKDIR}/package && ${PATCH} -p1 < ${FILESDIR}/mongodb-client-encryption.patch
+	${REINPLACE_CMD} -E \
+		's|^(.*\.include_dir.*)$$|\1 "/usr/include", "${PREFIX}/include"|' \
+		${WRKDIR}/package/binding.gyp
+	${REINPLACE_CMD} -E \
+		"s|^( *').*(lib.*-static.*\.a)('.*)$$|\1${PREFIX}/lib/\2\3|" \
+		${WRKDIR}/package/binding.gyp
+	${REINPLACE_CMD} -E \
+		-e 's|("chai"): "\^4\.3\.7"|\1: "^4.0.0"|' \
+		-e 's|("eslint"): "\^8\.46\.0"|\1: "^8.0.0"|' \
+		-e 's|("@typescript-eslint\/parser"): "\^6\.3\.0"|\1: "^6.0.0"|' \
+		${WRKDIR}/package/package.json
+	${FIND} ${WRKDIR}/package -name \*.orig -or -name \*.bak -delete
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm --offline -- install node-gyp-cache@0.2.1
+	${ECHO} "node_gyp = node-gyp-cache" >> ${WRKDIR}/.npmrc
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		node-gyp rebuild --python=${PYTHON_CMD}
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm pack file:${WRKDIR}/package
+	${RM} -rd ${WRKDIR}/package
+
+	# Prepare fs-xattr
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/fs-xattr-${NPM_FSXATTR_VER}.tgz \
+		-C ${WRKDIR}
+	cd ${WRKDIR}/package && ${PATCH} -p1 < ${FILESDIR}/fs-xattr.patch
+	${CP} ${FILESDIR}/xattr.h ${WRKDIR}/package/src
+	${CP} ${FILESDIR}/xattr_api.c ${WRKDIR}/package/src
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm --offline -- install node-gyp-cache@0.2.1
+	# ${ECHO} "node_gyp = node-gyp-cache" >> ${WRKDIR}/.npmrc
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm exec node-gyp-cache rebuild --python=${PYTHON_CMD}
+	${FIND} ${WRKDIR}/package -name \*.orig -or -name \*.bak -delete
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm pack file:${WRKDIR}/package
+	${RM} -rd ${WRKDIR}/package
+
+	# Prepare os-dns-native
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/os-dns-native-${NPM_OSDNSNATIVE_VER}.tgz \
+		-C ${WRKDIR}
+	cd ${WRKDIR} && ${PATCH} -p0 < ${FILESDIR}/os-dns-native.patch
+	${MKDIR} ${WRKDIR}/package/node_modules
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm --offline -- install node-gyp-cache@0.2.1
+	${ECHO} "node-gyp = node-gyp-cache" >> ${WRKDIR}/.npmrc
+	cd ${WRKDIR}/package && ${SETENV} ${MAKE_ENV} \
+		PATH=${PATH}:${WRKDIR}/package/node_modules/.bin \
+		npm run install
+	${FIND} ${WRKDIR}/package -name \*.orig -or -name \*.bak -delete
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm pack file:${WRKDIR}/package
+	${RM} -rd ${WRKDIR}/package
+
+	# Prepare napi-rs-cli (for mongodb-js-zstd)
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_napi} -C ${WRKDIR}
+	${TAR} xf ${DISTCACHEFILE_yarn} -C ${NPM_NAPI_DIR}
+	${MKDIR} ${NPM_NAPI_DIR}/node_modules
+	cd ${NPM_NAPI_DIR} && ${PATCH} -p1 < ${FILESDIR}/napi-cli.patch
+	cd ${NPM_NAPI_DIR} && ${SETENV} ${MAKE_ENV} yarn install
+	cd ${NPM_NAPI_DIR} && ${SETENV} ${MAKE_ENV} \
+		PATH=$${PATH}:${NPM_NAPI_DIR}/node_modules/.bin npm run build
+	${FIND} ${NPM_NAPI_DIR} -name \*.orig -or -name \*.bak -delete
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm pack file:${NPM_NAPI_DIR}/cli
+
+	# Prepare mongodb-js-zstd.
+	${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_zstd} -C ${WRKDIR}
+
+	# Install node_modules for zstd.
+	${MKDIR} ${MONGO_ZSTD_DIR}/node_modules
+	cd ${MONGO_ZSTD_DIR} && \
+		${PATCH} -p1 < ${FILESDIR}/mongodb-js-zstd.patch
+	cd ${MONGO_ZSTD_DIR} && \
+		${SETENV} ${MAKE_ENV} ${PATH_ENV_zstd} \
+		npm --offline -- install \
+		${WRKDIR}/napi-rs-cli-${NPM_NAPI_VER}.tgz
+	cd ${MONGO_ZSTD_DIR} && \
+		${SETENV} ${MAKE_ENV} ${PATH_ENV_zstd} CARGO_NET_OFFLINE=true \
+		napi build --platform --release --target ${NAPI_TARGET} && \
+		${SETENV} ${MAKE_ENV} ${PATH_ENV_zstd} ${INSTALL_LIB} \
+		zstd.freebsd-${ELECTRON_ARCH}.node npm/freebsd-${ELECTRON_ARCH}/
+	${FIND} ${MONGO_ZSTD_DIR} -name \*.orig -or -name \*.bak -delete
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm pack file:${MONGO_ZSTD_DIR}
+	cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} npm pack \
+		file:${MONGO_ZSTD_DIR}/npm/freebsd-${ELECTRON_ARCH}
+
+	# Replace "git+ssh:" and "github:" entry with "file:"
+	# to exported tarballs.
+	${REINPLACE_CMD} -E ' \
+		s,"(resolved|from|version)": "git\+ssh:.*/reflux-state-mixin\.git.*","\1": "file://${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_reflux}",; \
+		s,"(reflux-state-mixin|resolved|from)": "(.+@)?github:mongodb-js/reflux-state-mixin(.[0-9a-f]+)?","\1": "file://${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_reflux}",; \
+		' ${WRKSRC}/package-lock.json
+
+	for pjson in $$(find ${WRKSRC} -name package.json -print); do \
+		${REINPLACE_CMD} -E ' \
+		s,"(reflux-state-mixin)": "github:mongodb-js/reflux-state-mixin","\1": "file://${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_reflux}",; \
+		' $${pjson}; done
+
+	# Install node modules
+	${MKDIR} ${NODE_MODULES_DIR}
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm install --offline \
+		${DISTDIR}/${DIST_SUBDIR}/${DISTFILE_reflux} \
+		${WRKDIR}/fs-xattr-${NPM_FSXATTR_VER}.tgz \
+		${WRKDIR}/kerberos-${NPM_KERBEROS_VER}.tgz \
+		${WRKDIR}/napi-rs-cli-${NPM_NAPI_VER}.tgz \
+		${WRKDIR}/mongodb-js-zstd-*.tgz \
+		${WRKDIR}/mongodb-client-encryption-${MONGO_CLIENC_VER}.tgz \
+		${WRKDIR}/os-dns-native-${NPM_OSDNSNATIVE_VER}.tgz
+
+	# Install electron without build.
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+		npm --offline --omit-dev --ignore-scripts -- install \
+		electron@${ELECTRON_VER}
+
+	# Install node modules for production (APPMOD)
+	${MKDIR} ${DISTTMP_DIR}/node_modules
+	cd ${DISTTMP_DIR} && ${SETENV} ${MAKE_ENV} \
+		npm --offline --omit-dev -- install \
+		${WRKDIR}/kerberos-${NPM_KERBEROS_VER}.tgz \
+		${WRKDIR}/mongodb-client-encryption-${MONGO_CLIENC_VER}.tgz
+	-${RM} ${APPMODFILE}
+	${TAR} -cf ${APPMODFILE} --exclude python3 \
+		-C ${DISTTMP_DIR} node_modules
+
+do-build:
+	# Set up download zip file for electron-packager
+	cd ${WRKSRC}/node_modules/electron-packager/src && \
+		${PATCH} -p1 < ${FILESDIR}/electron-packager.patch
+	cd ${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR} && \
+		zip -q -r ${WRKDIR}/electron-v${ELECTRON_VER}-freebsd-${ELECTRON_ARCH}.zip .
+
+	# Install electron
+	${CP} -R ${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR} \
+		${NODE_MODULES_DIR}/electron/dist
+	${ECHO} "electron" > ${NODE_MODULES_DIR}/electron/path.txt
+
+	# Build MongoDB Compass
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} lerna run bootstrap --stream
+	cd ${WRKSRC} && ${SETENV} ${HADRON_ENV} npm run package-compass
+
+do-install:
+	# Install MongoDB Compass
+	-${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
+	${INSTALL_DATA} ${WRKSRC}/packages/compass/app-icons/linux/mongodb-compass.png \
+		${STAGEDIR}${PREFIX}/share/pixmaps/
+	-${MKDIR} ${STAGEDIR}${DESKTOPDIR}
+	${INSTALL_DATA} ${FILESDIR}/mongodb-compass.desktop \
+		${STAGEDIR}${DESKTOPDIR}/
+	-${MKDIR} ${STAGEDIR}${DATADIR}
+	cd ${COMPASS_DIR}/dist/MongoDB* && ${TAR} cf - .  | \
+		${TAR} xf - -C ${STAGEDIR}${DATADIR}
+.for f in chromedriver mksnapshot v8_context_snapshot_generator
+	${RM} ${STAGEDIR}${DATADIR}/${f}
+.endfor
+	${RM} -r ${STAGEDIR}${DATADIR}/gen
+	${RM} -r ${STAGEDIR}${DATADIR}/node_headers
+	${RLN} ${STAGEDIR}${DATADIR}/MongoDB* \
+		${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+	${FIND} ${STAGEDIR}${DATADIR} -name \*.node -exec ${STRIP_CMD} {} \;
+
+	# Install documents
+do-install-DOCS-on:
+	-${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for f in ${PORTDOCS}
+	${INSTALL_MAN} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
+.endfor
+
+post-stage:
+	cd ${STAGEDIR}${PREFIX} && \
+		${FIND} ${DATADIR_REL}/resources/app.asar.unpacked/build \
+		-type f -o -type l > ${WRKDIR}/PLIST.unpacked
+	cd ${WRKDIR} && ${SED} -i -e "/PLIST.unpacked/r PLIST.unpacked" ${TMPPLIST}
+
+do-test:
+	cd ${WRKSRC}/packages/compass && \
+		${SETENV} ${TEST_ENV} \
+		xvfb-maybe electron-mocha --no-sandbox "./src/main/*.spec.*"
+
+post-clean:
+.for file in ${DISTCACHEFILES} compass_node_modules.tar
+	${RM} ${DISTDIR}/${DIST_SUBDIR}/${file}
+.endfor
+
+.include <bsd.port.mk>
diff --git a/databases/compass/distinfo b/databases/compass/distinfo
new file mode 100644
index 000000000000..6c13053e85e8
--- /dev/null
+++ b/databases/compass/distinfo
@@ -0,0 +1,41 @@
+TIMESTAMP = 1717056528
+SHA256 (compass/EuclidCircularA-Semibold-WebXL.woff2) = 3c927c939c68fc5598be8b24d6bcd848c76848730c817d099a07a8def77bd35f
+SIZE (compass/EuclidCircularA-Semibold-WebXL.woff2) = 44116
+SHA256 (compass/EuclidCircularA-Semibold-WebXL.woff) = 29c04cda134c536c105d8c61e6eba8931ba91d27cf0624642532765028fd9903
+SIZE (compass/EuclidCircularA-Semibold-WebXL.woff) = 57832
+SHA256 (compass/EuclidCircularA-SemiboldItalic-WebXL.woff2) = ec9e21eaa3056c28f83f985e8b851b44dcd5f72fa9bd9932a12001280d1c8d84
+SIZE (compass/EuclidCircularA-SemiboldItalic-WebXL.woff2) = 46120
+SHA256 (compass/EuclidCircularA-SemiboldItalic-WebXL.woff) = f3ffad457620e630a2924d0e8123e535f599372902a1213b7cfc0020910db56b
+SIZE (compass/EuclidCircularA-SemiboldItalic-WebXL.woff) = 60668
+SHA256 (compass/EuclidCircularA-Medium-WebXL.woff2) = 4b72108384fc2ff8526bbac345c72e42df413c7bfc950d3a34d8315f8c254fcc
+SIZE (compass/EuclidCircularA-Medium-WebXL.woff2) = 44284
+SHA256 (compass/EuclidCircularA-Medium-WebXL.woff) = 947aa46c1ac09d7ba59dc037d4cf905ab235092258b0187e6c30edd1810e83ce
+SIZE (compass/EuclidCircularA-Medium-WebXL.woff) = 58084
+SHA256 (compass/EuclidCircularA-MediumItalic-WebXL.woff2) = 575377efc4dc278a6d346dddc96b1da688f5106ff64d4ab21f72c7fcfc2f0163
+SIZE (compass/EuclidCircularA-MediumItalic-WebXL.woff2) = 46004
+SHA256 (compass/EuclidCircularA-MediumItalic-WebXL.woff) = e5f0b9d8c79478d4f2906c10601116df3ef8489d7fbfd1ad50b36ddb4c3454be
+SIZE (compass/EuclidCircularA-MediumItalic-WebXL.woff) = 60492
+SHA256 (compass/EuclidCircularA-Regular-WebXL.woff2) = 7c181fe423a88db5dc73df916136aed4cc5d858ef6546df0b0c31a5cb4663e96
+SIZE (compass/EuclidCircularA-Regular-WebXL.woff2) = 44028
+SHA256 (compass/EuclidCircularA-Regular-WebXL.woff) = 90e9c137559eed0ae440f6e8b3edebe2ba07efe3c2f85c8f8615d85ddb72708c
+SIZE (compass/EuclidCircularA-Regular-WebXL.woff) = 57952
+SHA256 (compass/EuclidCircularA-RegularItalic-WebXL.woff2) = deaa04a19ac9a9eb38021504863017092e2b66f520a4000f336e4b3f868a726f
+SIZE (compass/EuclidCircularA-RegularItalic-WebXL.woff2) = 45828
+SHA256 (compass/EuclidCircularA-RegularItalic-WebXL.woff) = bf9fad0a9ad3c49bf2633d9575ef20b1fa4e51078ded0a7a4277bedbf7756810
+SIZE (compass/EuclidCircularA-RegularItalic-WebXL.woff) = 60288
+SHA256 (compass/fs-xattr-0.3.1.tgz) = 7ffa656d19f21b81970bba32ef69ae68064a8d6a53687907419bbc5c3424eb89
+SIZE (compass/fs-xattr-0.3.1.tgz) = 6094
+SHA256 (compass/kerberos-2.1.0.tgz) = eeb1d33472dcf15be8ae46e30ffc76455a62356a91cee52bb8d48f97a35a58c7
+SIZE (compass/kerberos-2.1.0.tgz) = 28988
+SHA256 (compass/mongodb-client-encryption-6.0.0.tgz) = b72d6ad4e4c449ba4548f8f4f8708d37c1490c6615caefa8c56a02f22897b64a
+SIZE (compass/mongodb-client-encryption-6.0.0.tgz) = 15734
+SHA256 (compass/os-dns-native-1.2.1.tgz) = 9baa54587fed81884735aee59d82eaf95870d344b83f5060a75256f4852d964d
+SIZE (compass/os-dns-native-1.2.1.tgz) = 6535
+SHA256 (compass/mongodb-js-compass-v1.43.0_GH0.tar.gz) = 13df0ab4ea4abc7db8c3e8e071bfac003ebe50197e24f24fcdcc1932f4384758
+SIZE (compass/mongodb-js-compass-v1.43.0_GH0.tar.gz) = 11846405
+SHA256 (compass/mongodb-js-reflux-state-mixin-e050454cb3be029c3e7fd2ee6a08111e4d15161f_GH0.tar.gz) = deefbccaf2d2a7d6c92f08aaa80733f2a5c9a26294808ba87242f223f2c4f554
+SIZE (compass/mongodb-js-reflux-state-mixin-e050454cb3be029c3e7fd2ee6a08111e4d15161f_GH0.tar.gz) = 11584
+SHA256 (compass/mongodb-js-zstd-v1.0.0_GH0.tar.gz) = d88095ed323a9eaa5794d8b855bd63223ec46ba4e23403cdc408e7ed9de3b5f3
+SIZE (compass/mongodb-js-zstd-v1.0.0_GH0.tar.gz) = 61628
+SHA256 (compass/napi-rs-napi-rs-@napi-rs-cli@2.9.0_GH0.tar.gz) = 79feb09abe0253f4b984a0d0d451f0d0e493c4228a1990edf7e64399782bad78
+SIZE (compass/napi-rs-napi-rs-@napi-rs-cli@2.9.0_GH0.tar.gz) = 1159595
diff --git a/databases/compass/files/electron-packager.patch b/databases/compass/files/electron-packager.patch
new file mode 100644
index 000000000000..5fb42ebbca78
--- /dev/null
+++ b/databases/compass/files/electron-packager.patch
@@ -0,0 +1,57 @@
+--- /dev/null	2023-01-11 00:11:02.154961000 +0000
++++ src/freebsd.js	2023-01-11 00:10:31.037935000 +0000
+@@ -0,0 +1,25 @@
++'use strict'
++
++const App = require('./platform')
++const common = require('./common')
++
++class FreeBSDApp extends App {
++  get originalElectronName () {
++    return 'electron'
++  }
++
++  get newElectronName () {
++    return common.sanitizeAppName(this.executableName)
++  }
++
++  async create () {
++    await this.initialize()
++    await this.renameElectron()
++    await this.copyExtraResources()
++    return this.move()
++  }
++}
++
++module.exports = {
++  App: FreeBSDApp
++}
+diff -Nur src.orig/targets.js src/targets.js
+--- src.orig/targets.js	2023-01-10 16:23:47.997092000 +0000
++++ src/targets.js	2023-01-10 16:16:03.395991000 +0000
+@@ -5,12 +5,13 @@
+ const semver = require('semver')
+ 
+ const officialArchs = ['ia32', 'x64', 'armv7l', 'arm64', 'mips64el', 'universal']
+-const officialPlatforms = ['darwin', 'linux', 'mas', 'win32']
++const officialPlatforms = ['darwin', 'linux', 'mas', 'win32', 'freebsd']
+ const officialPlatformArchCombos = {
+   darwin: ['x64', 'arm64', 'universal'],
+   linux: ['ia32', 'x64', 'armv7l', 'arm64', 'mips64el'],
+   mas: ['x64', 'arm64', 'universal'],
+-  win32: ['ia32', 'x64', 'arm64']
++  win32: ['ia32', 'x64', 'arm64'],
++  freebsd: ['x64', 'arm64'],
+ }
+ 
+ const buildVersions = {
+@@ -36,7 +37,8 @@
+   darwin: './mac',
+   linux: './linux',
+   mas: './mac', // map to darwin
+-  win32: './win32'
++  win32: './win32',
++  freebsd: './freebsd',
+ }
+ 
+ const supported = {
diff --git a/databases/compass/files/fs-xattr.patch b/databases/compass/files/fs-xattr.patch
new file mode 100644
index 000000000000..3020371e7fd4
--- /dev/null
+++ b/databases/compass/files/fs-xattr.patch
@@ -0,0 +1,157 @@
+diff -ur package.orig/binding.gyp package/binding.gyp
+--- package.orig/binding.gyp	2023-06-11 17:38:40.780062000 +0900
++++ package/binding.gyp	2023-06-19 18:31:50.306023000 +0900
+@@ -7,7 +7,8 @@
+         "src/error.c",
+         "src/sync.c",
+         "src/util.c",
+-        "src/xattr.c"
++        "src/xattr.c",
++        "src/xattr_api.c"
+       ]
+     }
+   ]
+diff -ur package.orig/src/async.c package/src/async.c
+--- package.orig/src/async.c	2023-06-11 17:38:40.779324000 +0900
++++ package/src/async.c	2023-06-19 17:47:16.981890000 +0900
+@@ -1,7 +1,7 @@
+ #include <assert.h>
+ #include <errno.h>
+ #include <stdlib.h>
+-#include <sys/xattr.h>
++#include "xattr.h"
+ 
+ #include "error.h"
+ #include "util.h"
+@@ -20,7 +20,7 @@
+ void xattr_get_execute(napi_env env, void* _data) {
+   XattrGetData* data = _data;
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   data->value_length = getxattr(data->filename, data->attribute, NULL, 0, 0, 0);
+ #else
+   data->value_length = getxattr(data->filename, data->attribute, NULL, 0);
+@@ -33,7 +33,7 @@
+ 
+   data->value = malloc((size_t) data->value_length);
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   data->value_length = getxattr(data->filename, data->attribute, data->value, (size_t) data->value_length, 0, 0);
+ #else
+   data->value_length = getxattr(data->filename, data->attribute, data->value, (size_t) data->value_length);
+@@ -108,7 +108,7 @@
+ void xattr_set_execute(napi_env env, void* _data) {
+   XattrSetData* data = _data;
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   int res = setxattr(data->filename, data->attribute, data->value, data->value_length, 0, 0);
+ #else
+   int res = setxattr(data->filename, data->attribute, data->value, data->value_length, 0);
+@@ -185,7 +185,7 @@
+ void xattr_list_execute(napi_env env, void* _data) {
+   XattrListData* data = _data;
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   data->result_length = listxattr(data->filename, NULL, 0, 0);
+ #else
+   data->result_length = listxattr(data->filename, NULL, 0);
+@@ -198,7 +198,7 @@
+ 
+   data->result = (char *) malloc((size_t) data->result_length);
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   data->result_length = listxattr(data->filename, data->result, (size_t) data->result_length, 0);
+ #else
+   data->result_length = listxattr(data->filename, data->result, (size_t) data->result_length);
+@@ -266,7 +266,7 @@
+ void xattr_remove_execute(napi_env env, void* _data) {
+   XattrRemoveData* data = _data;
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   int res = removexattr(data->filename, data->attribute, 0);
+ #else
+   int res = removexattr(data->filename, data->attribute);
+diff -ur package.orig/src/error.c package/src/error.c
+--- package.orig/src/error.c	2023-06-11 17:38:40.779790000 +0900
++++ package/src/error.c	2023-06-19 18:12:10.021510000 +0900
+@@ -3,7 +3,7 @@
+ 
+ #include "error.h"
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+ #define E_ENOATTR ENOATTR
+ #define S_ENOATTR "ENOATTR"
+ #else
+diff -ur package.orig/src/sync.c package/src/sync.c
+--- package.orig/src/sync.c	2023-06-11 17:38:40.779976000 +0900
++++ package/src/sync.c	2023-06-19 17:48:05.139598000 +0900
+@@ -1,7 +1,7 @@
+ #include <assert.h>
+ #include <errno.h>
+ #include <stdlib.h>
+-#include <sys/xattr.h>
++#include "xattr.h"
+ 
+ #include "error.h"
+ #include "util.h"
+@@ -25,7 +25,7 @@
+ 
+   ssize_t value_length;
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   value_length = getxattr(filename, attribute, NULL, 0, 0, 0);
+ #else
+   value_length = getxattr(filename, attribute, NULL, 0);
+@@ -42,7 +42,7 @@
+   void* buffer_data;
+   assert(napi_create_buffer(env, (size_t) value_length, &buffer_data, &buffer) == napi_ok);
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   value_length = getxattr(filename, attribute, buffer_data, (size_t) value_length, 0, 0);
+ #else
+   value_length = getxattr(filename, attribute, buffer_data, (size_t) value_length);
+@@ -78,7 +78,7 @@
+   size_t value_length;
+   assert(napi_get_buffer_info(env, args[2], &value, &value_length) == napi_ok);
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   int res = setxattr(filename, attribute, value, value_length, 0, 0);
+ #else
+   int res = setxattr(filename, attribute, value, value_length, 0);
+@@ -107,7 +107,7 @@
+ 
+   ssize_t result_length;
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   result_length = listxattr(filename, NULL, 0, 0);
+ #else
+   result_length = listxattr(filename, NULL, 0);
+@@ -121,7 +121,7 @@
+ 
+   char *result = (char *) malloc((size_t) result_length);
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   result_length = listxattr(filename, result, (size_t) result_length, 0);
+ #else
+   result_length = listxattr(filename, result, (size_t) result_length);
+@@ -158,7 +158,7 @@
+   char *attribute = malloc(attribute_length + 1);
+   assert(napi_get_value_string_utf8(env, args[1], attribute, attribute_length + 1, NULL) == napi_ok);
+ 
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+   int res = removexattr(filename, attribute, 0);
+ #else
+   int res = removexattr(filename, attribute);
diff --git a/databases/compass/files/kerberos-heimdal.patch b/databases/compass/files/kerberos-heimdal.patch
new file mode 100644
index 000000000000..2ef5795dd1d9
--- /dev/null
+++ b/databases/compass/files/kerberos-heimdal.patch
@@ -0,0 +1,82 @@
+diff -ur package.orig/src/unix/kerberos_gss.cc package/src/unix/kerberos_gss.cc
+--- package.orig/src/unix/kerberos_gss.cc	1985-10-26 17:15:00.000000000 +0900
++++ package/src/unix/kerberos_gss.cc	2024-05-29 05:59:03.862817000 +0900
+@@ -120,9 +120,9 @@
+ 
+ namespace node_kerberos {
+ 
+-const char* krb5_get_err_text(const krb5_context&, krb5_error_code code) {
+-    return COMERR_CALL(error_message)(code);
+-}
++//const char* krb5_get_err_text(const krb5_context& ctx, krb5_error_code code) {
++//    return COMERR_CALL(krb5_get_error_message)(ctx, code);
++//}
+ 
+ static gss_result gss_success_result(int ret);
+ static gss_result gss_error_result(OM_uint32 err_maj, OM_uint32 err_min);
+@@ -138,7 +138,7 @@
+     int code;
+     krb5_context kcontext;
+     krb5_keytab kt = NULL;
+-    krb5_kt_cursor cursor = NULL;
++    krb5_kt_cursor cursor;
+     krb5_keytab_entry entry;
+     char* pname = NULL;
+ 
+@@ -174,12 +174,12 @@
+         if (strncmp(pname, match, match_len) == 0) {
+             details = pname;
+             KRB5_CALL(krb5_free_unparsed_name)(kcontext, pname);
+-            KRB5_CALL(krb5_free_keytab_entry_contents)(kcontext, &entry);
++            KRB5_CALL(krb5_kt_free_entry)(kcontext, &entry);
+             break;
+         }
+ 
+         KRB5_CALL(krb5_free_unparsed_name)(kcontext, pname);
+-        KRB5_CALL(krb5_free_keytab_entry_contents)(kcontext, &entry);
++        KRB5_CALL(krb5_kt_free_entry)(kcontext, &entry);
+     }
+ 
+     if (details.empty()) {
+@@ -189,8 +189,7 @@
+         result.data = std::move(details);
+     }
+ end:
+-    if (cursor)
+-        KRB5_CALL(krb5_kt_end_seq_get)(kcontext, kt, &cursor);
++    KRB5_CALL(krb5_kt_end_seq_get)(kcontext, kt, &cursor);
+     if (kt)
+         KRB5_CALL(krb5_kt_close)(kcontext, kt);
+     KRB5_CALL(krb5_free_context)(kcontext);
+@@ -223,7 +222,7 @@
+     name_token.value = (char*)service;
+ 
+     maj_stat =
+-        GSS_CALL(gss_import_name)(&min_stat, &name_token, GSS_VALUE(gss_nt_service_name), &state->server_name);
++        GSS_CALL(gss_import_name)(&min_stat, &name_token, GSS_VALUE(GSS_C_NT_HOSTBASED_SERVICE), &state->server_name);
+ 
+     if (GSS_ERROR(maj_stat)) {
+         ret = gss_error_result(maj_stat, min_stat);
+diff -ur package.orig/src/unix/kerberos_gss.h package/src/unix/kerberos_gss.h
+--- package.orig/src/unix/kerberos_gss.h	1985-10-26 17:15:00.000000000 +0900
++++ package/src/unix/kerberos_gss.h	2024-05-29 06:03:39.889151000 +0900
+@@ -18,8 +18,9 @@
+ #define KERBEROS_GSS_H
+ 
+ extern "C" {
++    #include <krb5.h>
+     #include <gssapi/gssapi.h>
+-    #include <gssapi/gssapi_generic.h>
++    // #include <gssapi/gssapi_generic.h>
+     #include <gssapi/gssapi_krb5.h>
+ }
+ 
+@@ -27,7 +28,7 @@
+ 
+ namespace node_kerberos {
+ 
+-const char* krb5_get_err_text(const krb5_context&, krb5_error_code code);
++// const char* krb5_get_err_text(const krb5_context&, krb5_error_code code);
+ 
+ #define AUTH_GSS_ERROR -1
+ #define AUTH_GSS_COMPLETE 1
diff --git a/databases/compass/files/kerberos.patch b/databases/compass/files/kerberos.patch
new file mode 100644
index 000000000000..8ae52a1edee5
--- /dev/null
+++ b/databases/compass/files/kerberos.patch
@@ -0,0 +1,54 @@
+diff -ur package.orig/binding.gyp package/binding.gyp
+--- package.orig/binding.gyp	1985-10-26 17:15:00.000000000 +0900
++++ package/binding.gyp	2024-05-29 05:04:21.119164000 +0900
+@@ -3,7 +3,8 @@
+     {
+       'target_name': 'kerberos',
+       'type': 'loadable_module',
+-      'include_dirs': [  "<!(node -p \"require('node-addon-api').include_dir\")" ],
++      'include_dirs': [  "<!(node -p \"require('node-addon-api').include_dir\")"
++      ],
+       'sources': [
+         'src/kerberos.cc'
+       ],
+@@ -34,14 +35,16 @@
+               'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
+             }
+         }],
+-        ['OS=="mac" or OS=="linux"', {
++        ['OS=="mac" or OS=="linux" or OS=="freebsd"', {
++          'cflags+': ['-DNODE_API_EXPERIMENTAL',
++            '-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT'],
+           'sources': [
+             'src/unix/base64.cc',
+             'src/unix/kerberos_gss.cc',
+             'src/unix/kerberos_unix.cc'
+           ]
+         }],
+-        ['(OS=="mac" or OS=="linux") and (kerberos_use_rtld!="true")', {
++        ['(OS=="mac" or OS=="linux" or OS=="freebsd") and (kerberos_use_rtld!="true")', {
+           'link_settings': {
+             'libraries': [
*** 4682 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407231145.46NBjv6I050330>