summaryrefslogtreecommitdiff
path: root/databases/mongodb80
diff options
context:
space:
mode:
Diffstat (limited to 'databases/mongodb80')
-rw-r--r--databases/mongodb80/Makefile178
-rw-r--r--databases/mongodb80/distinfo5
-rw-r--r--databases/mongodb80/files/extrapatch-SConstruct16
-rw-r--r--databases/mongodb80/files/extrapatch-src_third__party_mozjs_SConscript11
-rw-r--r--databases/mongodb80/files/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp11
-rwxr-xr-xdatabases/mongodb80/files/make.test.sh31
-rw-r--r--databases/mongodb80/files/mongod.in53
-rw-r--r--databases/mongodb80/files/patch-SConstruct36
-rw-r--r--databases/mongodb80/files/patch-buildscripts_scons.py18
-rw-r--r--databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp58
-rw-r--r--databases/mongodb80/files/patch-src_third__party_abseil-cpp_dist_absl_time_internal_cctz_src_time__zone__format.cc13
-rw-r--r--databases/mongodb80/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp11
-rw-r--r--databases/mongodb80/files/patch-src_third__party_boost_boost_thread_future.hpp18
-rw-r--r--databases/mongodb80/files/patch-src_third__party_libbson_dist_src_libbson_src_bson_bson-error.c11
-rw-r--r--databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh36
-rw-r--r--databases/mongodb80/pkg-descr5
-rw-r--r--databases/mongodb80/pkg-message16
-rw-r--r--databases/mongodb80/pkg-plist10
18 files changed, 537 insertions, 0 deletions
diff --git a/databases/mongodb80/Makefile b/databases/mongodb80/Makefile
new file mode 100644
index 000000000000..54c4447d8508
--- /dev/null
+++ b/databases/mongodb80/Makefile
@@ -0,0 +1,178 @@
+PORTNAME= mongodb
+DISTVERSIONPREFIX= r
+DISTVERSION= 8.0.10
+PORTREVISION= 2
+CATEGORIES= databases net
+PKGNAMESUFFIX= ${DISTVERSION:R:S/.//}
+
+MAINTAINER= ronald@FreeBSD.org
+COMMENT= MongoDB Community Edition (8.0.x Branch)
+WWW= https://www.mongodb.com/docs/v8.0/
+
+LICENSE= APACHE20 SSPLv1 # mongodb is SSPLv1, C++ driver is APACHE20
+LICENSE_COMB= multi
+LICENSE_NAME_SSPLv1= Server Side Public License Version 1
+LICENSE_FILE_SSPLv1= ${WRKSRC}/LICENSE-Community.txt
+LICENSE_PERMS_SSPLv1= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le
+ONLY_FOR_ARCHS_REASON= only ported to amd64, aarch64, and powerpc64le on FreeBSD; upstream supports arm64, ppc64le, s390x, and x86-64
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}distro>0:sysutils/py-distro@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}gitpython>0:devel/py-gitpython@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pymongo>0:databases/py-pymongo@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pyyaml>=3.11:devel/py-pyyaml@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}retry2>0:devel/py-retry2@${PY_FLAVOR} \
+ git:devel/git@tiny \
+ rust-cbindgen>0:devel/rust-cbindgen
+# build depends used while running ${WRKSRC}/src/third_party/mozjs/gen-config.sh
+BUILD_DEPENDS+= gm4:devel/m4 \
+ gsed:textproc/gsed
+LIB_DEPENDS= libcurl.so:ftp/curl \
+ libsnappy.so:archivers/snappy \
+ libstemmer.so:textproc/snowballstemmer \
+ libunwind.so:devel/libunwind \
+ libyaml-cpp.so:devel/yaml-cpp \
+ libzstd.so:archivers/zstd
+
+FLAVORS= default armv80a
+
+armv80a_PKGNAMESUFFIX= ${DISTVERSION:R:S/.//}-armv80a
+
+USES= compiler:c++20-lang cpe python:build scons shebangfix ssl
+# gmake is used while running ${WRKSRC}/src/third_party/mozjs/gen-config.sh
+USES+= gmake pkgconfig
+CPE_PRODUCT= mongodb
+
+# mozjs tag comes from ${WRKSRC}/src/third_party/mozjs/get-sources.sh
+MOZJS_TAG= 98c8be22bec7bb650156e0d389b425322d8c323c
+
+USE_GITHUB= yes
+GH_ACCOUNT= mongodb mongodb-forks:mozjs
+GH_PROJECT= mongo spidermonkey:mozjs
+GH_TAGNAME= ${MOZJS_TAG}:mozjs
+USE_RC_SUBR= mongod
+
+SHEBANG_FILES= buildscripts/scons.py
+python_OLD_CMD= @python_interpreter@
+
+HAS_CONFIGURE= yes
+CONFIGURE_SCRIPT= gen-config.sh
+CONFIGURE_ARGS+= ${MOZJS_ARCH} \
+ freebsd
+CONFIGURE_ENV+= PYTHON3="${PYTHON_CMD}"
+
+MAKE_ARGS= --allocator=system \
+ --cxx-std=20 \
+ --disable-warnings-as-errors \
+ --libc++ \
+ --runtime-hardening=on \
+ --ssl \
+ --use-system-libunwind \
+ --use-system-snappy \
+ --use-system-stemmer \
+ --use-system-yaml \
+ --use-system-zlib \
+ --use-system-zstd \
+ -j${MAKE_JOBS_NUMBER} \
+ AR=llvm-ar \
+ MONGO_VERSION=${DISTVERSION} \
+ VERBOSE=on
+ALL_TARGET= install-servers
+
+CFLAGS+= -DBOOST_NO_CXX98_FUNCTION_BASE
+
+CONFLICTS_INSTALL= mongodb[0-9][0-9]
+
+EXTRACT_AFTER_ARGS= --exclude src/third_party/snappy-* \
+ --exclude src/third_party/libstemmer_c \
+ --exclude src/third_party/unwind \
+ --exclude src/third_party/yaml-cpp \
+ --exclude src/third_party/zlib-* \
+ --exclude src/third_party/zstandard \
+ --no-same-owner --no-same-permissions
+
+# This ports is only following the Major Release.
+# https://docs.mongodb.com/manual/reference/versioning/
+PORTSCOUT= limit:^8\.0\.
+
+CONFIGURE_WRKSRC= ${MOZJS_WRKSRC}
+
+USERS= mongodb
+GROUPS= mongodb
+
+OPTIONS_DEFINE= LTO NOAVX SASL
+OPTIONS_DEFINE_aarch64= ARMV80A
+OPTIONS_DEFAULT= NOAVX SASL
+
+# MongoDB on non-LSE ARM cpu like Raspberry Pi can work but is unsupported upstream.
+# Can give corruption on high concurrency.
+# Please read https://jira.mongodb.org/browse/SERVER-71772.
+ARMV80A_DESC= Enable non-LSE ARM64 CPUs like RPI4.
+NOAVX_DESC= "Disable AVX instructions on amd64 (Sandybridge+)"
+
+ARMV80A_EXTRA_PATCHES= ${FILESDIR}/extrapatch-SConstruct
+
+LTO_MAKE_ARGS= --lto=on
+
+NOAVX_MAKE_ARGS= --experimental-optimization="-sandybridge"
+NOAVX_EXTRA_PATCHES= ${FILESDIR}/extrapatch-src_third__party_mozjs_SConscript \
+ ${FILESDIR}/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp
+
+SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2
+SASL_MAKE_ARGS= --use-sasl-client
+
+MOZJS_WRKSRC= ${WRKSRC}/src/third_party/mozjs
+
+.if ${FLAVOR:U} == armv80a
+OPTIONS_SET+= ARMV80A
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if ${FLAVOR:U} == armv80a && ${ARCH} != aarch64
+IGNORE= flavor armv80a is only valid on aarch64
+.endif
+
+.if ${ARCH} == amd64
+MOZJS_ARCH= x86_64
+.elif ${ARCH} == powerpc64le
+MOZJS_ARCH= ppc64le
+.elif ${ARCH} == aarch64
+MOZJS_ARCH= ${ARCH}
+.endif
+
+post-extract:
+# Verify we downloaded the proper mozjs git tag.
+ ${SH} -xc "test \"X`grep -E '^LIB_GIT_REVISION=' ${MOZJS_WRKSRC}/get-sources.sh`\" = \"XLIB_GIT_REVISION=${MOZJS_TAG}\""
+
+pre-configure:
+# Replacement of ${WRKSRC}/src/third_party/mozjs/get-sources.sh
+ ${LN} -sF ${WRKDIR}/spidermonkey-${MOZJS_TAG} ${MOZJS_WRKSRC}/mozilla-release
+
+do-build:
+ ${WRKSRC}/buildscripts/scons.py -C ${WRKSRC} ${MAKE_ARGS}
+
+do-install:
+.for f in mongod mongos
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f}
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.conf.sample
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for doc in LICENSE-Community.txt MPL-2 README THIRD-PARTY-NOTICES
+ ${MV} ${STAGEDIR}${PREFIX}/${doc} ${STAGEDIR}${DOCSDIR}/
+.endfor
+ ${INSTALL_MAN} ${WRKSRC}/debian/mongod.1 ${STAGEDIR}${PREFIX}/share/man/man1/
+ ${INSTALL_MAN} ${WRKSRC}/debian/mongos.1 ${STAGEDIR}${PREFIX}/share/man/man1/
+ ${INSTALL_MAN} ${WRKSRC}/debian/mongodb-parameters.5 ${STAGEDIR}${PREFIX}/share/man/man5/
+ ${RM} ${STAGEDIR}${PREFIX}/bin/resmoke.py
+
+do-test:
+ ${SH} ${FILESDIR}/make.test.sh "${STAGEDIR}${PREFIX}/bin"
+
+.include <bsd.port.post.mk>
diff --git a/databases/mongodb80/distinfo b/databases/mongodb80/distinfo
new file mode 100644
index 000000000000..f90baa6c0bb2
--- /dev/null
+++ b/databases/mongodb80/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1748462151
+SHA256 (mongodb-mongo-r8.0.10_GH0.tar.gz) = 32dafc101bbac2a19280f508ad92473960241a9f3b74ac2a1a76352355269a05
+SIZE (mongodb-mongo-r8.0.10_GH0.tar.gz) = 95649032
+SHA256 (mongodb-forks-spidermonkey-98c8be22bec7bb650156e0d389b425322d8c323c_GH0.tar.gz) = 9c266a0b13e1352d410e4c0b985c4f31cea0bcc81631f2a38af9291f676434bf
+SIZE (mongodb-forks-spidermonkey-98c8be22bec7bb650156e0d389b425322d8c323c_GH0.tar.gz) = 280427824
diff --git a/databases/mongodb80/files/extrapatch-SConstruct b/databases/mongodb80/files/extrapatch-SConstruct
new file mode 100644
index 000000000000..05946bd82cdc
--- /dev/null
+++ b/databases/mongodb80/files/extrapatch-SConstruct
@@ -0,0 +1,16 @@
+--- SConstruct.orig 2023-06-07 17:07:38 UTC
++++ SConstruct
+@@ -3217,8 +3205,12 @@ if not env.TargetOSIs('windows', 'macOS') and (env.Too
+ # setting it for both C and C++ by setting both of CFLAGS and
+ # CXXFLAGS.
+
++ arm_march_flag = "armv8-a"
++ if get_option('use-hardware-crc32') == "on":
++ arm_march_flag += "+crc"
++
+ default_targeting_flags_for_architecture = {
+- "aarch64": {"-march=": "armv8.2-a", "-mtune=": "generic"},
++ "aarch64": {"-march=": arm_march_flag, "-mtune=": "generic"},
+ "i386": {"-march=": "nocona", "-mtune=": "generic"},
+ "ppc64le": {"-mcpu=": "power8", "-mtune=": "power8", "-mcmodel=": "medium"},
+ "s390x": {"-march=": "z196", "-mtune=": "zEC12"},
diff --git a/databases/mongodb80/files/extrapatch-src_third__party_mozjs_SConscript b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_SConscript
new file mode 100644
index 000000000000..4370f13323a4
--- /dev/null
+++ b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_SConscript
@@ -0,0 +1,11 @@
+--- src/third_party/mozjs/SConscript.orig 2024-08-14 20:38:09 UTC
++++ src/third_party/mozjs/SConscript
+@@ -144,7 +145,7 @@ sources = [
+ "extract/js/src/wasm/WasmCode-platform.cpp",
+ ]
+
+-if env['TARGET_ARCH'] == 'x86_64' and not env.TargetOSIs('windows'):
++if False and env['TARGET_ARCH'] == 'x86_64' and not env.TargetOSIs('windows'):
+ env.Append(CCFLAGS=['-mavx2'])
+ sources.extend(["extract/mozglue/misc/SIMD_avx2.cpp", "extract/mozglue/misc/SSE.cpp"])
+
diff --git a/databases/mongodb80/files/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp
new file mode 100644
index 000000000000..f68cc2552390
--- /dev/null
+++ b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp
@@ -0,0 +1,11 @@
+--- src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp.orig 2024-11-07 09:56:02 UTC
++++ src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp
+@@ -448,7 +448,7 @@ const char* SIMD::memchr8SSE2(const char* ptr, char va
+ // assertion failure. Accordingly, we just don't allow that to happen. We
+ // are not particularly concerned about ensuring that newer 32 bit processors
+ // get access to the AVX2 functions exposed here.
+-# if defined(MOZILLA_MAY_SUPPORT_AVX2) && defined(__x86_64__)
++# if 0 && defined(MOZILLA_MAY_SUPPORT_AVX2) && defined(__x86_64__)
+
+ bool SupportsAVX2() { return supports_avx2(); }
+
diff --git a/databases/mongodb80/files/make.test.sh b/databases/mongodb80/files/make.test.sh
new file mode 100755
index 000000000000..c42bb1973e6b
--- /dev/null
+++ b/databases/mongodb80/files/make.test.sh
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+set -e
+
+usage() {
+ echo "Usage: $0 <path>"
+ echo "<path> path to the executables"
+}
+
+test "$#" -eq 1 || ( usage && exit 1 )
+
+set -x
+
+PATH="$1:$PATH"
+
+DBDIR=$( mktemp -d -t tmp.mongodb )
+
+trap 'rm -rf "$DBDIR"' EXIT
+
+# Trivial check if the binaries execute at all.
+mongod --version
+mongos --version
+
+# Check if an empty database can be created.
+mkdir "$DBDIR/db"
+tail -F "$DBDIR/log" | ( grep -qFe "Waiting for connections" && kill $(cat "$DBDIR/pid") ) &
+script -eF "$DBDIR/log" \
+ timeout -s TERM -k 30s 60s \
+ mongod --dbpath "$DBDIR/db" --pidfilepath "$DBDIR/pid"
+
+echo "Test successful"
diff --git a/databases/mongodb80/files/mongod.in b/databases/mongodb80/files/mongod.in
new file mode 100644
index 000000000000..20b0f5c0f43d
--- /dev/null
+++ b/databases/mongodb80/files/mongod.in
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# PROVIDE: mongod
+# REQUIRE: NETWORK ldconfig
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# mongod_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable mongod.
+# mongod_dbpath (str): Default to "/var/db/mongodb"
+# Base database directory.
+# mongod_flags (str): Custom additional arguments to be passed to mongod.
+# Default to "--logpath ${mongod_dbpath}/mongod.log --logappend".
+# mongod_config (str): Default to "%%PREFIX%%/etc/mongodb.conf"
+# Path to config file
+#
+
+. /etc/rc.subr
+
+name="mongod"
+rcvar=mongod_enable
+
+load_rc_config $name
+
+: ${mongod_enable="NO"}
+: ${mongod_dbpath="/var/db/mongodb"}
+: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend --setParameter=disabledSecureAllocatorDomains=\*"}
+: ${mongod_user="mongodb"}
+: ${mongod_group="mongodb"}
+: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"}
+
+pidfile="${mongod_dbpath}/mongod.lock"
+command=%%PREFIX%%/bin/${name}
+command_args="--config $mongod_config --dbpath $mongod_dbpath --fork >/dev/null 2>/dev/null"
+start_precmd="${name}_prestart"
+
+mongod_create_dbpath()
+{
+ mkdir ${mongod_dbpath} >/dev/null 2>/dev/null
+ [ $? -eq 0 ] && chown -R ${mongod_user}:${mongod_group} ${mongod_dbpath}
+}
+
+mongod_prestart()
+{
+ if [ ! -d ${mongod_dbpath} ]; then
+ mongod_create_dbpath || return 1
+ fi
+ return 0
+}
+
+run_rc_command "$1"
diff --git a/databases/mongodb80/files/patch-SConstruct b/databases/mongodb80/files/patch-SConstruct
new file mode 100644
index 000000000000..375b9238a97a
--- /dev/null
+++ b/databases/mongodb80/files/patch-SConstruct
@@ -0,0 +1,36 @@
+--- SConstruct.orig 2024-07-22 19:17:33 UTC
++++ SConstruct
+@@ -25,7 +25,6 @@ import SCons.Script
+
+ import SCons
+ import SCons.Script
+-from mongo_tooling_metrics.lib.top_level_metrics import SConsToolingMetrics
+ from site_scons.mongo import build_profiles
+
+ # This must be first, even before EnsureSConsVersion, if
+@@ -1722,16 +1721,6 @@ env.AddMethod(lambda env, name, **kwargs: add_option(n
+ del envDict
+ env.AddMethod(lambda env, name, **kwargs: add_option(name, **kwargs), 'AddOption')
+
+-# The placement of this is intentional. Here we setup an atexit method to store tooling metrics.
+-# We should only register this function after env, env_vars and the parser have been properly initialized.
+-SConsToolingMetrics.register_metrics(
+- utc_starttime=datetime.utcnow(),
+- artifact_dir=env.Dir('$BUILD_DIR').get_abspath(),
+- env_vars=env_vars,
+- env=env,
+- parser=_parser,
+-)
+-
+ if get_option('build-metrics'):
+ env['BUILD_METRICS_ARTIFACTS_DIR'] = '$BUILD_ROOT/$VARIANT_DIR'
+ env.Tool('build_metrics')
+@@ -1835,7 +1824,7 @@ if unknown_vars:
+
+ unknown_vars = env_vars.UnknownVariables()
+ if unknown_vars:
+- env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys())))
++ print("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys())))
+
+ install_actions.setup(env, get_option('install-action'))
+
diff --git a/databases/mongodb80/files/patch-buildscripts_scons.py b/databases/mongodb80/files/patch-buildscripts_scons.py
new file mode 100644
index 000000000000..5759ae7f71d9
--- /dev/null
+++ b/databases/mongodb80/files/patch-buildscripts_scons.py
@@ -0,0 +1,18 @@
+--- buildscripts/scons.py.orig 2024-07-23 11:11:41 UTC
++++ buildscripts/scons.py
+@@ -18,15 +18,6 @@ sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path
+
+ sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path
+
+-# pylint: disable=C0413
+-from mongo.pip_requirements import verify_requirements, MissingRequirements
+-
+-try:
+- verify_requirements()
+-except MissingRequirements as ex:
+- print(ex)
+- sys.exit(1)
+-
+ try:
+ import SCons.Script
+ except ImportError as import_err:
diff --git a/databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp b/databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp
new file mode 100644
index 000000000000..e2c815567836
--- /dev/null
+++ b/databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp
@@ -0,0 +1,58 @@
+--- src/mongo/platform/waitable_atomic.cpp.orig 2024-11-20 23:53:48 UTC
++++ src/mongo/platform/waitable_atomic.cpp
+@@ -34,6 +34,9 @@
+ #ifdef __linux__
+ #include <linux/futex.h>
+ #include <sys/syscall.h>
++#elif defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/umtx.h>
+ #elif defined(_WIN32)
+ #include <synchapi.h>
+ #endif
+@@ -233,6 +236,45 @@ bool waitUntil(const void* uaddr,
+ // There isn't a good list of possible errors, so assuming that anything other than a timeout
+ // error is a possible spurious wakeup.
+ return timeoutOverflow || errno != ETIMEDOUT;
++}
++
++#elif defined(__FreeBSD__)
++
++void notifyOne(const void* uaddr) {
++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE_PRIVATE, 1, NULL, NULL);
++}
++
++void notifyMany(const void* uaddr, int nToWake) {
++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE_PRIVATE, nToWake, NULL, NULL);
++}
++
++void notifyAll(const void* uaddr) {
++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE_PRIVATE, INT_MAX, NULL, NULL);
++}
++
++bool waitUntil(const void* uaddr,
++ uint32_t old,
++ boost::optional<system_clock::time_point> deadline) {
++ struct _umtx_time umtx_deadline;
++ void* uaddr2 = nullptr;
++
++ if (deadline) {
++ umtx_deadline._timeout.tv_sec = durationCount<Seconds>(deadline->time_since_epoch());
++ umtx_deadline._timeout.tv_nsec = durationCount<Nanoseconds>(
++ deadline->time_since_epoch() - stdx::chrono::seconds(umtx_deadline._timeout.tv_sec));
++ umtx_deadline._flags = UMTX_ABSTIME;
++ umtx_deadline._clockid = CLOCK_REALTIME_FAST;
++ uaddr2 = &umtx_deadline;
++ }
++
++ int umtxOpRet;
++ if ((umtxOpRet = _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAIT_UINT_PRIVATE, old, (void*)sizeof(struct _umtx_time), uaddr2)) != 0) {
++ if (errno == ETIMEDOUT) {
++ return false;
++ }
++ invariant(umtxOpRet == 0, errorMessage(lastSystemError()));
++ }
++ return true;
+ }
+
+ #else
diff --git a/databases/mongodb80/files/patch-src_third__party_abseil-cpp_dist_absl_time_internal_cctz_src_time__zone__format.cc b/databases/mongodb80/files/patch-src_third__party_abseil-cpp_dist_absl_time_internal_cctz_src_time__zone__format.cc
new file mode 100644
index 000000000000..d498ecfd3fbd
--- /dev/null
+++ b/databases/mongodb80/files/patch-src_third__party_abseil-cpp_dist_absl_time_internal_cctz_src_time__zone__format.cc
@@ -0,0 +1,13 @@
+# https://github.com/abseil/abseil-cpp/commit/ded2ec077d911de647d47ab48ef3a8e24a1fb64a
+# https://github.com/abseil/abseil-cpp/issues/1587
+--- src/third_party/abseil-cpp/dist/absl/time/internal/cctz/src/time_zone_format.cc.orig 2024-07-23 13:17:01 UTC
++++ src/third_party/abseil-cpp/dist/absl/time/internal/cctz/src/time_zone_format.cc
+@@ -19,7 +19,7 @@
+ #endif
+
+ #if defined(HAS_STRPTIME) && HAS_STRPTIME
+-#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__)
++#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+ #define _XOPEN_SOURCE 500 // Exposes definitions for SUSv2 (UNIX 98).
+ #endif
+ #endif
diff --git a/databases/mongodb80/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp b/databases/mongodb80/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp
new file mode 100644
index 000000000000..f6e1178b4a65
--- /dev/null
+++ b/databases/mongodb80/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp
@@ -0,0 +1,11 @@
+--- src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp.orig 2023-06-15 22:07:57 UTC
++++ src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp
+@@ -56,7 +56,7 @@ struct AUX_WRAPPER_NAME
+ // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
+ // while some other don't like 'value + 1' (Borland), and some don't like
+ // either
+-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
++#if 1 //BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
+ private:
+ BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
+ BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
diff --git a/databases/mongodb80/files/patch-src_third__party_boost_boost_thread_future.hpp b/databases/mongodb80/files/patch-src_third__party_boost_boost_thread_future.hpp
new file mode 100644
index 000000000000..cf4ad80ef93d
--- /dev/null
+++ b/databases/mongodb80/files/patch-src_third__party_boost_boost_thread_future.hpp
@@ -0,0 +1,18 @@
+https://github.com/boostorg/thread/issues/402
+
+In file included from src/third_party/boost/libs/thread/src/pthread/thread.cpp:19:
+src/third_party/boost/boost/thread/future.hpp:4672:19: error: no member named 'that' in 'run_it<FutureExecutorContinuationSharedState>'; did you mean 'that_'?
+ 4672 | that_=x.that;
+ | ^~~~
+
+--- src/third_party/boost/boost/thread/future.hpp.orig 2024-12-12 08:36:29 UTC
++++ src/third_party/boost/boost/thread/future.hpp
+@@ -4669,7 +4669,7 @@ namespace detail
+ }
+ run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT {
+ if (this != &x) {
+- that_=x.that;
++ that_=x.that_;
+ x.that_.reset();
+ }
+ return *this;
diff --git a/databases/mongodb80/files/patch-src_third__party_libbson_dist_src_libbson_src_bson_bson-error.c b/databases/mongodb80/files/patch-src_third__party_libbson_dist_src_libbson_src_bson_bson-error.c
new file mode 100644
index 000000000000..4ee39110eefd
--- /dev/null
+++ b/databases/mongodb80/files/patch-src_third__party_libbson_dist_src_libbson_src_bson_bson-error.c
@@ -0,0 +1,11 @@
+--- src/third_party/libbson/dist/src/libbson/src/bson/bson-error.c.orig 2024-07-04 10:59:36 UTC
++++ src/third_party/libbson/dist/src/libbson/src/bson/bson-error.c
+@@ -130,7 +130,7 @@ bson_strerror_r (int err_code, /* I
+ // required) by the POSIX spec (see:
+ // https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html#tag_16_574_08).
+ (void) strerror_r (err_code, buf, buflen);
+-#elif defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700
++#elif defined(__FreeBSD__) || ( defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700 )
+ // The behavior (of `strerror_l`) is undefined if the locale argument to
+ // `strerror_l()` is the special locale object LC_GLOBAL_LOCALE or is not a
+ // valid locale object handle.
diff --git a/databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh b/databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh
new file mode 100644
index 000000000000..2e515c03f964
--- /dev/null
+++ b/databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh
@@ -0,0 +1,36 @@
+--- src/third_party/mozjs/gen-config.sh.orig 2025-05-13 17:12:47 UTC
++++ src/third_party/mozjs/gen-config.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ set -e
+ set -v
+@@ -29,6 +29,9 @@ case "$_Path" in
+ }
+
+ case "$_Path" in
++ "platform/aarch64/freebsd")
++ _CONFIG_OPTS="--host=aarch64-freebsd"
++ ;;
+ "platform/aarch64/linux")
+ _CONFIG_OPTS="--host=aarch64-linux"
+ ;;
+@@ -111,7 +114,7 @@ CFLAGS="$CFLAGS -D__STDC_FORMAT_MACROS" \
+ --disable-wasm-moz-intgemm \
+ "$_CONFIG_OPTS"
+
+-make recurse_export
++gmake recurse_export
+
+ cd ../../../..
+
+@@ -166,7 +169,7 @@ find "$_Path/build" -name '*.cpp' |
+ find "$_Path/build" -name '*.cpp' |
+ while read unified_file ; do
+ echo "Processing $unified_file"
+- sed $SEDOPTION \
++ gsed $SEDOPTION \
+ -e 's|#include ".*/js/src/|#include "|' \
+ -e 's|#error ".*/js/src/|#error "|' \
+ "$unified_file"
diff --git a/databases/mongodb80/pkg-descr b/databases/mongodb80/pkg-descr
new file mode 100644
index 000000000000..5bf5a965fd47
--- /dev/null
+++ b/databases/mongodb80/pkg-descr
@@ -0,0 +1,5 @@
+Distributed document-oriented "NoSQL" database.
+
+Mongo (from "humongous") is a high-performance, open source,
+schema-free, document-oriented database. A common name in the
+"NOSQL" community.
diff --git a/databases/mongodb80/pkg-message b/databases/mongodb80/pkg-message
new file mode 100644
index 000000000000..fb041b1ff931
--- /dev/null
+++ b/databases/mongodb80/pkg-message
@@ -0,0 +1,16 @@
+[
+{ type: install
+ message: <<EOM
+MongoDB on Raspberry Pi can work but is unsupported upstream.
+Please read https://jira.mongodb.org/browse/SERVER-71772 and enable option
+ARMV80A if you run this on a non-LSE ARM cpu like Raspberry Pi 4.
+
+MongoDB 6.0 and up do not include the 'mongo' CLI shell anymore. You can
+use the MongoDB Shell (https://github.com/mongodb-js/mongosh).
+# pkg install npm
+$ npm install mongosh
+$ npx mongosh mongodb://127.0.0.1:27017/
+
+EOM
+}
+]
diff --git a/databases/mongodb80/pkg-plist b/databases/mongodb80/pkg-plist
new file mode 100644
index 000000000000..46587b510b14
--- /dev/null
+++ b/databases/mongodb80/pkg-plist
@@ -0,0 +1,10 @@
+bin/mongod
+bin/mongos
+@sample etc/mongodb.conf.sample
+%%DOCSDIR%%/LICENSE-Community.txt
+%%DOCSDIR%%/MPL-2
+%%DOCSDIR%%/README
+%%DOCSDIR%%/THIRD-PARTY-NOTICES
+share/man/man1/mongod.1.gz
+share/man/man1/mongos.1.gz
+share/man/man5/mongodb-parameters.5.gz