There's a snappy library included in mongodb 8.0.4 which requires additional patch or it fails to build:
snappy-noavx.patch
I use the following script to build deb packages (in Debian 12). The build system has changed in mongodb 8 - see the comments at the beginning of the script.
#!/bin/sh
# python3 -m venv ~/.venvs/mongodb8-build
# ~/.venvs/mongodb8-build/bin/python -m pip install 'poetry==1.5.1'
# ~/.venvs/mongodb8-build/bin/python -m poetry install --no-root --sync
# ~/.venvs/mongodb8-build/bin/python -m pip install mongo-tooling-metrics psutil pyyaml memory_profiler puremagic networkx cxxfilt retry cheetah3
RELEASE="8.0.4"
wget -N https://repo.mongodb.org/apt/debian/dists/bookworm/mongodb-org/8.0/main/binary-amd64/mongodb-org-server_"${RELEASE}"_amd64.deb || exit 1
(
cd mongodb-without-avx/mongo/ || exit 1
git remote update && git checkout SConstruct src/third_party/mozjs/SConscript src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp src/third_party/snappy/platform/build_linux_x86_64/config.h || exit 1
git checkout master && git pull && git checkout r"${RELEASE}" || exit 1
patch -p1 SConstruct < ../o2_patch.diff || exit 1
patch -p1 <../mozjs-noavx.patch || exit 1
patch -p1 <../snappy-noavx.patch || exit 1
~/.venvs/mongodb8-build/bin/python buildscripts/scons.py --disable-warnings-as-errors --linker=gold -j 64 install-mongod || exit 1
)
rm -rf 1 && fakeroot dpkg-deb -R mongodb-org-server_"${RELEASE}"_amd64.deb 1 || exit 1
strip -o 1/usr/bin/mongod mongodb-without-avx/mongo/build/install/bin/mongod || exit 1
SUM=$(md5sum 1/usr/bin/mongod | sed -e 's,1/,,')
sed -i '/usr\/bin\/mongod$/c\'"$SUM" 1/DEBIAN/md5sums || exit 1
sed -i '/^Version: / s/$/+noavx-1/' 1/DEBIAN/control || exit 1
fakeroot dpkg-deb -b 1 mongodb-org-server_"${RELEASE}"+noavx-1_amd64.deb || exit 1
There's a snappy library included in mongodb 8.0.4 which requires additional patch or it fails to build:
snappy-noavx.patch
I use the following script to build deb packages (in Debian 12). The build system has changed in mongodb 8 - see the comments at the beginning of the script.